faraday_middleware-parse_oj 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +6 -1
- data/faraday_middleware-parse_oj.gemspec +2 -1
- data/lib/faraday_middleware/parse_oj.rb +2 -2
- data/spec/parse_oj_spec.rb +3 -3
- metadata +32 -34
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b184847a122ce6ba755d8e5de52f7e09e667d2e7
|
4
|
+
data.tar.gz: 384e3e0b715d281341f3b21af5f2a445fff25885
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fda4cf70da2c925798bc707c386688f98fe8fc8cc72d1cb811bbc6635b31e7cc94badee7f1681288a6622b190bf5b54197fae4dcdd51d9a2ee79ef0f2a7870e7
|
7
|
+
data.tar.gz: ed8070e8512acea87d9a625cc7d9002d4c95191578b7f0e41bc161b3b7a0eedd33f528eb688a448b0b0424ac3367789588bc8a18a534a70a3269ee9244d6367a
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ A simple Faraday middleware that parses JSON responses. It is identical to `Fara
|
|
6
6
|
|
7
7
|
``` ruby
|
8
8
|
# Gemfile
|
9
|
-
gem 'faraday_middleware-parse_oj', '~> 0.
|
9
|
+
gem 'faraday_middleware-parse_oj', '~> 0.3.0'
|
10
10
|
```
|
11
11
|
|
12
12
|
or
|
@@ -30,6 +30,11 @@ end
|
|
30
30
|
connection.get('http://example.com/some.json')
|
31
31
|
```
|
32
32
|
|
33
|
+
### Note
|
34
|
+
|
35
|
+
Starting from version 0.3 `FaradayMiddleware::ParseOj` supports
|
36
|
+
only `faraday` versions `0.9` and higher.
|
37
|
+
|
33
38
|
## Contributing
|
34
39
|
|
35
40
|
1. Fork it
|
@@ -15,7 +15,8 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ['lib']
|
16
16
|
gem.version = FaradayMiddleware::ParseOj::VERSION
|
17
17
|
|
18
|
-
gem.add_runtime_dependency '
|
18
|
+
gem.add_runtime_dependency 'faraday', '~> 0.9.0'
|
19
|
+
gem.add_runtime_dependency 'faraday_middleware', '~> 0.9.1'
|
19
20
|
gem.add_runtime_dependency 'oj', '~> 2.0'
|
20
21
|
|
21
22
|
gem.add_development_dependency 'rake'
|
@@ -8,8 +8,8 @@ module FaradayMiddleware
|
|
8
8
|
Oj.load(body, mode: :compat) unless body.strip.empty?
|
9
9
|
end
|
10
10
|
|
11
|
-
VERSION = '0.
|
11
|
+
VERSION = '0.3.0'
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
Faraday.register_middleware
|
15
|
+
Faraday::Response.register_middleware oj: FaradayMiddleware::ParseOj
|
data/spec/parse_oj_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require 'faraday_middleware/parse_oj'
|
|
3
3
|
describe FaradayMiddleware::ParseOj do
|
4
4
|
before(:each) do
|
5
5
|
@body = '{"a": 1, "b": 2}'
|
6
|
-
@parsed_body =
|
6
|
+
@parsed_body = double("Parsed body")
|
7
7
|
|
8
8
|
@connection = Faraday.new do |builder|
|
9
9
|
builder.response :oj
|
@@ -16,7 +16,7 @@ describe FaradayMiddleware::ParseOj do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
it "parses the response body with Oj.load" do
|
19
|
-
Oj.
|
20
|
-
@connection.get('/url').body.
|
19
|
+
expect(Oj).to receive(:load).with(@body, mode: :compat).and_return(@parsed_body)
|
20
|
+
expect(@connection.get('/url').body).to eq(@parsed_body)
|
21
21
|
end
|
22
22
|
end
|
metadata
CHANGED
@@ -1,78 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday_middleware-parse_oj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Vsevolod Romashov
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-04-24 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: faraday
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.9.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.9.0
|
14
27
|
- !ruby/object:Gem::Dependency
|
15
28
|
name: faraday_middleware
|
16
29
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
30
|
requirements:
|
19
|
-
- - ~>
|
31
|
+
- - "~>"
|
20
32
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
33
|
+
version: 0.9.1
|
22
34
|
type: :runtime
|
23
35
|
prerelease: false
|
24
36
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
37
|
requirements:
|
27
|
-
- - ~>
|
38
|
+
- - "~>"
|
28
39
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
40
|
+
version: 0.9.1
|
30
41
|
- !ruby/object:Gem::Dependency
|
31
42
|
name: oj
|
32
43
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
44
|
requirements:
|
35
|
-
- - ~>
|
45
|
+
- - "~>"
|
36
46
|
- !ruby/object:Gem::Version
|
37
47
|
version: '2.0'
|
38
48
|
type: :runtime
|
39
49
|
prerelease: false
|
40
50
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
51
|
requirements:
|
43
|
-
- - ~>
|
52
|
+
- - "~>"
|
44
53
|
- !ruby/object:Gem::Version
|
45
54
|
version: '2.0'
|
46
55
|
- !ruby/object:Gem::Dependency
|
47
56
|
name: rake
|
48
57
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
58
|
requirements:
|
51
|
-
- -
|
59
|
+
- - ">="
|
52
60
|
- !ruby/object:Gem::Version
|
53
61
|
version: '0'
|
54
62
|
type: :development
|
55
63
|
prerelease: false
|
56
64
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
65
|
requirements:
|
59
|
-
- -
|
66
|
+
- - ">="
|
60
67
|
- !ruby/object:Gem::Version
|
61
68
|
version: '0'
|
62
69
|
- !ruby/object:Gem::Dependency
|
63
70
|
name: rspec
|
64
71
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
72
|
requirements:
|
67
|
-
- -
|
73
|
+
- - ">="
|
68
74
|
- !ruby/object:Gem::Version
|
69
75
|
version: '0'
|
70
76
|
type: :development
|
71
77
|
prerelease: false
|
72
78
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
79
|
requirements:
|
75
|
-
- -
|
80
|
+
- - ">="
|
76
81
|
- !ruby/object:Gem::Version
|
77
82
|
version: '0'
|
78
83
|
description: Faraday middleware for parsing JSON using the Oj parser.
|
@@ -82,7 +87,7 @@ executables: []
|
|
82
87
|
extensions: []
|
83
88
|
extra_rdoc_files: []
|
84
89
|
files:
|
85
|
-
- .gitignore
|
90
|
+
- ".gitignore"
|
86
91
|
- Gemfile
|
87
92
|
- LICENSE
|
88
93
|
- README.md
|
@@ -92,33 +97,26 @@ files:
|
|
92
97
|
- spec/parse_oj_spec.rb
|
93
98
|
homepage: https://github.com/7even/faraday_middleware-parse_oj
|
94
99
|
licenses: []
|
100
|
+
metadata: {}
|
95
101
|
post_install_message:
|
96
102
|
rdoc_options: []
|
97
103
|
require_paths:
|
98
104
|
- lib
|
99
105
|
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
-
none: false
|
101
106
|
requirements:
|
102
|
-
- -
|
107
|
+
- - ">="
|
103
108
|
- !ruby/object:Gem::Version
|
104
109
|
version: '0'
|
105
|
-
segments:
|
106
|
-
- 0
|
107
|
-
hash: -861556909971012127
|
108
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
-
none: false
|
110
111
|
requirements:
|
111
|
-
- -
|
112
|
+
- - ">="
|
112
113
|
- !ruby/object:Gem::Version
|
113
114
|
version: '0'
|
114
|
-
segments:
|
115
|
-
- 0
|
116
|
-
hash: -861556909971012127
|
117
115
|
requirements: []
|
118
116
|
rubyforge_project:
|
119
|
-
rubygems_version:
|
117
|
+
rubygems_version: 2.2.2
|
120
118
|
signing_key:
|
121
|
-
specification_version:
|
119
|
+
specification_version: 4
|
122
120
|
summary: Oj middleware for Faraday
|
123
121
|
test_files:
|
124
122
|
- spec/parse_oj_spec.rb
|