api-client 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +4 -0
- data/README.md +2 -2
- data/lib/api-client/configuration.rb +1 -1
- data/lib/api-client/version.rb +1 -1
- data/spec/api-client/configuration_spec.rb +9 -6
- data/spec/api-client_spec.rb +1 -1
- metadata +24 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a35c06c36961565a77bac593b0beb0d5e29e137
|
4
|
+
data.tar.gz: a6fc06af1d9d5cea440496c9d3d1bc60c285c210
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1251a98fc630dc9e52e5cf21c35decd3b64b46069f664db603ba13c591b1ba3161630895d256253fda0231aa196e38061a435da1568d6515cd9cfc6b72b339b
|
7
|
+
data.tar.gz: d114100fdf1077b944315ce1b06a9e13492f702d0872403241699baa8b09739cc71ab044c20ec6da6214ec92c3a358472e173ea1c7962f575ab82eb443d0d5ca
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.1.1
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -190,7 +190,7 @@ ApiClient.parallel do
|
|
190
190
|
end
|
191
191
|
```
|
192
192
|
|
193
|
-
## Migrating from 2
|
193
|
+
## Migrating from 2.\*.\* to 3.0.0
|
194
194
|
|
195
195
|
Since version 3.0.0 is not necessarily set the root_node on the attributes when calling methods on the class.
|
196
196
|
|
@@ -221,4 +221,4 @@ After:
|
|
221
221
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
222
222
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
223
223
|
4. Push to the branch (`git push origin my-new-feature`)
|
224
|
-
5. Create new Pull Request
|
224
|
+
5. Create new Pull Request
|
@@ -40,7 +40,7 @@ module ApiClient
|
|
40
40
|
#
|
41
41
|
# @param [Hash] header the default header for requisitions.
|
42
42
|
def header=(header = {})
|
43
|
-
@header = { 'Content-Type' => 'application/json' }.merge(header)
|
43
|
+
@header = { 'Content-Type' => 'application/json', 'Accept' => 'application/json' }.merge(header)
|
44
44
|
end
|
45
45
|
|
46
46
|
# Set a basic authentication for all requisitions.
|
data/lib/api-client/version.rb
CHANGED
@@ -62,17 +62,19 @@ describe ApiClient::Configuration do
|
|
62
62
|
describe '#header' do
|
63
63
|
context 'when not configured' do
|
64
64
|
it 'should return a hash with configs for content_type only' do
|
65
|
-
ApiClient.config.header.should == { 'Content-Type' => 'application/json' }
|
65
|
+
ApiClient.config.header.should == { 'Content-Type' => 'application/json', 'Accept' => 'application/json' }
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
69
|
context 'when configured' do
|
70
70
|
before :each do
|
71
|
-
ApiClient.
|
71
|
+
ApiClient.configure do |config|
|
72
|
+
config.header = { 'key' => 'value' }
|
73
|
+
end
|
72
74
|
end
|
73
75
|
|
74
|
-
it 'should return
|
75
|
-
ApiClient.config.header.should == { 'key' => 'value' }
|
76
|
+
it 'should return the configs merged' do
|
77
|
+
ApiClient.config.header.should == { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'key' => 'value' }
|
76
78
|
end
|
77
79
|
end
|
78
80
|
end
|
@@ -80,12 +82,12 @@ describe ApiClient::Configuration do
|
|
80
82
|
describe '#header=' do
|
81
83
|
before :each do
|
82
84
|
ApiClient.configure do |config|
|
83
|
-
config.header = { 'Content-Type' => 'application/xml' }
|
85
|
+
config.header = { 'Content-Type' => 'application/xml', 'Accept' => 'application/xml' }
|
84
86
|
end
|
85
87
|
end
|
86
88
|
|
87
89
|
it 'should merge content_type json with the given hash' do
|
88
|
-
ApiClient.config.header.should == { 'Content-Type' => 'application/xml' }
|
90
|
+
ApiClient.config.header.should == { 'Content-Type' => 'application/xml', 'Accept' => 'application/xml' }
|
89
91
|
end
|
90
92
|
end
|
91
93
|
|
@@ -104,6 +106,7 @@ describe ApiClient::Configuration do
|
|
104
106
|
|
105
107
|
it 'should merge basic_auth in header params' do
|
106
108
|
ApiClient.config.header.should == { 'Content-Type' => 'application/xml',
|
109
|
+
'Accept' => 'application/xml',
|
107
110
|
'Authorization' => 'Basic dXNlcjpwYXNz' }
|
108
111
|
end
|
109
112
|
end
|
data/spec/api-client_spec.rb
CHANGED
@@ -55,7 +55,7 @@ describe ApiClient do
|
|
55
55
|
end
|
56
56
|
|
57
57
|
it 'should return the default header' do
|
58
|
-
ApiClient.config.header.should == { 'Content-Type' => 'application/json' }
|
58
|
+
ApiClient.config.header.should == { 'Content-Type' => 'application/json', 'Accept' => 'application/json' }
|
59
59
|
end
|
60
60
|
|
61
61
|
it 'should have mock equal false' do
|
metadata
CHANGED
@@ -1,111 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paulo Henrique Lopes Ribeiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: webmock
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: yard
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: coveralls
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: activemodel
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: json_pure
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
description:
|
@@ -114,11 +114,11 @@ executables: []
|
|
114
114
|
extensions: []
|
115
115
|
extra_rdoc_files: []
|
116
116
|
files:
|
117
|
-
- .gitignore
|
118
|
-
- .rspec
|
119
|
-
- .ruby-gemset
|
120
|
-
- .ruby-version
|
121
|
-
- .travis.yml
|
117
|
+
- ".gitignore"
|
118
|
+
- ".rspec"
|
119
|
+
- ".ruby-gemset"
|
120
|
+
- ".ruby-version"
|
121
|
+
- ".travis.yml"
|
122
122
|
- CHANGELOG.md
|
123
123
|
- Gemfile
|
124
124
|
- LICENSE
|
@@ -184,17 +184,17 @@ require_paths:
|
|
184
184
|
- lib
|
185
185
|
required_ruby_version: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
|
-
- -
|
187
|
+
- - ">="
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: '0'
|
190
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
|
-
- -
|
192
|
+
- - ">="
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
195
|
requirements: []
|
196
196
|
rubyforge_project:
|
197
|
-
rubygems_version: 2.
|
197
|
+
rubygems_version: 2.2.2
|
198
198
|
signing_key:
|
199
199
|
specification_version: 4
|
200
200
|
summary: Api client easy to play with parallelism support!
|