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

Comparison of false with =~ #266

Closed
tagliala opened this issue Sep 13, 2024 · 0 comments · Fixed by #267
Closed

Comparison of false with =~ #266

tagliala opened this issue Sep 13, 2024 · 0 comments · Fixed by #267

Comments

@tagliala
Copy link
Member

versions.reject { |v| !v =~ /^v\d+$/ }.map { |v| File.basename v }.sort

lib/document.rb:104: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
tagliala added a commit that referenced this issue Sep 13, 2024
The original `reject` had no effect due to matching full paths and
comparing `false` against a regular expression.

This change replaces a non-functional `reject.map` with `map.grep`
for correct filtering and resolves a deprecation warning.

Close #266
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.

1 participant