diff options
author | Jeff McCune <jeff@puppetlabs.com> | 2013-02-18 12:22:04 -0800 |
---|---|---|
committer | Jeff McCune <jeff@puppetlabs.com> | 2013-02-18 12:22:04 -0800 |
commit | d2e0c53243060a158e2fde18d8b05718397e0ded (patch) | |
tree | 0e63aa32b5afff6333ec81cc340bd5ec7ad51d9b /lib/puppet/provider | |
parent | d7aea0f0be659223452ba2d65e799d2b7dbfd823 (diff) | |
parent | 1e2ee5bd01b85258548bb7c0aabe4ce0938b2560 (diff) | |
download | puppet-stdlib-d2e0c53243060a158e2fde18d8b05718397e0ded.tar.gz puppet-stdlib-d2e0c53243060a158e2fde18d8b05718397e0ded.tar.bz2 |
Merge branch '2.x' into 3.x
* 2.x:
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 |