diff options
author | Jeff McCune <jeff@puppetlabs.com> | 2013-02-18 12:22:18 -0800 |
---|---|---|
committer | Jeff McCune <jeff@puppetlabs.com> | 2013-02-18 12:22:18 -0800 |
commit | 1c33e9cd71ff9b20653ffc95355fa3be07078104 (patch) | |
tree | 1e8c56fc5fad1c2659fa5442cdd8f1b2ab8d3fbd /lib/puppet | |
parent | fb7ae217438590c8ca081d9646f2823d03bbb83d (diff) | |
parent | d2e0c53243060a158e2fde18d8b05718397e0ded (diff) | |
download | puppet-stdlib-1c33e9cd71ff9b20653ffc95355fa3be07078104.tar.gz puppet-stdlib-1c33e9cd71ff9b20653ffc95355fa3be07078104.tar.bz2 |
Merge branch '3.x' into 4.x
* 3.x:
changed .count to .size to support legacy ruby
Diffstat (limited to 'lib/puppet')
-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 |