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

Check right slash position #2176

Merged
merged 2 commits into from
Nov 20, 2018
Merged

Conversation

okkez
Copy link
Contributor

@okkez okkez commented Nov 12, 2018

This change can raise Fluent::ConfigError when right slash is missing.
This helps users to notice the weird behavior like #2175.

This change can raise Fluent::ConfigError when right slash is missing.
This helps users to notice the weird behavior like fluent#2175.

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
@@ -74,6 +74,9 @@ def self.regexp_value(str)
return nil unless str
return Regexp.compile(str) unless str.start_with?("/")
right_slash_position = str.rindex("/")
if right_slash_position < str.size - 3
raise ConfigError, "invalid regexp: missing right slash: #{str}"
Copy link
Member

Choose a reason for hiding this comment

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

Could you add Fluent::?
We want to use Fluent::ConfigError for new code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just added.

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
@repeatedly repeatedly merged commit 604828f into fluent:master Nov 20, 2018
@repeatedly
Copy link
Member

Thanks!

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