diff --git a/fluentd.gemspec b/fluentd.gemspec index 5b0de02fe3..1e81fe7825 100644 --- a/fluentd.gemspec +++ b/fluentd.gemspec @@ -27,7 +27,9 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency("sigdump", ["~> 0.2.2"]) gem.add_runtime_dependency("tzinfo", [">= 1.0.0"]) gem.add_runtime_dependency("tzinfo-data", [">= 1.0.0"]) - gem.add_runtime_dependency("string-scrub", [">= 0.0.3", "<= 0.0.5"]) + unless "".respond_to?(:scrub) + gem.add_runtime_dependency("string-scrub", [">= 0.1.1"]) + end gem.add_development_dependency("rake", [">= 0.9.2"]) gem.add_development_dependency("flexmock", ["~> 1.3.3"]) diff --git a/lib/fluent/plugin/string_util.rb b/lib/fluent/plugin/string_util.rb index 73e419aa50..81496d934e 100644 --- a/lib/fluent/plugin/string_util.rb +++ b/lib/fluent/plugin/string_util.rb @@ -14,6 +14,8 @@ # limitations under the License. # +require "string-scrub" unless "".respond_to?(:scrub) + module Fluent module StringUtil def match_regexp(regexp, string)