Module: Pluginscan::Reports::CLOCReport

Defined in:
lib/pluginscan/reports/cloc_report.rb

Class Method Summary collapse

Class Method Details



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/pluginscan/reports/cloc_report.rb', line 10

def self.print(plugin_directory, printer, error_printer)
  cloc = CLOCScanner.new.scan(plugin_directory)
  printer.print(cloc)

rescue CLOCScanner::Unavailable
  error_printer.print("The 'cloc' command is unavailable. Is it installed and in your path?")
rescue CLOCScanner::Exception => e
  error_printer.print("An error occurred while calculating the sloccount with CLOC:\n          #{e.message}")
rescue StandardError => e
  # We don't want an error with CLOC to interrupt the rest of pluginscan
  # TODO: not sure this is sensible
  error_printer.print("An error occurred while calculating the sloccount with CLOC:\n          #{e.message}")
else
  return true
end