Sha256: 7dfddaaf71db2fd2365db9a95b9628577e7052a642ff7ad49c55b4335df2973f
Contents?: true
Size: 1.01 KB
Versions: 6
Compression:
Stored size: 1.01 KB
Contents
Prospectus.extra_dep('gitlab_api', 'keylime') Prospectus.extra_dep('gitlab_api', 'gitlab') module LogCabin module Modules ## # Provide an api method for modules to query GitLab module GitlabApi def gitlab_api @gitlab_api ||= Gitlab.client( endpoint: gitlab_endpoint + '/api/v4', private_token: gitlab_token ) end private def gitlab_token @gitlab_token ||= token_from_file @gitlab_token ||= Keylime.new( server: gitlab_endpoint, account: 'prospectus' ).get!("GitLab API token (#{gitlab_endpoint}/profile/account)").password end def token_from_file return unless File.exist? File.expand_path('~/.gitlab_api') File.read('~/.gitlab_api').strip end def gitlab_endpoint @gitlab_endpoint ||= 'https://gitlab.com' end def repo(value) @repo = value end def endpoint(value) @gitlab_endpoint = value end end end end
Version data entries
6 entries across 6 versions & 1 rubygems