Merge branch 'mhellmic-2.x' into 2.x

* mhellmic-2.x:
  changed .count to .size to support legacy ruby
This commit is contained in:
Jeff McCune 2013-02-18 12:21:49 -08:00
commit 1e2ee5bd01

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