faraday_middleware 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/faraday/mashify.rb +2 -3
- data/lib/faraday/oauth2.rb +0 -1
- data/lib/faraday/parse_json.rb +1 -2
- data/lib/faraday/parse_xml.rb +1 -2
- data/lib/faraday_middleware/version.rb +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/lib/faraday/mashify.rb
CHANGED
@@ -4,16 +4,15 @@ module Faraday
|
|
4
4
|
require 'hashie'
|
5
5
|
rescue LoadError, NameError => error
|
6
6
|
self.load_error = error
|
7
|
-
raise error
|
8
7
|
end
|
9
8
|
|
10
9
|
def self.register_on_complete(env)
|
11
10
|
env[:response].on_complete do |response|
|
12
11
|
json = response[:body]
|
13
12
|
if json.is_a?(Hash)
|
14
|
-
response[:body] = Hashie::Mash.new(json)
|
13
|
+
response[:body] = ::Hashie::Mash.new(json)
|
15
14
|
elsif json.is_a?(Array) and json.first.is_a?(Hash)
|
16
|
-
response[:body] = json.map{|item| Hashie::Mash.new(item) }
|
15
|
+
response[:body] = json.map{|item| ::Hashie::Mash.new(item) }
|
17
16
|
end
|
18
17
|
end
|
19
18
|
end
|
data/lib/faraday/oauth2.rb
CHANGED
data/lib/faraday/parse_json.rb
CHANGED
@@ -4,7 +4,6 @@ module Faraday
|
|
4
4
|
require 'multi_json'
|
5
5
|
rescue LoadError, NameError => error
|
6
6
|
self.load_error = error
|
7
|
-
raise error
|
8
7
|
end
|
9
8
|
|
10
9
|
def self.register_on_complete(env)
|
@@ -18,7 +17,7 @@ module Faraday
|
|
18
17
|
when "false"
|
19
18
|
false
|
20
19
|
else
|
21
|
-
MultiJson.decode(response[:body])
|
20
|
+
::MultiJson.decode(response[:body])
|
22
21
|
end
|
23
22
|
end
|
24
23
|
end
|
data/lib/faraday/parse_xml.rb
CHANGED
@@ -4,13 +4,12 @@ module Faraday
|
|
4
4
|
require 'multi_xml'
|
5
5
|
rescue LoadError, NameError => error
|
6
6
|
self.load_error = error
|
7
|
-
raise error
|
8
7
|
end
|
9
8
|
|
10
9
|
def self.register_on_complete(env)
|
11
10
|
env[:response].on_complete do |response|
|
12
11
|
response[:body] = begin
|
13
|
-
MultiXml.parse(response[:body])
|
12
|
+
::MultiXml.parse(response[:body])
|
14
13
|
end
|
15
14
|
end
|
16
15
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday_middleware
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 6
|
10
|
+
version: 0.1.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Wynn Netherland
|