gitlab 4.6.1 → 4.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21faa5844bf8594341b47aa10a2876322c075f2bb2c8b5aecce9be5e79a098cb
4
- data.tar.gz: 6f9c6f4694252803fdd008ef0df3522c2b83d3fa4ccabd5c757e3fc3a21b6089
3
+ metadata.gz: 421115b0e89dbdc41a5b604763a4d2f8c159117ea7a750112cd4ae4384716f46
4
+ data.tar.gz: f29e4c90ebf303275d2cdb40814019d537b7cd79d9ca620b234eab78f990c7ef
5
5
  SHA512:
6
- metadata.gz: a1c0b7dd15862139d596ebe5588221120efdc2e51979fe98de3f2fec0b869cd0945833f10c847917e2ff095cb0ff7cc9231371494c78da4c7a89a12eeebdf769
7
- data.tar.gz: 9fface702b7ac313f50f2d414dd4c89a79a295f23cdce13273f25509d119690cdae8ff2dc0340ff0f1a6ccb78858f60f42726e8ea646e159ac9ea23429874557
6
+ metadata.gz: 0fa2447b6dff0b4335d542f199b3dac0b5171850417b01f8f0d2238eca7015707548308ccfa235b60443b2bf4fa436bb4981f6d21a36126d37c4432359c7a2b5
7
+ data.tar.gz: 15acf72e2442ea9aca44941545db106560ac07090c32012cc70a734dea36abb74ca57b1852350a29b825cf8080725a6989948e4faa92b09eaf75a209a7f6ddc2
@@ -35,6 +35,19 @@ class Gitlab::Client
35
35
  end
36
36
  alias repo_commit commit
37
37
 
38
+ # Cherry picks a commit to a given branch.
39
+ #
40
+ # @example
41
+ # Gitlab.cherry_pick_commit(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6', 'master')
42
+ #
43
+ # @param [Integer, String] project The ID or name of a project.
44
+ # @param [String] sha The commit hash or name of a repository branch or tag
45
+ # @param [String] branch The name of the branch
46
+ # @return [Gitlab::ObjectifiedHash]
47
+ def cherry_pick_commit(project, sha, branch)
48
+ post("/projects/#{url_encode project}/repository/commits/#{sha}/cherry_pick", body: { branch: branch })
49
+ end
50
+
38
51
  # Get the diff of a commit in a project.
39
52
  #
40
53
  # @example
@@ -205,5 +205,27 @@ class Gitlab::Client
205
205
  def time_stats_for_issue(project, id)
206
206
  get("/projects/#{url_encode project}/issues/#{id}/time_stats")
207
207
  end
208
+
209
+ # Get participants on issue
210
+ #
211
+ # @example
212
+ # @gitlab.participants_on_issue(3, 42)
213
+ #
214
+ # @param [Integer, String] project The ID or name of a project.
215
+ # @param [Integer] id The ID of an issue.
216
+ def participants_on_issue(project, id)
217
+ get("/projects/#{url_encode project}/issues/#{id}/participants")
218
+ end
219
+
220
+ # List merge requests that will close issue on merge
221
+ #
222
+ # @example
223
+ # Gitlab.merge_requests_closing_issue_on_merge(3, 42)
224
+ #
225
+ # @param [Integer, String] project The ID or name of a project.
226
+ # @param [Integer] id The ID of an issue.
227
+ def merge_requests_closing_issue_on_merge(project, id)
228
+ get("/projects/#{url_encode project}/issues/#{id}/closed_by")
229
+ end
208
230
  end
209
231
  end
@@ -43,6 +43,18 @@ class Gitlab::Client
43
43
  get("/projects/#{url_encode project}/merge_requests/#{id}")
44
44
  end
45
45
 
