]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
changed .count to .size to support legacy ruby
authorMartin Hellmich <mhellmic@cern.ch>
Mon, 18 Feb 2013 15:02:15 +0000 (16:02 +0100)
committerJeff McCune <jeff@puppetlabs.com>
Mon, 18 Feb 2013 20:21:34 +0000 (12:21 -0800)
lib/puppet/provider/file_line/ruby.rb

index e21eaa82ab4b80ecc34a41056e2e653081e3a73d..a3219d3d4d44133bd9608fd05004c18556c12a21 100644 (file)
@@ -34,7 +34,7 @@ Puppet::Type.type(:file_line).provide(:ruby) do
 
   def handle_create_with_match()
     regex = resource[:match] ? Regexp.new(resource[:match]) : nil
-    match_count = lines.select { |l| regex.match(l) }.count
+    match_count = lines.select { |l| regex.match(l) }.size
     if match_count > 1
       raise Puppet::Error, "More than one line in file '#{resource[:path]}' matches pattern '#{resource[:match]}'"
     end