reso_api 0.4.9 → 0.5.2

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: 429940488232e917ca2fec8f1c5bbdd8d3bff37fb50f5b2d47d9ff817067abac
4
- data.tar.gz: 7f0736cd242987fc19c0b6a0286b2ceef11f0dc363b31d8a161e02756d5456b1
3
+ metadata.gz: bb4efcbd6e142b91dc5db82ab6391f768acfe72018c3a6a1f28f94add767aeb6
4
+ data.tar.gz: 196b5b3ae73192acb4c6d30f974c6a232487115ba4eaa146c2c9b5d1a610328f
5
5
  SHA512:
6
- metadata.gz: 3e5a50322a425cbde496039eaaa36bfdf255d08a49df1f148871fd01d3b809ff55e60bd070d74dc5c47bae5e80d45005ea7e0453c17fb981d665317d2804b23c
7
- data.tar.gz: 89871becd21ea774f8763fb5e2e25e8b0c922a28bfe747709ad29c39b4e2d7e353fbfcc85dc85cf6d0474ff408ef380fab64caada98fa68613f01738e5d43cd4
6
+ metadata.gz: 53f38b2ab327a82f32ab5296ffad4698f8f3e304557becda120c3010ab40e52a4db923d49ef26e914366e0d210d749baa84b7f3a1b7300d0bedfb43d8c7ca8e2
7
+ data.tar.gz: 3ab0add11e6b7b6adbf25c8cebe4203cead5e74b5276f83fe121df34d100224aefb05ababbcb5f9eb7c20a1f64c38e0ee669b908ce90b24cd446081a5d74c07c
data/Gemfile.lock CHANGED
@@ -1,74 +1,57 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- reso_api (0.2.1)
4
+ reso_api (0.5.0)
5
5
  activesupport
6
6
  oauth2
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (6.1.4.1)
11
+ activesupport (7.0.3)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
13
  i18n (>= 1.6, < 2)
14
14
  minitest (>= 5.1)
15
15
  tzinfo (~> 2.0)
16
- zeitwerk (~> 2.3)
17
- concurrent-ruby (1.1.9)
18
- diff-lcs (1.4.4)
19
- faraday (1.8.0)
20
- faraday-em_http (~> 1.0)
21
- faraday-em_synchrony (~> 1.0)
22
- faraday-excon (~> 1.1)
23
- faraday-httpclient (~> 1.0.1)
24
- faraday-net_http (~> 1.0)
25
- faraday-net_http_persistent (~> 1.1)
26
- faraday-patron (~> 1.0)
27
- faraday-rack (~> 1.0)
28
- multipart-post (>= 1.2, < 3)
16
+ concurrent-ruby (1.1.10)
17
+ diff-lcs (1.5.0)
18
+ faraday (2.3.0)
19
+ faraday-net_http (~> 2.0)
29
20
  ruby2_keywords (>= 0.0.4)
30
- faraday-em_http (1.0.0)
31
- faraday-em_synchrony (1.0.0)
32
- faraday-excon (1.1.0)
33
- faraday-httpclient (1.0.1)
34
- faraday-net_http (1.0.1)
35
- faraday-net_http_persistent (1.2.0)
36
- faraday-patron (1.0.0)
37
- faraday-rack (1.0.0)
38
- i18n (1.8.10)
21
+ faraday-net_http (2.0.3)
22
+ i18n (1.10.0)
39
23
  concurrent-ruby (~> 1.0)
40
- jwt (2.2.3)
41
- minitest (5.14.4)
24
+ jwt (2.3.0)
25
+ minitest (5.15.0)
42
26
  multi_json (1.15.0)
43
27
  multi_xml (0.6.0)
44
- multipart-post (2.1.1)
45
- oauth2 (1.4.7)
46
- faraday (>= 0.8, < 2.0)
28
+ oauth2 (1.4.9)
29
+ faraday (>= 0.17.3, < 3.0)
47
30
  jwt (>= 1.0, < 3.0)
48
31
  multi_json (~> 1.3)
49
32
  multi_xml (~> 0.5)
50
33
  rack (>= 1.2, < 3)
51
- rack (2.2.3)
34
+ rack (2.2.3.1)
52
35
  rake (13.0.6)
