fantasticstay_api 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +48 -32
- data/lib/fantasticstay_api/api.rb +5 -0
- data/lib/fantasticstay_api/client.rb +11 -0
- 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: 9d3dd0bcdc9ebfcf65816cd8ac2b54bd3e38ca4939afb5ea3542d1613e6764f7
|
4
|
+
data.tar.gz: 8d3fb583ea0f45a79035c604a64fa1068500127c73fa705f14a4104e60d626c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2f952635355a4490fb1a50fe940862e4f32402ed40146452dc1fdd513398b3dfed40721be0ceeb282356c35c417ca00bcf4f630a140b9d83fe579a9c49f328c
|
7
|
+
data.tar.gz: ca24a9515fadbbd2be6da20dcb1b88d1ee2c5d41d7ed51af11f26a41b20917ac37f0666d7f6e28c7b5b512195b623a475bb337b51b45b236d1ba58dac4fb72af
|
data/Gemfile.lock
CHANGED
@@ -1,49 +1,64 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fantasticstay_api (0.1.
|
4
|
+
fantasticstay_api (0.1.6)
|
5
5
|
api_cache (~> 0.3.0)
|
6
|
+
dry-configurable (~> 0.13)
|
6
7
|
faraday (~> 2.6.0)
|
7
8
|
oj (~> 3.11)
|
8
9
|
|
9
10
|
GEM
|
10
11
|
remote: https://rubygems.org/
|
11
12
|
specs:
|
12
|
-
addressable (2.8.
|
13
|
-
public_suffix (>= 2.0.2, <
|
13
|
+
addressable (2.8.7)
|
14
|
+
public_suffix (>= 2.0.2, < 7.0)
|
14
15
|
api_cache (0.3.0)
|
15
16
|
ast (2.4.2)
|
16
|
-
|
17
|
+
base64 (0.2.0)
|
18
|
+
bigdecimal (3.1.8)
|
19
|
+
concurrent-ruby (1.3.4)
|
20
|
+
crack (1.0.0)
|
21
|
+
bigdecimal
|
17
22
|
rexml
|
18
|
-
diff-lcs (1.5.
|
19
|
-
|
23
|
+
diff-lcs (1.5.1)
|
24
|
+
dry-configurable (0.16.1)
|
25
|
+
dry-core (~> 0.6)
|
26
|
+
zeitwerk (~> 2.6)
|
27
|
+
dry-core (0.9.1)
|
28
|
+
concurrent-ruby (~> 1.0)
|
29
|
+
zeitwerk (~> 2.6)
|
20
30
|
faraday (2.6.0)
|
21
31
|
faraday-net_http (>= 2.0, < 3.1)
|
22
32
|
ruby2_keywords (>= 0.0.4)
|
23
|
-
faraday-net_http (3.0.
|
24
|
-
hashdiff (1.
|
25
|
-
oj (3.
|
26
|
-
|
27
|
-
|
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)
|
28
41
|
ast (~> 2.4.1)
|
29
|
-
|
42
|
+
racc
|
43
|
+
public_suffix (6.0.1)
|
44
|
+
racc (1.8.1)
|
30
45
|
rainbow (3.1.1)
|
31
|
-
rake (13.
|
32
|
-
regexp_parser (2.
|
33
|
-
rexml (3.
|
34
|
-
rspec (3.
|
35
|
-
rspec-core (~> 3.
|
36
|
-
rspec-expectations (~> 3.
|
37
|
-
rspec-mocks (~> 3.
|
38
|
-
rspec-core (3.
|
39
|
-
rspec-support (~> 3.
|
40
|
-
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)
|
41
56
|
diff-lcs (>= 1.2.0, < 2.0)
|
42
|
-
rspec-support (~> 3.
|
43
|
-
rspec-mocks (3.
|
57
|
+
rspec-support (~> 3.13.0)
|
58
|
+
rspec-mocks (3.13.2)
|
44
59
|
diff-lcs (>= 1.2.0, < 2.0)
|
45
|
-
rspec-support (~> 3.
|
46
|
-
rspec-support (3.
|
60
|
+
rspec-support (~> 3.13.0)
|
61
|
+
rspec-support (3.13.1)
|
47
62
|
rubocop (0.93.1)
|
48
63
|
parallel (~> 1.10)
|
49
64
|
parser (>= 2.7.1.5)
|
@@ -53,23 +68,24 @@ GEM
|
|
53
68
|
rubocop-ast (>= 0.6.0)
|
54
69
|
ruby-progressbar (~> 1.7)
|
55
70
|
unicode-display_width (>= 1.4.0, < 2.0)
|
56
|
-
rubocop-ast (1.
|
57
|
-
parser (>= 3.
|
58
|
-
ruby-progressbar (1.
|
71
|
+
rubocop-ast (1.32.3)
|
72
|
+
parser (>= 3.3.1.0)
|
73
|
+
ruby-progressbar (1.13.0)
|
59
74
|
ruby2_keywords (0.0.5)
|
60
75
|
unicode-display_width (1.8.0)
|
61
|
-
vcr (6.1
|
62
|
-
|
76
|
+
vcr (6.3.1)
|
77
|
+
base64
|
78
|
+
webmock (3.24.0)
|
63
79
|
addressable (>= 2.8.0)
|
64
80
|
crack (>= 0.3.2)
|
65
81
|
hashdiff (>= 0.4.0, < 2.0.0)
|
82
|
+
zeitwerk (2.6.18)
|
66
83
|
|
67
84
|
PLATFORMS
|
68
85
|
aarch64-linux
|
69
86
|
x86_64-linux
|
70
87
|
|
71
88
|
DEPENDENCIES
|
72
|
-
dotenv (~> 2.7)
|
73
89
|
fantasticstay_api!
|
74
90
|
rake (~> 13.0)
|
75
91
|
rspec (~> 3.0)
|
@@ -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,6 +81,7 @@ 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
|
80
85
|
end
|
81
86
|
end
|
82
87
|
|
@@ -82,6 +82,17 @@ module FantasticstayApi
|
|
82
82
|
process_response(response)
|
83
83
|
end
|
84
84
|
|
85
|
+
# FantasticstayApi::Client.new.search(query)
|
86
|
+
def search(query, type = nil, global_params = {})
|
87
|
+
response = request(
|
88
|
+
http_method: :get,
|
89
|
+
endpoint: 'search',
|
90
|
+
params: { q: query, type: type }.merge!(global_params),
|
91
|
+
cache_ttl: 3600 * 24
|
92
|
+
)
|
93
|
+
process_response(response)
|
94
|
+
end
|
95
|
+
|
85
96
|
protected
|
86
97
|
|
87
98
|
def process_response(response)
|
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.7
|
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: []
|