diff options
author | Martin Hellmich <mhellmic@cern.ch> | 2013-02-18 16:02:15 +0100 |
---|---|---|
committer | Jeff McCune <jeff@puppetlabs.com> | 2013-02-18 12:21:34 -0800 |
commit | 9fa70ae43f14a9b13343ae67ab8d1520f43ebb4d (patch) | |
tree | 55aed3981301764ac81d3ea9b8738c8ad6cb52ca /lib/puppet/provider | |
parent | 2b7591896d790a17f902fbafc2aed8743dc674f2 (diff) |
changed .count to .size to support legacy ruby
Diffstat (limited to 'lib/puppet/provider')
-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 |