faraday_middleware-jsons 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/VERSION +1 -1
- data/lib/faraday_middleware/jsons/request/encoder.rb +4 -3
- 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: 7ecadb28c1a1ab45afd4ee8a47482e1a4cc42bf5
|
4
|
+
data.tar.gz: 73422fc24d3bcd21b23e31af334b7227ff9fe126
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd4b1f28843acfa500a4e3e05880291955a8562ab31fc30a7d07b0cd7a7cd63fed33f6f1f85b280b4dbaf594795f3c0311229221c72853e755f745824a5c68e7
|
7
|
+
data.tar.gz: 6c721d2906147a54c18b5536646387c36d1bde0837512af07e565979e9aad0be0efbe902f37a974142268d471a1af2f5818c57d951df080017887a551c9a8794
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
@@ -3,13 +3,14 @@ module FaradayMiddleware::Jsons
|
|
3
3
|
def initialize(app, options = {})
|
4
4
|
super(app)
|
5
5
|
|
6
|
-
@pretty = options
|
7
|
-
@content_type = options
|
6
|
+
@pretty = options.delete(:pretty) || false
|
7
|
+
@content_type = options.delete(:content_type) || %r!^application/(.*\+)?json!
|
8
|
+
@options = options
|
8
9
|
end
|
9
10
|
|
10
11
|
def call(env)
|
11
12
|
if has_body?(env) && match_content_type?(env)
|
12
|
-
env[:body] = MultiJson.dump(env[:body], pretty: @pretty)
|
13
|
+
env[:body] = MultiJson.dump(env[:body], @options.merge(pretty: @pretty))
|
13
14
|
end
|
14
15
|
|
15
16
|
@app.call(env)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday_middleware-jsons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- okitan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|