Method: ChildProcess.posix_spawn?

Defined in:
lib/childprocess.rb

.posix_spawn?Boolean



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/childprocess.rb', line 72

def posix_spawn?
  enabled = @posix_spawn || %w[1 true].include?(ENV['CHILDPROCESS_POSIX_SPAWN'])
  return false unless enabled

  begin
    require 'ffi'
  rescue LoadError
    raise ChildProcess::MissingFFIError
  end

  begin
    require "childprocess/unix/platform/#{ChildProcess.platform_name}"
  rescue LoadError
    raise ChildProcess::MissingPlatformError
  end

  require "childprocess/unix/lib"
  require 'childprocess/unix/posix_spawn_process'

  true
rescue ChildProcess::MissingPlatformError => ex
  warn_once ex.message
  false
end