Skip to content

Commit 5b81c26

Browse files
author
Jeff McCune
committed
Merge branch '4.x'
* 4.x: changed .count to .size to support legacy ruby closes #131
2 parents a45d4f1 + 1c33e9c commit 5b81c26

File tree

1 file changed

+1
-1
lines changed
  • lib/puppet/provider/file_line

1 file changed

+1
-1
lines changed

lib/puppet/provider/file_line/ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def lines
3434

3535
def handle_create_with_match()
3636
regex = resource[:match] ? Regexp.new(resource[:match]) : nil
37-
match_count = lines.select { |l| regex.match(l) }.count
37+
match_count = lines.select { |l| regex.match(l) }.size
3838
if match_count > 1
3939
raise Puppet::Error, "More than one line in file '#{resource[:path]}' matches pattern '#{resource[:match]}'"
4040
end

0 commit comments

Comments
 (0)