GitLab API | gitlab gem で グループの一覧を取得する
概要
gitlab gem で グループの一覧を取得します
サンプル
require 'gitlab'
require 'tbpgr_utils'
Gitlab.configure do |config|
config.endpoint = 'http://some_path/api/v3'
config.private_token = 'your token'
end
groups = Gitlab.groups
bulk_puts_eval binding, <<-EOS
groups.first.id
groups.first.name
groups.first.path
groups.first.owner_id
EOS
__END__
下記はTbpgrUtils gemの機能
bulk_puts_eval
https://rubygems.org/gems/tbpgr_utils
https://github.com/tbpgr/tbpgr_utils
出力
groups.first.id # => 4
groups.first.name # => "SampleGroup"
groups.first.path # => "samplegroup"
groups.first.owner_id # => nil
参照
GitLab gem RubyGems
https://rubygems.org/gems/gitlabGitLab gem GitHub
https://github.com/NARKOZ/gitlab