Class: Deis::Commands::Info

Inherits:
Struct
  • Object
show all
Includes:
Helpers
Defined in:
lib/deis/commands/info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#app_exists?, #capture_output, #capture_syscall, #debug?, #deis_command, #deis_local_command, #deis_login!, #deploy, #get_runner, #get_units!, #git_clone, #increment_retry!, #info, #reset_retry!, #run_util, #scale, seconds_to_human, #shell, #should_retry?, #status, #units

Instance Attribute Details

#appObject

Returns the value of attribute app

Returns:

  • (Object)

    the current value of app



3
4
5
# File 'lib/deis/commands/info.rb', line 3

def app
  @app
end

Instance Method Details

#output_hash(hash, indent = 0) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/deis/commands/info.rb', line 12

def output_hash(hash, indent = 0)
  hash.each do |k, v|
    case v
    when Hash
      puts ('  ' * indent) + k + ':'
      output_hash(v, indent + 1)
    when Array
      puts ('  ' * indent) + k + ':', *v.map { |i| ('  ' * (indent + 1)) + i.to_s }
    else
      puts ('  ' * indent) + "#{k}: #{v}"
    end
  end
end

#runObject



6
7
8
9
10
# File 'lib/deis/commands/info.rb', line 6

def run
  h = info(app)
  status "`#{app}` Information"
  output_hash h
end