diff --git a/lib/fluent/plugin/in_tail.rb b/lib/fluent/plugin/in_tail.rb index 23a2af7c4b..8185df0f5e 100644 --- a/lib/fluent/plugin/in_tail.rb +++ b/lib/fluent/plugin/in_tail.rb @@ -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 @@ -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 @@ -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 diff --git a/lib/fluent/plugin/out_secondary_file.rb b/lib/fluent/plugin/out_secondary_file.rb index 5cadf94984..a82fccf78e 100644 --- a/lib/fluent/plugin/out_secondary_file.rb +++ b/lib/fluent/plugin/out_secondary_file.rb @@ -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" diff --git a/lib/fluent/plugin/parser.rb b/lib/fluent/plugin/parser.rb index 0854129f0e..d912521976 100644 --- a/lib/fluent/plugin/parser.rb +++ b/lib/fluent/plugin/parser.rb @@ -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']