Class: CC::CLI::Engines::Remove

Inherits:
EngineCommand show all
Defined in:
lib/cc/cli/engines/remove.rb

Constant Summary

Constants inherited from Command

Command::CODECLIMATE_YAML

Instance Method Summary collapse

Methods inherited from Command

command_name, #execute, #fatal, #initialize, #require_codeclimate_yml, #say, #warn

Constructor Details

This class inherits a constructor from CC::CLI::Command

Instance Method Details

#runObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/cc/cli/engines/remove.rb', line 7

def run
  require_codeclimate_yml

  if !engine_exists?
    say "Engine not found. Run 'codeclimate engines:list' for a list of valid engines."
  elsif !engine_present_in_yaml?
    say "Engine not found in .codeclimate.yml."
  else
    remove_engine
    update_yaml
    say "Engine removed from .codeclimate.yml."
  end
end