mirror of
https://github.com/teampoltergeist/poltergeist.git
synced 2022-11-09 12:05:00 -05:00

posix-spawn relies on a C extension. This does work under JRuby, but it won't work on Travis CI as they disallow JRuby C extensions, as they are considered to not be a good practice. Instead we are using either Process.spawn on Ruby 1.9, or the childprocess gem on Ruby 1.8. childprocess uses native JVM APIs on JRuby, and fork+exec on others.
17 lines
310 B
Ruby
17 lines
310 B
Ruby
require 'childprocess'
|
|
|
|
module Capybara::Poltergeist
|
|
module Spawn
|
|
def self.spawn(*args)
|
|
args = args.map(&:to_s)
|
|
|
|
if RUBY_VERSION >= "1.9"
|
|
Process.spawn(*args)
|
|
else
|
|
process = ChildProcess.build(*args)
|
|
process.start
|
|
process.pid
|
|
end
|
|
end
|
|
end
|
|
end
|