Sha256: 420c20f8b7a3676e14690bf4189c93833221b118f338c6f4b4a39649c026edbf

Contents?: true

Size: 834 Bytes

Versions: 30

Compression:

Stored size: 834 Bytes

Contents

require 'ey-core/cli/subcommand'

module Ey
  module Core
    module Cli
      class Applications < Subcommand
        title "applications"
        summary "Retrieve a list of Engine Yard applications that you have access to."

        option :account,
          short: 'c',
          long: 'account',
          description: 'Filter by account name or id',
          argument: 'Account'

        def handle
          table_data = TablePrint::Printer.new(
            applications,
            [{id: {width: 10}}, :name]
          )

          puts table_data.table_print
        end

        private
        def applications
          if option(:account)
            core_account.applications.all
          else
            core_accounts.map(&:applications).flatten.sort_by(&:id)
          end
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
ey-core-3.6.0.autoscaling1 lib/ey-core/cli/applications.rb
ey-core-3.6.4 lib/ey-core/cli/applications.rb
ey-core-3.6.3 lib/ey-core/cli/applications.rb
ey-core-3.6.1 lib/ey-core/cli/applications.rb
groove-ey-core-3.6.3 lib/ey-core/cli/applications.rb
groove-ey-core-3.6.2 lib/ey-core/cli/applications.rb
groove-ey-core-3.6.1 lib/ey-core/cli/applications.rb
ey-core-3.5.0 lib/ey-core/cli/applications.rb
ey-core-3.4.4 lib/ey-core/cli/applications.rb
ey-core-3.4.2 lib/ey-core/cli/applications.rb
ey-core-3.4.1 lib/ey-core/cli/applications.rb
ey-core-3.4.0 lib/ey-core/cli/applications.rb
ey-core-3.3.1 lib/ey-core/cli/applications.rb
ey-core-3.3.0 lib/ey-core/cli/applications.rb
ey-core-3.2.6 lib/ey-core/cli/applications.rb
ey-core-3.2.5 lib/ey-core/cli/applications.rb
ey-core-3.2.4 lib/ey-core/cli/applications.rb
ey-core-3.2.3 lib/ey-core/cli/applications.rb
ey-core-3.2.2 lib/ey-core/cli/applications.rb
ey-core-3.2.1 lib/ey-core/cli/applications.rb