Skip to content

Commit d2e0c53

Browse files
author
Jeff McCune
committed
Merge branch '2.x' into 3.x
* 2.x: changed .count to .size to support legacy ruby
2 parents d7aea0f + 1e2ee5b commit d2e0c53

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)