splinter-pto 0.1.1 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +12 -3
- data/Gemfile.lock +33 -32
- data/README.md +1 -1
- data/lib/splinter/api.rb +19 -7
- data/lib/splinter/version.rb +1 -1
- data/splinter.gemspec +5 -4
- metadata +24 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 244d535b9b207228adf3e369095795b614ad8a1f8d11b65d061d8d8221fb5803
|
4
|
+
data.tar.gz: 92af48704ef825497a0b6d83dfb45778f5f6e0021fc4d92b9c9e0ecdfca7410d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 590718ca6a66a73d1a7a88ca7d35a90bd65a4a8b97731fe98ad00617aae5624e014e1b4c7306f960c9bfbff61117a7fa758ea2a9d1988a27f42111a7f703f678
|
7
|
+
data.tar.gz: 24c492f39b77aaaf2568a8f7d29a69a13937f4e13a7f1c9cfa61b5833dca60bd17ea5cff7d64a497dc0cda8e634235af648137dde2cb95101d8b040c8556b715
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2020-
|
3
|
+
# on 2020-10-30 09:28:15 UTC using RuboCop version 0.90.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -16,14 +16,15 @@ Packaging/GemspecGit:
|
|
16
16
|
Exclude:
|
17
17
|
- 'splinter.gemspec'
|
18
18
|
|
19
|
-
# Offense count:
|
19
|
+
# Offense count: 6
|
20
20
|
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
21
21
|
RSpec/VerifiedDoubles:
|
22
22
|
Exclude:
|
23
23
|
- 'spec/lib/splinter/api_spec.rb'
|
24
24
|
- 'spec/lib/splinter/ooo_events_spec.rb'
|
25
|
+
- 'spec/lib/splinter/ooo_types_spec.rb'
|
25
26
|
|
26
|
-
# Offense count:
|
27
|
+
# Offense count: 3
|
27
28
|
# Cop supports --auto-correct.
|
28
29
|
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
29
30
|
# SupportedStyles: single_quotes, double_quotes
|
@@ -31,3 +32,11 @@ Style/StringLiterals:
|
|
31
32
|
Exclude:
|
32
33
|
- 'spec/lib/splinter/api_spec.rb'
|
33
34
|
- 'spec/lib/splinter/ooo_events_spec.rb'
|
35
|
+
- 'spec/lib/splinter/ooo_types_spec.rb'
|
36
|
+
|
37
|
+
# Offense count: 2
|
38
|
+
# Cop supports --auto-correct.
|
39
|
+
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
40
|
+
# URISchemes: http, https
|
41
|
+
Layout/LineLength:
|
42
|
+
Max: 121
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
splinter-pto (0.1.
|
4
|
+
splinter-pto (0.1.6)
|
5
5
|
rest-client (~> 2.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
ast (2.4.
|
10
|
+
ast (2.4.2)
|
11
11
|
coderay (1.1.3)
|
12
12
|
diff-lcs (1.4.4)
|
13
13
|
domain_name (0.5.20190701)
|
@@ -15,56 +15,57 @@ GEM
|
|
15
15
|
http-accept (1.7.0)
|
16
16
|
http-cookie (1.0.3)
|
17
17
|
domain_name (~> 0.5)
|
18
|
-
json (2.
|
18
|
+
json (2.5.1)
|
19
19
|
method_source (1.0.0)
|
20
20
|
mime-types (3.3.1)
|
21
21
|
mime-types-data (~> 3.2015)
|
22
|
-
mime-types-data (3.
|
22
|
+
mime-types-data (3.2021.0225)
|
23
23
|
netrc (0.11.0)
|
24
|
-
parallel (1.
|
25
|
-
parser (
|
24
|
+
parallel (1.20.1)
|
25
|
+
parser (3.0.1.1)
|
26
26
|
ast (~> 2.4.1)
|
27
|
-
pry (0.
|
27
|
+
pry (0.14.1)
|
28
28
|
coderay (~> 1.1)
|
29
29
|
method_source (~> 1.0)
|
30
30
|
rainbow (3.0.0)
|
31
|
-
rake (13.0.
|
32
|
-
regexp_parser (1.
|
31
|
+
rake (13.0.3)
|
32
|
+
regexp_parser (2.1.1)
|
33
33
|
rest-client (2.1.0)
|
34
34
|
http-accept (>= 1.7.0, < 2.0)
|
35
35
|
http-cookie (>= 1.0.2, < 2.0)
|
36
36
|
mime-types (>= 1.16, < 4.0)
|
37
37
|
netrc (~> 0.8)
|
38
|
-
rexml (3.2.
|
39
|
-
rspec (3.
|
40
|
-
rspec-core (~> 3.
|
41
|
-
rspec-expectations (~> 3.
|
42
|
-
rspec-mocks (~> 3.
|
43
|
-
rspec-core (3.
|
44
|
-
rspec-support (~> 3.
|
45
|
-
rspec-expectations (3.
|
38
|
+
rexml (3.2.5)
|
39
|
+
rspec (3.10.0)
|
40
|
+
rspec-core (~> 3.10.0)
|
41
|
+
rspec-expectations (~> 3.10.0)
|
42
|
+
rspec-mocks (~> 3.10.0)
|
43
|
+
rspec-core (3.10.1)
|
44
|
+
rspec-support (~> 3.10.0)
|
45
|
+
rspec-expectations (3.10.1)
|
46
46
|
diff-lcs (>= 1.2.0, < 2.0)
|
47
|
-
rspec-support (~> 3.
|
48
|
-
rspec-mocks (3.
|
47
|
+
rspec-support (~> 3.10.0)
|
48
|
+
rspec-mocks (3.10.2)
|
49
49
|
diff-lcs (>= 1.2.0, < 2.0)
|
50
|
-
rspec-support (~> 3.
|
51
|
-
rspec-support (3.
|
52
|
-
rubocop (0.
|
50
|
+
rspec-support (~> 3.10.0)
|
51
|
+
rspec-support (3.10.2)
|
52
|
+
rubocop (0.93.1)
|
53
53
|
parallel (~> 1.10)
|
54
|
-
parser (>= 2.7.1.
|
54
|
+
parser (>= 2.7.1.5)
|
55
55
|
rainbow (>= 2.2.2, < 4.0)
|
56
|
-
regexp_parser (>= 1.
|
56
|
+
regexp_parser (>= 1.8)
|
57
57
|
rexml
|
58
|
-
rubocop-ast (>= 0.
|
58
|
+
rubocop-ast (>= 0.6.0)
|
59
59
|
ruby-progressbar (~> 1.7)
|
60
60
|
unicode-display_width (>= 1.4.0, < 2.0)
|
61
|
-
rubocop-ast (
|
62
|
-
parser (>=
|
63
|
-
rubocop-packaging (0.
|
64
|
-
rubocop (
|
65
|
-
rubocop-rspec (1.
|
61
|
+
rubocop-ast (1.6.0)
|
62
|
+
parser (>= 3.0.1.1)
|
63
|
+
rubocop-packaging (0.5.1)
|
64
|
+
rubocop (>= 0.89, < 2.0)
|
65
|
+
rubocop-rspec (1.44.1)
|
66
66
|
rubocop (~> 0.87)
|
67
|
-
|
67
|
+
rubocop-ast (>= 0.7.1)
|
68
|
+
ruby-progressbar (1.11.0)
|
68
69
|
unf (0.1.4)
|
69
70
|
unf_ext
|
70
71
|
unf_ext (0.0.7.7)
|
@@ -84,4 +85,4 @@ DEPENDENCIES
|
|
84
85
|
splinter-pto!
|
85
86
|
|
86
87
|
BUNDLED WITH
|
87
|
-
2.
|
88
|
+
2.2.16
|
data/README.md
CHANGED
data/lib/splinter/api.rb
CHANGED
@@ -2,29 +2,41 @@
|
|
2
2
|
|
3
3
|
require 'rest-client'
|
4
4
|
require 'json'
|
5
|
+
require 'uri'
|
5
6
|
|
6
7
|
module Splinter
|
7
8
|
class API
|
8
9
|
BASE_URL = 'https://ninja-bot.treehoppr.com/api/beta'
|
9
10
|
|
10
11
|
def self.get(endpoint)
|
11
|
-
|
12
|
-
response = RestClient.get("#{BASE_URL}/#{endpoint}", headers)
|
12
|
+
response = RestClient.get(build_url(endpoint), headers)
|
13
13
|
JSON.parse(response.body)
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.paginated_get(endpoint, params = {})
|
17
|
-
|
18
|
-
url = "#{BASE_URL}/#{endpoint}"
|
17
|
+
url = build_url(endpoint, params)
|
19
18
|
results = []
|
19
|
+
|
20
20
|
loop do
|
21
|
-
result = RestClient.get(url, headers
|
21
|
+
result = RestClient.get(url, headers)
|
22
22
|
parsed_result = JSON.parse(result.body)
|
23
|
-
url = parsed_result.dig('next')
|
24
23
|
results.concat(parsed_result['results'])
|
25
|
-
|
24
|
+
url = parsed_result.dig('next')
|
25
|
+
break if url.nil?
|
26
26
|
end
|
27
|
+
|
27
28
|
results
|
28
29
|
end
|
30
|
+
|
31
|
+
def self.headers
|
32
|
+
{ 'Authorization': "Token #{Splinter.configuration.api_key}" }
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.build_url(endpoint, params = {})
|
36
|
+
url = "#{BASE_URL}/#{endpoint}"
|
37
|
+
url += "?#{URI.encode_www_form(params)}" unless params.empty?
|
38
|
+
|
39
|
+
url
|
40
|
+
end
|
29
41
|
end
|
30
42
|
end
|
data/lib/splinter/version.rb
CHANGED
data/splinter.gemspec
CHANGED
@@ -5,13 +5,13 @@ require_relative 'lib/splinter/version'
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'splinter-pto'
|
7
7
|
spec.version = Splinter::VERSION
|
8
|
-
spec.authors = ['
|
8
|
+
spec.authors = ['Lien Van Den Steen']
|
9
9
|
spec.email = ['lvandensteen@gitlab.com']
|
10
10
|
|
11
|
-
spec.summary = 'Ruby wrapper for the PTO
|
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.4.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,11 +26,12 @@ 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.add_runtime_dependency 'rest-client', '~> 2.0'
|
30
|
+
|
29
31
|
spec.add_development_dependency 'json'
|
30
32
|
spec.add_development_dependency 'pry', '~> 0.13'
|
31
33
|
spec.add_development_dependency 'rake', '~> 13.0'
|
32
34
|
spec.add_development_dependency 'rspec', '~> 3.7', '>= 3.9.0'
|
33
|
-
spec.add_runtime_dependency 'rest-client', '~> 2.0'
|
34
35
|
spec.add_development_dependency 'rubocop', '~> 0.85'
|
35
36
|
spec.add_development_dependency 'rubocop-packaging', '~> 0.1'
|
36
37
|
spec.add_development_dependency 'rubocop-rspec', '~> 1.39'
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- Lien Van Den Steen
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-27 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'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: json
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,20 +86,6 @@ dependencies:
|
|
72
86
|
- - ">="
|
73
87
|
- !ruby/object:Gem::Version
|
74
88
|
version: 3.9.0
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: rest-client
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - "~>"
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '2.0'
|
82
|
-
type: :runtime
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - "~>"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '2.0'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: rubocop
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,7 +128,7 @@ dependencies:
|
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '1.39'
|
131
|
-
description:
|
131
|
+
description:
|
132
132
|
email:
|
133
133
|
- lvandensteen@gitlab.com
|
134
134
|
executables: []
|
@@ -162,7 +162,7 @@ metadata:
|
|
162
162
|
homepage_uri: https://gitlab.com/gitlab-com/people-group/peopleops-eng/splinter
|
163
163
|
source_code_uri: https://gitlab.com/gitlab-com/people-group/peopleops-eng/splinter
|
164
164
|
changelog_uri: https://gitlab.com/gitlab-com/people-group/peopleops-eng/splinter
|
165
|
-
post_install_message:
|
165
|
+
post_install_message:
|
166
166
|
rdoc_options: []
|
167
167
|
require_paths:
|
168
168
|
- lib
|
@@ -170,15 +170,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
170
170
|
requirements:
|
171
171
|
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 2.
|
173
|
+
version: 2.4.0
|
174
174
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
175
|
requirements:
|
176
176
|
- - ">="
|
177
177
|
- !ruby/object:Gem::Version
|
178
178
|
version: '0'
|
179
179
|
requirements: []
|
180
|
-
rubygems_version: 3.
|
181
|
-
signing_key:
|
180
|
+
rubygems_version: 3.2.3
|
181
|
+
signing_key:
|
182
182
|
specification_version: 4
|
183
|
-
summary: Ruby wrapper for the PTO
|
183
|
+
summary: Ruby wrapper for the PTO by Roots API
|
184
184
|
test_files: []
|