You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by dj...@apache.org on 2009/06/23 02:06:42 UTC
svn commit: r787484 - /buildr/trunk/lib/buildr/core/shell.rb
Author: djspiewak
Date: Tue Jun 23 00:06:41 2009
New Revision: 787484
URL: http://svn.apache.org/viewvc?rev=787484&view=rev
Log:
Added JavaRebel support for JIRB
Modified:
buildr/trunk/lib/buildr/core/shell.rb
Modified: buildr/trunk/lib/buildr/core/shell.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/shell.rb?rev=787484&r1=787483&r2=787484&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/shell.rb (original)
+++ buildr/trunk/lib/buildr/core/shell.rb Tue Jun 23 00:06:41 2009
@@ -4,7 +4,9 @@
module Buildr
module Shell
class JIRB < Base
- SUFFIX = if Util.win_os? then '.bat' else '' end
+ include JavaRebel
+
+ JRUBY_VERSION = '1.1.6'
class << self
def lang
@@ -13,20 +15,16 @@
end
def launch
- fail 'Are we forgetting something? JRUBY_HOME not set.' unless jruby_home
-
- cp = project.compile.dependencies.join(File::PATH_SEPARATOR) +
- File::PATH_SEPARATOR + project.path_to(:target, :classes)
-
- cp_var = ENV['CLASSPATH']
- if cp_var
- ENV['CLASSPATH'] += File::PATH_SEPARATOR
- else
- ENV['CLASSPATH'] = ''
- end
- ENV['CLASSPATH'] += cp
+ cp = project.compile.dependencies + [
+ "org.jruby:jruby-complete:jar:#{JRUBY_VERSION}",
+ project.path_to(:target, :classes)
+ ]
- system(File.expand_path('bin/jirb' + SUFFIX, jruby_home))
+ Java::Commands.java 'org.jruby.Main', '--command', 'irb', {
+ :properties => rebel_props(project),
+ :classpath => cp,
+ :java_args => rebel_args
+ }
end
private