Sha256: 0a2f6a68a185e3e4552c5a870bb2cbc55631840de1ef6c610ee7fe4c3a014b14

Contents?: true

Size: 769 Bytes

Versions: 50

Compression:

Stored size: 769 Bytes

Contents

# frozen_string_literal: true

Resque.after_fork do |_job|
  Coverband.start
  Coverband.runtime_coverage!
end

Resque.before_first_fork do
  Coverband.eager_loading_coverage!
  Coverband.configuration.background_reporting_enabled = false
  Coverband::Background.stop
  Coverband.report_coverage
end

module Coverband
  module ResqueWorker
    def perform
      super
    ensure
      Coverband.report_coverage
    end
  end
end

if defined?(Coverband::COVERBAND_ALTERNATE_PATCH)
  Resque::Job.class_eval do
    def perform_with_coverband
      perform_without_coverband
    ensure
      Coverband.report_coverage
    end
    alias perform_without_coverband perform
    alias perform perform_with_coverband
  end
else
  Resque::Job.prepend(Coverband::ResqueWorker)
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
coverband-6.1.4 lib/coverband/integrations/resque.rb
coverband-6.1.3 lib/coverband/integrations/resque.rb
coverband-6.1.2 lib/coverband/integrations/resque.rb
coverband-6.1.2.rc.1 lib/coverband/integrations/resque.rb
coverband-6.1.1 lib/coverband/integrations/resque.rb
coverband-6.1.0 lib/coverband/integrations/resque.rb
coverband-6.0.3.rc.4 lib/coverband/integrations/resque.rb
coverband-6.0.3.rc.3 lib/coverband/integrations/resque.rb
coverband-6.0.3.rc.2 lib/coverband/integrations/resque.rb
coverband-6.0.3.rc.1 lib/coverband/integrations/resque.rb
coverband-6.0.2 lib/coverband/integrations/resque.rb
coverband-6.0.1 lib/coverband/integrations/resque.rb
coverband-6.0.1.rc.1 lib/coverband/integrations/resque.rb
coverband-6.0.0 lib/coverband/integrations/resque.rb
coverband-5.2.6.rc.6 lib/coverband/integrations/resque.rb
coverband-5.2.3.2 lib/coverband/integrations/resque.rb
coverband-5.2.6.rc.5 lib/coverband/integrations/resque.rb
coverband-5.2.3.1 lib/coverband/integrations/resque.rb
coverband-5.2.6.rc.4 lib/coverband/integrations/resque.rb
coverband-5.2.6.rc.3 lib/coverband/integrations/resque.rb