Merge pull request #291 from liveh2o/master

JRuby 1.9 doesn't require posix/spawn
This commit is contained in:
David Dollar
2013-01-14 05:08:10 -08:00
2 changed files with 3 additions and 3 deletions

View File

@@ -8,8 +8,8 @@ module Foreman
File.expand_path("../../bin/foreman-runner", __FILE__)
end
def self.jruby?
defined?(RUBY_PLATFORM) and RUBY_PLATFORM == "java"
def self.jruby_18?
defined?(RUBY_PLATFORM) and RUBY_PLATFORM == "java" and ruby_18?
end
def self.ruby_18?

View File

@@ -53,7 +53,7 @@ class Foreman::Process
Dir.chdir(cwd) do
Process.spawn env, expanded_command(env), :out => output, :err => output
end
elsif Foreman.jruby?
elsif Foreman.jruby_18?
require "posix/spawn"
wrapped_command = "#{Foreman.runner} -d '#{cwd}' -p -- #{command}"
POSIX::Spawn.spawn env, wrapped_command, :out => output, :err => output