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

Match #23

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/fluent/plugin/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def configure(conf)
raise Fluent::ConfigError, "cannot use glob_policy as always with the default path_delimitor: `,\""
end

if @glob_policy == :extended && /\{.*,.*\}/.match(@path) && extended_glob_pattern(@path)
if @glob_policy == :extended && /\{.*,.*\}/.match?(@path) && extended_glob_pattern(@path)
raise Fluent::ConfigError, "cannot include curly braces with glob patterns in `#{@path}\". Use glob_policy always instead."
end

Expand Down Expand Up @@ -300,7 +300,7 @@ def have_read_capability?
end

def extended_glob_pattern(path)
path.include?('*') || path.include?('?') || /\[.*\]/.match(path)
path.include?('*') || path.include?('?') || /\[.*\]/.match?(path)
end

# Curly braces is not supported with default path_delimiter
Expand All @@ -313,7 +313,7 @@ def use_glob?(path)
# regular expressions as much as possible.
# This is because not using `true' as a returning value
# when choosing :always here.
extended_glob_pattern(path) || /\{.*,.*\}/.match(path)
extended_glob_pattern(path) || /\{.*,.*\}/.match?(path)
elsif @glob_policy == :extended
extended_glob_pattern(path)
elsif @glob_policy == :backward_compatible
Expand Down
4 changes: 2 additions & 2 deletions lib/fluent/plugin/out_secondary_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ def validate_compatible_with_primary_buffer!(path_without_suffix)
raise Fluent::ConfigError, "out_secondary_file: basename or directory has an incompatible placeholder, remove time formats, like `%Y%m%d`, from basename or directory"
end

if !@chunk_key_tag && (ph = placeholders.find { |placeholder| placeholder.match(/tag(\[\d+\])?/) })
if !@chunk_key_tag && (ph = placeholders.find { |placeholder| placeholder.match?(/tag(\[\d+\])?/) })
raise Fluent::ConfigError, "out_secondary_file: basename or directory has an incompatible placeholder #{ph}, remove tag placeholder, like `${tag}`, from basename or directory"
end

vars = placeholders.reject { |placeholder| placeholder.match(/tag(\[\d+\])?/) || (placeholder == 'chunk_id') }
vars = placeholders.reject { |placeholder| placeholder.match?(/tag(\[\d+\])?/) || (placeholder == 'chunk_id') }

if ph = vars.find { |v| !@chunk_keys.include?(v) }
raise Fluent::ConfigError, "out_secondary_file: basename or directory has an incompatible placeholder #{ph}, remove variable placeholder, like `${varname}`, from basename or directory"
Expand Down
2 changes: 1 addition & 1 deletion lib/fluent/plugin/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def convert_values(time, record)
end

def string_like_null(value, null_empty_string = @null_empty_string, null_value_regexp = @null_value_pattern)
null_empty_string && value.empty? || null_value_regexp && string_safe_encoding(value){|s| null_value_regexp.match(s) }
null_empty_string && value.empty? || null_value_regexp && string_safe_encoding(value){|s| null_value_regexp.match?(s) }
end

TRUTHY_VALUES = ['true', 'yes', '1']
Expand Down
Loading