Skip to content

Commit

Permalink
JariBakken: Launch JRuby in-process.
Browse files Browse the repository at this point in the history
r9907
  • Loading branch information
jarib committed Oct 10, 2010
1 parent 86f6d9d commit e5038cf
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

java -Djruby.launch.inproc=false -jar third_party/jruby/jruby-complete-1.5.0.RC2.jar -S rake $*
java -jar third_party/jruby/jruby-complete-1.5.0.RC2.jar -S rake $*
2 changes: 1 addition & 1 deletion go.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
java -Djruby.launch.inproc=false -jar third_party\jruby\jruby-complete-1.5.0.RC2.jar -S rake %*
java -jar third_party\jruby\jruby-complete-1.5.0.RC2.jar -S rake %*
15 changes: 5 additions & 10 deletions rake-tasks/crazy_fun/mappings/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,13 @@ class RubyRunner
JRUBY_JAR = "third_party/jruby/jruby-complete-1.5.0.RC2.jar"

def self.run(impl, opts)
cmd = []
cmd = ["ruby"]

case impl.to_sym
when :jruby
cmd << "java"
cmd << "-Djava.awt.headless=true" if opts[:headless]
cmd << "-jar" << JRUBY_JAR
if impl.to_sym == :jruby
JRuby.runtime.instance_config.run_ruby_in_process = true
cmd << "-J-Djava.awt.headless=true" if opts[:headless]
else
cmd << impl.to_s
JRuby.runtime.instance_config.run_ruby_in_process = false
end

if opts[:debug]
Expand Down Expand Up @@ -286,9 +284,6 @@ def jruby(opts)
RubyRunner.run :jruby, opts
end


def ruby(opts)
# if we're running on jruby, -Djruby.launch.inproc=false needs to be set for this to work.
# otherwise sh("ruby", ...) will reuse the current JVM
RubyRunner.run :ruby, opts
end
5 changes: 1 addition & 4 deletions rb/spec/selenium/webdriver/support/jruby_test_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ def quit
private

def in_process_test_environment
@in_process_test_environment ||= begin
puts "creating InProcessTestEnvironment"
org.openqa.selenium.environment.InProcessTestEnvironment.new
end
@in_process_test_environment ||= org.openqa.selenium.environment.InProcessTestEnvironment.new
end

end # JRubyTestEnvironmnet
Expand Down
2 changes: 1 addition & 1 deletion rb/spec/selenium/webdriver/support/test_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class TestEnvironment
attr_accessor :unguarded

def initialize
puts "creating #{self.class} :: #{RUBY_DESCRIPTION}"
puts "creating test env :: #{RUBY_DESCRIPTION}"
end

def driver
Expand Down

0 comments on commit e5038cf

Please sign in to comment.