fs-gitlab 4.19.1 → 4.19.3
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/README.md +3 -10
- data/lib/gitlab/client/project_access_tokens.rb +46 -0
- data/lib/gitlab/client.rb +1 -0
- data/lib/gitlab/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22e2342fad2bb037dcc812fb0521579fd0b2adda20d87ef2a997a072b97167e3
|
4
|
+
data.tar.gz: 83d254fd49f121a5d61f423fd04edc34cf117326c7a8db8e4a4bd9158b856f2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/lib/gitlab/version.rb
CHANGED
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.
|
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
|
+
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
|