fs-gitlab 4.19.2 → 4.19.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d6d237e2560e667f245a972f4955cb565bf54a11793137ee819048102d70d92
4
- data.tar.gz: 12dec2346fa278c5a0bd9a518387551ed91a95b699d9da12dd0e4ade930c4a5e
3
+ metadata.gz: 22e2342fad2bb037dcc812fb0521579fd0b2adda20d87ef2a997a072b97167e3
4
+ data.tar.gz: 83d254fd49f121a5d61f423fd04edc34cf117326c7a8db8e4a4bd9158b856f2e
5
5
  SHA512:
6
- metadata.gz: b6840b7449765f86a91998f25cc571bb7205e45db612de1461bc5b61176c1da757f36b1a488024181daa9f4636c504bb16e25db135b8e7fa55d2245c39aafa8c
7
- data.tar.gz: 285c72e97a516ae67425c8e038246acaa290dfd0815f37b695d33cc994083f6a4a7d13d870c6af6388417565045edbf2164d24492283c98c50a88cb33051af9b
6
+ metadata.gz: 704f80e2fba957da9469f310a20bd64028a35b0e51687128cbbde7caa5e708225549a69a1cfe4751cc13b12f5de2019db6f93b21fa9ce8152b6c169e6034ac67
7
+ data.tar.gz: 3a22557e6dd4cd9227fe49a5bc6cc01c6632f9edd043927d37dfb0f52f79d00b5bb4e890db4b43128515644eb6daf50ba579eff7b6ff1949ad59e19a89b7a987
data/README.md CHANGED
@@ -15,20 +15,13 @@ Gitlab is a Ruby wrapper and CLI for the [GitLab API](https://docs.gitlab.com/ee
15
15
  Install it from rubygems:
16
16
 
17
17
  ```sh
18
- gem install gitlab
18
+ gem install fs-gitlab
19
19
  ```
20
20
 
21
21
  Or add to a Gemfile:
22
22
 
23
23
  ```ruby
24
- gem 'gitlab'
25
- # gem 'gitlab', github: 'NARKOZ/gitlab'
26
- ```
27
-
28
- Mac OS users can install using Homebrew (may not be the latest version):
29
-
30
- ```sh
31
- brew install gitlab-gem
24
+ gem 'fs-gitlab'
32
25
  ```
33
26
 
34
27
  ## Usage
@@ -186,7 +179,7 @@ gitlab> protect_branch 1 master
186
179
  gitlab> create_merge_request 4 "New merge request" "{source_branch: 'new_branch', target_branch: 'master', assignee_id: 42}"
187
180
  ```
188
181
 
189
- Web version is available at https://gitlab-live.herokuapp.com
182
+ Web version is available at https://gitlab-live.herokuapp.com
190
183
  For more information, refer to [website](https://narkoz.github.io/gitlab).
191
184
 
192
185
  ## Development
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Gitlab::Client
4
+ # Defines methods related to project access tokens.
5
+ # @see https://docs.gitlab.com/ee/api/project_access_tokens.html
6
+ module ProjectAccessTokens
7
+ # Gets a list of a projects access tokens.
8
+ #
9
+ # @example
10
+ # Gitlab.project_access_tokens(5)
11
+ #
12
+ # @param [Integer, String] project The ID or name of a project.
13
+ # @return [Array<Gitlab::ObjectifiedHash>] List of all access tokens of a project
14
+ def project_access_tokens(project)
15
+ get("/projects/#{url_encode project}/access_tokens")
16
+ end
17
+
18
+ # Gets an access token of a project.
19
+ #
20
+ # @example
21
+ # Gitlab.project_access_token(5, 42)
22
+ #
23
+ # @param [Integer, String] project The ID or name of a project.
24
+ # @param [Integer] token_id The token ID.
25
+ # @return [Gitlab::ObjectifiedHash] Information about the requested access token
26
+ def project_access_token(project, token_id)
27
+ get("/projects/#{url_encode project}/access_tokens/#{token_id}")
28
+ end
29
+
30
+ # Create a project access token.
31
+ #
32
+ # @example
33
+ # Gitlab.create_project_access_token(5, { name: "test_token", scopes: ["api", "read_repository"], expires_at: "2021-01-01"})
34
+ #
35
+ # @param [Integer, String] project The ID or name of a project.
36
+ # @param [Hash] options A customizable set of options.
37
+ # @option options [String] :name(required) Name of the token
38
+ # @option options [List[String]] :scopes(required) List of api scopes
39
+ # @option options [String] :expires_at(required) Expiration date in the format (YYYY-MM-DD)
40
+ # @option options [String] :access_level(optional) Access level of the token (Defaults to 40 (maintainer access))
41
+ # @return [Gitlab::ObjectifiedHash] Information about the created project access token.
42
+ def create_project_access_token(project, options = {})
43
+ post("/projects/#{url_encode project}/access_tokens", body: options)
44
+ end
45
+ end
46
+ end
data/lib/gitlab/client.rb CHANGED
@@ -44,6 +44,7 @@ module Gitlab
44
44
  include PipelineSchedules
45
45
  include PipelineTriggers
46
46
  include Pipelines
47
+ include ProjectAccessTokens
47
48
  include ProjectBadges
48
49
  include ProjectClusters
49
50
  include ProjectReleaseLinks
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gitlab
4
- VERSION = '4.19.2'
4
+ VERSION = '4.19.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fs-gitlab
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.19.2
4
+ version: 4.19.3
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: 2024-03-12 00:00:00.000000000 Z
12
+ date: 2024-03-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -137,6 +137,7 @@ files:
137
137
  - lib/gitlab/client/pipeline_schedules.rb
138
138
  - lib/gitlab/client/pipeline_triggers.rb
139
139
  - lib/gitlab/client/pipelines.rb
140
+ - lib/gitlab/client/project_access_tokens.rb
140
141
  - lib/gitlab/client/project_badges.rb
141
142
  - lib/gitlab/client/project_clusters.rb
142
143
  - lib/gitlab/client/project_release_links.rb