splinter-pto 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +39 -34
- data/README.md +31 -1
- data/lib/splinter/api.rb +3 -3
- data/lib/splinter/version.rb +1 -1
- data/splinter.gemspec +4 -9
- metadata +14 -103
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5821afb5639784fdb5c6b4c36f4fca724416896684f7f12f14775bc724d60ff
|
4
|
+
data.tar.gz: 626b71239669714059498c25b43f423a9532a30541e086fcfa3d435a10f378db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 804aaef385c945eca3bcb0e597baa29e7bbc195454ebc5e64f8de7a2677a28e3d9d89e4c16e35c663e215aa2484791179bd74a4088a34d79d955548597638bc9
|
7
|
+
data.tar.gz: f6252e2d1e884dfdae27f0c26c7ab99632028bc07433b89e81355538644ca81a47a5c8807408f26efb6aa49c4dc26c9c51bb5f11a17d90b77ebbee59fb07a3d7
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
@@ -4,3 +4,14 @@ source 'https://rubygems.org'
|
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in splinter.gemspec
|
6
6
|
gemspec
|
7
|
+
|
8
|
+
# Development Dependencies
|
9
|
+
group :development, :test do
|
10
|
+
gem 'pry', '~> 0.13'
|
11
|
+
gem 'rake', '~> 13.0'
|
12
|
+
gem 'rspec', '~> 3.7', '>= 3.9.0'
|
13
|
+
gem 'rubocop', '~> 1.65'
|
14
|
+
gem 'rubocop-packaging', '~> 0.5'
|
15
|
+
gem 'rubocop-rake', '~> 0.6'
|
16
|
+
gem 'rubocop-rspec', '~> 3.0'
|
17
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
splinter-pto (0.1.
|
4
|
+
splinter-pto (0.1.8)
|
5
|
+
json
|
5
6
|
rest-client (~> 2.0)
|
6
7
|
|
7
8
|
GEM
|
@@ -10,32 +11,35 @@ GEM
|
|
10
11
|
ast (2.4.2)
|
11
12
|
coderay (1.1.3)
|
12
13
|
diff-lcs (1.4.4)
|
13
|
-
domain_name (0.
|
14
|
-
unf (>= 0.0.5, < 1.0.0)
|
14
|
+
domain_name (0.6.20240107)
|
15
15
|
http-accept (1.7.0)
|
16
|
-
http-cookie (1.0.
|
16
|
+
http-cookie (1.0.6)
|
17
17
|
domain_name (~> 0.5)
|
18
|
-
json (2.
|
18
|
+
json (2.7.2)
|
19
|
+
language_server-protocol (3.17.0.3)
|
19
20
|
method_source (1.0.0)
|
20
|
-
mime-types (3.
|
21
|
+
mime-types (3.5.2)
|
21
22
|
mime-types-data (~> 3.2015)
|
22
|
-
mime-types-data (3.
|
23
|
+
mime-types-data (3.2024.0702)
|
23
24
|
netrc (0.11.0)
|
24
|
-
parallel (1.
|
25
|
-
parser (3.
|
25
|
+
parallel (1.25.1)
|
26
|
+
parser (3.3.4.0)
|
26
27
|
ast (~> 2.4.1)
|
28
|
+
racc
|
27
29
|
pry (0.14.1)
|
28
30
|
coderay (~> 1.1)
|
29
31
|
method_source (~> 1.0)
|
30
|
-
|
32
|
+
racc (1.8.0)
|
33
|
+
rainbow (3.1.1)
|
31
34
|
rake (13.0.3)
|
32
|
-
regexp_parser (2.
|
35
|
+
regexp_parser (2.9.2)
|
33
36
|
rest-client (2.1.0)
|
34
37
|
http-accept (>= 1.7.0, < 2.0)
|
35
38
|
http-cookie (>= 1.0.2, < 2.0)
|
36
39
|
mime-types (>= 1.16, < 4.0)
|
37
40
|
netrc (~> 0.8)
|
38
|
-
rexml (3.
|
41
|
+
rexml (3.3.1)
|
42
|
+
strscan
|
39
43
|
rspec (3.10.0)
|
40
44
|
rspec-core (~> 3.10.0)
|
41
45
|
rspec-expectations (~> 3.10.0)
|
@@ -49,39 +53,40 @@ GEM
|
|
49
53
|
diff-lcs (>= 1.2.0, < 2.0)
|
50
54
|
rspec-support (~> 3.10.0)
|
51
55
|
rspec-support (3.10.2)
|
52
|
-
rubocop (
|
56
|
+
rubocop (1.65.0)
|
57
|
+
json (~> 2.3)
|
58
|
+
language_server-protocol (>= 3.17.0)
|
53
59
|
parallel (~> 1.10)
|
54
|
-
parser (>=
|
60
|
+
parser (>= 3.3.0.2)
|
55
61
|
rainbow (>= 2.2.2, < 4.0)
|
56
|
-
regexp_parser (>=
|
57
|
-
rexml
|
58
|
-
rubocop-ast (>=
|
62
|
+
regexp_parser (>= 2.4, < 3.0)
|
63
|
+
rexml (>= 3.2.5, < 4.0)
|
64
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
59
65
|
ruby-progressbar (~> 1.7)
|
60
|
-
unicode-display_width (>=
|
61
|
-
rubocop-ast (1.
|
62
|
-
parser (>= 3.
|
63
|
-
rubocop-packaging (0.5.
|
64
|
-
rubocop (>=
|
65
|
-
rubocop-
|
66
|
-
rubocop (~> 0
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
unicode-display_width (1.7.0)
|
66
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
67
|
+
rubocop-ast (1.31.3)
|
68
|
+
parser (>= 3.3.1.0)
|
69
|
+
rubocop-packaging (0.5.2)
|
70
|
+
rubocop (>= 1.33, < 2.0)
|
71
|
+
rubocop-rake (0.6.0)
|
72
|
+
rubocop (~> 1.0)
|
73
|
+
rubocop-rspec (3.0.3)
|
74
|
+
rubocop (~> 1.61)
|
75
|
+
ruby-progressbar (1.13.0)
|
76
|
+
strscan (3.1.0)
|
77
|
+
unicode-display_width (2.5.0)
|
73
78
|
|
74
79
|
PLATFORMS
|
75
80
|
ruby
|
76
81
|
|
77
82
|
DEPENDENCIES
|
78
|
-
json
|
79
83
|
pry (~> 0.13)
|
80
84
|
rake (~> 13.0)
|
81
85
|
rspec (~> 3.7, >= 3.9.0)
|
82
|
-
rubocop (~>
|
83
|
-
rubocop-packaging (~> 0.
|
84
|
-
rubocop-
|
86
|
+
rubocop (~> 1.65)
|
87
|
+
rubocop-packaging (~> 0.5)
|
88
|
+
rubocop-rake (~> 0.6)
|
89
|
+
rubocop-rspec (~> 3.0)
|
85
90
|
splinter-pto!
|
86
91
|
|
87
92
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -19,7 +19,37 @@ Or install it yourself as:
|
|
19
19
|
$ gem install splinter-pto
|
20
20
|
|
21
21
|
## Usage
|
22
|
-
|
22
|
+
|
23
|
+
### Configuration
|
24
|
+
|
25
|
+
Configure an API Key:
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
Splinter.configure do |c|
|
29
|
+
c.api_key = "MY_API_KEY"
|
30
|
+
end
|
31
|
+
```
|
32
|
+
|
33
|
+
### OOO Events
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
# Get all PTO Events
|
37
|
+
Splinter::OOOEvents.get_all
|
38
|
+
|
39
|
+
event_id = 1 # example event ID
|
40
|
+
Splinter::OOOEvents.find(event_id)
|
41
|
+
```
|
42
|
+
|
43
|
+
### OOO Types
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
# List all OOO Event Types
|
47
|
+
Splinter::OOOTypes.get_all
|
48
|
+
|
49
|
+
# Find a specific event type by ID
|
50
|
+
type_id = '1'
|
51
|
+
Splinter::OOOTypes.find(type_id)
|
52
|
+
```
|
23
53
|
|
24
54
|
## Development
|
25
55
|
|
data/lib/splinter/api.rb
CHANGED
@@ -6,7 +6,7 @@ require 'uri'
|
|
6
6
|
|
7
7
|
module Splinter
|
8
8
|
class API
|
9
|
-
BASE_URL = 'https://ninja
|
9
|
+
BASE_URL = 'https://ninja.tryroots.io/api/beta'
|
10
10
|
|
11
11
|
def self.get(endpoint)
|
12
12
|
response = RestClient.get(build_url(endpoint), headers)
|
@@ -21,7 +21,7 @@ module Splinter
|
|
21
21
|
result = RestClient.get(url, headers)
|
22
22
|
parsed_result = JSON.parse(result.body)
|
23
23
|
results.concat(parsed_result['results'])
|
24
|
-
url = parsed_result
|
24
|
+
url = parsed_result&.dig('next')&.gsub('http:', 'https:')
|
25
25
|
break if url.nil?
|
26
26
|
end
|
27
27
|
|
@@ -29,7 +29,7 @@ module Splinter
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.headers
|
32
|
-
{
|
32
|
+
{ Authorization: "Token #{Splinter.configuration.api_key}" }
|
33
33
|
end
|
34
34
|
|
35
35
|
def self.build_url(endpoint, params = {})
|
data/lib/splinter/version.rb
CHANGED
data/splinter.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = 'Ruby wrapper for the PTO by Roots API'
|
12
12
|
spec.homepage = 'https://gitlab.com/gitlab-com/people-group/peopleops-eng/splinter'
|
13
13
|
spec.license = 'MIT'
|
14
|
-
spec.required_ruby_version = Gem::Requirement.new('>= 2.
|
14
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
|
15
15
|
|
16
16
|
spec.metadata['homepage_uri'] = spec.homepage
|
17
17
|
spec.metadata['source_code_uri'] = 'https://gitlab.com/gitlab-com/people-group/peopleops-eng/splinter'
|
@@ -26,13 +26,8 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
27
|
spec.require_paths = ['lib']
|
28
28
|
|
29
|
-
spec.
|
29
|
+
spec.add_dependency 'json'
|
30
|
+
spec.add_dependency 'rest-client', '~> 2.0'
|
30
31
|
|
31
|
-
spec.
|
32
|
-
spec.add_development_dependency 'pry', '~> 0.13'
|
33
|
-
spec.add_development_dependency 'rake', '~> 13.0'
|
34
|
-
spec.add_development_dependency 'rspec', '~> 3.7', '>= 3.9.0'
|
35
|
-
spec.add_development_dependency 'rubocop', '~> 0.85'
|
36
|
-
spec.add_development_dependency 'rubocop-packaging', '~> 0.1'
|
37
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 1.39'
|
32
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
38
33
|
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: splinter-pto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lien Van Den Steen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rest-client
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2.0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '2.0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: json
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -31,7 +17,7 @@ dependencies:
|
|
31
17
|
- - ">="
|
32
18
|
- !ruby/object:Gem::Version
|
33
19
|
version: '0'
|
34
|
-
type: :
|
20
|
+
type: :runtime
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
@@ -39,96 +25,20 @@ dependencies:
|
|
39
25
|
- !ruby/object:Gem::Version
|
40
26
|
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0.13'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0.13'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '13.0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '13.0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '3.7'
|
76
|
-
- - ">="
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: 3.9.0
|
79
|
-
type: :development
|
80
|
-
prerelease: false
|
81
|
-
version_requirements: !ruby/object:Gem::Requirement
|
82
|
-
requirements:
|
83
|
-
- - "~>"
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '3.7'
|
86
|
-
- - ">="
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: 3.9.0
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: rubocop
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '0.85'
|
96
|
-
type: :development
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - "~>"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '0.85'
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: rubocop-packaging
|
105
|
-
requirement: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0.1'
|
110
|
-
type: :development
|
111
|
-
prerelease: false
|
112
|
-
version_requirements: !ruby/object:Gem::Requirement
|
113
|
-
requirements:
|
114
|
-
- - "~>"
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: '0.1'
|
117
|
-
- !ruby/object:Gem::Dependency
|
118
|
-
name: rubocop-rspec
|
28
|
+
name: rest-client
|
119
29
|
requirement: !ruby/object:Gem::Requirement
|
120
30
|
requirements:
|
121
31
|
- - "~>"
|
122
32
|
- !ruby/object:Gem::Version
|
123
|
-
version: '
|
124
|
-
type: :
|
33
|
+
version: '2.0'
|
34
|
+
type: :runtime
|
125
35
|
prerelease: false
|
126
36
|
version_requirements: !ruby/object:Gem::Requirement
|
127
37
|
requirements:
|
128
38
|
- - "~>"
|
129
39
|
- !ruby/object:Gem::Version
|
130
|
-
version: '
|
131
|
-
description:
|
40
|
+
version: '2.0'
|
41
|
+
description:
|
132
42
|
email:
|
133
43
|
- lvandensteen@gitlab.com
|
134
44
|
executables: []
|
@@ -162,7 +72,8 @@ metadata:
|
|
162
72
|
homepage_uri: https://gitlab.com/gitlab-com/people-group/peopleops-eng/splinter
|
163
73
|
source_code_uri: https://gitlab.com/gitlab-com/people-group/peopleops-eng/splinter
|
164
74
|
changelog_uri: https://gitlab.com/gitlab-com/people-group/peopleops-eng/splinter
|
165
|
-
|
75
|
+
rubygems_mfa_required: 'true'
|
76
|
+
post_install_message:
|
166
77
|
rdoc_options: []
|
167
78
|
require_paths:
|
168
79
|
- lib
|
@@ -170,15 +81,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
170
81
|
requirements:
|
171
82
|
- - ">="
|
172
83
|
- !ruby/object:Gem::Version
|
173
|
-
version: 2.
|
84
|
+
version: 2.7.0
|
174
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
86
|
requirements:
|
176
87
|
- - ">="
|
177
88
|
- !ruby/object:Gem::Version
|
178
89
|
version: '0'
|
179
90
|
requirements: []
|
180
|
-
rubygems_version: 3.
|
181
|
-
signing_key:
|
91
|
+
rubygems_version: 3.5.11
|
92
|
+
signing_key:
|
182
93
|
specification_version: 4
|
183
94
|
summary: Ruby wrapper for the PTO by Roots API
|
184
95
|
test_files: []
|