Permalink
Browse files

Classpath urls should still use expand_path to properly canonicalize …

…the path. This fixes no reported issue
  • Loading branch information...
enebo committed Nov 27, 2013
1 parent bc4b4ce commit 429149e7f5b9114ff8f6326bd72fde5a1f0a941b
Showing with 2 additions and 2 deletions.
  1. +2 −2 core/src/main/ruby/jruby/kernel19/kernel.rb
@@ -12,8 +12,8 @@ def require_relative(relative_arg)
# know about classpath: paths.
if file =~ /^classpath:(.*)/
dir = File.dirname($1)
- dir = dir == '.' ? "" : dir + "/"
- absolute_feature = "classpath:#{dir}#{relative_arg}"
+ dir = '' if dir == '.'
+ absolute_feature = "classpath:" + File.expand_path(relative_arg, dir)
else
absolute_feature = File.expand_path(relative_arg, File.dirname(file))
end

2 comments on commit 429149e

Member

atambo replied Dec 26, 2013

This commit might have caused an issue on windows:
https://groups.google.com/forum/#!msg/jruby-users/A5YCOv1jChk/yYD9TsncsJ4J

rsim replied Dec 31, 2013

Created issue "require_relative fails when called from classpath:/ path file on Windows in JRuby 1.7.9" with examples showing the issue this commit introduced #1374

Please sign in to comment.