Sha256: 040b5cbcd70f063de71a68b1dc9d482d97e80f6fa63ffdbea7e17495f96efa61

Contents?: true

Size: 1.68 KB

Versions: 86

Compression:

Stored size: 1.68 KB

Contents

require "cf/cli/space/base"

module CF
  module Space
    class Space < Base
      desc "Show space information"
      group :spaces
      input :organization, :desc => "Space's organization",
        :aliases => %w{--org -o},
        :default => proc { client.current_organization },
        :from_given => by_name(:organization)
      input :space, :desc => "Space to show", :argument => :optional,
        :default => proc { client.current_space },
        :from_given => space_by_name
      input :full, :desc => "Show full information for apps, services, etc.",
        :default => false

      def space
        space = CF::Populators::Space.new(input, org).populate_and_save!

        unless space
          return if quiet?
          fail "No current space."
        end

        if quiet?
          puts space.name
          return
        end

        line "#{c(space.name, :name)}:"

        indented do
          line "organization: #{c(space.organization.name, :name)}"

          if input[:full]
            line
            line "apps:"

            spaced(space.apps(:depth => 2)) do |a|
              indented do
                invoke :app, :app => a
              end
            end
          else
            line "apps: #{name_list(space.apps)}"
          end

          if input[:full]
            line
            line "services:"
            spaced(space.service_instances(:depth => 2)) do |s|
              indented do
                invoke :service, :service => s
              end
            end
          else
            line "services: #{name_list(space.service_instances)}"
          end

          line "domains: #{name_list(space.domains)}"
        end
      end
    end
  end
end

Version data entries

86 entries across 86 versions & 2 rubygems

Version Path
cf-5.4.7 lib/cf/cli/space/space.rb
cf-5.4.7.rc1 lib/cf/cli/space/space.rb
cf-5.4.5 lib/cf/cli/space/space.rb
cf-5.4.4 lib/cf/cli/space/space.rb
trucker-cli-0.0.3 lib/cf/cli/space/space.rb
cf-5.4.3 lib/cf/cli/space/space.rb
cf-5.4.2 lib/cf/cli/space/space.rb
trucker-cli-0.0.2 lib/cf/cli/space/space.rb
trucker-cli-0.0.1 lib/cf/cli/space/space.rb
cf-5.4.1 lib/cf/cli/space/space.rb
cf-5.4.1.rc1 lib/cf/cli/space/space.rb
cf-5.4.0 lib/cf/cli/space/space.rb
cf-5.3.1 lib/cf/cli/space/space.rb
cf-5.3.0 lib/cf/cli/space/space.rb
cf-5.2.2 lib/cf/cli/space/space.rb
cf-5.2.1.rc15 lib/cf/cli/space/space.rb
cf-5.2.1.rc14 lib/cf/cli/space/space.rb
cf-5.2.1.rc13 lib/cf/cli/space/space.rb
cf-5.2.1.rc12 lib/cf/cli/space/space.rb
cf-5.2.1.rc11 lib/cf/cli/space/space.rb