Sha256: d11c4c8492632847d25dae49b3f46133668c591ca778cbf0af4810ea6d82effc
Contents?: true
Size: 1.11 KB
Versions: 160
Compression:
Stored size: 1.11 KB
Contents
# frozen_string_literal: true module Appsignal class Hooks # @api private 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 Exception => error # rubocop:disable Lint/RescueException # Format given arguments and cast to hash if possible params, _ = args params = params.to_hash if params.respond_to?(:to_hash) transaction = Appsignal::Transaction.create( SecureRandom.uuid, Appsignal::Transaction::BACKGROUND_JOB, Appsignal::Transaction::GenericRequest.new( :params => params ) ) transaction.set_action(name) transaction.set_error(error) transaction.complete Appsignal.stop("rake") raise error end end end end end end
Version data entries
160 entries across 160 versions & 1 rubygems