File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ edge_gemspec = Gem::Specification.load File.join(__dir__, 'concurrent-ruby-edge.
18
18
19
19
require 'rake/javaextensiontask'
20
20
21
- JRUBY_JAR_PATH = '/usr/local/opt/rbenv/versions/jruby-9.1.17.0/lib/jruby.jar'
22
-
23
21
class ConcurrentRubyJavaExtensionTask < Rake ::JavaExtensionTask
24
22
def java_classpath_arg ( *args )
25
23
jruby_cpath = nil
@@ -42,10 +40,15 @@ class ConcurrentRubyJavaExtensionTask < Rake::JavaExtensionTask
42
40
end
43
41
44
42
unless jruby_cpath
45
- jruby_cpath = JRUBY_JAR_PATH
46
- raise "#{ jruby_cpath } does not exist" unless File . exist? jruby_cpath
43
+ jruby_home = ENV [ 'JRUBY_HOME' ]
44
+ if jruby_home
45
+ candidate = File . join ( jruby_home , 'lib' , 'jruby.jar' )
46
+ jruby_cpath = candidate if File . exist? candidate
47
+ end
47
48
end
48
49
50
+ raise "jruby.jar path not found" unless jruby_cpath
51
+
49
52
jruby_cpath += File ::PATH_SEPARATOR + args . join ( File ::PATH_SEPARATOR ) unless args . empty?
50
53
jruby_cpath ? "-cp \" #{ jruby_cpath } \" " : ""
51
54
end
You can’t perform that action at this time.
0 commit comments