lib/rogue_one/cli.rb in rogue_one-0.1.3 vs lib/rogue_one/cli.rb in rogue_one-0.1.4

- old
+ new

@@ -6,19 +6,22 @@ module RogueOne class CLI < Thor desc "report [DNS_SERVER]", "Show a report of a given DNS server" def report(dns_server) with_error_handling do + Ping.pong? dns_server + detector = Detector.new(target: dns_server) puts JSON.pretty_generate(detector.report) end end no_commands do def with_error_handling yield rescue StandardError => e - puts "Warning: #{e}" + message = { error: e.to_s } + puts JSON.pretty_generate(message) end end end end