module Deis module Commands class Info < Struct.new :app include Helpers def run h = info(app) status "`#{app}` Information" output_hash h end 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 end end end