Class: Kitchen::CLI
- Inherits:
-
Thor
- Object
- Thor
- Kitchen::CLI
- Includes:
- PerformCommand, Logging
- Defined in:
- lib/kitchen/cli.rb
Overview
The command line runner for Kitchen.
Defined Under Namespace
Modules: PerformCommand Classes: Driver
Constant Summary collapse
- MAX_CONCURRENCY =
The maximum number of concurrent instances that can run--which is a bit high
9999
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Class Method Summary collapse
-
.log_options ⇒ Object
private
Sets the logging method_options.
-
.test_base_path ⇒ Object
private
Sets the test_base_path method_options.
Instance Method Summary collapse
- #console ⇒ Object
- #diagnose(*args) ⇒ Object
- #exec(*args) ⇒ Object
-
#initialize(*args) ⇒ CLI
constructor
Constructs a new instance.
- #list(*args) ⇒ Object
- #login(*args) ⇒ Object
- #package(*args) ⇒ Object
- #sink ⇒ Object
- #test(*args) ⇒ Object
- #version ⇒ Object
Methods included from PerformCommand
Methods included from Logging
#banner, #debug, #error, #fatal, #info, #warn
Constructor Details
#initialize(*args) ⇒ CLI
Constructs a new instance.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/kitchen/cli.rb', line 67 def initialize(*args) super $stdout.sync = true @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 ) @config.log_level = Kitchen.env_log unless Kitchen.env_log.nil? @config.log_overwrite = Kitchen.env_log_overwrite unless Kitchen.env_log_overwrite.nil? end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
64 65 66 |
# File 'lib/kitchen/cli.rb', line 64 def config @config end |
Class Method Details
.log_options ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Sets the logging method_options
84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/kitchen/cli.rb', line 84 def self. method_option :log_level, aliases: "-l", desc: "Set the log level (debug, info, warn, error, fatal)" method_option :log_overwrite, desc: "Set to false to prevent log overwriting each time Test Kitchen runs", type: :boolean method_option :color, type: :boolean, lazy_default: $stdout.tty?, desc: "Toggle color output for STDOUT logger" end |
.test_base_path ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Sets the test_base_path method_options
99 100 101 102 103 |
# File 'lib/kitchen/cli.rb', line 99 def self.test_base_path method_option :test_base_path, aliases: "-t", desc: "Set the base path of the tests" end |
Instance Method Details
#console ⇒ Object
274 275 276 |
# File 'lib/kitchen/cli.rb', line 274 def console perform("console", "console") end |
#diagnose(*args) ⇒ Object
141 142 143 144 |
# File 'lib/kitchen/cli.rb', line 141 def diagnose(*args) update_config! perform("diagnose", "diagnose", args, loader: @loader) end |
#exec(*args) ⇒ Object
257 258 259 260 |
# File 'lib/kitchen/cli.rb', line 257 def exec(*args) update_config! perform("exec", "exec", args) end |
#list(*args) ⇒ Object
119 120 121 122 |
# File 'lib/kitchen/cli.rb', line 119 def list(*args) update_config! perform("list", "list", args) end |
#login(*args) ⇒ Object
239 240 241 242 |
# File 'lib/kitchen/cli.rb', line 239 def login(*args) update_config! perform("login", "login", args) end |
#package(*args) ⇒ Object
246 247 248 249 |
# File 'lib/kitchen/cli.rb', line 246 def package(*args) update_config! perform("package", "package", args) end |
#sink ⇒ Object
269 270 271 |
# File 'lib/kitchen/cli.rb', line 269 def sink perform("sink", "sink") end |
#test(*args) ⇒ Object
231 232 233 234 235 |
# File 'lib/kitchen/cli.rb', line 231 def test(*args) update_config! ensure_initialized perform("test", "test", args) end |