Skip to content

Conversation

@ekohl
Copy link
Contributor

@ekohl ekohl commented Apr 17, 2025

In d971ad5 the method was rewritten with the intention of being compatible with Ruby 3.3 where =~ is only defined on strings.

A problem with this is that /regex/.match?(nil) works, but /regex/.match?(42) raises a TypeError. It would have been broken with the old code on Ruby 3.3 as well, but only raised a deprecation warning on prior versions.

Fixes: d971ad5 ("Fix warning on nil comparison")

This doesn't implement tests because there is no testing infrastructure at all, but given it led to a regression in Foreman that would be a good idea to do.

In d971ad5 the method was rewritten
with the intention of being compatible with Ruby 3.3 where =~ is only
defined on strings.

A problem with this is that /regex/.match?(nil) works, but
/regex/.match?(42) raises a TypeError. It would have been broken with
the old code on Ruby 3.3 as well, but only raised a deprecation warning
on prior versions.

Fixes: d971ad5 ("Fix warning on nil comparison")
Copy link
Collaborator

@nofaralfasi nofaralfasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the issue for me.

@nofaralfasi nofaralfasi merged commit ad456d6 into fog:master Apr 20, 2025
1 of 5 checks passed
@ekohl ekohl deleted the fix-is_uuid branch April 20, 2025 15:17
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.

2 participants