You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
string.match(regex) works everywhere
string.match?(regex) woeks in modern rubies
same with regex.match[?](string)
rubocop changes to match? so I had to disable the fixing
Fixed and released. While I'm not targeting End-of-Life rubies, I'm happy to keep syntax compatible. I run this through travis including ruby 2.3.7 which did work.
The problem was actually rubocop. It "fixed" the syntax on that line to the "new, preferred" way, not the way that works most universally. Great for an app, not cool for a library supporting multiple ruby versions.
Regexp#match?
was introduced in Ruby 2.4.0 and code using older versions of Ruby can expect errors related tomatch?
not being defined.it's used for example here
Either docs could be updated or code can check which
RUBY_VERSION
and based on version usingmatch?
, WDYT?The text was updated successfully, but these errors were encountered: