lib/shutter/iptables/iface.rb in shutter-0.0.1 vs lib/shutter/iptables/iface.rb in shutter-0.0.2
- old
+ new
@@ -1,30 +1,30 @@
module Shutter
- module IPTables
- class Iface
- def initialize( path, type )
- @type = type
- file = File.open("#{path}/iface.#{type.to_s}", "r")
- @content = file.read
- end
+ module IPTables
+ class Iface
+ def initialize( path, type )
+ @type = type
+ file = File.open("#{path}/iface.#{type.to_s}", "r")
+ @content = file.read
+ end
- def to_s
- @content
- end
+ def to_s
+ @content
+ end
- def to_ipt
- @rules = ""
- @content.each_line do |line|
- line = line.strip
- if line =~ /^[a-z].+$/
- @rules += send(:"#{@type.to_s}_ipt", line)
- end
- end
- @rules
- end
+ def to_ipt
+ @rules = ""
+ @content.each_line do |line|
+ line = line.strip
+ if line =~ /^[a-z].+$/
+ @rules += send(:"#{@type.to_s}_ipt", line)
+ end
+ end
+ @rules
+ end
- def dmz_ipt( iface )
- "-A Dmz -i #{iface} -j ACCEPT\n"
- end
- end
- end
+ def dmz_ipt( iface )
+ "-A Dmz -i #{iface} -j ACCEPT\n"
+ end
+ end
+ end
end
\ No newline at end of file