Permalink
Browse files

Since JRuby 1.9 doesn't require posix/spawn, only follow that path if…

… JRuby is loaded and running in 1.8 mode.
  • Loading branch information...
liveh2o committed Nov 28, 2012
1 parent 8fe86e9 commit 7ad41da59297e8b0816f719b77655175260a3428
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/foreman.rb
  2. +1 −1 lib/foreman/process.rb
View
@@ -8,8 +8,8 @@ def self.runner
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
@@ -53,7 +53,7 @@ def run(options={})
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

0 comments on commit 7ad41da

Please sign in to comment.