Class: Moonshot::Commands::Create
- Inherits:
-
Moonshot::Command
- Object
- Moonshot::Command
- Moonshot::Commands::Create
- Includes:
- ParameterArguments
- Defined in:
- lib/moonshot/commands/create.rb
Instance Attribute Summary collapse
-
#deploy ⇒ Object
readonly
Returns the value of attribute deploy.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
Methods inherited from Moonshot::Command
Instance Attribute Details
#deploy ⇒ Object (readonly)
Returns the value of attribute deploy.
11 12 13 |
# File 'lib/moonshot/commands/create.rb', line 11 def deploy @deploy end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
11 12 13 |
# File 'lib/moonshot/commands/create.rb', line 11 def version @version end |
Instance Method Details
#execute ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/moonshot/commands/create.rb', line 26 def execute controller.create if @deploy && @version.nil? controller.push elsif @deploy controller.deploy_version(@version) end end |
#parser ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/moonshot/commands/create.rb', line 13 def parser @deploy = true parser = super parser.on('-d', '--[no-]deploy', TrueClass, 'Choose if code should be deployed immediately after the stack is created') do |v| # rubocop:disable LineLength @deploy = v end parser.on('--version VERSION_NAME', 'Version for initial deployment. If unset, a new development build is created from the local directory') do |v| # rubocop:disable LineLength @version = v end end |