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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c195be317aecfd463fb9491f5ed7b27787eb7e78b32680c83bba9edb9a75fce
4
- data.tar.gz: d3ad2eb30acd27719c9f59c77616bd437968193f806a802fa363530c8bf4085f
3
+ metadata.gz: c1fa876c06e24e1982e371d33b78d84ad9fc1d9e8115560b6dec34693968896c
4
+ data.tar.gz: be1aeaf93737c49444677e392595fcda2839053752592c168a878fefb7669b55
5
5
  SHA512:
6
- metadata.gz: d61b75eac0c2df0b538dc7a28dc8884e18666827890cd7946756511eb96ec0877e8d9cf71b589509aa78b087908978a367a4be2464b1947863505815bf8dbeba
7
- data.tar.gz: 4bb2cd55b28f2e2fa1b1463e77ff75ad8b0007570bd961c451fee938fa1f51fa202f1c74bdd6733454ef3ca7d2be76d377fcb127fe5f8332d91b8fc6f692c2f5
6
+ metadata.gz: fa1856489ed78f577e606c2e3fbfa4484e2140fa2cd589d8d57dc5844c8f5d05255a3fe1edddaf9b1b23b7d158937055d55530f84ade1f407362b97ceca8d1b9
7
+ data.tar.gz: 687739e890625acd1093a30ef069094d039e0554cc6b59c34194b91983f9146c5ba671e3e450ebf9a472b71927cc277eec6bc75d78520b19f5db68b7a0d798c5
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## 1.5.8
6
+ - Add GetHTTP#response
7
+
5
8
  ## 1.5.7
6
9
  - `download_button` and `export_button` fixes
7
10
  - checkboxes-dropdown CSS improvements
@@ -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 = Timeout.timeout(TIMEOUT) do
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 response.code.start_with?("3")
33
- @url = response["Location"]
34
- return call
42
+ if http_response.code.start_with?("3")
43
+ @url = http_response["Location"]
44
+ return fetch_response
35
45
  end
36
46
 
37
- unless response.code.start_with?("2")
38
- raise Error, "invalid response code : #{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
- response.body
51
+ http_response
42
52
  rescue *EXCEPTIONS_TO_RERAISE => e
43
53
  raise Error, e.message
44
54
  end
@@ -1,3 +1,3 @@
1
1
  module Agilibox
2
- VERSION = "1.5.7"
2
+ VERSION = "1.5.8"
3
3
  end
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.7
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-21 00:00:00.000000000 Z
11
+ date: 2019-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails-i18n