JRuby can double slash ("//") the directory given by __FILE__ when "everything" 
suits this thing to happen. :-)
---------------------------------------------------------------------------------------------------------------

                 Key: JRUBY-3312
                 URL: http://jira.codehaus.org/browse/JRUBY-3312
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.1.7
            Reporter: Joao Pedrosa
            Assignee: Thomas E Enebo
            Priority: Minor


In other words, I can't create a small program to reproduce it because this 
happens inside of a larger framework,
and so far I failed to reproduce it using a framework-free sample. :-)

But the given files show the summary of it:

File A:

GUI::AppManager.register __FILE__, {
    :version => '1.0',
    :title => 'JEditor'
    }

File B:

    def AppManager.register filename, conf = nil
      p 'Watch out filename:', filename


The output is:

"Watch out filename:"
"/home/dewd/code/apps/jeditor/gui/lib//jeditor_gui/conf.rb"

Which for me doesn't quite match what is expected, that is, the double slash in 
"lib//jeditor_gui" screws things for me. For this one case I was able to 
normalize
it with File.expand_path and it worked. But I fear it could happen elsewhere 
still.

This same code works great with Ruby itself and only derails with JRuby.

Maybe if __FILE__ knows that it is returning the full path of the file in 
question
it could be normalized inside JRuby core so it better matched what Ruby provides
in similar situations.



-- 
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