fantasticstay_api 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +41 -32
- data/lib/fantasticstay_api/api.rb +8 -1
- data/lib/fantasticstay_api/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 738b039ce921a5d93329f37ae2591232a237d77bbfb31ce9e77405800565ea4b
|
4
|
+
data.tar.gz: 52ce2629fd1cbe2502996c08eaec1453f24fe194960f50cbd2e77a0380e190ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8fbc83b647ba08bfaaae2b609ff3d1e23fefe48d1f55e9ff15387f103ac95c0a7e12d775115b547849b1ba526a418a66a91b1ba8ac6a8a17c7d6173c53313d2
|
7
|
+
data.tar.gz: da9ca9eb3fc3b60aa7a9f00601d21e8eac365be0aa15264410c13dec97853207addbb2ddf3cc67eb3cabf509a026a8b1b082d30ca7e2012910364d1cf27f206e
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fantasticstay_api (0.1.
|
4
|
+
fantasticstay_api (0.1.7)
|
5
5
|
api_cache (~> 0.3.0)
|
6
6
|
dry-configurable (~> 0.13)
|
7
7
|
faraday (~> 2.6.0)
|
@@ -10,14 +10,17 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
addressable (2.8.
|
14
|
-
public_suffix (>= 2.0.2, <
|
13
|
+
addressable (2.8.7)
|
14
|
+
public_suffix (>= 2.0.2, < 7.0)
|
15
15
|
api_cache (0.3.0)
|
16
16
|
ast (2.4.2)
|
17
|
-
|
18
|
-
|
17
|
+
base64 (0.2.0)
|
18
|
+
bigdecimal (3.1.8)
|
19
|
+
concurrent-ruby (1.3.4)
|
20
|
+
crack (1.0.0)
|
21
|
+
bigdecimal
|
19
22
|
rexml
|
20
|
-
diff-lcs (1.5.
|
23
|
+
diff-lcs (1.5.1)
|
21
24
|
dry-configurable (0.16.1)
|
22
25
|
dry-core (~> 0.6)
|
23
26
|
zeitwerk (~> 2.6)
|
@@ -27,30 +30,35 @@ GEM
|
|
27
30
|
faraday (2.6.0)
|
28
31
|
faraday-net_http (>= 2.0, < 3.1)
|
29
32
|
ruby2_keywords (>= 0.0.4)
|
30
|
-
faraday-net_http (3.0.
|
31
|
-
hashdiff (1.
|
32
|
-
oj (3.
|
33
|
-
|
34
|
-
|
33
|
+
faraday-net_http (3.0.2)
|
34
|
+
hashdiff (1.1.1)
|
35
|
+
oj (3.16.6)
|
36
|
+
bigdecimal (>= 3.0)
|
37
|
+
ostruct (>= 0.2)
|
38
|
+
ostruct (0.6.0)
|
39
|
+
parallel (1.26.3)
|
40
|
+
parser (3.3.5.0)
|
35
41
|
ast (~> 2.4.1)
|
36
|
-
|
42
|
+
racc
|
43
|
+
public_suffix (6.0.1)
|
44
|
+
racc (1.8.1)
|
37
45
|
rainbow (3.1.1)
|
38
|
-
rake (13.
|
39
|
-
regexp_parser (2.
|
40
|
-
rexml (3.
|
41
|
-
rspec (3.
|
42
|
-
rspec-core (~> 3.
|
43
|
-
rspec-expectations (~> 3.
|
44
|
-
rspec-mocks (~> 3.
|
45
|
-
rspec-core (3.
|
46
|
-
rspec-support (~> 3.
|
47
|
-
rspec-expectations (3.
|
46
|
+
rake (13.2.1)
|
47
|
+
regexp_parser (2.9.2)
|
48
|
+
rexml (3.3.8)
|
49
|
+
rspec (3.13.0)
|
50
|
+
rspec-core (~> 3.13.0)
|
51
|
+
rspec-expectations (~> 3.13.0)
|
52
|
+
rspec-mocks (~> 3.13.0)
|
53
|
+
rspec-core (3.13.1)
|
54
|
+
rspec-support (~> 3.13.0)
|
55
|
+
rspec-expectations (3.13.3)
|
48
56
|
diff-lcs (>= 1.2.0, < 2.0)
|
49
|
-
rspec-support (~> 3.
|
50
|
-
rspec-mocks (3.
|
57
|
+
rspec-support (~> 3.13.0)
|
58
|
+
rspec-mocks (3.13.2)
|
51
59
|
diff-lcs (>= 1.2.0, < 2.0)
|
52
|
-
rspec-support (~> 3.
|
53
|
-
rspec-support (3.
|
60
|
+
rspec-support (~> 3.13.0)
|
61
|
+
rspec-support (3.13.1)
|
54
62
|
rubocop (0.93.1)
|
55
63
|
parallel (~> 1.10)
|
56
64
|
parser (>= 2.7.1.5)
|
@@ -60,17 +68,18 @@ GEM
|
|
60
68
|
rubocop-ast (>= 0.6.0)
|
61
69
|
ruby-progressbar (~> 1.7)
|
62
70
|
unicode-display_width (>= 1.4.0, < 2.0)
|
63
|
-
rubocop-ast (1.
|
64
|
-
parser (>= 3.
|
65
|
-
ruby-progressbar (1.
|
71
|
+
rubocop-ast (1.32.3)
|
72
|
+
parser (>= 3.3.1.0)
|
73
|
+
ruby-progressbar (1.13.0)
|
66
74
|
ruby2_keywords (0.0.5)
|
67
75
|
unicode-display_width (1.8.0)
|
68
|
-
vcr (6.1
|
69
|
-
|
76
|
+
vcr (6.3.1)
|
77
|
+
base64
|
78
|
+
webmock (3.24.0)
|
70
79
|
addressable (>= 2.8.0)
|
71
80
|
crack (>= 0.3.2)
|
72
81
|
hashdiff (>= 0.4.0, < 2.0.0)
|
73
|
-
zeitwerk (2.6.
|
82
|
+
zeitwerk (2.6.18)
|
74
83
|
|
75
84
|
PLATFORMS
|
76
85
|
aarch64-linux
|
@@ -24,6 +24,7 @@ module FantasticstayApi
|
|
24
24
|
'default' => ApiError
|
25
25
|
}.freeze
|
26
26
|
API_ENDPOINT = 'https://api.fsapp.io'
|
27
|
+
API_TIMEOUT = 30
|
27
28
|
API_TOKEN = 'TESTING'
|
28
29
|
|
29
30
|
setting :follow_redirects, default: true
|
@@ -31,6 +32,9 @@ module FantasticstayApi
|
|
31
32
|
# The api endpoint used to connect to FantasticstayApi if none is set
|
32
33
|
setting :endpoint, default: ENV['FANTASTICSTAY_API_ENDPOINT'] || API_ENDPOINT, reader: true
|
33
34
|
|
35
|
+
# The timeout in requests made to fsapp
|
36
|
+
setting :timeout, default: ENV['FANTASTICSTAY_API_TIMEOUT'] || API_TIMEOUT, reader: true
|
37
|
+
|
34
38
|
# The token included in request header 'x-api-key'
|
35
39
|
setting :token, default: ENV['FANTASTICSTAY_API_TOKEN'] || API_TOKEN, reader: true
|
36
40
|
|
@@ -77,13 +81,16 @@ module FantasticstayApi
|
|
77
81
|
client.headers['Content-Type'] = 'application/json'
|
78
82
|
client.headers['x-api-key'] = config.token
|
79
83
|
client.headers['User-Agent'] = config.user_agent
|
84
|
+
client.options.timeout = config.timeout
|
85
|
+
client.response :raise_error # raise Faraday::Error on status code 4xx or 5xx
|
80
86
|
end
|
81
87
|
end
|
82
88
|
|
83
89
|
def request(http_method:, endpoint:, params: {}, cache_ttl: 3600)
|
84
90
|
response = APICache.get(
|
85
91
|
Digest::SHA256.bubblebabble(config.token) + http_method.to_s + endpoint + params.to_s,
|
86
|
-
cache: cache_ttl
|
92
|
+
cache: cache_ttl,
|
93
|
+
timeout: config.timeout
|
87
94
|
) do
|
88
95
|
client.public_send(http_method, endpoint, params)
|
89
96
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fantasticstay_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dinis
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: api_cache
|
@@ -104,7 +104,7 @@ metadata:
|
|
104
104
|
homepage_uri: https://github.com/dlage/fantasticstay_api_gem
|
105
105
|
source_code_uri: https://github.com/dlage/fantasticstay_api_gem
|
106
106
|
changelog_uri: https://github.com/dlage/fantasticstay_api_gem/blob/master/CHANGELOG.md
|
107
|
-
post_install_message:
|
107
|
+
post_install_message:
|
108
108
|
rdoc_options: []
|
109
109
|
require_paths:
|
110
110
|
- lib
|
@@ -119,8 +119,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
- !ruby/object:Gem::Version
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
|
-
rubygems_version: 3.
|
123
|
-
signing_key:
|
122
|
+
rubygems_version: 3.3.26
|
123
|
+
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: FantasticStay API Wrapper.
|
126
126
|
test_files: []
|