53
- rspec (3.10.0)
54
- rspec-core (~> 3.10.0)
55
- rspec-expectations (~> 3.10.0)
56
- rspec-mocks (~> 3.10.0)
57
- rspec-core (3.10.1)
58
- rspec-support (~> 3.10.0)
59
- rspec-expectations (3.10.1)
36
+ rspec (3.11.0)
37
+ rspec-core (~> 3.11.0)
38
+ rspec-expectations (~> 3.11.0)
39
+ rspec-mocks (~> 3.11.0)
40
+ rspec-core (3.11.0)
41
+ rspec-support (~> 3.11.0)
42
+ rspec-expectations (3.11.0)
60
43
  diff-lcs (>= 1.2.0, < 2.0)
61
- rspec-support (~> 3.10.0)
62
- rspec-mocks (3.10.2)
44
+ rspec-support (~> 3.11.0)
45
+ rspec-mocks (3.11.1)
63
46
  diff-lcs (>= 1.2.0, < 2.0)
64
- rspec-support (~> 3.10.0)
65
- rspec-support (3.10.2)
47
+ rspec-support (~> 3.11.0)
48
+ rspec-support (3.11.0)
66
49
  ruby2_keywords (0.0.5)
67
50
  tzinfo (2.0.4)
68
51
  concurrent-ruby (~> 1.0)
69
- zeitwerk (2.4.2)
70
52
 
71
53
  PLATFORMS
54
+ arm64-darwin-21
72
55
  x86_64-linux
73
56
 
74
57
  DEPENDENCIES
@@ -78,4 +61,4 @@ DEPENDENCIES
78
61
  rspec (~> 3.0)
79
62
 
80
63
  BUNDLED WITH
81
- 2.2.27
64
+ 2.3.7
@@ -51,6 +51,7 @@ module RESO
51
51
  hash = args.first.is_a?(Hash) ? args.first : {}
52
52
  endpoint = FILTERABLE_ENDPOINTS[method_name]
53
53
  response = {}
54
+ threads = []
54
55
  params = {
55
56
  "$select": hash[:select],
56
57
  "$filter": hash[:filter],
@@ -66,14 +67,22 @@ module RESO
66
67
  response = perform_call(endpoint, params)
67
68
 
68
69
  if response["value"].class.eql?(Array)
69
- hash[:batch] ? block.call(response["value"]) : response["value"].each{|hash| block.call(hash)}
70
+ threads << Thread.new do
71
+ hash[:batch] ? block.call(response["value"]) : response["value"].each{|hash| block.call(hash)}
72
+ end
70
73
  end
71
74
 
72
75
  while (next_link = response["@odata.nextLink"]).present?
73
- response = perform_call(next_link, nil)
74
-
76
+ threads << Thread.new do
77
+ response = perform_call(next_link, nil)
78
+ end
79
+
80
+ threads.each(&:join)
81
+
75
82
  if response["value"].class.eql?(Array)
76
- hash[:batch] ? block.call(response["value"]) : response["value"].each{|hash| block.call(hash)}
83
+ threads << Thread.new do
84
+ hash[:batch] ? block.call(response["value"]) : response["value"].each{|hash| block.call(hash)}
85
+ end
77
86
  end
78
87
  end
79
88
  else
@@ -170,6 +179,9 @@ module RESO
170
179
  raise StandardError
171
180
  elsif response.is_a?(Hash) && response.has_key?("error")
172
181
  raise StandardError
182
+ elsif response.is_a?(Hash) && response.has_key?("retry-after")
183
+ sleep response["retry-after"].to_i
184
+ raise StandardError
173
185
  end
174
186
  rescue Net::ReadTimeout, StandardError
175
187
  if (retries += 1) <= 5
@@ -1,3 +1,3 @@
1
1
  module ResoApi
2
- VERSION = "0.4.9"
2
+ VERSION = "0.5.2"
3
3
  end
data/license.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Michael Edlund
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reso_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Edlund
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-26 00:00:00.000000000 Z
11
+ date: 2022-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -103,6 +103,7 @@ files:
103
103
  - lib/reso_api/app/models/reso/api/client.rb
104
104
  - lib/reso_api/config/inflections.rb
105
105
  - lib/reso_api/version.rb
106
+ - license.md
106
107
  - reso_api.gemspec
107
108
  homepage: https://github.com/arcticleo/reso_api
108
109
  licenses: []