summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff McCune <jeff@puppetlabs.com>2012-03-09 14:09:55 -0800
committerJeff McCune <jeff@puppetlabs.com>2012-03-09 14:09:55 -0800
commitfab75be6c9ceea283e0aa8d90f7943316b3efca6 (patch)
treedf03321b6c0177b4f21830615a3bebcc4275693e
parente0eadf2e61994f083d9e158a4eef7f05a97a60f5 (diff)
parentf156e554d43f7d5517d2fd79bab41f7d9ee73688 (diff)
Merge branch 'ticket/2.3.x/13018_any_on_string' into 2.3.x
* ticket/2.3.x/13018_any_on_string: (maint) Comment Ken's fix to String#any? (#13018) Fix missing method any? message for ruby 1.9.x
-rw-r--r--lib/puppet/parser/functions/validate_re.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/puppet/parser/functions/validate_re.rb b/lib/puppet/parser/functions/validate_re.rb
index 9c216d8..ca25a70 100644
--- a/lib/puppet/parser/functions/validate_re.rb
+++ b/lib/puppet/parser/functions/validate_re.rb
@@ -30,7 +30,9 @@ 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|
+ # We're using a flattened array here because we can't call String#any? in
+ # Ruby 1.9 like we can in Ruby 1.8
+ raise Puppet::ParseError, (msg) unless [args[1]].flatten.any? do |re_str|
args[0] =~ Regexp.compile(re_str)
end