Skip to content

Conversation

@nilium
Copy link

@nilium nilium commented Sep 14, 2024

Description

As of Ruby 3.2, true =~ /regex/ raises an exception (a NoMethodError for =~) instead of returning nil (seen in 3.1 and earlier), so using --override key:true (and false / nil) fails with an error. Instead of always comparing value against a regular expression, only do it if the value didn't match a known true/false/nil value.

This appears to stem from https://bugs.ruby-lang.org/issues/15231.


Maintainers

Please ensure that you check for:

  • If this change impacts git cache validity, it bumps the git cache
    serial number
  • If this change impacts compatibility with omnibus-software, the
    corresponding change is reviewed and there is a release plan
  • If this change impacts compatibility with the omnibus cookbook, the
    corresponding change is reviewed and there is a release plan

@nilium nilium requested review from a team as code owners September 14, 2024 06:23
@sonarqubecloud
Copy link

As of Ruby 3.2, `true =~ /regex/` raises an exception (a NoMethodError
for `=~`) instead of returning `nil` (seen in 3.1 and earlier),
so using `--override key:true` (and false / nil) fails with an
error. Instead of always comparing value against a regular expression,
only do it if the value didn't match a known true/false/nil value.

This appears to stem from <https://bugs.ruby-lang.org/issues/15231>.

Signed-off-by: Noel Cower <[email protected]>
@nilium nilium force-pushed the nc/override-nonstring branch from d7bf75a to a0ee559 Compare February 27, 2025 19:38
@sonarqubecloud
Copy link

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 this pull request may close these issues.

1 participant