NARKOZ / gitlab

Ruby wrapper and CLI for the GitLab REST API
https://narkoz.github.io/gitlab
BSD 2-Clause "Simplified" License
1.06k stars 394 forks source link

Config location #636

Closed VovkaSOL closed 2 years ago

VovkaSOL commented 2 years ago

Hi, sorry, but i can't understand, where config file located with this parameters:

Usage Configuration example:

Gitlab.configure do |config| config.endpoint = 'https://example.net/api/v4' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT'] and falls back to ENV['CI_API_V4_URL'] config.private_token = 'qEsq1pt6HJPaNciie3MG' # user's private token or OAuth2 access token, default: ENV['GITLAB_API_PRIVATE_TOKEN']

Optional

config.user_agent = 'Custom User Agent' # user agent, default: 'Gitlab Ruby Gem [version]'

config.sudo = 'user' # username for sudo mode, default: nil

end (Note: If you are using GitLab.com's hosted service, your endpoint will be https://gitlab.com/api/v4)

Usage examples:

set an API endpoint

Gitlab.endpoint = 'https://example.net/api/v4'

=> "https://example.net/api/v4"

set a user private token

Gitlab.private_token = 'qEsq1pt6HJPaNciie3MG'

=> "qEsq1pt6HJPaNciie3MG"

configure a proxy server

Gitlab.http_proxy('proxyhost', 8888)

proxy server with basic auth

Gitlab.http_proxy('proxyhost', 8888, 'proxyuser', 'strongpasswordhere')

set timeout for responses

ENV['GITLAB_API_HTTPARTY_OPTIONS'] = '{read_timeout: 60}' .... sorry for issue, but in readme i can't found this information. I try to create Gemfile in run path, but it is not visible for gitlab command (like gitlab users)

NARKOZ commented 2 years ago

You should add it to your code before using client methods.