Merge pull request #291 from liveh2o/master
JRuby 1.9 doesn't require posix/spawn
This commit is contained in:
+2
-2
@@ -8,8 +8,8 @@ module Foreman
|
|||||||
File.expand_path("../../bin/foreman-runner", __FILE__)
|
File.expand_path("../../bin/foreman-runner", __FILE__)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.jruby?
|
def self.jruby_18?
|
||||||
defined?(RUBY_PLATFORM) and RUBY_PLATFORM == "java"
|
defined?(RUBY_PLATFORM) and RUBY_PLATFORM == "java" and ruby_18?
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.ruby_18?
|
def self.ruby_18?
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class Foreman::Process
|
|||||||
Dir.chdir(cwd) do
|
Dir.chdir(cwd) do
|
||||||
Process.spawn env, expanded_command(env), :out => output, :err => output
|
Process.spawn env, expanded_command(env), :out => output, :err => output
|
||||||
end
|
end
|
||||||
elsif Foreman.jruby?
|
elsif Foreman.jruby_18?
|
||||||
require "posix/spawn"
|
require "posix/spawn"
|
||||||
wrapped_command = "#{Foreman.runner} -d '#{cwd}' -p -- #{command}"
|
wrapped_command = "#{Foreman.runner} -d '#{cwd}' -p -- #{command}"
|
||||||
POSIX::Spawn.spawn env, wrapped_command, :out => output, :err => output
|
POSIX::Spawn.spawn env, wrapped_command, :out => output, :err => output
|
||||||
|
|||||||
Reference in New Issue
Block a user