Module: Wafoo::Helper
- Included in:
- Run
- Defined in:
- lib/wafoo/helper.rb
Instance Method Summary collapse
- #added_print(message) ⇒ Object
- #info_print(message) ⇒ Object
- #output_table(ipsets_list) ⇒ Object
- #removed_print(message) ⇒ Object (also: #error_print)
- #split_cidr(ipset) ⇒ Object
Instance Method Details
#added_print(message) ⇒ Object
14 15 16 |
# File 'lib/wafoo/helper.rb', line 14 def added_print() "\e[32m" + + "\e[0m" end |
#info_print(message) ⇒ Object
18 19 20 |
# File 'lib/wafoo/helper.rb', line 18 def info_print() "\e[36m" + + "\e[0m" end |
#output_table(ipsets_list) ⇒ Object
3 4 5 6 7 |
# File 'lib/wafoo/helper.rb', line 3 def output_table(ipsets_list) table = Terminal::Table.new(:headings => ['Type', 'IPSets ID', 'Name'], :rows => ipsets_list) puts table end |
#removed_print(message) ⇒ Object Also known as: error_print
22 23 24 |
# File 'lib/wafoo/helper.rb', line 22 def removed_print() "\e[31m" + + "\e[0m" end |
#split_cidr(ipset) ⇒ Object
9 10 11 12 |
# File 'lib/wafoo/helper.rb', line 9 def split_cidr(ipset) addr = NetAddr::CIDR.create(ipset) addr.enumerate end |