Skip to content

Commit 9fa70ae

Browse files
Martin HellmichJeff McCune
authored andcommitted
changed .count to .size to support legacy ruby
1 parent 2b75918 commit 9fa70ae

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)