fs-gitlab 4.19.1 → 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: 9e4984e7691363572b1a54014c75add8440ab4c240e730d387d22bdc93e86b71
4
- data.tar.gz: f8a78ba35922b97efd3b329b8a92b8357c473cce70da430aca68782e2a002325
3
+ metadata.gz: 22e2342fad2bb037dcc812fb0521579fd0b2adda20d87ef2a997a072b97167e3
4
+ data.tar.gz: 83d254fd49f121a5d61f423fd04edc34cf117326c7a8db8e4a4bd9158b856f2e
5
5
  SHA512:
6
- metadata.gz: 58860a5afdb7c24d9897fc0f932e7ab430d1e6e6c8fd072c384b28ebe421f75bbafb5e71c42f9d50982ca690596ed5e71dfd32621d188ca69f6075aa46309132
7
- data.tar.gz: 2c9ca3f8ac27a033992fe13be4a9c9fce3e8bc546a2d451b25149e95bf5d9c14d7d06d12658df0b4181d7ffa466cac4ec9894a627433623360e6372141f63d15
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.1'
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.1
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-01 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