README.md in gitlab-4.18.0 vs README.md in gitlab-4.19.0
- old
+ new
@@ -1,18 +1,16 @@
# Gitlab
-[![Build Status](https://img.shields.io/github/workflow/status/NARKOZ/gitlab/CI/master)](https://github.com/NARKOZ/gitlab/actions?query=workflow%3ARuby)
-[![Inline docs](https://inch-ci.org/github/NARKOZ/gitlab.svg)](https://inch-ci.org/github/NARKOZ/gitlab)
+[![Build Status](https://img.shields.io/github/workflow/status/NARKOZ/gitlab/CI/master)](https://github.com/NARKOZ/gitlab/actions/workflows/ci.yml)
[![Gem version](https://img.shields.io/gem/v/gitlab.svg)](https://rubygems.org/gems/gitlab)
[![License](https://img.shields.io/badge/license-BSD-red.svg)](https://github.com/NARKOZ/gitlab/blob/master/LICENSE.txt)
[website](https://narkoz.github.io/gitlab) |
[documentation](https://www.rubydoc.info/gems/gitlab/frames) |
[gitlab-live](https://github.com/NARKOZ/gitlab-live)
-Gitlab is a Ruby wrapper and CLI for the [GitLab API](https://docs.gitlab.com/ce/api/README.html).
-As of version `4.0.0` this gem only supports GitLab API v4.
+Gitlab is a Ruby wrapper and CLI for the [GitLab API](https://docs.gitlab.com/ee/api/index.html).
## Installation
Install it from rubygems:
@@ -95,10 +93,14 @@
# disable a sudo mode
Gitlab.sudo = nil
# => nil
+# set the private token to an empty string to make unauthenticated API requests
+Gitlab.private_token = ''
+# => ""
+
# a paginated response
projects = Gitlab.projects(per_page: 5)
# check existence of the next page
projects.has_next_page?
@@ -119,35 +121,36 @@
## CLI
It is possible to use this gem as a command line interface to GitLab. In order to make that work you need to set a few environment variables:
```sh
-export GITLAB_API_ENDPOINT=https://gitlab.yourcompany.com/api/v4
-export GITLAB_API_PRIVATE_TOKEN=<your private token from /profile/account or /profile/personal_access_tokens in newer version>
+export GITLAB_API_ENDPOINT=https://gitlab.example.com/api/v4
+export GITLAB_API_PRIVATE_TOKEN=<your private token from /profile/personal_access_tokens>
+
# This one is optional and can be used to set any HTTParty option you may need
# using YAML hash syntax. For example, this is how you would disable SSL
# verification (useful if using a self-signed cert).
export GITLAB_API_HTTPARTY_OPTIONS="{verify: false}"
```
Usage:
-When you want to know which CLI commands are supported, take a look at the client [commands implemented in this gem](https://www.rubydoc.info/gems/gitlab/4.5.0/Gitlab/Client). Any of those methods can be called as a command by passing the parameters of the commands as parameters of the CLI.
+When you want to know which CLI commands are supported, take a look at the client [commands implemented in this gem](https://www.rubydoc.info/gems/gitlab/4.18.0/Gitlab/Client). Any of those methods can be called as a command by passing the parameters of the commands as parameters of the CLI.
Usage examples:
```sh
# list users
-# see: https://www.rubydoc.info/gems/gitlab/4.5.0/Gitlab/Client/Users#users-instance_method
+# see: https://www.rubydoc.info/gems/gitlab/Gitlab/Client/Users#users-instance_method
gitlab users
# get current user
-# see: https://www.rubydoc.info/gems/gitlab/4.5.0/Gitlab/Client/Users#user-instance_method
+# see: https://www.rubydoc.info/gems/gitlab/Gitlab/Client/Users#user-instance_method
gitlab user
# get a user
-# see: https://www.rubydoc.info/gems/gitlab/4.5.0/Gitlab/Client/Users#user-instance_method
+# see: https://www.rubydoc.info/gems/gitlab/Gitlab/Client/Users#user-instance_method
gitlab user 2
# filter output
gitlab user --only=id,username
@@ -155,10 +158,10 @@
# get a user and render result as json
gitlab user 2 --json
# passing options hash to a command (use YAML)
-# see: https://www.rubydoc.info/gems/gitlab/4.5.0/Gitlab/Client/MergeRequests#create_merge_request-instance_method
+# see: https://www.rubydoc.info/gems/gitlab/Gitlab/Client/MergeRequests#create_merge_request-instance_method
gitlab create_merge_request 4 "New merge request" "{source_branch: 'new_branch', target_branch: 'master', assignee_id: 42}"
```
## CLI Shell