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

Make em-hiredis compatible with ruby 2.7 #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ndomenec
Copy link

When trying to update a project to ruby 2.7 I ended up getting a few broken specs because of em-hiredis

Failure/Error:
   self.eval(lua, keys.size, *keys, *args)
     .callback(&df.method(:succeed)).errback(&df.method(:fail))
 ArgumentError:
   wrong number of arguments (given 5, expected 1..4)
  # /.../.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/bundler/gems/em-hiredis-c9eac4b938a1/lib/em-hiredis/client.rb:39:in `eval'

It appears that Kernel#eval is overriding the gem's eval method for some reason, so directly using method_missing with eval as an argument makes it work with ruby 2.7

All specs are working fine with the new fix

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 this pull request may close these issues.

1 participant