Sha256: 408ed91bc0179642955cf31929fb70eadca871735418bd19f938809a68125a8d
Contents?: true
Size: 485 Bytes
Versions: 13
Compression:
Stored size: 485 Bytes
Contents
module Specjour::Fork module_function # fork, but don't run the parent's exit handlers # The one exit handler we lose however, is the printing out # of exceptions, so reincorporate that. def fork Kernel.fork do at_exit { exit! } begin yield rescue StandardError => e $stderr.puts "#{e.class} #{e.message}", e.backtrace end end end def fork_quietly fork do $stdout = StringIO.new yield end end end
Version data entries
13 entries across 13 versions & 1 rubygems