Sha256: 6ce47193ddd1c6480b5ed915509e2ddc16097ba3ca7b3a2154417493c824c5a3

Contents?: true

Size: 781 Bytes

Versions: 15

Compression:

Stored size: 781 Bytes

Contents

require 'rake'

module RuntimeerrorNotifier
  module RakeHandler
    def self.included(base)
      base.class_eval do
        alias_method :display_errors_without_runtimeerror, :display_error_message
        alias_method :display_error_message, :display_errors_with_runtimeerror
      end
    end

    def display_errors_with_runtimeerror(excp)
      RuntimeerrorNotifier::Notifier.notification(environment_info, excp)
      display_errors_without_runtimeerror(excp)
    end

    def environment_info
      { component: 'rake', action: command_line_info, rake_env: ENV}
    end

    def command_line_info
      ARGV.join(' ')
    end
  end
end

# Hook to capture rake errors
Rake.application.instance_eval do
  class << self
    include RuntimeerrorNotifier::RakeHandler
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
runtimeerror_notifier-0.0.27 lib/runtimeerror_notifier/rake_handler.rb
runtimeerror_notifier-0.0.26 lib/runtimeerror_notifier/rake_handler.rb
runtimeerror_notifier-0.0.25 lib/runtimeerror_notifier/rake_handler.rb
runtimeerror_notifier-0.0.24 lib/runtimeerror_notifier/rake_handler.rb
runtimeerror_notifier-0.0.23 lib/runtimeerror_notifier/rake_handler.rb
runtimeerror_notifier-0.0.22 lib/runtimeerror_notifier/rake_handler.rb
runtimeerror_notifier-0.0.21 lib/runtimeerror_notifier/rake_handler.rb
runtimeerror_notifier-0.0.20 lib/runtimeerror_notifier/rake_handler.rb
runtimeerror_notifier-0.0.19 lib/runtimeerror_notifier/rake_handler.rb
runtimeerror_notifier-0.0.18 lib/runtimeerror_notifier/rake_handler.rb
runtimeerror_notifier-0.0.17 lib/runtimeerror_notifier/rake_handler.rb
runtimeerror_notifier-0.0.15 lib/runtimeerror_notifier/rake_handler.rb
runtimeerror_notifier-0.0.14 lib/runtimeerror_notifier/rake_handler.rb
runtimeerror_notifier-0.0.13 lib/runtimeerror_notifier/rake_handler.rb
runtimeerror_notifier-0.0.12 lib/runtimeerror_notifier/rake_handler.rb