diff options
author | Jeff McCune <jeff@puppetlabs.com> | 2013-02-18 12:22:27 -0800 |
---|---|---|
committer | Jeff McCune <jeff@puppetlabs.com> | 2013-02-18 12:22:33 -0800 |
commit | 5b81c26d94eb763eeb044b484a22b56f71c0cd5e (patch) | |
tree | 7a946e41df13e302d1452cc41eda97b3a56f7f73 /lib | |
parent | a45d4f13070cd05c029b96c789f499133721d523 (diff) | |
parent | 1c33e9cd71ff9b20653ffc95355fa3be07078104 (diff) |
Merge branch '4.x'
* 4.x:
changed .count to .size to support legacy ruby
closes #131
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/provider/file_line/ruby.rb | 2 |
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 |