Class: RubyCritic::Command::Compare

Inherits:
Default show all
Defined in:
lib/rubycritic/commands/compare.rb

Direct Known Subclasses

Ci

Instance Method Summary collapse

Methods inherited from Default

#report

Constructor Details

#initialize(options) ⇒ Compare

Returns a new instance of Compare.



14
15
16
17
18
# File 'lib/rubycritic/commands/compare.rb', line 14

def initialize(options)
  super
  @original_config_root = Config.root
  @build_number = 0
end

Instance Method Details

#executeObject



20
21
22
23
24
25
26
27
28
# File 'lib/rubycritic/commands/compare.rb', line 20

def execute
  if Config.send(:base_branch) == Config.send(:feature_branch)
    raise('The branch you are on and are comparing with are the same.
    Please switch to a different branch or choose a different branch to compare.')
  end
  compare_branches
  status_reporter.score = Config.feature_branch_score
  status_reporter
end