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, full) ⇒ Object
- #removed_print(message) ⇒ Object (also: #error_print)
- #split_cidr(ipset) ⇒ Object
Instance Method Details
#added_print(message) ⇒ Object
15 16 17 |
# File 'lib/wafoo/helper.rb', line 15 def added_print() "\e[32m" + + "\e[0m" end |
#info_print(message) ⇒ Object
19 20 21 |
# File 'lib/wafoo/helper.rb', line 19 def info_print() "\e[36m" + + "\e[0m" end |
#output_table(ipsets_list, full) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/wafoo/helper.rb', line 3 def output_table(ipsets_list, full) header = ['Type', 'IPSet ID', 'IPSet Name'] header.concat(['WebACL ID', 'WebACL Name']) if full table = Terminal::Table.new(:headings => header, :rows => ipsets_list) puts table end |
#removed_print(message) ⇒ Object Also known as: error_print
23 24 25 |
# File 'lib/wafoo/helper.rb', line 23 def removed_print() "\e[31m" + + "\e[0m" end |
#split_cidr(ipset) ⇒ Object
10 11 12 13 |
# File 'lib/wafoo/helper.rb', line 10 def split_cidr(ipset) addr = NetAddr::CIDR.create(ipset) addr.enumerate end |