Class: Reviser::Components::Checker
- Inherits:
-
Reviser::Component
- Object
- Reviser::Component
- Reviser::Components::Checker
- Includes:
- Helpers::Criteria
- Defined in:
- lib/reviser/components/checker.rb
Overview
The Checker is a component that wraps all required tools to do the analysis. It adapts itself dynamically to the configuration
Constant Summary
Constants included from Helpers::Criteria
Helpers::Criteria::CRITERIA, Helpers::Criteria::EXTENSIONS, Helpers::Criteria::PWD
Instance Attribute Summary
Attributes included from Helpers::Criteria
Instance Method Summary collapse
-
#initialize(data) ⇒ Checker
constructor
A new instance of Checker.
-
#run ⇒ Object
For each project processed by Organiser, we run analysis and store results.
Methods included from Helpers::Criteria
Methods inherited from Reviser::Component
Constructor Details
#initialize(data) ⇒ Checker
Returns a new instance of Checker.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/reviser/components/checker.rb', line 41 def initialize(data) super data @criteria = Hash.new @output = Hash.new @logger.h1 Logger::INFO, "Loading modules" load_modules CRITERIA load_modules EXTENSIONS # # We also load user-registered extensions if any # Reviser.registered_extensions.each do |ext| load_module_methods ext end @logger.h1 Logger::INFO, "Loading labels" [:criteria, :extensions].each { |x| load_labels x } @results = {} end |
Instance Method Details
#run ⇒ Object
For each project processed by Organiser, we run analysis and store results
70 71 72 73 74 75 76 77 78 |
# File 'lib/reviser/components/checker.rb', line 70 def run @data.each_with_index do |proj, i| path = File.join(Cfg[:dest], proj) puts "----[#{i+1}/#{@data.size}]\t#{proj}" Dir.chdir(path) { check proj } end @results end |