Class: EY::Action::ListEnvironments

Inherits:
Object
  • Object
show all
Extended by:
Util
Defined in:
lib/engineyard/action/list_environments.rb

Class Method Summary collapse

Class Method Details

.call(all) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/engineyard/action/list_environments.rb', line 8

def self.call(all)
  app, envs = app_and_envs(all)
  if app
    EY.ui.say %|Cloud environments for #{app.name}:|
      EY.ui.print_envs(envs, EY.config.default_environment)
  elsif envs
    EY.ui.say %|Cloud environments:|
      EY.ui.print_envs(envs, EY.config.default_environment)
  else
    EY.ui.say %|You do not have any cloud environments.|
  end
end