iptablez
iptablez copied to clipboard
Extract 'dat parsing into its own helper.
Magic
There's a little bit of parsing logic that goes on under the hood.
Extracting for More Modules
It'd be cool to extract out that logic into it's own parsing methods that could be used under the hood and out of the hood for output that iptablez itself may not have triggered. I think this would make a cool feature and would make it a bit more modular. So many modules.
Example Idea
I'm thinking something like this in practice:
require 'iptablez'
Iptablez.parse.lines_to_array(output_from_iptables_tack_L)
# => []
# array containing lines excluding the header stuff all chains
Iptablez.parse.lines_to_arrays(output_from_iptables_tack_L)
# => { "INPUT" => [], "OUTPUT=> [], "FORWARD" => [] }
# hash containing chains with each line per chain