Pretty print JSON data

See travis-ci/travis-ci#1555.

JSON data are pretty-formatted for humans.
This commit is contained in:
Hiro Asari 2013-11-14 21:29:33 -05:00
parent e61a723d06
commit da62a6ce3c

View File

@ -10,7 +10,7 @@ class Travis::Api::App
def respond_with(resource, options = {})
result = respond(resource, options)
result = result.to_json if result && response.content_type =~ /application\/json/
result = JSON.pretty_generate(result) if result && response.content_type =~ /application\/json/
halt result || 404
end