From da62a6ce3c1bafb16b1de00ea6332c5e3b8ede8d Mon Sep 17 00:00:00 2001 From: Hiro Asari Date: Thu, 14 Nov 2013 21:29:33 -0500 Subject: [PATCH] Pretty print JSON data See travis-ci/travis-ci#1555. JSON data are pretty-formatted for humans. --- lib/travis/api/app/helpers/respond_with.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/travis/api/app/helpers/respond_with.rb b/lib/travis/api/app/helpers/respond_with.rb index 611f789f..18df03ad 100644 --- a/lib/travis/api/app/helpers/respond_with.rb +++ b/lib/travis/api/app/helpers/respond_with.rb @@ -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