Merge branch '2.x' into 3.x

* 2.x:
  changed .count to .size to support legacy ruby
This commit is contained in:
Jeff McCune 2013-02-18 12:22:04 -08:00
commit d2e0c53243

View file

@ -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