Sha256: 48ac695dd8588fb308869bf6e31b7e8917b79b69b5274b546b21d33b902e1d07

Contents?: true

Size: 640 Bytes

Versions: 15

Compression:

Stored size: 640 Bytes

Contents

# coding: utf-8

module Fig; end

# This exists because standard Kernel#at_exit blocks don't get run before
# Kernel#exec.
class Fig::AtExit
  def self.add(&block)
    EXIT_PROCS << block

    return
  end

  def self.execute()
    EXIT_PROCS.each do
      |proc|

      begin
        proc.call()
      rescue StandardError => exception
        $stderr.puts(
          [
            %q<Got exception from "at exit" processing.>,
            exception.message,
            exception.backtrace
          ].flatten.join("\n")
        )
      end
    end

    return
  end

  private

  EXIT_PROCS = []

  at_exit { Fig::AtExit.execute() }
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
fig-1.27.10 lib/fig/at_exit.rb
fig-1.27.8 lib/fig/at_exit.rb
fig-1.27.5 lib/fig/at_exit.rb
fig-1.27.4 lib/fig/at_exit.rb
fig-1.27.3 lib/fig/at_exit.rb
fig-1.27.0 lib/fig/at_exit.rb
fig-1.26.1.beta.1 lib/fig/at_exit.rb
fig-1.26.0 lib/fig/at_exit.rb
fig-1.25.1.beta.1 lib/fig/at_exit.rb
fig-1.25.0 lib/fig/at_exit.rb
fig-1.24.1.beta.3 lib/fig/at_exit.rb
fig-1.24.1.beta.2 lib/fig/at_exit.rb
fig-1.24.1.beta.1 lib/fig/at_exit.rb
fig-1.24.0 lib/fig/at_exit.rb
fig-1.23.1.beta.1 lib/fig/at_exit.rb