Skip to content

Commit 1c33e9c

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

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)