rocket_pants 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rocket_pants/controller/respondable.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1437dd0365794b5cc7676ed82fc9fa7521a75254
|
|
4
|
+
data.tar.gz: bb89a7f927c2ae4a06bc6e4a461a6bc83fdee696
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a51e6090e9e712c5d2e5e639ca0618e1891ad13f08720a036ad21da41d35c855d67da5160dea20ab4578cb77e4b6a6a3548f1cf243be17ab32e49ef4b9b3eb58
|
|
7
|
+
data.tar.gz: 772f09b18a7a57be684961cb08cbc2f2ae9ed745b4c66de7470f08c8c1096d58ca03d38ccfc77c2e65438131f45a87fc1ddd3cec3247008c27b093dd68d3fe88
|
|
@@ -95,6 +95,10 @@ module RocketPants
|
|
|
95
95
|
}
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
+
def encode_to_json(object)
|
|
99
|
+
ActiveSupport::JSON.encode object
|
|
100
|
+
end
|
|
101
|
+
|
|
98
102
|
# Given a json object or encoded json, will encode it
|
|
99
103
|
# and set it to be the output of the given page.
|
|
100
104
|
def render_json(json, options = {})
|
|
@@ -103,7 +107,7 @@ module RocketPants
|
|
|
103
107
|
self.content_type = options[:content_type] if options[:content_type]
|
|
104
108
|
options = options.slice(*RENDERING_OPTIONS)
|
|
105
109
|
# Don't convert raw strings to JSON.
|
|
106
|
-
json =
|
|
110
|
+
json = encode_to_json(json) unless json.respond_to?(:to_str)
|
|
107
111
|
# Encode the object to json.
|
|
108
112
|
self.status ||= :ok
|
|
109
113
|
self.content_type ||= Mime::JSON
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rocket_pants
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.9.
|
|
4
|
+
version: 1.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Darcy Laycock
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-09-
|
|
11
|
+
date: 2013-09-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionpack
|