diff options
author | Ken Barber <ken@bob.sh> | 2012-03-07 19:55:21 -0800 |
---|---|---|
committer | Ken Barber <ken@bob.sh> | 2012-03-07 19:55:21 -0800 |
commit | 010fb5e5685fec7aefe9e62901ebcdf06af19d5a (patch) | |
tree | de474e573d89196426cb4a44d63256dedcda664c /lib/puppet | |
parent | e0eadf2e61994f083d9e158a4eef7f05a97a60f5 (diff) | |
download | puppet-stdlib-010fb5e5685fec7aefe9e62901ebcdf06af19d5a.tar.gz puppet-stdlib-010fb5e5685fec7aefe9e62901ebcdf06af19d5a.tar.bz2 |
(#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.
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/parser/functions/validate_re.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |