rsl / stringex

Some [hopefully] useful extensions to Ruby’s String class. It is made up of three libraries: ActsAsUrl [permalink solution with better character translation], Unidecoder [Unicode to Ascii transliteration], and StringExtensions [miscellaneous helper methods for the String class].
MIT License
984 stars 158 forks source link

Support Ruby 2.7 arg syntax in callback_options #208

Closed jocmp closed 1 year ago

jocmp commented 1 year ago

Fixes an issue in Ruby 3 and above where the callback options cause a NoMethodError.

Error: test_should_truncate_words_by_default(ActsAsUrlIntegrationTest)a:
  NoMethodError: undefined method `before_validation' for [:on, :create]:Array

              target.send(method, *arguments, &block)
                    ^^^^^
rsl commented 1 year ago

hey, do you mind bumping the whole version so this gets picked up easier? i reverted the merge so not this might not need a new pr

jocmp commented 1 year ago

hey, do you mind bumping the whole version so this gets picked up easier?

@rsl sure thing. do you mean running rake gemspec?

rsl commented 1 year ago

hrm... i made this before bundler gem and all so im not sure how that updates anymore. defs https://github.com/rsl/stringex/blob/master/VERSION bump. does the rake task update it now?

jocmp commented 1 year ago

Yep! Seems like GitHub won't let me reopen this PR so I started a new one below