Sha256: 9da701ac37fe2ae8981c98399aa8e039ea7bfb8645f2ea9c3ba2adcb551b7edb

Contents?: true

Size: 1.01 KB

Versions: 54

Compression:

Stored size: 1.01 KB

Contents

require "vmc/cli/service/base"

module VMC::Service
  class Service < Base
    desc "Show service information"
    group :services
    input :service, :desc => "Service to show", :argument => :required,
          :from_given => by_name(:service_instance, :service)
    def service
      display_service(input[:service])
    end

    private

    def display_service(i)
      if quiet?
        line i.name
      elsif v2?
        plan = i.service_plan
        service = plan.service

        apps = i.service_bindings.collect { |b|
          c(b.app.name, :name)
        }.join(", ")

        line "#{c(i.name, :name)}: #{service.label} #{service.version}"

        indented do
          line "provider: #{c(service.provider, :name)}"
          line "bound to: #{apps}" unless apps.empty?
          line "plan: #{c(plan.name, :name)}"

          indented do
            line "description: #{plan.description}"
          end
        end
      else
        line "#{c(i.name, :name)}: #{i.vendor} #{i.version}"
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 4 rubygems

Version Path
cloulu-1.0.0 lib/vmc/cli/service/service.rb
cloulu-0.7.0 lib/vmc/cli/service/service.rb
cloulu-0.6.6 lib/vmc/cli/service/service.rb
cloulu-0.6.5 lib/vmc/cli/service/service.rb
cloulu-0.6.1 lib/vmc/cli/service/service.rb
cloulu-0.6.0 lib/vmc/cli/service/service.rb
cloulu-0.5.1 lib/vmc/cli/service/service.rb
cloulu-0.5.0 lib/vmc/cli/service/service.rb
cloulu-0.3.0 lib/vmc/cli/service/service.rb
cloulu-0.2.6 lib/vmc/cli/service/service.rb
cloulu-0.2.5 lib/vmc/cli/service/service.rb
cloulu-0.2.4 lib/vmc/cli/service/service.rb
cloulu-0.2.3 lib/vmc/cli/service/service.rb
cloulu-0.2.1 lib/vmc/cli/service/service.rb
cloulu-0.2.0 lib/vmc/cli/service/service.rb
cloulu-0.1.6 lib/vmc/cli/service/service.rb
cloulu-0.1.5 lib/vmc/cli/service/service.rb
cloulu-0.1.2 lib/vmc/cli/service/service.rb
cloulu-0.1.1 lib/vmc/cli/service/service.rb
vmc-0.5.1 lib/vmc/cli/service/service.rb