From a7faff6f5b0de882bc720c8eb652d37b85a6b2a8 Mon Sep 17 00:00:00 2001 From: Jonathan Boyett Date: Mon, 11 Jul 2011 10:19:07 -0700 Subject: [PATCH] replace String#lines with a String#split to ensure compatibility with Ruby 1.8.5 --- lib/puppet/provider/firewall/iptables.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/puppet/provider/firewall/iptables.rb b/lib/puppet/provider/firewall/iptables.rb index 7e87e14..84238a8 100644 --- a/lib/puppet/provider/firewall/iptables.rb +++ b/lib/puppet/provider/firewall/iptables.rb @@ -72,10 +72,12 @@ Puppet::Type.type(:firewall).provide :iptables, :parent => Puppet::Provider::Fir table = nil rules = [] counter = 1 - iptables_save.lines do |line| + + # String#lines would be nice, but we need to support Ruby 1.8.5 + iptables_save.split("\n").each do |line| unless line =~ /^\#\s+|^\:\S+|^COMMIT/ if line =~ /^\*/ - table = line.sub(/\*/, "").chomp! + table = line.sub(/\*/, "") else if hash = rule_to_hash(line, table, counter) rules << new(hash) -- 2.45.2