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

Usage of Ruby's Safe Navigation Operator (&.) is causing issues when using Ruby versions < 2.3.0 #9

Open
chris-sansone-angi opened this issue Jul 31, 2019 · 1 comment
Assignees

Comments

@chris-sansone-angi
Copy link

The respond_to_missing function in lib/ostruct.rb is causing issues when using versions of Ruby < 2.3.0

def respond_to_missing?(mid, include_private = false) # :nodoc:
    mname = mid.to_s.chomp("=").to_sym
    @table&.key?(mname) || super
end

Line 196 uses the &. (Safe Navigation Operator) which was introduced in Ruby 2.3.0.

If you want to use the Safe Navigation Operator then please specify the required_ruby_version property in the ostruct.gemspec file

@marcandre marcandre self-assigned this Jul 31, 2019
@marcandre
Copy link
Member

That line has been modified in MRI's master so I'll have to merge that in. The new version should be ok for <= 2.3.0, but we should specify required_ruby_version in the gemspec in any case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants