Class: EYCli::Command::Show
Defined Under Namespace
Classes: ShowParser
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #help ⇒ Object
- #info(app) ⇒ Object
-
#initialize ⇒ Show
constructor
A new instance of Show.
- #invoke ⇒ Object
- #options_parser ⇒ Object
- #status(app) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize ⇒ Show
Returns a new instance of Show.
4 5 6 |
# File 'lib/ey_cli/commands/show.rb', line 4 def initialize @apps = EYCli::Controller::Apps.new end |
Instance Method Details
#help ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/ey_cli/commands/show.rb', line 48 def help <<-EOF Show information and status of an application. If a name is not supplied it assumes the current directory as application base. Usage: `ey_cli show app_name' EOF end |
#info(app) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/ey_cli/commands/show.rb', line 16 def info(app) %Q{ #{app.name}: - Info: + git repository: #{app.git_repository}} end |
#invoke ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/ey_cli/commands/show.rb', line 8 def invoke app = @apps.fetch_app(nil, ) if app EYCli.term.say info(app) EYCli.term.say(status(app)) if app.environments end end |
#options_parser ⇒ Object
56 57 58 |
# File 'lib/ey_cli/commands/show.rb', line 56 def ShowParser.new end |
#status(app) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ey_cli/commands/show.rb', line 23 def status(app) status = %Q{ - Status per environment:} app.environments.each do |env| status << %Q{ + #{env.name}: - environment: #{env.framework_env} - stack: #{env.app_server_stack_name} - status: #{env.instance_status}} if env.instances status << %Q{ - instances:} env.instances.each do |instance| status << %Q{ + #{instance.role}: - Amazon ID: #{instance.amazon_id} - status: #{instance.status}} end end end status end |