Class: CC::CLI::Engines::Enable

Inherits:
EngineCommand show all
Defined in:
lib/cc/cli/engines/enable.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
20
21
# File 'lib/cc/cli/engines/enable.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_enabled?
    say "Engine already enabled."
    pull_docker_images
  else
    enable_engine
    update_yaml
    say "Engine added to .codeclimate.yml."
    pull_docker_images
  end
end