Class: RubyCritic::Command::Default

Inherits:
Base
  • Object
show all
Defined in:
lib/rubycritic/commands/default.rb

Direct Known Subclasses

Ci

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Default

Returns a new instance of Default.


11
12
13
14
15
# File 'lib/rubycritic/commands/default.rb', line 11

def initialize(options)
  super
  @paths = options[:paths]
  Config.source_control_system = SourceControlSystem::Base.create
end

Instance Method Details

#critiqueObject


22
23
24
25
# File 'lib/rubycritic/commands/default.rb', line 22

def critique
  analysed_modules = AnalysersRunner.new(paths).run
  RevisionComparator.new(paths).set_statuses(analysed_modules)
end

#executeObject


17
18
19
20
# File 'lib/rubycritic/commands/default.rb', line 17

def execute
  report(critique)
  status_reporter
end

#report(analysed_modules) ⇒ Object


27
28
29
30
# File 'lib/rubycritic/commands/default.rb', line 27

def report(analysed_modules)
  Reporter.generate_report(analysed_modules)
  status_reporter.score = analysed_modules.score
end