Module: Honeybadger::RakeHandler Private

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

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Patch Rake::Application to handle errors with Honeybadger

Defined Under Namespace

Modules: Rake087Methods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

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

#reconstruct_command_lineObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

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