Class: RogueOne::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/rogue_one/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/rogue_one/cli.rb', line 9

def exit_on_failure?
  true
end

Instance Method Details

#report(dns_server) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rogue_one/cli.rb', line 20

def report(dns_server)
  with_error_handling do
    Ping.pong? dns_server

    custom_list = options["custom_list"]
    default_list = options["default_list"].downcase
    record_type = options["record_type"].upcase
    threshold = options["threshold"]
    verbose = options["verbose"]

    detector = Detector.new(
      custom_list: custom_list,
      default_list: default_list,
      record_type: record_type,
      target: dns_server,
      threshold: threshold,
      verbose: verbose,
    )
    puts JSON.pretty_generate(detector.report)
  end
end