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"
参照
GitLab gem RubyGems
https://rubygems.org/gems/gitlabGitLab gem GitHub
https://github.com/NARKOZ/gitlab