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.



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

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



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

def execute
  RubyCritic::Config.formats = [:json]

  report(critique)

  status_reporter
end

#report(analysed_modules) ⇒ Object

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

Parameters:



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

def report(analysed_modules)
  Reporter.generate_report(analysed_modules)

  status_reporter.analysed_modules = analysed_modules
  status_reporter.score = analysed_modules.score
end