faraday_middleware 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/faraday_middleware/response/parse_json.rb +1 -1
- data/lib/faraday_middleware/response/parse_marshal.rb +1 -1
- data/lib/faraday_middleware/response/parse_xml.rb +2 -2
- data/lib/faraday_middleware/response/parse_yaml.rb +6 -2
- data/lib/faraday_middleware/response_middleware.rb +1 -5
- data/lib/faraday_middleware/version.rb +1 -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: 98b62a188512ffc22a73d58652fdd1b812f0a481
|
4
|
+
data.tar.gz: 458cc66e01374dfc59e58b9231a061bfed6b8788
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb8e817ff09109ef7d47ddf01f7483b792e7696cf6cb39cacd378c0305f8b6b09776f38e411cb0fdb9201165412692bac5c3446f5dbb99b06af6f4208ad2edaa
|
7
|
+
data.tar.gz: 7c349cf036245554e4c94d125e64359c9269b518fc13c9b12b3dc887e5f037bf6e9d60f2bf7025c0554dedabe37eab80ce1da3c11ac92276ca311f562c9b38c5
|
@@ -8,7 +8,7 @@ module FaradayMiddleware
|
|
8
8
|
end
|
9
9
|
|
10
10
|
define_parser do |body, parser_options|
|
11
|
-
::JSON.parse(body, parser_options) unless body.strip.empty?
|
11
|
+
::JSON.parse(body, parser_options || {}) unless body.strip.empty?
|
12
12
|
end
|
13
13
|
|
14
14
|
# Public: Override the content-type of the response with "application/json"
|
@@ -26,8 +26,12 @@ module FaradayMiddleware
|
|
26
26
|
class ParseYaml < ResponseMiddleware
|
27
27
|
dependency 'safe_yaml/load'
|
28
28
|
|
29
|
-
define_parser do |body|
|
30
|
-
SafeYAML
|
29
|
+
define_parser do |body, parser_options|
|
30
|
+
if SafeYAML::YAML_ENGINE == 'psych'
|
31
|
+
SafeYAML.load(body, nil, parser_options || {})
|
32
|
+
else
|
33
|
+
SafeYAML.load(body, parser_options || {})
|
34
|
+
end
|
31
35
|
end
|
32
36
|
end
|
33
37
|
end
|
@@ -48,11 +48,7 @@ module FaradayMiddleware
|
|
48
48
|
def parse(body)
|
49
49
|
if self.class.parser
|
50
50
|
begin
|
51
|
-
|
52
|
-
self.class.parser.call(body, @parser_options)
|
53
|
-
else
|
54
|
-
self.class.parser.call(body)
|
55
|
-
end
|
51
|
+
self.class.parser.call(body, @parser_options)
|
56
52
|
rescue StandardError, SyntaxError => err
|
57
53
|
raise err if err.is_a? SyntaxError and err.class.name != 'Psych::SyntaxError'
|
58
54
|
raise Faraday::Error::ParsingError, err
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday_middleware
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Michaels-Ober
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-08-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|