spyke 5.4.3 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spyke/http.rb +12 -12
- data/lib/spyke/version.rb +1 -1
- data/test/support/fixtures.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23653781200f18b330b2e78e4dd4adf51d928f1835b600be6a7c836f23d8ec15
|
4
|
+
data.tar.gz: 69b1d6472dde425e63e267e21b1b2660e2407bc805a60456ee2b89f055e8760d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fc271dceb9578df58082af323786c241cdd4c23e0b78611b2839c64a50d30cdad780156c5afd79df55601265ca3468a4bdfe60b6c041f573d44133a0a39a8d6
|
7
|
+
data.tar.gz: a52dd019cc4f8fdf21ab95708ed04f666411f0cf3d4f6c4c24d3702c1308fcc562c4eacc4ec2c354fada1d26ab8e6d495b1e0d6c113922542b67efcdee9d95fe
|
data/lib/spyke/http.rb
CHANGED
@@ -41,20 +41,20 @@ module Spyke
|
|
41
41
|
@uri ||= uri_template || default_uri
|
42
42
|
end
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
44
|
+
private
|
45
|
+
|
46
|
+
def send_request(method, path, params)
|
47
|
+
connection.send(method) do |request|
|
48
|
+
if method == :get
|
49
|
+
request.url path.to_s, params
|
50
|
+
else
|
51
|
+
request.url path.to_s
|
52
|
+
request.body = params
|
53
|
+
end
|
51
54
|
end
|
55
|
+
rescue Faraday::ConnectionFailed, Faraday::TimeoutError
|
56
|
+
raise ConnectionError
|
52
57
|
end
|
53
|
-
rescue Faraday::ConnectionFailed, Faraday::TimeoutError
|
54
|
-
raise ConnectionError
|
55
|
-
end
|
56
|
-
|
57
|
-
private
|
58
58
|
|
59
59
|
def scoped_request(method)
|
60
60
|
uri = new.uri
|
data/lib/spyke/version.rb
CHANGED
data/test/support/fixtures.rb
CHANGED
@@ -119,10 +119,10 @@ end
|
|
119
119
|
class OtherRecipe < OtherApi
|
120
120
|
uri 'recipes/(:id)'
|
121
121
|
|
122
|
-
def self.
|
122
|
+
def self.request(method, path, params)
|
123
123
|
super
|
124
124
|
rescue Spyke::ConnectionError
|
125
|
-
Recipe.
|
125
|
+
Recipe.request(method, path, params)
|
126
126
|
end
|
127
127
|
end
|
128
128
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spyke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Balvig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|