wotc 0.1.5 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wotc/client/employees.rb +2 -2
- data/lib/wotc/client/utils.rb +6 -0
- data/lib/wotc/configuration.rb +11 -1
- data/lib/wotc/connection.rb +3 -0
- data/lib/wotc/request.rb +7 -7
- data/lib/wotc/version.rb +1 -1
- data/wotc.gemspec +1 -0
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1130b35023fac46a89b2a2731a94d37323a31bcf287d8292e3171d09fbe90f50
|
4
|
+
data.tar.gz: decbba7c1dd5e314e617c60d69e415b709878d436b7377378304d536584b84a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fac4f144b01e6bf2db86bb9d8216772f3ea352e57024c9f8e6b9c7ce807ab6085836c6477b2d1582ad693c0cee86a6829ba45f1c8e56f1244b250a7896a2aa3c
|
7
|
+
data.tar.gz: 01c2398a2250eb4cc30531c57f1fb599133d2d79d2aa0b84f65a1420047a0182ade4926e7d622d910b3f554a761a94e06cf01b1037570381a6430716735e9603
|
@@ -24,7 +24,7 @@ module WOTC
|
|
24
24
|
|
25
25
|
# Get employee's WOTC status
|
26
26
|
def employee_wotc_status(employee_id)
|
27
|
-
get("employees
|
27
|
+
get("employees/#{employee_id}/wotc/status")
|
28
28
|
end
|
29
29
|
|
30
30
|
# Get wotc info for specific employee
|
@@ -54,4 +54,4 @@ module WOTC
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
57
|
-
end
|
57
|
+
end
|
data/lib/wotc/client/utils.rb
CHANGED
data/lib/wotc/configuration.rb
CHANGED
@@ -16,6 +16,8 @@ module WOTC
|
|
16
16
|
:user_agent,
|
17
17
|
:auto_paginate,
|
18
18
|
:per_page,
|
19
|
+
:timeout,
|
20
|
+
:open_timeout,
|
19
21
|
].freeze
|
20
22
|
|
21
23
|
# By default, don't set an access token
|
@@ -32,9 +34,15 @@ module WOTC
|
|
32
34
|
# @note The default faraday adapter is Net::HTTP.
|
33
35
|
DEFAULT_ADAPTER = Faraday.default_adapter
|
34
36
|
|
35
|
-
# By default, don't set
|
37
|
+
# By default, don't set connection options.
|
36
38
|
DEFAULT_CONNECTION_OPTIONS = {}
|
37
39
|
|
40
|
+
# Default timeout time is 20 seconds
|
41
|
+
DEFAULT_TIMEOUT = 20
|
42
|
+
|
43
|
+
# By default, the open timeout is 20 seconds.
|
44
|
+
DEFAULT_OPEN_TIMEOUT = 20
|
45
|
+
|
38
46
|
# By default, use sandbox environment
|
39
47
|
DEFAULT_HOST = 'https://sandbox.wotc.com'.freeze
|
40
48
|
|
@@ -87,6 +95,8 @@ module WOTC
|
|
87
95
|
self.user_agent = DEFAULT_USER_AGENT
|
88
96
|
self.auto_paginate = DEFAULT_AUTO_PAGINATE
|
89
97
|
self.per_page = DEFAULT_PER_PAGE
|
98
|
+
self.timeout = DEFAULT_TIMEOUT
|
99
|
+
self.open_timeout = DEFAULT_OPEN_TIMEOUT
|
90
100
|
end
|
91
101
|
end
|
92
102
|
end
|
data/lib/wotc/connection.rb
CHANGED
@@ -18,6 +18,9 @@ module WOTC
|
|
18
18
|
|
19
19
|
Faraday::Connection.new(options) do |conn|
|
20
20
|
conn.authorization :Bearer, access_token
|
21
|
+
# https://github.com/lostisland/faraday/issues/417#issuecomment-223413386
|
22
|
+
conn.options[:timeout] = timeout
|
23
|
+
conn.options[:open_timeout] = open_timeout
|
21
24
|
conn.request :json
|
22
25
|
|
23
26
|
conn.use FaradayMiddleWare::RaiseHttpException
|
data/lib/wotc/request.rb
CHANGED
@@ -38,10 +38,10 @@ module WOTC
|
|
38
38
|
|
39
39
|
# return all results when enabled auto paginate
|
40
40
|
last_response = response.dup
|
41
|
-
data = response["data"]
|
42
|
-
while last_response["next_page_url"]
|
43
|
-
last_response = get(last_response["next_page_url"]
|
44
|
-
data.concat(last_response["data"]) if last_response["data"].is_a?(Array)
|
41
|
+
data = response.body["data"]
|
42
|
+
while last_response.body["next_page_url"]
|
43
|
+
last_response = get(last_response.body["next_page_url"])
|
44
|
+
data.concat(last_response.body["data"]) if last_response.body["data"].is_a?(Array)
|
45
45
|
end
|
46
46
|
|
47
47
|
return data
|
@@ -51,9 +51,9 @@ module WOTC
|
|
51
51
|
response = connection.send(method) do |request|
|
52
52
|
case method
|
53
53
|
when :get, :delete
|
54
|
-
request.url(URI.
|
54
|
+
request.url(Addressable::URI.escape(path), options)
|
55
55
|
when :post, :put
|
56
|
-
request.path = URI.
|
56
|
+
request.path = Addressable::URI.escape(path)
|
57
57
|
request.body = options
|
58
58
|
end
|
59
59
|
end
|
@@ -61,4 +61,4 @@ module WOTC
|
|
61
61
|
response
|
62
62
|
end
|
63
63
|
end
|
64
|
-
end
|
64
|
+
end
|
data/lib/wotc/version.rb
CHANGED
data/wotc.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wotc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- workstream.us
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: addressable
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
description: An Ruby wrapper for wotc.com REST APIs
|
112
126
|
email:
|
113
127
|
- ryan@workstream.is
|
@@ -154,7 +168,7 @@ metadata:
|
|
154
168
|
homepage_uri: https://github.com/helloworld1812/wotc-ruby-gem
|
155
169
|
source_code_uri: https://github.com/helloworld1812/wotc-ruby-gem
|
156
170
|
changelog_uri: https://github.com/helloworld1812/wotc-ruby-gem/CHANGELOG.md
|
157
|
-
post_install_message:
|
171
|
+
post_install_message:
|
158
172
|
rdoc_options: []
|
159
173
|
require_paths:
|
160
174
|
- lib
|
@@ -169,8 +183,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
183
|
- !ruby/object:Gem::Version
|
170
184
|
version: '0'
|
171
185
|
requirements: []
|
172
|
-
rubygems_version: 3.
|
173
|
-
signing_key:
|
186
|
+
rubygems_version: 3.5.20
|
187
|
+
signing_key:
|
174
188
|
specification_version: 4
|
175
189
|
summary: Ruby wrapper for wotc.com APIs
|
176
190
|
test_files: []
|