class Gabrake::Collector::Event

Public Class Methods

new(exception) click to toggle source
# File lib/gabrake/collector.rb, line 29
def initialize(exception)
  @exception = exception
end

Public Instance Methods

action() click to toggle source
# File lib/gabrake/collector.rb, line 37
def action
  @message ||= "#{@exception.class}: #{@exception.message}"
end
category() click to toggle source
# File lib/gabrake/collector.rb, line 33
def category
  'Gabrake (Rails)'
end
label() click to toggle source
# File lib/gabrake/collector.rb, line 41
def label
  "#{location.gsub(/\A#{::Rails.root}\//, '')}" if location
end

Private Instance Methods

location() click to toggle source
# File lib/gabrake/collector.rb, line 47
def location
  return @location if @location

  backtrace = @exception.backtrace.try(:first)

  return unless backtrace

  @location = backtrace.match(/\A(.+?:\d+)/)[1]
end