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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48008ac826dd56410a97b505cc303db75d70fb73
4
- data.tar.gz: e2871f34f3b3063d6665f65985ed6408418c99ee
3
+ metadata.gz: 7ecadb28c1a1ab45afd4ee8a47482e1a4cc42bf5
4
+ data.tar.gz: 73422fc24d3bcd21b23e31af334b7227ff9fe126
5
5
  SHA512:
6
- metadata.gz: f8a4f6db4ae060f08c866a7b08fe389581561ed2f764491c8b632e580060f4f7fd33e427172a01a3ec3d03fd68c504dd6db787314a1be7d4b088c8b0b9664b2d
7
- data.tar.gz: 2fb72595e7f15fc30b38da89661397b8fdc3d565f9f3ade66c15ad32b84dc846aa3bc8f5b78c9b3b75a746563be927b98b9601c04d38c4902a87f6d718ae7095
6
+ metadata.gz: fd4b1f28843acfa500a4e3e05880291955a8562ab31fc30a7d07b0cd7a7cd63fed33f6f1f85b280b4dbaf594795f3c0311229221c72853e755f745824a5c68e7
7
+ data.tar.gz: 6c721d2906147a54c18b5536646387c36d1bde0837512af07e565979e9aad0be0efbe902f37a974142268d471a1af2f5818c57d951df080017887a551c9a8794
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.2.1
2
+
3
+ * keep remained options to pass it to dump, then some adapter accepts (e.g. json_gems accepts ascii_only)
4
+
1
5
  # 0.2.0
2
6
 
3
7
  * add response middleware :jsons
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
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[:pretty] || false
7
- @content_type = options[:content_type] || %r!^application/(.*\+)?json!
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.0
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-02 00:00:00.000000000 Z
11
+ date: 2015-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday