Class: RangeScan::CLI
- Inherits:
-
Thor
- Object
- Thor
- RangeScan::CLI
- Defined in:
- lib/rangescan/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
39 40 41 |
# File 'lib/rangescan/cli.rb', line 39 def exit_on_failure? true end |
Instance Method Details
#scan(ip_with_subnet_mask, regexp = ".") ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rangescan/cli.rb', line 17 def scan(ip_with_subnet_mask, regexp = ".") = symbolize_hash_keys() range = Range.new(ip_with_subnet_mask) scanner = Scanner.new(**) results = scanner.scan(range.to_a) matcher = Matcher.new(regexp) filtered = matcher.filter(results) puts JSON.pretty_generate(filtered) end |