Sha256: 6396cc0eeec94012a8227ec8ff2fc164d8f73eccae9a8a1b3bacaccdf8aa1444

Contents?: true

Size: 869 Bytes

Versions: 63

Compression:

Stored size: 869 Bytes

Contents

module Appsignal
  class Hooks
    class RakeHook < Appsignal::Hooks::Hook
      register :rake

      def dependencies_present?
        defined?(::Rake::Task)
      end

      def install
        ::Rake::Task.class_eval do
          alias :execute_without_appsignal :execute

          def execute(*args)
            execute_without_appsignal(*args)
          rescue => error
            transaction = Appsignal::Transaction.create(
              SecureRandom.uuid,
              Appsignal::Transaction::BACKGROUND_JOB,
              Appsignal::Transaction::GenericRequest.new(
                :params => args
              )
            )
            transaction.set_action(name)
            transaction.set_error(error)
            transaction.complete
            Appsignal.stop('rake')
            raise error
          end
        end
      end
    end
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
appsignal-1.2.1.beta.2 lib/appsignal/hooks/rake.rb
appsignal-1.2.1.beta.1 lib/appsignal/hooks/rake.rb
appsignal-1.2.0 lib/appsignal/hooks/rake.rb
appsignal-1.2.0.beta.1 lib/appsignal/hooks/rake.rb
appsignal-1.2.0.alpha.6 lib/appsignal/hooks/rake.rb
appsignal-1.2.0.alpha.5 lib/appsignal/hooks/rake.rb
appsignal-1.2.0.alpha.4 lib/appsignal/hooks/rake.rb
appsignal-1.1.9 lib/appsignal/hooks/rake.rb
appsignal-1.1.9.beta.2 lib/appsignal/hooks/rake.rb
appsignal-1.1.9.beta.1 lib/appsignal/hooks/rake.rb
appsignal-1.1.8 lib/appsignal/hooks/rake.rb
appsignal-1.2.0.alpha.3 lib/appsignal/hooks/rake.rb
appsignal-1.1.7 lib/appsignal/hooks/rake.rb
appsignal-1.2.0.alpha.2 lib/appsignal/hooks/rake.rb
appsignal-1.1.7.beta.2 lib/appsignal/hooks/rake.rb
appsignal-1.2.0.alpha.1 lib/appsignal/hooks/rake.rb
appsignal-1.1.7.beta.1 lib/appsignal/hooks/rake.rb
appsignal-1.1.6 lib/appsignal/hooks/rake.rb
appsignal-1.1.6.beta.1 lib/appsignal/hooks/rake.rb
appsignal-1.1.5 lib/appsignal/hooks/rake.rb