JRuby files should work with limited functionality within Jar files
-------------------------------------------------------------------

                 Key: JRUBY-1682
                 URL: http://jira.codehaus.org/browse/JRUBY-1682
             Project: JRuby
          Issue Type: Improvement
          Components: Core Classes/Modules
            Reporter: Ola Bini


I think it's starting to look likely that we should support more File 
operations on files inside of Jar-files, especially when __FILE__ now sometimes 
returns
file:/abc/foobar file paths. As things are currently, you can require explicit 
files within a jar file:

{noformat}
require 'file:abc.jar!/foo.rb' 
{noformat}

Will work, if abc.jar exists in the current directory, and foo.rb exists within 
it. The problem is that it's not a general solution. Say that you have 
ActiveSupport in a jar-file. At some point core_ext.rb will be required, and 
the full code of that file is:

{noformat}
Dir[File.dirname(__FILE__) + "/core_ext/*.rb"].each { |file| require(file) }
{noformat}

In this case, nothing will happen, since __FILE__ is a "file:"-URL, and 
Dir.glob doesn't know how to handle that correctly. File.exist?() will also 
return bad results. So, the general solution seems to be to extend RubyFile and 
RubyDir to give limited functionality for jarred files too. Not necessarily 
anything else, but jar-files seems to be too important to not support at this 
point.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to