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

Inconsistency with __dir__ in jar #4649

Closed
stergiom opened this issue Jun 7, 2017 · 1 comment
Closed

Inconsistency with __dir__ in jar #4649

stergiom opened this issue Jun 7, 2017 · 1 comment

Comments

@stergiom
Copy link

stergiom commented Jun 7, 2017

Environments

  • jruby 9.1.10.0 (2.3.3) 2017-05-25 b09c48a Java HotSpot(TM) 64-Bit Server VM 25.131-b11 on 1.8.0_131-b11 +jit [darwin-x86_64]

  • jruby 9.1.7.0 (2.3.1) 2017-01-11 68056ae Java HotSpot(TM) 64-Bit Server VM 25.131-b11 on 1.8.0_131-b11 +jit [darwin-x86_64]

Expected Behavior

When called inside of a jar __dir__ returns a jar relative path

Actual Behavior

Returns an os relative path + the jar relative path

Example:

puts "__dir__: #{__dir__}"
#=> __dir__: /Users/usr/dev/app/classpath:

puts "File.dirname(__FILE__): #{File.dirname(__FILE__)}"
#=> File.dirname(__FILE__): classpath:/

Additional info:
This affects use of the Dry-Validation gem here: https://github.com/dry-rb/dry-validation/blob/7a9897a806f9f6664a83567f48f5dc0acb739f04/lib/dry/validation/messages/abstract.rb#L13

@stergiom stergiom changed the title Inconsistency with __dir__ in jar Inconsistency with __dir__ in jar Jun 7, 2017
@stergiom
Copy link
Author

stergiom commented Jun 7, 2017

Just noticed this has already been reported in #4611

@stergiom stergiom closed this as completed Jun 7, 2017
@enebo enebo added this to the Invalid or Duplicate milestone Jun 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants