Pretty print JSON data
See travis-ci/travis-ci#1555. JSON data are pretty-formatted for humans.
This commit is contained in:
parent
e61a723d06
commit
da62a6ce3c
|
@ -10,7 +10,7 @@ class Travis::Api::App
|
||||||
|
|
||||||
def respond_with(resource, options = {})
|
def respond_with(resource, options = {})
|
||||||
result = respond(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
|
halt result || 404
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user