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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a727acfeab9f3a592ea54d2fe8622a2b116b47868a930bcda001d4d029487bc
4
- data.tar.gz: afb8961fb5454320a021b6f5891aa1990de185ec1a7b79d2592d7d69f6cdfafd
3
+ metadata.gz: 9d3dd0bcdc9ebfcf65816cd8ac2b54bd3e38ca4939afb5ea3542d1613e6764f7
4
+ data.tar.gz: 8d3fb583ea0f45a79035c604a64fa1068500127c73fa705f14a4104e60d626c8
5
5
  SHA512:
6
- metadata.gz: 7068b3721b8d27d6e74c1b454c39579014d12cf2c57b28c67210eb70b29f6300dfb9b495683a51923922a4b559a5aadeca307961bd786bbf51956f54648cfe55
7
- data.tar.gz: 5ea6380129337d84b23a29dadcab7c5be2ef565eb27019c5b65776bc37ffc2467b820564e708374f770f22ce8ffd17a697ab1dbccbf3083992e34f53b9bb4023
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.3)
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.1)
13
- public_suffix (>= 2.0.2, < 6.0)
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
- crack (0.4.5)
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.0)
19
- dotenv (2.8.1)
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.1)
24
- hashdiff (1.0.1)
25
- oj (3.13.21)
26
- parallel (1.22.1)
27
- parser (3.1.2.1)
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
- public_suffix (5.0.0)
42
+ racc
43
+ public_suffix (6.0.1)
44
+ racc (1.8.1)
30
45
  rainbow (3.1.1)
31
- rake (13.0.6)
32
- regexp_parser (2.6.0)
33
- rexml (3.2.5)
34
- rspec (3.12.0)
35
- rspec-core (~> 3.12.0)
36
- rspec-expectations (~> 3.12.0)
37
- rspec-mocks (~> 3.12.0)
38
- rspec-core (3.12.0)
39
- rspec-support (~> 3.12.0)
40
- rspec-expectations (3.12.0)
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.12.0)
43
- rspec-mocks (3.12.0)
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.12.0)
46
- rspec-support (3.12.0)
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.23.0)
57
- parser (>= 3.1.1.0)
58
- ruby-progressbar (1.11.0)
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.0)
62
- webmock (3.18.1)
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FantasticstayApi
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.7'
5
5
  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.5
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: 2022-10-28 00:00:00.000000000 Z
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.2.33
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: []