Class: Kitchen::CLI

Inherits:
Thor
  • Object
show all
Includes:
PerformCommand, Logging
Defined in:
lib/kitchen/cli.rb

Overview

The command line runner for Kitchen.

Author:

Defined Under Namespace

Modules: PerformCommand Classes: Driver

Constant Summary collapse

MAX_CONCURRENCY =
9999

Instance Method Summary collapse

Methods included from PerformCommand

#perform

Constructor Details

#initialize(*args) ⇒ CLI

Constructs a new instance.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/kitchen/cli.rb', line 57

def initialize(*args)
  super
  $stdout.sync = true
  Kitchen.logger = Kitchen.default_file_logger
  @loader = Kitchen::Loader::YAML.new(
    :project_config => ENV['KITCHEN_YAML'],
    :local_config => ENV['KITCHEN_LOCAL_YAML'],
    :global_config => ENV['KITCHEN_GLOBAL_YAML']
  )
  @config = Kitchen::Config.new(
    :loader     => @loader,
    :log_level  => ENV.fetch('KITCHEN_LOG', "info").downcase.to_sym
  )
end

Instance Method Details

#consoleObject



176
177
178
# File 'lib/kitchen/cli.rb', line 176

def console
  perform("console", "console")
end

#diagnose(*args) ⇒ Object



93
94
95
96
# File 'lib/kitchen/cli.rb', line 93

def diagnose(*args)
  update_config!
  perform("diagnose", "diagnose", args, :loader => @loader)
end

#list(*args) ⇒ Object



79
80
81
82
# File 'lib/kitchen/cli.rb', line 79

def list(*args)
  update_config!
  perform("list", "list", args)
end

#login(*args) ⇒ Object



159
160
161
162
# File 'lib/kitchen/cli.rb', line 159

def (*args)
  update_config!
  perform("login", "login", args)
end

#sinkObject



171
172
173
# File 'lib/kitchen/cli.rb', line 171

def sink
  perform("sink", "sink")
end

#test(*args) ⇒ Object



150
151
152
153
154
# File 'lib/kitchen/cli.rb', line 150

def test(*args)
  update_config!
  ensure_initialized
  perform("test", "test", args)
end

#versionObject



165
166
167
# File 'lib/kitchen/cli.rb', line 165

def version
  puts "Test Kitchen version #{Kitchen::VERSION}"
end