I'm facing a strange problem when I'm using JRuby + Warbler: I'm packing a JRuby program inside a .jar file. But when the path that the JAR is contains spaces, File.dirname(__FILE__) returns some kind of URI to the file like the following:
jar:file:/tmp/Directory%20with%20spaces/my-program.jar!/my-program/lib/boot.rb
These "%20" confuses some commands like require_relative (it don't work at all), or File.read[lines] (don't work either). Somehow, require works fine.
A workaround that I did is to create a URI.unescape(File.dirname(__FILE__)), but I don't know if this can lead to problems if, for instance, the file that I'm trying to read has %20 on its filename.