# File lib/chef/knife/core/generic_presenter.rb, line 58 def format(data) case parse_format_option when :summary summarize(data) when :text text_format(data) when :json Chef::JSONCompat.to_json_pretty(data) when :yaml require 'yaml' YAML::dump(data) when :pp # If you were looking for some attribute and there is only one match # just dump the attribute value if data.length == 1 and config[:attribute] data.values[0] else out = StringIO.new PP.pp(data, out) out.string end end end