From: Ken Barber Date: Thu, 8 Mar 2012 03:55:21 +0000 (-0800) Subject: (#13018) Fix missing method any? message for ruby 1.9.x X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=010fb5e5685fec7aefe9e62901ebcdf06af19d5a;p=puppet-stdlib.git (#13018) Fix missing method any? message for ruby 1.9.x The any? method doesn't exist for 1.9.x, this converts a string to a single element array to work around the problem. --- diff --git a/lib/puppet/parser/functions/validate_re.rb b/lib/puppet/parser/functions/validate_re.rb index 9c216d8..b5e8ff4 100644 --- a/lib/puppet/parser/functions/validate_re.rb +++ b/lib/puppet/parser/functions/validate_re.rb @@ -30,7 +30,7 @@ module Puppet::Parser::Functions msg = args[2] || "validate_re(): #{args[0].inspect} does not match #{args[1].inspect}" - raise Puppet::ParseError, (msg) unless args[1].any? do |re_str| + raise Puppet::ParseError, (msg) unless [args[1]].flatten.any? do |re_str| args[0] =~ Regexp.compile(re_str) end