Class: VMC::App::Apps

Inherits:
Base
  • Object
show all
Defined in:
lib/appfog-vmc-plugin/vmc/app/apps.rb

Instance Method Summary collapse

Instance Method Details

#display_apps_table(apps) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/appfog-vmc-plugin/vmc/app/apps.rb', line 3

def display_apps_table(apps)
  table(
    ["name", infras_enabled? && "infra", "status", "usage", v2? && "plan", "runtime", "urls", "services"],
    apps.collect { |a|
      [ c(a.name, :name),
        infras_enabled? && c(a.infra.name, :infra),
        app_status(a),
        "#{a.total_instances} x #{human_mb(a.memory)}",
        v2? && (a.production ? "prod" : "dev"),
        a.runtime.name,
        if a.urls.empty?
          d("none")
        elsif a.urls.size == 1
          a.url
        else
          a.urls.join(", ")
        end,
        if a.services.empty?
          d("none")
        else
          a.services.collect {|s| c(s.name, :name)}.join(", ")
        end
      ]
    })
end