LoginSignup
4
4

More than 5 years have passed since last update.

GitLab API | gitlab gem で プロジェクトのURL、リポジトリのURLの取得

Posted at

GitLab API | gitlab gem で プロジェクトのURL、リポジトリのURLの取得

概要

gitlab gem で プロジェクトのURL、リポジトリのURLの取得

サンプル

require 'pp'
require 'gitlab'

Gitlab.configure do |config|
  config.endpoint       = 'http://some_path/api/v3' 
  config.private_token  = 'your token'
end
projects =  Gitlab.projects

pp projects.first.ssh_url_to_repo
pp projects.first.http_url_to_repo
pp projects.first.web_url

出力

"git@some_ip:some_group/some_project_name.git"
"http://some_ip/some_group/some_project_name.git"
"http://some_ip/some_group/some_project_name"

参照

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4