Module: Aptible::CLI::Subcommands::Services

Included in:
Agent
Defined in:
lib/aptible/cli/subcommands/services.rb

Class Method Summary collapse

Class Method Details

.included(thor) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/aptible/cli/subcommands/services.rb', line 5

def self.included(thor)
  thor.class_eval do
    include Helpers::App

    desc 'services', 'List Services for an App'
    app_options
    def services
      app = ensure_app(options)

      Formatter.render(Renderer.current) do |root|
        root.list do |list|
          app.each_service do |service|
            list.object do |node|
              ResourceFormatter.inject_service(node, service, app)
            end
          end
        end
      end
    end
  end
end