Class: TargetPrettifier

Inherits:
Object show all
Defined in:
lib/jdc/cli/start/target_prettifier.rb

Class Method Summary collapse

Class Method Details

.prettify(client, outputter) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/jdc/cli/start/target_prettifier.rb', line 2

def self.prettify(client, outputter)
  outputter.line("Target Information (where will apps be pushed):")
  outputter.line("  JDC instance: #{print_var(client.try(:target), outputter)} (API version: #{print_var(client.try(:version), outputter)})")
  outputter.line("  user: #{print_var(client.try(:current_user).try(:email), outputter)}")
  #outputter.line("  user: #{print_var(client.try(:current_user), outputter)}")
  outputter.line("  target app space: #{print_var(client.try(:current_space).try(:name), outputter)} (org: #{print_var(client.try(:current_organization).try(:name), outputter)})")
end


10
11
12
13
14
15
16
# File 'lib/jdc/cli/start/target_prettifier.rb', line 10

def self.print_var(object_name, outputter)
  if object_name
    outputter.c(object_name, :good)
  else
    outputter.c('N/A', :bad)
  end
end