class Raygun::GitlabClient

Attributes

endpoint[RW]
token[RW]
uri[RW]

Public Class Methods

new(endpoint) click to toggle source
# File lib/raygun/gitlab_client.rb, line 7
def initialize(endpoint)
  @endpoint = URI.parse(endpoint)
  @token = ENV['GITLAB_API_PRIVATE_TOKEN']
  unless `which security`.empty?
    cmd = "security 2>&1 >/dev/null find-generic-password -g -l#{@endpoint.host}-private-token"
    @token ||= `#{cmd}`.gsub(/password: *"([^"]+)"\n/, '\1')
  end
  Gitlab.configure do |config|
    config.endpoint       = endpoint
    config.private_token  = @token
  end
end

Public Instance Methods

domain() click to toggle source
# File lib/raygun/gitlab_client.rb, line 20
def domain
  endpoint.host
end