Module: SimpleDeploy::CLI
- Defined in:
- lib/simple_deploy/cli.rb,
lib/simple_deploy/cli/list.rb,
lib/simple_deploy/cli/clone.rb,
lib/simple_deploy/cli/create.rb,
lib/simple_deploy/cli/deploy.rb,
lib/simple_deploy/cli/events.rb,
lib/simple_deploy/cli/shared.rb,
lib/simple_deploy/cli/status.rb,
lib/simple_deploy/cli/update.rb,
lib/simple_deploy/cli/destroy.rb,
lib/simple_deploy/cli/execute.rb,
lib/simple_deploy/cli/outputs.rb,
lib/simple_deploy/cli/protect.rb,
lib/simple_deploy/cli/template.rb,
lib/simple_deploy/cli/instances.rb,
lib/simple_deploy/cli/resources.rb,
lib/simple_deploy/cli/attributes.rb,
lib/simple_deploy/cli/parameters.rb,
lib/simple_deploy/cli/environments.rb
Defined Under Namespace
Modules: Shared
Classes: Attributes, Clone, Create, Deploy, Destroy, Environments, Events, Execute, Instances, List, Outputs, Parameters, Protect, Resources, Status, Template, Update
Class Method Summary
collapse
Class Method Details
.commands ⇒ Object
90
91
92
93
94
|
# File 'lib/simple_deploy/cli.rb', line 90
def self.commands
return @commands if @commands
klasses = SimpleDeploy::CLI.constants.reject { |c| c == :Shared }
@commands = klasses.map { |klass| SimpleDeploy::CLI.const_get(klass).new }
end
|
.length_of_longest_command ⇒ Object
96
97
98
|
# File 'lib/simple_deploy/cli.rb', line 96
def self.length_of_longest_command
commands.map { |c| c.command_name.length }.max
end
|
.usage ⇒ Object
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# File 'lib/simple_deploy/cli.rb', line 76
def self.usage
puts 'Usage: simple_deploy command'
puts ''
puts 'Append -h for help on specific subcommand.'
puts ''
puts 'Commands:'
commands.each do |cmd|
$stdout.printf " %-#{length_of_longest_command}s %s\n",
cmd.command_name,
cmd.command_summary
end
end
|