Class: Skunk::Command::Default

Inherits:
RubyCritic::Command::Default
  • Object
show all
Includes:
Shareable
Defined in:
lib/skunk/commands/default.rb

Overview

Default command runs a critique using RubyCritic and uses Skunk::Command::StatusReporter to report status

Instance Method Summary collapse

Methods included from Shareable

#share, #sharing?

Constructor Details

#initialize(options) ⇒ Default

Returns a new instance of Default.



19
20
21
22
23
# File 'lib/skunk/commands/default.rb', line 19

def initialize(options)
  super
  @options = options
  @status_reporter = Skunk::Command::StatusReporter.new(options)
end

Instance Method Details

#executeSkunk::Command::StatusReporter

It generates a report and it returns an instance of Skunk::Command::StatusReporter



29
30
31
32
33
34
35
# File 'lib/skunk/commands/default.rb', line 29

def execute
  RubyCritic::Config.formats = []

  report(critique)

  status_reporter
end

#report(analysed_modules) ⇒ Object

It connects the Skunk::Command::StatusReporter with the collection of analysed modules.

Parameters:



41
42
43
44
# File 'lib/skunk/commands/default.rb', line 41

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