Class: Rundock::CLI
- Inherits:
-
Thor
show all
- Defined in:
- lib/rundock/cli.rb
Constant Summary
collapse
- DEFAULT_SCENARIO_FILE_PATH =
'./scenario.yml'
- DEFAULT_SSH_OPTIONS_DEFAULT_FILE_PATH =
'./default_ssh.yml'
- DEFAULT_HOSTGROUP_FILE_PATH =
'./targetgroup.yml'
Instance Method Summary
collapse
Constructor Details
#initialize(args, opts, config) ⇒ CLI
Returns a new instance of CLI.
16
17
18
19
20
21
22
23
24
|
# File 'lib/rundock/cli.rb', line 16
def initialize(args, opts, config)
super(args, opts, config)
Rundock::Logger.level = ::Logger.const_get(options[:log_level].upcase)
Rundock::Logger.formatter.colored = options[:color]
Rundock::Logger.formatter. = options[:header]
Rundock::Logger.formatter. = options[:short_header]
Rundock::Logger.formatter. = options[:date_header]
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(command, *args) ⇒ Object
76
77
78
|
# File 'lib/rundock/cli.rb', line 76
def method_missing(command, *args)
help
end
|
Instance Method Details
70
71
72
73
74
|
# File 'lib/rundock/cli.rb', line 70
def configure
opts = {}
Configure.start(opts.merge(options.deep_symbolize_keys))
end
|
#do(*scenario_file_path) ⇒ Object
39
40
41
42
43
44
|
# File 'lib/rundock/cli.rb', line 39
def do(*scenario_file_path)
scenario_file_path = [DEFAULT_SCENARIO_FILE_PATH] if scenario_file_path.empty?
opts = { :scenario => scenario_file_path[0] }
Runner.run(opts.merge(options.deep_symbolize_keys))
end
|
61
62
63
64
65
|
# File 'lib/rundock/cli.rb', line 61
def ssh
opts = {}
Runner.run(opts.merge(options.deep_symbolize_keys))
end
|
27
28
29
|
# File 'lib/rundock/cli.rb', line 27
def version
puts Rundock::VERSION.to_s
end
|