Method: Licensed::Reporters::JsonReporter#end_report_command

Defined in:
lib/licensed/reporters/json_reporter.rb

#end_report_command(command, report) ⇒ Object

Report all information from the command run to the shell as a JSON object

command - The command being run report - A report object containing information about the command run



11
12
13
14
# File 'lib/licensed/reporters/json_reporter.rb', line 11

def end_report_command(command, report)
  report["apps"] = report.reports.map(&:to_h) if report.reports.any?
  shell.info JSON.pretty_generate(report.to_h)
end