Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATH] Use extended version of file_name in require_or_load

#6345

Currently require_or_load uses extended version of filename to check wether file was loaded or not, but when it loads the file it uses just a filename instead of extended version.

So the same file gets loaded several times.

And even more if you use ruby 1.9, project directory isn't prepended to $LOAD_PATH, so require_or_load fails to load simple 'lib/some_file'.

This patch fixes it by using extended version of filename.

https://github.com/rails/rails/pull/175

Reported by Ravil Bayramgalin · January 29th, 2011 @ 05:44 PM

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Ravil Bayramgalin
    Ravil Bayramgalin

    Sorry, current commit wasn't working correctly, I've removed it. So the problem still stands.

    Simple way to illustrate, add following to application.rb:

    config.autoload_paths << 'lib'
    

    And try to reference module/class from lib using ruby 1.9 (but not in console since it's eagerly loads these files, it seems).

    January 29th, 2011 @ 06:22 PM

  2. rails
    rails
    • State changed from new to open
    • Tag changed from rails 3.1, 1.9, activesupport, dependencies, patch to rails 31, 19, activesupport, dependencies, patch

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    April 30th, 2011 @ 01:00 AM

  3. rails
    rails
    • State changed from open to stale

    April 30th, 2011 @ 01:00 AM