Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Pathname#relative_path_from failing when there is a '!' character in the path #3392
For jruby-126.96.36.199 (discovered on 188.8.131.52). I don't know if there are other characters that trigger this.
this is true and it is onaly a problem with an ! at the end of the name. there are quite some places where we discover jar urls like
by looking for !/
To give more detail, I found the problem in the context of digital preservation in a library. We get sets of files with all kinds of bizarre (to me) naming convention/directory structures coming from our various units. In particular our archive unit is likely to get weird stuff and want to preserve it as is. I think the particular case I found was something like ../../PLUS!/../...
So if a general solution is possible I'd certainly be appreciative, but I do bear in mind that I wouldn't be the one doing it.
Also I'm a little confused by the idea that it is a legacy feature - is there equivalent functionality for Pathname#relative_path_from elsewhere in ruby or the stdlib?
I found the other problem. Let me know if you'd like me to open another ticket for it. This time it's when the path involves some unicode characters:
jruby-184.108.40.206 :007 > x = "joe"
Here's the MRI version, which works:
2.2.3 :006 > x = "joe"