Class: Buildr::Shell::JIRB
- Includes:
- JavaRebel
- Defined in:
- lib/buildr/core/shell.rb
Constant Summary collapse
- JRUBY_VERSION =
'1.4.0'
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
Methods included from JavaRebel
#rebel_args, #rebel_home, #rebel_props
Methods inherited from Base
Constructor Details
This class inherits a constructor from Buildr::Shell::Base
Class Method Details
.lang ⇒ Object
66 67 68 |
# File 'lib/buildr/core/shell.rb', line 66 def lang :none end |
Instance Method Details
#launch ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/buildr/core/shell.rb', line 71 def launch if jruby_home # if JRuby is installed, use it cp = project.compile.dependencies + [project.path_to(:target, :classes)] + Dir.glob("#{jruby_home}#{File::SEPARATOR}lib#{File::SEPARATOR}*.jar") props = { 'jruby.home' => jruby_home, 'jruby.lib' => "#{jruby_home}#{File::SEPARATOR}lib" } if not Util.win_os? uname = `uname -m` cpu = if uname =~ /i[34567]86/ 'i386' elsif uname == 'i86pc' 'x86' elsif uname =~ /amd64|x86_64/ 'amd64' end os = `uname -s | tr '[A-Z]' '[a-z]'` path = if os == 'darwin' 'darwin' else "#{os}-#{cpu}" end props['jna.boot.library.path'] = "#{jruby_home}/lib/native/#{path}" end props['jruby.script'] = if Util.win_os? then 'jruby.bat' else 'jruby' end props['jruby.shell'] = if Util.win_os? then 'cmd.exe' else '/bin/sh' end args = [ "-Xbootclasspath/a:#{Dir.glob("#{jruby_home}#{File::SEPARATOR}lib#{File::SEPARATOR}jruby*.jar").join File::PATH_SEPARATOR}" ] Java::Commands.java 'org.jruby.Main', "#{jruby_home}#{File::SEPARATOR}bin#{File::SEPARATOR}jirb", { :properties => props.merge(rebel_props(project)), :classpath => cp, :java_args => args + rebel_args } else cp = project.compile.dependencies + [ jruby_artifact, project.path_to(:target, :classes) ] Java::Commands.java 'org.jruby.Main', '--command', 'irb', { :properties => rebel_props(project), :classpath => cp, :java_args => rebel_args } end end |