lib/cf/cli/space/space.rb in cf-1.1.3.rc1 vs lib/cf/cli/space/space.rb in cf-1.1.4

- old
+ new

@@ -1,63 +1,66 @@ require "cf/cli/space/base" -module CF::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! +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 - unless space - return if quiet? - fail "No current space." - end + def space + space = CF::Populators::Space.new(input, org).populate_and_save! - if quiet? - puts space.name - return - end + unless space + return if quiet? + fail "No current space." + end - line "#{c(space.name, :name)}:" + if quiet? + puts space.name + return + end - indented do - line "organization: #{c(space.organization.name, :name)}" + line "#{c(space.name, :name)}:" - if input[:full] - line - line "apps:" + indented do + line "organization: #{c(space.organization.name, :name)}" - spaced(space.apps(:depth => 2)) do |a| - indented do - invoke :app, :app => a + 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 - 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 + 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 - else - line "services: #{name_list(space.service_instances)}" - end - line "domains: #{name_list(space.domains)}" + line "domains: #{name_list(space.domains)}" + end end end end end