diff options
author | Jeff McCune <jeff@puppetlabs.com> | 2013-02-18 12:21:49 -0800 |
---|---|---|
committer | Jeff McCune <jeff@puppetlabs.com> | 2013-02-18 12:21:49 -0800 |
commit | 1e2ee5bd01b85258548bb7c0aabe4ce0938b2560 (patch) | |
tree | 55aed3981301764ac81d3ea9b8738c8ad6cb52ca | |
parent | 2b7591896d790a17f902fbafc2aed8743dc674f2 (diff) | |
parent | 9fa70ae43f14a9b13343ae67ab8d1520f43ebb4d (diff) | |
download | puppet-stdlib-1e2ee5bd01b85258548bb7c0aabe4ce0938b2560.tar.gz puppet-stdlib-1e2ee5bd01b85258548bb7c0aabe4ce0938b2560.tar.bz2 |
Merge branch 'mhellmic-2.x' into 2.x
* mhellmic-2.x:
changed .count to .size to support legacy ruby
-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 |