brandonhilkert / sucker_punch

Sucker Punch is a Ruby asynchronous processing library using concurrent-ruby, heavily influenced by Sidekiq and girl_friday.
MIT License
2.64k stars 114 forks source link

Apply new keyword arguments syntax #235

Closed K-S-A closed 3 years ago

K-S-A commented 3 years ago

This PR adds ruby 3.0 compatibility.

Fixes: https://github.com/brandonhilkert/sucker_punch/issues/234

K-S-A commented 3 years ago

Probably, it will be better to add backward compatibility with ruby 2.x versions.

brandonhilkert commented 3 years ago

For sure. Would the current be compatible?

K-S-A commented 3 years ago

For sure. Would the current be compatible?

Not yet. I'll need to make a few tweaks. E.g. replace recently introduced ....

K-S-A commented 3 years ago

@brandonhilkert , is it necessary to support ruby versions before ruby 2.5?

Ruby 2.5 EOL date: 2021-03-31 (https://www.ruby-lang.org/en/downloads/branches/)

brandonhilkert commented 3 years ago

Yes, I'd like to. What changes would have to be excluded? Although it could be a major bump, but I always find that to be extremely frustrating as a user.

K-S-A commented 3 years ago

I'll check PR tomorrow morning my time and will add final fixes and some test cases, if necessary.

brandonhilkert commented 3 years ago

Could you add an entry to the change log?

K-S-A commented 3 years ago

@brandonhilkert , I've updated CHANGES.md. Not sure about the exact version number, though.

brandonhilkert commented 3 years ago

Let's go with 3.0.0. Seems fitting ;)

K-S-A commented 3 years ago

I do like 3.0.0) Done.

brandonhilkert commented 3 years ago

3.0.0 has been released. Thanks again!

eregon commented 3 years ago

(*args, **kwargs)-delegation is unfortunately incorrect on Ruby <= 2.7. In other words, (*args, **kwargs)-delegation is only correct in Ruby 3+. See https://eregon.me/blog/2021/02/13/correct-delegation-in-ruby-2-27-3.html for correct delegation compatible with Ruby 2 & 3.

ivoanjo commented 3 years ago

For context, it also triggered an error in JRuby for our test suite @ https://github.com/DataDog/dd-trace-rb/issues/1369 which is why I ended up reporting it TruffleRuby && JRuby.

brandonhilkert commented 3 years ago

Fixed in 3.0.1.

eregon commented 3 years ago

Thanks for the quick fix and release :) (https://github.com/brandonhilkert/sucker_punch/pull/236)