summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMartin Hellmich <mhellmic@cern.ch>2013-02-18 16:02:15 +0100
committerMartin Hellmich <mhellmic@cern.ch>2013-02-18 16:02:15 +0100
commit0c622b2e30333f26103a4440a888d440cf455c9c (patch)
tree7a946e41df13e302d1452cc41eda97b3a56f7f73 /lib
parenta45d4f13070cd05c029b96c789f499133721d523 (diff)
downloadpuppet-stdlib-0c622b2e30333f26103a4440a888d440cf455c9c.tar.gz
puppet-stdlib-0c622b2e30333f26103a4440a888d440cf455c9c.tar.bz2
changed .count to .size to support legacy ruby
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/provider/file_line/ruby.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/provider/file_line/ruby.rb b/lib/puppet/provider/file_line/ruby.rb
index e21eaa8..a3219d3 100644
--- a/lib/puppet/provider/file_line/ruby.rb
+++ b/lib/puppet/provider/file_line/ruby.rb
@@ -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