openapply 1.0.3.2 → 1.0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGE_LOG.md +6 -0
- data/Gemfile.lock +57 -49
- data/lib/openapply/client.rb +57 -5
- data/lib/openapply/version.rb +1 -1
- data/openapply.gemspec +9 -9
- metadata +23 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54e06e0268716085179c1375a17f8af5fcea53555910d93e57b3c74cc83a48d1
|
4
|
+
data.tar.gz: 9ab858a17bc4bac531bb5089ffa5e57281bfa364548dd2d57b959275df0f9c55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eddaee0e81d1f7cbc497485f324fc150537822e3651c9df87424a1481a4b89070617c1c258ebd2533f64cab7503e87cb0f8408d11c522a358a808997c4f3f950
|
7
|
+
data.tar.gz: ab98c2215e726e7492a1c0b6d73f8bea2f2a1598c9fcce1ff943a923080487f010e6f990538a55db2336b299450371af606323a54987053b5d73f028719dfe54
|
data/CHANGE_LOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
### Openapply CHANGE LOG
|
2
2
|
|
3
|
+
* **v1.0.3.5** - compatible with 1.0.x - 2022-08-23
|
4
|
+
- add a debug env variable to debug queries
|
5
|
+
|
6
|
+
* **v1.0.3.4** - compatible with 1.0.x - 2022-08-23
|
7
|
+
- update dependencies
|
8
|
+
|
3
9
|
* **v1.0.2** - compatible with 1.0.x - 2020-05-18
|
4
10
|
- improve auth token generation
|
5
11
|
|
data/Gemfile.lock
CHANGED
@@ -1,84 +1,92 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
openapply (1.0.3.
|
5
|
-
httparty (~> 0.
|
6
|
-
json (~> 2.
|
7
|
-
oauth2 (~>
|
4
|
+
openapply (1.0.3.6)
|
5
|
+
httparty (~> 0.20)
|
6
|
+
json (~> 2.6)
|
7
|
+
oauth2 (~> 2.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
addressable (2.
|
13
|
-
public_suffix (>= 2.0.2, <
|
12
|
+
addressable (2.8.1)
|
13
|
+
public_suffix (>= 2.0.2, < 6.0)
|
14
14
|
codacy-coverage (2.2.1)
|
15
15
|
simplecov
|
16
16
|
coderay (1.1.3)
|
17
|
-
crack (0.4.
|
18
|
-
|
19
|
-
diff-lcs (1.
|
20
|
-
docile (1.
|
21
|
-
faraday (
|
22
|
-
|
17
|
+
crack (0.4.5)
|
18
|
+
rexml
|
19
|
+
diff-lcs (1.5.0)
|
20
|
+
docile (1.4.0)
|
21
|
+
faraday (2.5.2)
|
22
|
+
faraday-net_http (>= 2.0, < 3.1)
|
23
|
+
ruby2_keywords (>= 0.0.4)
|
24
|
+
faraday-net_http (3.0.0)
|
23
25
|
hashdiff (1.0.1)
|
24
|
-
|
26
|
+
hashie (5.0.0)
|
27
|
+
httparty (0.20.0)
|
25
28
|
mime-types (~> 3.0)
|
26
29
|
multi_xml (>= 0.5.2)
|
27
|
-
json (2.
|
28
|
-
jwt (2.
|
30
|
+
json (2.6.2)
|
31
|
+
jwt (2.4.1)
|
29
32
|
method_source (1.0.0)
|
30
|
-
mime-types (3.
|
33
|
+
mime-types (3.4.1)
|
31
34
|
mime-types-data (~> 3.2015)
|
32
|
-
mime-types-data (3.
|
33
|
-
multi_json (1.15.0)
|
35
|
+
mime-types-data (3.2022.0105)
|
34
36
|
multi_xml (0.6.0)
|
35
|
-
|
36
|
-
|
37
|
-
faraday (>= 0.8, < 2.0)
|
37
|
+
oauth2 (2.0.7)
|
38
|
+
faraday (>= 0.17.3, < 3.0)
|
38
39
|
jwt (>= 1.0, < 3.0)
|
39
|
-
multi_json (~> 1.3)
|
40
40
|
multi_xml (~> 0.5)
|
41
41
|
rack (>= 1.2, < 3)
|
42
|
-
|
42
|
+
rash_alt (>= 0.4, < 1)
|
43
|
+
version_gem (~> 1.1)
|
44
|
+
pry (0.14.1)
|
43
45
|
coderay (~> 1.1)
|
44
46
|
method_source (~> 1.0)
|
45
|
-
public_suffix (
|
46
|
-
rack (2.2.
|
47
|
-
rake (13.0.
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
rspec-
|
54
|
-
|
47
|
+
public_suffix (5.0.0)
|
48
|
+
rack (2.2.4)
|
49
|
+
rake (13.0.6)
|
50
|
+
rash_alt (0.4.12)
|
51
|
+
hashie (>= 3.4)
|
52
|
+
rexml (3.2.5)
|
53
|
+
rspec (3.11.0)
|
54
|
+
rspec-core (~> 3.11.0)
|
55
|
+
rspec-expectations (~> 3.11.0)
|
56
|
+
rspec-mocks (~> 3.11.0)
|
57
|
+
rspec-core (3.11.0)
|
58
|
+
rspec-support (~> 3.11.0)
|
59
|
+
rspec-expectations (3.11.0)
|
55
60
|
diff-lcs (>= 1.2.0, < 2.0)
|
56
|
-
rspec-support (~> 3.
|
57
|
-
rspec-mocks (3.
|
61
|
+
rspec-support (~> 3.11.0)
|
62
|
+
rspec-mocks (3.11.1)
|
58
63
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
-
rspec-support (~> 3.
|
60
|
-
rspec-support (3.
|
61
|
-
|
62
|
-
simplecov (0.
|
64
|
+
rspec-support (~> 3.11.0)
|
65
|
+
rspec-support (3.11.0)
|
66
|
+
ruby2_keywords (0.0.5)
|
67
|
+
simplecov (0.21.2)
|
63
68
|
docile (~> 1.1)
|
64
69
|
simplecov-html (~> 0.11)
|
65
|
-
|
66
|
-
|
67
|
-
|
70
|
+
simplecov_json_formatter (~> 0.1)
|
71
|
+
simplecov-html (0.12.3)
|
72
|
+
simplecov_json_formatter (0.1.4)
|
73
|
+
version_gem (1.1.0)
|
74
|
+
webmock (3.18.1)
|
75
|
+
addressable (>= 2.8.0)
|
68
76
|
crack (>= 0.3.2)
|
69
77
|
hashdiff (>= 0.4.0, < 2.0.0)
|
70
78
|
|
71
79
|
PLATFORMS
|
72
|
-
|
80
|
+
arm64-darwin-20
|
73
81
|
|
74
82
|
DEPENDENCIES
|
75
|
-
bundler (~> 2.
|
76
|
-
codacy-coverage (~> 2.
|
83
|
+
bundler (~> 2.3)
|
84
|
+
codacy-coverage (~> 2.2)
|
77
85
|
openapply!
|
78
|
-
pry (~> 0.
|
86
|
+
pry (~> 0.14)
|
79
87
|
rake (~> 13.0)
|
80
|
-
rspec (~> 3.
|
81
|
-
webmock (~> 3.
|
88
|
+
rspec (~> 3.11)
|
89
|
+
webmock (~> 3.18)
|
82
90
|
|
83
91
|
BUNDLED WITH
|
84
|
-
2.
|
92
|
+
2.3.20
|
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,34 @@ 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
|
-
|
76
|
-
|
80
|
+
|
81
|
+
if ENV['OA_DEBUG']
|
82
|
+
puts "###"
|
83
|
+
puts "DEBUG OA CLIENT GET at #{Time.now}"
|
84
|
+
puts "request URI: #{url}"
|
85
|
+
puts "request options: #{options}"
|
86
|
+
puts "###"
|
87
|
+
end
|
88
|
+
|
89
|
+
answer = self.class.get(url, options)
|
90
|
+
|
91
|
+
if ENV['OA_DEBUG']
|
92
|
+
puts "ANSWER:"
|
93
|
+
puts "code: #{answer.code}"
|
94
|
+
puts "headers: #{answer.headers}"
|
95
|
+
puts "---"
|
96
|
+
puts "body:"
|
97
|
+
puts answer.body
|
98
|
+
puts "###"
|
99
|
+
end
|
100
|
+
|
101
|
+
raise TooManyRequestError if answer.too_many_requests?
|
102
|
+
|
103
|
+
return answer
|
104
|
+
rescue TooManyRequestError
|
105
|
+
sleep (answer.headers['X-RateLimit-Period'].to_i + 1)
|
106
|
+
retry
|
107
|
+
rescue *NET_EXCEPTIONS
|
77
108
|
if times_retried < max_retries
|
78
109
|
times_retried += 1
|
79
110
|
retry
|
@@ -99,8 +130,30 @@ module Openapply
|
|
99
130
|
begin
|
100
131
|
options[:headers] = { 'Content-Type' => 'application/x-www-form-urlencoded; charset=utf-8', "Authorization" => auth_token}
|
101
132
|
options[:body] = value
|
102
|
-
|
103
|
-
|
133
|
+
|
134
|
+
if ENV['OA_DEBUG']
|
135
|
+
puts "###" if ENV['OA_DEBUG']
|
136
|
+
puts "DEBUG OA CLIENT PUT at #{Time.now}"
|
137
|
+
puts "request URI: #{url}"
|
138
|
+
puts "request options: #{options}"
|
139
|
+
puts "###"
|
140
|
+
end
|
141
|
+
|
142
|
+
answer = self.class.put(url, options)
|
143
|
+
|
144
|
+
if ENV['OA_DEBUG']
|
145
|
+
puts "ANSWER:"
|
146
|
+
puts "code: #{answer.code}"
|
147
|
+
puts "headers: #{answer.headers}"
|
148
|
+
puts "---"
|
149
|
+
puts "body:"
|
150
|
+
puts answer.body
|
151
|
+
puts "###"
|
152
|
+
end
|
153
|
+
|
154
|
+
return answer
|
155
|
+
|
156
|
+
rescue *NET_EXCEPTIONS
|
104
157
|
if times_retried < max_retries
|
105
158
|
times_retried += 1
|
106
159
|
retry
|
@@ -161,5 +214,4 @@ module Openapply
|
|
161
214
|
end
|
162
215
|
|
163
216
|
end
|
164
|
-
|
165
217
|
end
|
data/lib/openapply/version.rb
CHANGED
data/openapply.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "openapply"
|
8
8
|
spec.version = Openapply::Version::VERSION
|
9
9
|
spec.authors = ["Bill Tihen", "Elliott Hébert"]
|
10
|
-
spec.email = ["btihen@gmail.com","btihen@las.ch","
|
10
|
+
spec.email = ["btihen@gmail.com","btihen@las.ch","ehebert@las.ch"]
|
11
11
|
|
12
12
|
spec.summary = %q{Access OpenApply's APIs with Ruby}
|
13
13
|
spec.homepage = "https://github.com/las-it/openapply"
|
@@ -20,14 +20,14 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_dependency "httparty", "~> 0.
|
24
|
-
spec.add_dependency "json" , "~> 2.
|
25
|
-
spec.add_dependency "oauth2", "~>
|
23
|
+
spec.add_dependency "httparty", "~> 0.20"
|
24
|
+
spec.add_dependency "json" , "~> 2.6"
|
25
|
+
spec.add_dependency "oauth2", "~> 2.0"
|
26
26
|
|
27
|
-
spec.add_development_dependency 'codacy-coverage', '~> 2.
|
28
|
-
spec.add_development_dependency "webmock", "~> 3.
|
29
|
-
spec.add_development_dependency "bundler", "~> 2.
|
27
|
+
spec.add_development_dependency 'codacy-coverage', '~> 2.2'
|
28
|
+
spec.add_development_dependency "webmock", "~> 3.18"
|
29
|
+
spec.add_development_dependency "bundler", "~> 2.3"
|
30
30
|
spec.add_development_dependency "rake", "~> 13.0"
|
31
|
-
spec.add_development_dependency "rspec", "~> 3.
|
32
|
-
spec.add_development_dependency "pry", "~> 0.
|
31
|
+
spec.add_development_dependency "rspec", "~> 3.11"
|
32
|
+
spec.add_development_dependency "pry", "~> 0.14"
|
33
33
|
end
|
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.6
|
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: 2022-09-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -17,84 +17,84 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '0.
|
20
|
+
version: '0.20'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '0.
|
27
|
+
version: '0.20'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: json
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '2.
|
34
|
+
version: '2.6'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '2.
|
41
|
+
version: '2.6'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: oauth2
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
48
|
+
version: '2.0'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '2.0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: codacy-coverage
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '2.
|
62
|
+
version: '2.2'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '2.
|
69
|
+
version: '2.2'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: webmock
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '3.
|
76
|
+
version: '3.18'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '3.
|
83
|
+
version: '3.18'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: bundler
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: '2.
|
90
|
+
version: '2.3'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '2.
|
97
|
+
version: '2.3'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: rake
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,33 +115,32 @@ dependencies:
|
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: '3.
|
118
|
+
version: '3.11'
|
119
119
|
type: :development
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: '3.
|
125
|
+
version: '3.11'
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: pry
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
130
|
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: '0.
|
132
|
+
version: '0.14'
|
133
133
|
type: :development
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
137
|
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: '0.
|
140
|
-
description:
|
139
|
+
version: '0.14'
|
140
|
+
description:
|
141
141
|
email:
|
142
142
|
- btihen@gmail.com
|
143
143
|
- btihen@las.ch
|
144
|
-
- ell.heb@container4.ch
|
145
144
|
- ehebert@las.ch
|
146
145
|
executables: []
|
147
146
|
extensions: []
|
@@ -173,7 +172,7 @@ homepage: https://github.com/las-it/openapply
|
|
173
172
|
licenses:
|
174
173
|
- MIT
|
175
174
|
metadata: {}
|
176
|
-
post_install_message:
|
175
|
+
post_install_message:
|
177
176
|
rdoc_options: []
|
178
177
|
require_paths:
|
179
178
|
- lib
|
@@ -188,8 +187,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
187
|
- !ruby/object:Gem::Version
|
189
188
|
version: '0'
|
190
189
|
requirements: []
|
191
|
-
rubygems_version: 3.
|
192
|
-
signing_key:
|
190
|
+
rubygems_version: 3.3.20
|
191
|
+
signing_key:
|
193
192
|
specification_version: 4
|
194
193
|
summary: Access OpenApply's APIs with Ruby
|
195
194
|
test_files: []
|