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

Avoid Ruby 1.8 compatibility when using Ruby 2.1.8 #67

Closed
wpiekutowski opened this issue Feb 17, 2016 · 3 comments
Closed

Avoid Ruby 1.8 compatibility when using Ruby 2.1.8 #67

wpiekutowski opened this issue Feb 17, 2016 · 3 comments

Comments

@wpiekutowski
Copy link
Contributor

There's a small problem in https://github.com/bluemonk/ipaddress/blob/master/lib/ipaddress.rb#L217.
This regular expression is matching not only Ruby 1.8, but also 2.1.8. Because of that, when you upgrade to any Ruby with a version similar to x.1.8, you'll get a ton of warnings similar to:

.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/sprockets-2.11.3/lib/sprockets/mime.rb:25: warning: Hash#index is deprecated; use Hash#key

That code is correctly using Hash#key, but due to the alias made in

https://github.com/bluemonk/ipaddress/blob/master/lib/ipaddress.rb#L219

Hash#key becomes an alias to Hash#index and actually Hash#index is called, which results in a lot of depreciation warnings.

@wpiekutowski
Copy link
Contributor Author

Would it be possible to release 0.8.3 with only this small fix? If so, I'm happy to create a proper branch based on 0.8.2.

@bluemonk
Copy link
Collaborator

What a silly bug! Good catch, thanks for the PR.
I will release 0.8.3 now.

@wpiekutowski
Copy link
Contributor Author

Awesome, thank you for a quick reaction.

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

No branches or pull requests

2 participants