Sha256: 4b7ba125e93b46a9f539bd21691048e2365b554bbed2c80bd26884364a833e1f

Contents?: true

Size: 623 Bytes

Versions: 45

Compression:

Stored size: 623 Bytes

Contents

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

45 entries across 45 versions & 1 rubygems

Version Path
fig-1.23.0 lib/fig/at_exit.rb
fig-1.22.1.beta.1 lib/fig/at_exit.rb
fig-1.22.0 lib/fig/at_exit.rb
fig-1.21.1.beta.2 lib/fig/at_exit.rb
fig-1.21.1.beta.1 lib/fig/at_exit.rb
fig-1.21.0 lib/fig/at_exit.rb
fig-1.20.1.beta.1 lib/fig/at_exit.rb
fig-1.20.0 lib/fig/at_exit.rb
fig-1.19.0 lib/fig/at_exit.rb
fig-1.18.0 lib/fig/at_exit.rb
fig-1.17.0 lib/fig/at_exit.rb
fig-1.16.1.beta.1 lib/fig/at_exit.rb
fig-1.16.0 lib/fig/at_exit.rb
fig-1.15.1.beta.2 lib/fig/at_exit.rb
fig-1.15.1.beta.1 lib/fig/at_exit.rb
fig-1.15.0 lib/fig/at_exit.rb
fig-1.14.0 lib/fig/at_exit.rb
fig-1.13.0 lib/fig/at_exit.rb
fig-1.12.0 lib/fig/at_exit.rb
fig-1.11.0 lib/fig/at_exit.rb