46
+ # Gets a list of merge request pipelines.
47
+ #
48
+ # @example
49
+ # Gitlab.merge_request_pipelines(5, 36)
50
+ #
51
+ # @param [Integer, String] project The ID or name of a project.
52
+ # @param [Integer] id The ID of a merge request.
53
+ # @return [Array<Gitlab::ObjectifiedHash>]
54
+ def merge_request_pipelines(project, id)
55
+ get("/projects/#{url_encode project}/merge_requests/#{id}/pipelines")
56
+ end
57
+
46
58
  # Creates a merge request.
47
59
  #
48
60
  # @example
@@ -38,9 +38,20 @@ class Gitlab::Client
38
38
  #
39
39
  # @param [Integer, String] project The ID or name of a project.
40
40
  # @param [String] ref Reference to commit.
41
+ # @param [Hash] variables Variables passed to pipelines
41
42
  # @return [Gitlab::ObjectifiedHash] The pipelines changes.
42
- def create_pipeline(project, ref)
43
- post("/projects/#{url_encode project}/pipeline?ref=#{ref}")
43
+ def create_pipeline(project, ref, variables = {})
44
+ body = {}
45
+
46
+ # This mapping is necessary, cause the API expects an array with objects (with `key` and `value` keys)
47
+ # See: https://docs.gitlab.com/ee/api/pipelines.html#create-a-new-pipeline
48
+ body[:variables] = variables.map { |(key, value)| { key: key, value: value } } if variables.any?
49
+
50
+ post(
51
+ "/projects/#{url_encode project}/pipeline",
52
+ query: { ref: ref },
53
+ body: body
54
+ )
44
55
  end
45
56
 
46
57
  # Cancels a pipeline.
@@ -467,6 +467,18 @@ class Gitlab::Client
467
467
  delete("/projects/#{url_encode project}/share/#{id}")
468
468
  end
469
469
 
470
+ # Transfer a project to a new namespace.
471
+ #
472
+ # @example
473
+ # Gitlab.transfer_project(42, 'yolo')
474
+ #
475
+ # @param [Integer, String] project The ID or path of a project
476
+ # @param [Integer, String] namespace The ID or path of the namespace to transfer to project to
477
+ # @return [Gitlab::ObjectifiedHash] Information about transfered project.
478
+ def transfer_project(project, namespace)
479
+ put("/projects/#{url_encode project}/transfer", body: { namespace: namespace })
480
+ end
481
+
470
482
  # Stars a project.
471
483
  # @see https://docs.gitlab.com/ce/api/projects.html#star-a-project
472
484
  #
@@ -59,7 +59,7 @@ module Gitlab
59
59
  case message
60
60
  when Gitlab::ObjectifiedHash
61
61
  message.to_h.sort.map do |key, val|
62
- "'#{key}' #{(val.is_a?(Hash) ? val.sort.map { |k, v| "(#{k}: #{v.join(' ')})" } : val).join(' ')}"
62
+ "'#{key}' #{(val.is_a?(Hash) ? val.sort.map { |k, v| "(#{k}: #{v.join(' ')})" } : [val].flatten).join(' ')}"
63
63
  end.join(', ')
64
64
  when Array
65
65
  message.join(' ')
@@ -7,7 +7,7 @@ module Gitlab
7
7
  class PageLinks
8
8
  HEADER_LINK = 'Link'
9
9
  DELIM_LINKS = ','
10
- LINK_REGEX = /<([^>]+)>; rel=\"([^\"]+)\"/
10
+ LINK_REGEX = /<([^>]+)>; rel=\"([^\"]+)\"/.freeze
11
11
  METAS = %w[last next first prev].freeze
12
12
 
13
13
  attr_accessor(*METAS)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gitlab
4
- VERSION = '4.6.1'
4
+ VERSION = '4.7.0'
5
5
  end
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.6.1
4
+ version: 4.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nihad Abbasov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-10-15 00:00:00.000000000 Z
12
+ date: 2018-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  version: '0'
204
204
  requirements: []
205
205
  rubyforge_project:
206
- rubygems_version: 2.7.7
206
+ rubygems_version: 2.7.8
207
207
  signing_key:
208
208
  specification_version: 4
209
209
  summary: A Ruby wrapper and CLI for the GitLab API