Module: Pluginscan::Reports::SLOCCountReport

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

Class Method Summary collapse

Class Method Details



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

def self.print(plugin_directory, printer, error_printer)
  sloccount = SLOCCountScanner.new.scan(plugin_directory)
  printer.print(sloccount)

rescue SLOCCountScanner::Unavailable
  error_printer.print("The 'sloccount' command is unavailable. Is it installed and in your path?")
rescue SLOCCountScanner::Exception => e
  error_printer.print("An error occurred while calculating the SLOCCount:\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:\n          #{e.message}")
else
  return true
end