Skip to content

Commit

Permalink
JRUBY-4709: Add trailing sep to classpath to make sure PWD is include…
Browse files Browse the repository at this point in the history
…d (like jruby.sh)
  • Loading branch information
nicksieger committed Apr 12, 2010
1 parent 4e449d3 commit 1ce8c7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions argparser.cpp
Expand Up @@ -477,6 +477,11 @@ void ArgParser::constructClassPath() {
classPath += cpAfter;
}

// JRUBY-4709: Include this by default to have PWD as part of classpath
if (!classPath.empty()) {
classPath += PATH_SEP;
}

logMsg("ClassPath: %s", classPath.c_str());
}

Expand Down
6 changes: 6 additions & 0 deletions spec/launcher_spec.rb
Expand Up @@ -148,10 +148,16 @@
jruby_launcher("-Xjdkhome '' 2>&1").should =~ /-Xjdkhome/
end

# JRUBY-4706
it "should put JRuby on regular classpath when -Xnobootclasspath is used" do
args = jruby_launcher_args("-e true")
args.grep(/Xbootclasspath/).should_not be_empty
args = jruby_launcher_args("-Xnobootclasspath -e true")
args.grep(/Xbootclasspath/).should be_empty
end

# JRUBY-4709
it "should include a bare : at the end of the classpath, to include PWD in the path" do
jruby_launcher_args("-Xnobootclasspath -e true").grep(/java\.class\.path/).first.should =~ /:$/
end
end

0 comments on commit 1ce8c7d

Please sign in to comment.