]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
(maint) Comment Ken's fix to String#any?
authorJeff McCune <jeff@puppetlabs.com>
Fri, 9 Mar 2012 22:08:54 +0000 (14:08 -0800)
committerJeff McCune <jeff@puppetlabs.com>
Fri, 9 Mar 2012 22:08:54 +0000 (14:08 -0800)
Just added a comment about why we're doing what we're doing.

lib/puppet/parser/functions/validate_re.rb

index b5e8ff466ee0cb691f22ec769c1c75205bb7bc61..ca25a702c58a9881a695882bb1bec3e85f8f15c3 100644 (file)
@@ -30,6 +30,8 @@ module Puppet::Parser::Functions
 
     msg = args[2] || "validate_re(): #{args[0].inspect} does not match #{args[1].inspect}"
 
+    # 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