openapply 1.0.3.2 → 1.0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +37 -27
- data/lib/openapply/client.rb +10 -4
- data/lib/openapply/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59976c236fadb201213e05988e2970d93372bcba011a885da3fa2f6764b6d62d
|
4
|
+
data.tar.gz: 9d08c0a5fc122cdf36fbe7284efe6fe1d29a2bf23cffa7990770bf895f1f223c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51c55c2d070ecbfd819e8ca6305e67fe44eab4faf3066925c75fbed5d369352f5084b91fc658fd61feb2693897b1090b4af09b59ea04a359aee96eec00ad9ca3
|
7
|
+
data.tar.gz: 8ee90f5a132ef602c748d9faa896f05c3ecc6ec4eb4b69b2cddae804149c11175b3800ed7181cd43898e2363190153d3878c7d7617c0e72b34cab15dfc606bda
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
openapply (1.0.3.
|
4
|
+
openapply (1.0.3.3)
|
5
5
|
httparty (~> 0.18)
|
6
6
|
json (~> 2.3)
|
7
7
|
oauth2 (~> 1.4)
|
@@ -14,56 +14,66 @@ GEM
|
|
14
14
|
codacy-coverage (2.2.1)
|
15
15
|
simplecov
|
16
16
|
coderay (1.1.3)
|
17
|
-
crack (0.4.
|
18
|
-
|
17
|
+
crack (0.4.5)
|
18
|
+
rexml
|
19
19
|
diff-lcs (1.4.4)
|
20
|
-
docile (1.3.
|
21
|
-
faraday (1.
|
20
|
+
docile (1.3.5)
|
21
|
+
faraday (1.4.1)
|
22
|
+
faraday-excon (~> 1.1)
|
23
|
+
faraday-net_http (~> 1.0)
|
24
|
+
faraday-net_http_persistent (~> 1.1)
|
22
25
|
multipart-post (>= 1.2, < 3)
|
26
|
+
ruby2_keywords (>= 0.0.4)
|
27
|
+
faraday-excon (1.1.0)
|
28
|
+
faraday-net_http (1.0.1)
|
29
|
+
faraday-net_http_persistent (1.1.0)
|
23
30
|
hashdiff (1.0.1)
|
24
31
|
httparty (0.18.1)
|
25
32
|
mime-types (~> 3.0)
|
26
33
|
multi_xml (>= 0.5.2)
|
27
|
-
json (2.
|
28
|
-
jwt (2.2.
|
34
|
+
json (2.5.1)
|
35
|
+
jwt (2.2.3)
|
29
36
|
method_source (1.0.0)
|
30
37
|
mime-types (3.3.1)
|
31
38
|
mime-types-data (~> 3.2015)
|
32
|
-
mime-types-data (3.
|
39
|
+
mime-types-data (3.2021.0225)
|
33
40
|
multi_json (1.15.0)
|
34
41
|
multi_xml (0.6.0)
|
35
42
|
multipart-post (2.1.1)
|
36
|
-
oauth2 (1.4.
|
43
|
+
oauth2 (1.4.7)
|
37
44
|
faraday (>= 0.8, < 2.0)
|
38
45
|
jwt (>= 1.0, < 3.0)
|
39
46
|
multi_json (~> 1.3)
|
40
47
|
multi_xml (~> 0.5)
|
41
48
|
rack (>= 1.2, < 3)
|
42
|
-
pry (0.
|
49
|
+
pry (0.14.1)
|
43
50
|
coderay (~> 1.1)
|
44
51
|
method_source (~> 1.0)
|
45
52
|
public_suffix (4.0.6)
|
46
53
|
rack (2.2.3)
|
47
|
-
rake (13.0.
|
48
|
-
|
49
|
-
|
50
|
-
rspec-
|
51
|
-
rspec-
|
52
|
-
|
53
|
-
|
54
|
-
|
54
|
+
rake (13.0.3)
|
55
|
+
rexml (3.2.5)
|
56
|
+
rspec (3.10.0)
|
57
|
+
rspec-core (~> 3.10.0)
|
58
|
+
rspec-expectations (~> 3.10.0)
|
59
|
+
rspec-mocks (~> 3.10.0)
|
60
|
+
rspec-core (3.10.1)
|
61
|
+
rspec-support (~> 3.10.0)
|
62
|
+
rspec-expectations (3.10.1)
|
55
63
|
diff-lcs (>= 1.2.0, < 2.0)
|
56
|
-
rspec-support (~> 3.
|
57
|
-
rspec-mocks (3.
|
64
|
+
rspec-support (~> 3.10.0)
|
65
|
+
rspec-mocks (3.10.2)
|
58
66
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
-
rspec-support (~> 3.
|
60
|
-
rspec-support (3.
|
61
|
-
|
62
|
-
simplecov (0.
|
67
|
+
rspec-support (~> 3.10.0)
|
68
|
+
rspec-support (3.10.2)
|
69
|
+
ruby2_keywords (0.0.4)
|
70
|
+
simplecov (0.21.2)
|
63
71
|
docile (~> 1.1)
|
64
72
|
simplecov-html (~> 0.11)
|
65
|
-
|
66
|
-
|
73
|
+
simplecov_json_formatter (~> 0.1)
|
74
|
+
simplecov-html (0.12.3)
|
75
|
+
simplecov_json_formatter (0.1.3)
|
76
|
+
webmock (3.12.2)
|
67
77
|
addressable (>= 2.3.6)
|
68
78
|
crack (>= 0.3.2)
|
69
79
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -81,4 +91,4 @@ DEPENDENCIES
|
|
81
91
|
webmock (~> 3.9)
|
82
92
|
|
83
93
|
BUNDLED WITH
|
84
|
-
2.
|
94
|
+
2.2.3
|
data/lib/openapply/client.rb
CHANGED
@@ -5,6 +5,9 @@ require "openapply/put"
|
|
5
5
|
require 'httparty'
|
6
6
|
|
7
7
|
module Openapply
|
8
|
+
class TooManyRequestError < StandardError
|
9
|
+
end
|
10
|
+
|
8
11
|
class Client
|
9
12
|
|
10
13
|
include HTTParty # Library for API calls
|
@@ -12,6 +15,8 @@ module Openapply
|
|
12
15
|
include Openapply::GetOneStudent # GET api calls
|
13
16
|
include Openapply::GetManyStudents # GET api calls
|
14
17
|
|
18
|
+
NET_EXCEPTIONS = [Net::ReadTimeout, Net::OpenTimeout, TooManyRequestError]
|
19
|
+
|
15
20
|
API_TIMEOUT = ENV['OA_TIMEOUT'].to_i == 0 ? 5 : ENV['OA_TIMEOUT'].to_i
|
16
21
|
default_timeout API_TIMEOUT
|
17
22
|
|
@@ -72,8 +77,10 @@ module Openapply
|
|
72
77
|
times_retried = 0
|
73
78
|
begin
|
74
79
|
options[:headers] = { 'Content-Type' => 'application/x-www-form-urlencoded; charset=utf-8', "Authorization" => auth_token}
|
75
|
-
self.class.get(url, options)
|
76
|
-
|
80
|
+
answer = self.class.get(url, options)
|
81
|
+
raise TooManyRequestError if answer.too_many_requests?
|
82
|
+
answer
|
83
|
+
rescue *NET_EXCEPTIONS
|
77
84
|
if times_retried < max_retries
|
78
85
|
times_retried += 1
|
79
86
|
retry
|
@@ -100,7 +107,7 @@ module Openapply
|
|
100
107
|
options[:headers] = { 'Content-Type' => 'application/x-www-form-urlencoded; charset=utf-8', "Authorization" => auth_token}
|
101
108
|
options[:body] = value
|
102
109
|
self.class.put(url, options)
|
103
|
-
rescue
|
110
|
+
rescue *NET_EXCEPTIONS
|
104
111
|
if times_retried < max_retries
|
105
112
|
times_retried += 1
|
106
113
|
retry
|
@@ -161,5 +168,4 @@ module Openapply
|
|
161
168
|
end
|
162
169
|
|
163
170
|
end
|
164
|
-
|
165
171
|
end
|
data/lib/openapply/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openapply
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.3.
|
4
|
+
version: 1.0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill Tihen
|
8
8
|
- Elliott Hébert
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-05-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -137,7 +137,7 @@ dependencies:
|
|
137
137
|
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0.13'
|
140
|
-
description:
|
140
|
+
description:
|
141
141
|
email:
|
142
142
|
- btihen@gmail.com
|
143
143
|
- btihen@las.ch
|
@@ -173,7 +173,7 @@ homepage: https://github.com/las-it/openapply
|
|
173
173
|
licenses:
|
174
174
|
- MIT
|
175
175
|
metadata: {}
|
176
|
-
post_install_message:
|
176
|
+
post_install_message:
|
177
177
|
rdoc_options: []
|
178
178
|
require_paths:
|
179
179
|
- lib
|
@@ -188,8 +188,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: '0'
|
190
190
|
requirements: []
|
191
|
-
rubygems_version: 3.
|
192
|
-
signing_key:
|
191
|
+
rubygems_version: 3.2.3
|
192
|
+
signing_key:
|
193
193
|
specification_version: 4
|
194
194
|
summary: Access OpenApply's APIs with Ruby
|
195
195
|
test_files: []
|