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

Disallow Warning.process(Regexp, &block) #19

Merged
merged 1 commit into from
Jul 5, 2022

Conversation

splattael
Copy link
Contributor

@splattael splattael commented Jul 5, 2022

Fixes #17.

Previously, the following code worked by accident:

  Warning.process(/foo/) { :raise }

Calling Warning.process a second time resulted in

  # => ArgumentError (comparison of Regexp with Regexp failed)

This PR checks the type of passed path to be a String.

Previously, the following code worked by accident:

  Warning.process(/foo/) { :raise }

Calling Warning.process a second time resulted in
  # => ArgumentError (comparison of Regexp with Regexp failed)

This commit checks the type of passed path to be a String.
@splattael splattael force-pushed the process-type-check-path branch from 4d1e972 to 9ca8f6a Compare July 5, 2022 22:27
@splattael splattael changed the title Disallow passing Regexp as path Disallow Warning.process(Regexp, &block) Jul 5, 2022
@jeremyevans
Copy link
Owner

Looks good, thanks for the patch!

@jeremyevans jeremyevans merged commit 9ca8f6a into jeremyevans:master Jul 5, 2022
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.

Make Warning.process(/foo/) { :raise } fail on initial call
2 participants