Class: Deis::Commands::Enable
- Inherits:
-
Struct
- Object
- Struct
- Deis::Commands::Enable
- Includes:
- Helpers
- Defined in:
- lib/deis/commands/enable.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
Instance Method Summary collapse
Methods included from Helpers
#app_exists?, #capture_output, #capture_syscall, #debug?, #deis_command, #deis_local_command, #deis_login!, #deploy, #get_runner, #get_units!, #git_clone, #increment_retry!, #info, #reset_retry!, #run_util, #scale, seconds_to_human, #shell, #should_retry?, #status, #units
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app
3 4 5 |
# File 'lib/deis/commands/enable.rb', line 3 def app @app end |
Instance Method Details
#run ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/deis/commands/enable.rb', line 6 def run status "Enabling App: #{app}" get_units! if units.any? { |_, v| v > 0 } status "App Already enabled!" return end scale app, units.keys.each_with_object({}) { |k, h| h[k] = 1 } status "App enabled!" end |