Class: Reviser::Components::Checker

Inherits:
Reviser::Component show all
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

Author:

  • Renan Strauss

Constant Summary

Constants included from Helpers::Criteria

Helpers::Criteria::CRITERIA, Helpers::Criteria::EXTENSIONS, Helpers::Criteria::PWD

Instance Attribute Summary

Attributes included from Helpers::Criteria

#criteria, #output

Instance Method Summary collapse

Methods included from Helpers::Criteria

#call

Methods inherited from Reviser::Component

#resource, #work

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

#runObject

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