Sha256: 36acfa0fe09ada8fe739accc51749d6ef2fc4ab7f0c28500e907f9d4eb567255
Contents?: true
Size: 1.16 KB
Versions: 34
Compression:
Stored size: 1.16 KB
Contents
require 'base64' $options = Marshal.load( Base64.strict_decode64( ARGV.pop ) ) if !$options[:without_cuboid] require 'cuboid' include Cuboid cuboid_options = Marshal.load( Base64.strict_decode64( ENV['CUBOID_SPAWN_OPTIONS'] ) ) Options.update cuboid_options require( Options.paths.application ) if Options.paths.application else if Gem.win_platform? require 'Win32API' require 'win32ole' end end def ppid $options[:ppid] end def parent_alive? # Windows is not big on POSIX so try it its own way if possible. if Gem.win_platform? begin alive = false wmi = WIN32OLE.connect( 'winmgmts://' ) processes = wmi.ExecQuery( "select ProcessId from win32_process where ProcessID='#{ppid}'") processes.each do |proc| proc.ole_free alive = true end processes.ole_free wmi.ole_free return alive rescue WIN32OLERuntimeError end end !!(Process.kill( 0, ppid ) rescue false) end def puts_stderr( str ) return if $stderr.closed? $stderr.puts str rescue end load ARGV.pop
Version data entries
34 entries across 34 versions & 1 rubygems