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

Using Hash#slice forces ruby 2.5+ #83

Open
hkmaly opened this issue Sep 21, 2021 · 4 comments · May be fixed by #84
Open

Using Hash#slice forces ruby 2.5+ #83

hkmaly opened this issue Sep 21, 2021 · 4 comments · May be fixed by #84

Comments

@hkmaly
Copy link

hkmaly commented Sep 21, 2021

The slice method was added in ruby 2.5+. On ruby 2.3 it causes this error:

NoMethodError: undefined method `slice' for {}:Hash
        /var/lib/gems/2.3.0/gems/beaneater-1.1.1/lib/beaneater/connection.rb:73:in `transmit'
        /var/lib/gems/2.3.0/gems/beaneater-1.1.1/lib/beaneater/tube/collection.rb:33:in `transmit'
        /var/lib/gems/2.3.0/gems/beaneater-1.1.1/lib/beaneater/tube/collection.rb:79:in `all'

If that's deliberate, ok, but I would expect explicit mention on README. If it's not (and seems it's only slice in whole code), you may want to re-think 13e9791

@nesquena
Copy link
Member

Thanks for raising this, I think we would definitely want to remove the use of slice in the code.

Would one you be open to preparing a simple patch? cc @albb0920 @hkmaly

I'd be happy to merge and release a patch update. However I wonder if there are other reasons the code wouldn't work prior to Ruby 2.5.

Alternatively I'd be happy to add a note to the readme specifying this library now only works with Ruby 2.5 or above

@albb0920
Copy link
Contributor

albb0920 commented Sep 21, 2021

Ruby 2.3 has long been EoL-ed, I don't think time should be spent on making EoL-ed ruby work.
As this will make supporting new versions harder.
https://www.ruby-lang.org/en/downloads/branches/

Time should be spent instead on refreshing the code and make it work well with ruby 3.0
A mention in README that we only test against supported versions of rubies should be enough.

@hkmaly hkmaly linked a pull request Sep 22, 2021 that will close this issue
@hkmaly
Copy link
Author

hkmaly commented Sep 22, 2021

Hmmm ... ok, it didn't get through tests, maybe I don't understand the code as much as I though.

@nesquena
Copy link
Member

If it's as simple a fix as #84 to support 2.3, then I am all for it. However, I am also fine adding a note that this only works with 2.5 and above especially given that 2.3 was EOL in 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 a pull request may close this issue.

3 participants