Module: Honeybadger::RakeHandler

Defined in:
lib/honeybadger/init/rake.rb

Defined Under Namespace

Modules: Rake087Methods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object


6
7
8
9
10
11
12
# File 'lib/honeybadger/init/rake.rb', line 6

def self.included(klass)
  klass.class_eval do
    include Rake087Methods unless defined?(Rake::VERSION) && Rake::VERSION >= '0.9.0'
    alias_method :display_error_message_without_honeybadger, :display_error_message
    alias_method :display_error_message, :display_error_message_with_honeybadger
  end
end

Instance Method Details

#display_error_message_with_honeybadger(ex) ⇒ Object


14
15
16
17
18
19
# File 'lib/honeybadger/init/rake.rb', line 14

def display_error_message_with_honeybadger(ex)
  Honeybadger.notify(ex, origin: :rake, component: reconstruct_command_line)
  display_error_message_without_honeybadger(ex)
ensure
  Honeybadger.context.clear!
end

#reconstruct_command_lineObject


21
22
23
# File 'lib/honeybadger/init/rake.rb', line 21

def reconstruct_command_line
  "rake #{ARGV.join( ' ' )}"
end