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

v0.1.14 breaks compatibility with Ruby versions before 2.4.0 #58

Closed
smnkrt opened this issue Mar 18, 2020 · 1 comment
Closed

v0.1.14 breaks compatibility with Ruby versions before 2.4.0 #58

smnkrt opened this issue Mar 18, 2020 · 1 comment

Comments

@smnkrt
Copy link

smnkrt commented Mar 18, 2020

Regexp#match? was introduced in Ruby 2.4.0 and code using older versions of Ruby can expect errors related to match? 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 using match?, WDYT?

@afair afair closed this as completed in 88965e0 Mar 18, 2020
afair added a commit that referenced this issue Mar 18, 2020
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
@afair
Copy link
Owner

afair commented Mar 18, 2020

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.

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 a pull request may close this issue.

2 participants