Sha256: 040b29fd03d5b76e876e0585b5edebc2e26f098f3d1aed49ad1ac9a002e66589

Contents?: true

Size: 179 Bytes

Versions: 4

Compression:

Stored size: 179 Bytes

Contents

module Signal
  def self.register_shutdown_handler(&block)
    %w(QUIT INT TERM).each do |sig|
      old = trap(sig) {}
      trap(sig) { block.call; old.call }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
madvertise-ext-0.5.3 lib/madvertise/ext/signal.rb
madvertise-ext-0.5.2 lib/madvertise/ext/signal.rb
madvertise-ext-0.5.1 lib/madvertise/ext/signal.rb
madvertise-ext-0.5.0 lib/madvertise/ext/signal.rb