Sha256: 86c7c2549dbb3246d42a3c1cbffab28772aba8281ef06164324ebb0da511a487

Contents?: true

Size: 583 Bytes

Versions: 20

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

20 entries across 20 versions & 1 rubygems

Version Path
coverband-4.2.7 lib/coverband/at_exit.rb
coverband-4.2.7.rc.1 lib/coverband/at_exit.rb
coverband-4.2.6 lib/coverband/at_exit.rb
coverband-4.2.5 lib/coverband/at_exit.rb
coverband-4.2.5.rc.2 lib/coverband/at_exit.rb
coverband-4.2.5.rc.1 lib/coverband/at_exit.rb
coverband-4.2.4 lib/coverband/at_exit.rb
coverband-4.2.4.rc.3 lib/coverband/at_exit.rb
coverband-4.2.4.rc.2 lib/coverband/at_exit.rb
coverband-4.2.4.rc.1 lib/coverband/at_exit.rb
coverband-4.2.3 lib/coverband/at_exit.rb
coverband-4.2.3.rc.2 lib/coverband/at_exit.rb
coverband-4.2.3.rc.1 lib/coverband/at_exit.rb
coverband-4.2.2 lib/coverband/at_exit.rb
coverband-4.2.2.rc.1 lib/coverband/at_exit.rb
coverband-4.2.1 lib/coverband/at_exit.rb
coverband-4.2.1.rc4 lib/coverband/at_exit.rb
coverband-4.2.1.rc3 lib/coverband/at_exit.rb
coverband-4.2.1.rc2 lib/coverband/at_exit.rb
coverband-4.2.1.rc1 lib/coverband/at_exit.rb