Method: VMC::Cli::Command::Apps#environment

Defined in:
lib/cli/commands/apps.rb

#environment(appname) ⇒ Object



415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
# File 'lib/cli/commands/apps.rb', line 415

def environment(appname)
  app = client.app_info(appname)
  env = app[:env] || []
  return display JSON.pretty_generate(env) if @options[:json]
  return display "No Environment Variables" if env.empty?
  etable = table do |t|
    t.headings = 'Variable', 'Value'
    env.each do |e|
      k,v = e.split('=', 2)
      t << [k, v]
    end
  end
  display "\n"
  display etable
end