require 'pluginscan/reports/cloc_report/cloc' require 'pluginscan/reports/cloc_report/system_cloc' require 'pluginscan/reports/cloc_report/cloc_scanner' require 'pluginscan/reports/cloc_report/cloc_printer' require 'pluginscan/error_printer' module Pluginscan module Reports module CLOCReport 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 end end end