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

An absolute Pathname is not correctly computed as absolute when a uri scheme/classloader is in the path #3033

Closed
blaines opened this issue Jun 10, 2015 · 5 comments
Assignees

Comments

@blaines
Copy link

blaines commented Jun 10, 2015

This should be pretty straightforward...
A Pathname with any URI scheme such as uri:classloader will be improperly be determined as relative.

1.7.20 master ~/···/jruby/jruby> pry
>  Pathname.new 'uri:classloader:/Users/bschanfeldt/Repos/Github/jruby/jruby/README.md'
=> <Pathname:uri:classloader:/Users/bschanfeldt/Repos/Github/jruby/jruby/README.md>
>  p = _
=> <Pathname:uri:classloader:/Users/bschanfeldt/Repos/Github/jruby/jruby/README.md>
>  p.absolute?
=> false
>  RUBY_VERSION
=> "1.9.3"
>  RUBY_PLATFORM
=> "java"
>  JRUBY_VERSION
=> "1.7.20"
@rtyler
Copy link

rtyler commented Jun 10, 2015

@blaines Will you include what version(s) of JRuby this IRB session is from?

@blaines
Copy link
Author

blaines commented Jun 11, 2015

Updated with versions

@ikaronen-relex
Copy link
Contributor

This specific issue seems to be fixed now (on JRuby 9.3.10.0):

> require 'pathname'
=> true
> p = Pathname.new 'uri:classloader:/Users/bschanfeldt/Repos/Github/jruby/jruby/README.md'
=> #<Pathname:uri:classloader:/Users/bschanfeldt/Repos/Github/jruby/jruby/README.md>
> p.absolute?
=> true

(There are still other problems with the handling of uri:classloader: paths in Pathname, such as p.relative_path_from('/') raising an ArgumentError, but I'll report that separately.)

@kares kares added this to the Invalid or Duplicate milestone Oct 16, 2023
@kares
Copy link
Member

kares commented Oct 16, 2023

okay, let's close this one - given the original report was for JRuby 1.7

@kares kares closed this as completed Oct 16, 2023
@enebo
Copy link
Member

enebo commented Oct 16, 2023

@kares I think I only fixed this in the last year but did not see this issue.

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

6 participants