Fix Ruby 2.7 warnings for the 1.2 branch#111
Fix Ruby 2.7 warnings for the 1.2 branch#111casperisfine wants to merge 5 commits intotzinfo:1.2from
Conversation
|
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. |
|
@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) |
There was a problem hiding this comment.
/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).
|
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 There will be a 1.2.6 release soon. |
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.xcompatible with Ruby 2.7 was released.cc @kamipo @rafaelfranca @Edouard-chin