Sha256: a5ac7579e905897777676190542e1d57da86d28987ee490279e3ba26df1dcd84

Contents?: true

Size: 583 Bytes

Versions: 12

Compression:

Stored size: 583 Bytes

Contents

# frozen_string_literal: true

module Coverband
  class AtExit
    @semaphore = Mutex.new

    @at_exit_registered = nil
    def self.register
      return if ENV["COVERBAND_DISABLE_AT_EXIT"]
      return if @at_exit_registered

      @semaphore.synchronize do
        return if @at_exit_registered

        @at_exit_registered = true
        at_exit do
          ::Coverband::Background.stop

          if !Coverband.configuration.report_on_exit
            # skip reporting
          else
            Coverband.report_coverage
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
coverband-5.1.0.rcmailer.1 lib/coverband/at_exit.rb
coverband-5.0.3 lib/coverband/at_exit.rb
coverband-5.0.2 lib/coverband/at_exit.rb
coverband-5.0.1 lib/coverband/at_exit.rb
coverband-5.0.1.rc.1 lib/coverband/at_exit.rb
coverband-5.0.0 lib/coverband/at_exit.rb
coverband-5.0.0.rc.8 lib/coverband/at_exit.rb
coverband-5.0.0.rc.7 lib/coverband/at_exit.rb
coverband-5.0.0.rc.6 lib/coverband/at_exit.rb
coverband-5.0.0.rc.5 lib/coverband/at_exit.rb
coverband-5.0.0.rc.4 lib/coverband/at_exit.rb
coverband-5.0.0.rc.3 lib/coverband/at_exit.rb