Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ruby 2.7 warnings for the 1.2 branch #111

Closed
wants to merge 5 commits into from

Conversation

casperisfine
Copy link

Most of these have been fixed on master, however they were only pusblish in the 2.0 release.

The issue is that I'm trying to fix warnings for the stable versions of Rails, so bumping tzinfo from a major version to another is complicated.

It would be much simpler if a 1.x compatible with Ruby 2.7 was released.

cc @kamipo @rafaelfranca @Edouard-chin

@philr
Copy link
Member

philr commented Dec 16, 2019

I've been working on fixing the warnings in the master branch for a 2.0.1 release. I'm planning to backport the fixes to the 1.2 branch for a 1.2.6 release.

@casperisfine
Copy link
Author

@philr that's great to hear. If my PR isn't useful I can close it, otherwise I can finish it to get a green CI. Let me know what you prefer.

def open_file(file_name, mode, opts, &block)
::File.open(file_name, mode, opts, &block)
end
ruby2_keywords :open_file if respond_to?(:ruby2_keywords, true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/Users/kamipo/src/github.com/rails/rails/vendor/bundle/ruby/2.7.0/bundler/gems/tzinfo-71873adbf908/lib/tzinfo/ruby_core_support.rb:145: warning: Skipping set of ruby2_keywords flag for open_file (method accepts keywords or method does not accept argument splat)

We can only use ruby2_keywords when method accepts splat arguments.
In this case probably we need extra version check RUBY_VERSION >= '2.0' then ::File.open(file_name, mode, **opts, &block).

@philr
Copy link
Member

philr commented Dec 23, 2019

Thanks for submitting this pull request.

I've committed some changes to the 1.2 branch to resolve the warnings with Ruby 2.7.

The implementation already in master took a different approach to that in this pull request (a refinement to replace Object#untaint). I decided to make the 1.2 branch follow the same path.

There will be a 1.2.6 release soon.

@philr philr closed this Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants