gitlab 4.13.1 → 4.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/lib/gitlab/client.rb +5 -1
- data/lib/gitlab/client/issues.rb +1 -1
- data/lib/gitlab/client/jobs.rb +14 -0
- data/lib/gitlab/client/projects.rb +14 -0
- data/lib/gitlab/client/repositories.rb +16 -0
- data/lib/gitlab/request.rb +7 -5
- data/lib/gitlab/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c77e29621138a7c5468d44f3753d6bb7e6ead353b384d2e10ed7230999323651
|
4
|
+
data.tar.gz: 44831812bcb2d53fb7adad0762a7822ba00f0a0dc064afa0ae7a3cc53d9b3eb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfb8f5b817ce9e73c35de24e28a9d5f98fdcdf2a1071f06cefaa238aec71f7e33eff9b5611f1d7cb0eac33a70baa87410a37536c1015a1d4663392dafb1fcca2
|
7
|
+
data.tar.gz: 937c02a461ec9c6b472542ce4576296afe660c3797533fd6ad0d3dc93b5f78b44809bbdc2acfe1ba800125cb8e26d063a56bceca3b4f62d4bd2bacb95be09fcb
|
data/LICENSE.txt
CHANGED
data/lib/gitlab/client.rb
CHANGED
@@ -73,8 +73,12 @@ module Gitlab
|
|
73
73
|
inspected
|
74
74
|
end
|
75
75
|
|
76
|
+
# Utility method for URL encoding of a string.
|
77
|
+
# Copied from https://ruby-doc.org/stdlib-2.7.0/libdoc/erb/rdoc/ERB/Util.html
|
78
|
+
#
|
79
|
+
# @return [String]
|
76
80
|
def url_encode(url)
|
77
|
-
|
81
|
+
url.to_s.b.gsub(/[^a-zA-Z0-9_\-.~]/n) { |m| sprintf('%%%02X', m.unpack1('C')) } # rubocop:disable Style/FormatString, Style/FormatStringToken
|
78
82
|
end
|
79
83
|
|
80
84
|
private
|
data/lib/gitlab/client/issues.rb
CHANGED
@@ -181,7 +181,7 @@ class Gitlab::Client
|
|
181
181
|
# @param [Integer] id The ID of an issue.
|
182
182
|
# @param [String] duration The time spent in human format. e.g: 3h30m
|
183
183
|
def add_time_spent_on_issue(project, id, duration)
|
184
|
-
post("/projects/#{url_encode project}/issues/#{id}/add_spent_time", body: { duration:
|
184
|
+
post("/projects/#{url_encode project}/issues/#{id}/add_spent_time", body: { duration: duration })
|
185
185
|
end
|
186
186
|
|
187
187
|
# Resets the total spent time for this issue to 0 seconds.
|
data/lib/gitlab/client/jobs.rb
CHANGED
@@ -163,5 +163,19 @@ class Gitlab::Client
|
|
163
163
|
def job_artifacts_keep(project_id, job_id)
|
164
164
|
post("/projects/#{url_encode project_id}/jobs/#{job_id}/artifacts/keep")
|
165
165
|
end
|
166
|
+
|
167
|
+
# Delete Artifacts
|
168
|
+
# Deletes the artifacts associated with a job.
|
169
|
+
#
|
170
|
+
# @example
|
171
|
+
# Gitlab.job_artifacts_delete(1,1)
|
172
|
+
# Gitlab.job_artifacts_delete("project", 1)
|
173
|
+
#
|
174
|
+
# @param [Integer, String] The ID or name of a project.
|
175
|
+
# @param [Integer] the id of the job
|
176
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
177
|
+
def job_artifacts_delete(project_id, job_id)
|
178
|
+
delete("/projects/#{url_encode project_id}/jobs/#{job_id}/artifacts")
|
179
|
+
end
|
166
180
|
end
|
167
181
|
end
|
@@ -380,6 +380,20 @@ class Gitlab::Client
|
|
380
380
|
post("/projects/#{url_encode project}/deploy_keys/#{key}/disable", body: { id: project, key_id: key })
|
381
381
|
end
|
382
382
|
|
383
|
+
# Updates an existing deploy key.
|
384
|
+
#
|
385
|
+
# @example
|
386
|
+
# Gitlab.edit_deploy_key(42, 66, 'New key name', can_push: false)
|
387
|
+
#
|
388
|
+
# @param [Integer, String] project The ID or path of a project.
|
389
|
+
# @param [Integer] id The ID of a deploy key.
|
390
|
+
# @param [String] title The title of a deploy key.
|
391
|
+
# @param [Hash] options A customizable set of options.
|
392
|
+
# @return [Gitlab::ObjectifiedHash] Information about created deploy key.
|
393
|
+
def edit_deploy_key(project, id, title, options = {})
|
394
|
+
put("/projects/#{url_encode project}/deploy_keys/#{id}", body: { title: title }.merge(options))
|
395
|
+
end
|
396
|
+
|
383
397
|
# Deletes a deploy key from project.
|
384
398
|
#
|
385
399
|
# @example
|
@@ -72,5 +72,21 @@ class Gitlab::Client
|
|
72
72
|
def merge_base(project, refs)
|
73
73
|
get("/projects/#{url_encode project}/repository/merge_base", query: { refs: refs })
|
74
74
|
end
|
75
|
+
|
76
|
+
# Get project repository contributors.
|
77
|
+
#
|
78
|
+
# @example
|
79
|
+
# Gitlab.contributors(42)
|
80
|
+
# Gitlab.contributors(42, { order: 'name' })
|
81
|
+
#
|
82
|
+
# @param [Integer, String] project The ID or name of a project.
|
83
|
+
# @param [Hash] options A customizable set of options.
|
84
|
+
# @option options [String] :order_by Order by name, email or commits (default = commits).
|
85
|
+
# @option options [String] :sort Sort order asc or desc (default = asc).
|
86
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
87
|
+
def contributors(project, options = {})
|
88
|
+
get("/projects/#{url_encode project}/repository/contributors", query: options)
|
89
|
+
end
|
90
|
+
alias repo_contributors contributors
|
75
91
|
end
|
76
92
|
end
|
data/lib/gitlab/request.rb
CHANGED
@@ -41,14 +41,16 @@ module Gitlab
|
|
41
41
|
|
42
42
|
%w[get post put delete].each do |method|
|
43
43
|
define_method method do |path, options = {}|
|
44
|
-
|
44
|
+
params = options.dup
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
httparty_config(params)
|
47
|
+
|
48
|
+
unless params[:unauthenticated]
|
49
|
+
params[:headers] ||= {}
|
50
|
+
params[:headers].merge!(authorization_header)
|
49
51
|
end
|
50
52
|
|
51
|
-
validate self.class.send(method, @endpoint + path,
|
53
|
+
validate self.class.send(method, @endpoint + path, params)
|
52
54
|
end
|
53
55
|
end
|
54
56
|
|
data/lib/gitlab/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nihad Abbasov
|
@@ -9,28 +9,28 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-03-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - ">="
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: 0.14.0
|
21
18
|
- - "~>"
|
22
19
|
- !ruby/object:Gem::Version
|
23
20
|
version: '0.14'
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.14.0
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
|
-
- - ">="
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
version: 0.14.0
|
31
28
|
- - "~>"
|
32
29
|
- !ruby/object:Gem::Version
|
33
30
|
version: '0.14'
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.14.0
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: terminal-table
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
226
|
- !ruby/object:Gem::Version
|
227
227
|
version: '0'
|
228
228
|
requirements: []
|
229
|
-
rubygems_version: 3.
|
229
|
+
rubygems_version: 3.1.2
|
230
230
|
signing_key:
|
231
231
|
specification_version: 4
|
232
232
|
summary: A Ruby wrapper and CLI for the GitLab API
|