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

Release a new version for Ruby < 2.1 compatability #152

Closed
schoblaska opened this issue Dec 7, 2015 · 8 comments
Closed

Release a new version for Ruby < 2.1 compatability #152

schoblaska opened this issue Dec 7, 2015 · 8 comments

Comments

@schoblaska
Copy link

Trying to load this gem in Ruby 2.0, I get the following error:

shared/bundle/ruby/2.0.0/gems/sidekiq-unique-jobs-4.0.9/lib/sidekiq_unique_jobs/util.rb:12: syntax error, unexpected ','
    def del_by(pattern = SCAN_PATTERN, count:, dry_run: true)

The required keyword syntax being used for the "count" parameter wasn't introduced until Ruby 2.1. I saw that this was fixed in master with this commit (045ca89), but there hasn't been a new version of the gem since that change. Doing a version bump should fix this problem for me and others.

Thanks for the great gem!

@mhenrixon
Copy link
Owner

Ah sorry about that! I'll do it first thing tomorrow!

@mhenrixon
Copy link
Owner

Sorry about the delay, had some unfinished changes locally. Could you check and see if the recent release fixes your issue?

@schoblaska
Copy link
Author

Hmm, now I'm getting a new error: uninitialized constant SidekiqUniqueJobs::Scripts::SingleForwardable

$ rvm use 2.0
$ gem install sidekiq-unique-jobs -v 4.0.9
$ gem list | grep sidekiq
sidekiq (4.0.1)
sidekiq-unique-jobs (4.0.9)

$ ruby -e "require 'rubygems'; require 'sidekiq-unique-jobs'"
/Users/joey/.rvm/rubies/ruby-2.0.0-p645/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require': /Users/joey/.rvm/gems/ruby-2.0.0-p645/gems/sidekiq-unique-jobs-4.0.9/lib/sidekiq_unique_jobs/util.rb:12: syntax error, unexpected ',' (SyntaxError)
    def del_by(pattern = SCAN_PATTERN, count:, dry_run: true)

$ gem uninstall sidekiq-unique-jobs
$ gem install sidekiq-unique-jobs
$ gem list | grep sidekiq
sidekiq (4.0.1)
sidekiq-unique-jobs (4.0.10)

$ ruby -e "require 'rubygems'; require 'sidekiq-unique-jobs'"
/Users/joey/.rvm/gems/ruby-2.0.0-p645/gems/sidekiq-unique-jobs-4.0.10/lib/sidekiq_unique_jobs/scripts.rb:14:in `<module:Scripts>': uninitialized constant SidekiqUniqueJobs::Scripts::SingleForwardable (NameError)
  from /Users/joey/.rvm/gems/ruby-2.0.0-p645/gems/sidekiq-unique-jobs-4.0.10/lib/sidekiq_unique_jobs/scripts.rb:7:in `<module:SidekiqUniqueJobs>'

@mhenrixon
Copy link
Owner

You want version 4.0.10 I think. SingleForwardable has been available
since forever.

@mhenrixon
Copy link
Owner

Not sure if you are aware but ruby 2.0 won't be maintained after end of February. Time to upgrade.

@schoblaska
Copy link
Author

Ah, "forwardable" needs to be explicitly required somewhere.

$ rvm use 2.2
$ gem list | grep sidekiq
sidekiq (4.0.1)
sidekiq-unique-jobs (4.0.10)

$ ruby -e "require 'rubygems'; require 'sidekiq-unique-jobs'"
/Users/joey/.rvm/gems/ruby-2.2.2/gems/sidekiq-unique-jobs-4.0.10/lib/sidekiq_unique_jobs/scripts.rb:14:in
  `<module:Scripts>': uninitialized constant SidekiqUniqueJobs::Scripts::SingleForwardable (NameError)

$ ruby -e "require 'rubygems'; require 'forwardable'; require 'sidekiq-unique-jobs'"
(no error)

@mhenrixon
Copy link
Owner

Fixed in d4c24b1 v4.0.11

@schoblaska
Copy link
Author

Awesome. Thanks a lot!

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