agilibox 1.5.7 → 1.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/app/libs/agilibox/get_http.rb +17 -7
- data/lib/agilibox/version.rb +1 -1
- 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: c1fa876c06e24e1982e371d33b78d84ad9fc1d9e8115560b6dec34693968896c
|
4
|
+
data.tar.gz: be1aeaf93737c49444677e392595fcda2839053752592c168a878fefb7669b55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa1856489ed78f577e606c2e3fbfa4484e2140fa2cd589d8d57dc5844c8f5d05255a3fe1edddaf9b1b23b7d158937055d55530f84ade1f407362b97ceca8d1b9
|
7
|
+
data.tar.gz: 687739e890625acd1093a30ef069094d039e0554cc6b59c34194b91983f9146c5ba671e3e450ebf9a472b71927cc277eec6bc75d78520b19f5db68b7a0d798c5
|
data/CHANGELOG.md
CHANGED
@@ -24,21 +24,31 @@ class Agilibox::GetHTTP < Agilibox::Service
|
|
24
24
|
uri
|
25
25
|
end
|
26
26
|
|
27
|
+
def response
|
28
|
+
@response ||= fetch_response
|
29
|
+
end
|
30
|
+
|
27
31
|
def call
|
28
|
-
response
|
32
|
+
response.body
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def fetch_response
|
38
|
+
http_response = Timeout.timeout(TIMEOUT) do
|
29
39
|
Net::HTTP.get_response(uri)
|
30
40
|
end
|
31
41
|
|
32
|
-
if
|
33
|
-
@url =
|
34
|
-
return
|
42
|
+
if http_response.code.start_with?("3")
|
43
|
+
@url = http_response["Location"]
|
44
|
+
return fetch_response
|
35
45
|
end
|
36
46
|
|
37
|
-
unless
|
38
|
-
raise Error, "invalid response code : #{
|
47
|
+
unless http_response.code.start_with?("2")
|
48
|
+
raise Error, "invalid response code : #{http_response.code}"
|
39
49
|
end
|
40
50
|
|
41
|
-
|
51
|
+
http_response
|
42
52
|
rescue *EXCEPTIONS_TO_RERAISE => e
|
43
53
|
raise Error, e.message
|
44
54
|
end
|
data/lib/agilibox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agilibox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- agilidée
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02
|
11
|
+
date: 2019-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails-i18n
|