Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requiring a bare file from current directory works unexpectedly #3049

Closed
eregon opened this issue Jun 15, 2015 · 3 comments
Closed

Requiring a bare file from current directory works unexpectedly #3049

eregon opened this issue Jun 15, 2015 · 3 comments

Comments

@eregon
Copy link
Member

eregon commented Jun 15, 2015

test.rb:

puts "BUG"
$ bin/jruby -e 'require "test"'

This should not find the file (well, unless "." is in $: but it is not) and raise a LoadError.

The last update to RubySpec revealed the bug.
9da2c2c should be revert once it is fixed.

@headius
Copy link
Member

headius commented Jun 15, 2015

This is a side effect of our desire to present both Ruby and Java command-line semantics. When running the "java" command at the command line, the current directory is added to the classpath. We do the same in our launcher. This causes Ruby files to be accessible because they can be found via classloader searching.

I'm not opposed to removing this classpath entry, but it would be a change from how the "jruby" command has run for many years.

@mkristian
Copy link
Member

I did removed this java "feature" on my https://github.com/jruby/jruby/tree/test-dir-globs-on-uri-classloader branch where I want to move the last bit of the old "LoadService" into the new one.

I always thought this is the desired feature since we have already such a test which does not fail for other reasons (ruby PWD != java PWD)

but whatever is decided here I would incorporate it in the above branch.

@enebo enebo added this to the JRuby 9.0.0.0.rc2 milestone Jul 6, 2015
@mkristian
Copy link
Member

fixed with #3073 which also added a test for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants