class ExceptionNotifier::GitlabNotifier

Public Class Methods

new(options) click to toggle source
# File lib/gitlab_exception_notification/gitlab_notifier.rb, line 5
def initialize(options)
  puts "On init, options => #{options.inspect}"
  @options = options
end

Public Instance Methods

call(exception, options={}) click to toggle source
# File lib/gitlab_exception_notification/gitlab_notifier.rb, line 20
def call(exception, options={})
  puts "On call, exception => #{exception.inspect}, options => #{options.inspect}"
  env = options[:env] || {}
  exception_notification(env, exception, @options.merge(options))
end
exception_notification(env, exception, options={}) click to toggle source
# File lib/gitlab_exception_notification/gitlab_notifier.rb, line 11
def exception_notification(env, exception, options={})
  issue = GitlabExceptionNotification::Issue.new(env, exception, options)
  if issue_id = issue.exists?
    issue.update(issue_id)
  else
    issue.create
  end
end