]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
(#13018) Fix missing method any? message for ruby 1.9.x
authorKen Barber <ken@bob.sh>
Thu, 8 Mar 2012 03:55:21 +0000 (19:55 -0800)
committerKen Barber <ken@bob.sh>
Thu, 8 Mar 2012 03:55:21 +0000 (19:55 -0800)
The any? method doesn't exist for 1.9.x, this converts a string to a single
element array to work around the problem.

lib/puppet/parser/functions/validate_re.rb

index 9c216d80efaf07ce67e3903b4432c6aca5d17183..b5e8ff466ee0cb691f22ec769c1c75205bb7bc61 100644 (file)
@@ -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