-
-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix missing new_ostruct_member in Ruby 2.7 #255
Fix missing new_ostruct_member in Ruby 2.7 #255
Conversation
Ref #259 |
lib/config/options.rb
Outdated
|
||
if v.is_a?(Hash) | ||
v = v["type"] == "hash" ? v["contents"] : __convert(v) | ||
elsif v.is_a?(Array) | ||
v = v.collect { |e| e.instance_of?(Hash) ? __convert(e) : e } | ||
end | ||
|
||
s.send("#{k}=".to_sym, v) | ||
if s.respond_to?(:[]=) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment about why this conditional is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was meant for backward compatibility with older Ruby versions. Now I noticed that the version #[]=
was introduced is way older than the version config
claims to support... ruby/ruby@e44e356#diff-f0ac5119f74bfda273347c9925e910d7
Therefore I'm going to remove this conditional, rather than adding comments.
OpenStruct#[]= was introduced in Ruby 2.0: ruby/ruby@e44e356 This is way older than the version `config` supports, namely Ruby 2.4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pkuczynski This LGTM. Once #256 is merged, this should go green too.
@qnighy Does it make sense to add 2.7.0 to the .travis.yml as well to verify this is working? |
Note, the failed tests are fixed in the hardcoding of sprockets in #250. |
Looks like the rails 4.2 test suite doesn't play nice with ruby 2.7 and the appraisal version it's trying to use. Is it time to drop rails 4.2 support? We've had several PRs that all seem to have issues with 4.2 and it's no longer supported upstream: see these PRs that hit 4.2 issues: #250 #251 #253 #254. @pkuczynski how can we help? |
You can probably also add an exclude to .travis.yml for
|
Thanks! |
The current gem `config` version (1.7.2, Gemfile.lock) is not compatible with Ruby 2.7 due to a protected method that has been removed from Ruby OpenStruct class (standard library). To correctly suppport Ruby 2.7 within rmt-server, I increased the gem version to the latest release (2.2.1) which fixes the described issue. Links: * Issue: rubyconfig/config#259 * Pull Request: rubyconfig/config#255 * Release: https://github.com/rubyconfig/config/releases/tag/2.2.1
The current gem `config` version (1.7.2, Gemfile.lock) is not compatible with Ruby 2.7 due to a protected method that has been removed from Ruby OpenStruct class (standard library). To correctly suppport Ruby 2.7 within rmt-server, I increased the gem version to the latest release (2.2.1) which fixes the described issue. Links: * Issue: rubyconfig/config#259 * Pull Request: rubyconfig/config#255 * Release: https://github.com/rubyconfig/config/releases/tag/2.2.1
The current gem `config` version (1.7.2, Gemfile.lock) is not compatible with Ruby 2.7 due to a protected method that has been removed from Ruby OpenStruct class (standard library). To correctly suppport Ruby 2.7 within rmt-server, I increased the gem version to the latest release (2.2.1) which fixes the described issue. Links: * Issue: rubyconfig/config#259 * Pull Request: rubyconfig/config#255 * Release: https://github.com/rubyconfig/config/releases/tag/2.2.1
OpenStruct#new_ostruct_member
has been removed in ruby/ruby#2178.