apipie-bindings 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/release_notes.md +4 -1
- data/lib/apipie_bindings/api.rb +8 -2
- data/lib/apipie_bindings/version.rb +1 -1
- data/test/unit/api_test.rb +6 -1
- metadata +2 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1ad2eec72ce942fa348bd32f2a4481bbaa1aaa3
|
4
|
+
data.tar.gz: a10963fb54de01a37f59ab521a5610eb4c6b754a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e43c66348f712fc334984dd7496b396ce54f0af59881b2134ea7f490b7d8543ff2a1cf478f5f6a41d493457a248a918ed7827a3750816848f22f883dbacc290
|
7
|
+
data.tar.gz: 7661d1ecf0801381f92efe89c74d1fa7913fcf81d4a10be821d80e280c4cae0dcfe6ec0aeaf5dad60a20db29519bcf2a68c6eceafcb799bf8a34ca4e47830f60
|
data/doc/release_notes.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
Release notes
|
2
2
|
=============
|
3
3
|
|
4
|
+
### 0.0.14 (2015-08-25)
|
5
|
+
* support rest-client 1.8.0 ([#27](https://github.com/Apipie/apipie-bindings/issues/27))
|
6
|
+
|
4
7
|
### 0.0.13 (2015-04-23)
|
5
|
-
* Limited rest-client
|
8
|
+
* Limited rest-client version to < 1.8.0
|
6
9
|
* Added option to turn off param validation (per call)
|
7
10
|
* Validation of optional parameters containing required attributes ([#24](https://github.com/Apipie/apipie-bindings/issues/24), [#25](https://github.com/Apipie/apipie-bindings/issues/25))
|
8
11
|
|
data/lib/apipie_bindings/api.rb
CHANGED
@@ -91,7 +91,8 @@ module ApipieBindings
|
|
91
91
|
|
92
92
|
@resource_config = {
|
93
93
|
:timeout => config[:timeout],
|
94
|
-
:headers => headers
|
94
|
+
:headers => headers,
|
95
|
+
:verify_ssl => false # keep rest_client >= 1.8.0 setup comaptible
|
95
96
|
}.merge(options)
|
96
97
|
|
97
98
|
@config = config
|
@@ -202,7 +203,12 @@ module ApipieBindings
|
|
202
203
|
empty_response = ApipieBindings::Example.new('', '', '', 200, '')
|
203
204
|
ex = options[:fake_response ] || empty_response
|
204
205
|
net_http_resp = Net::HTTPResponse.new(1.0, ex.status, "")
|
205
|
-
|
206
|
+
if RestClient::Response.method(:create).arity == 4 # RestClient > 1.8.0
|
207
|
+
response = RestClient::Response.create(ex.response, net_http_resp, args,
|
208
|
+
RestClient::Request.new(:method=>http_method, :url=>path))
|
209
|
+
else
|
210
|
+
response = RestClient::Response.create(ex.response, net_http_resp, args)
|
211
|
+
end
|
206
212
|
else
|
207
213
|
begin
|
208
214
|
apidoc_without_auth = (path =~ /\/apidoc\//) && !@apidoc_authenticated
|
data/test/unit/api_test.rb
CHANGED
@@ -159,7 +159,12 @@ describe ApipieBindings::API do
|
|
159
159
|
let(:fake_empty_response) {
|
160
160
|
data = ApipieBindings::Example.new('', '', '', 200, '[]')
|
161
161
|
net_http_resp = Net::HTTPResponse.new(1.0, data.status, "")
|
162
|
-
RestClient::Response.create
|
162
|
+
if RestClient::Response.method(:create).arity == 4 # RestClient >= 1.8.0
|
163
|
+
RestClient::Response.create(data.response, net_http_resp, {},
|
164
|
+
RestClient::Request.new(:method=>'GET', :url=>'http://example.com'))
|
165
|
+
else
|
166
|
+
RestClient::Response.create(data.response, net_http_resp, {})
|
167
|
+
end
|
163
168
|
}
|
164
169
|
|
165
170
|
it "should call credentials to_param when :credentials are set and doing authenticated call" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apipie-bindings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Bačovský
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -31,9 +31,6 @@ dependencies:
|
|
31
31
|
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 1.6.5
|
34
|
-
- - <
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: 1.8.0
|
37
34
|
type: :runtime
|
38
35
|
prerelease: false
|
39
36
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -41,9 +38,6 @@ dependencies:
|
|
41
38
|
- - '>='
|
42
39
|
- !ruby/object:Gem::Version
|
43
40
|
version: 1.6.5
|
44
|
-
- - <
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 1.8.0
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: oauth
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|