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.

Rails::Initializer.load_application_initializers is overzealously globbing SCCS directories

#627

I have a rails application checked into a BitKeeper repository. BitKeeper creates an SCCS directory in every directory in which there is source code committed:

config/initializers/inflections.rb

config/initializers/SCCS/s.inflections.rb

...

Rails::Initializer.load_application_initializers uses the following to load these initializers:

Dir[".../config/initializers/**/*.rb"].sort.each do |initializer|

load(initializer)

end

This pattern is used in many places including lib/tasks, etc. The result is that the SCCS/s.*.rb files are loaded which causes the Rails::Initializer to bomb out.

It seems there are two ways of fixing this problem, either change every where this pattern is used to do something like:

Dir[".../config/initializers/**/*.rb"].sort.each do |initializer|

load(initializer) unless initializer =~ /SCCS/

end

Even if i override this function in (for example) config/environment.rb there are other places were this occurs, such as actionpack-2.1.0/lib/action_controller/helpers.rb in the all_application_helpers function.

Reported by Peter Kovacs · July 15th, 2008 @ 09:11 PM

State: wontfix
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. josh
    josh
    • State changed from new to wontfix

    We use the /**/*.rb in a ton of places. So adding "=~ /SCCS/" to each is a no. Maybe you could override "Dir#[]"? Or try git :)

    July 19th, 2008 @ 09:43 PM

  2. Peter Kovacs
    Peter Kovacs

    I thought about overriding Dir[], but couldn't quite come up with the correct incantation (as I'm fairly new to ruby). Or perhaps I had it in the wrong place. I can definitely try that again though. Any pointers?

    July 20th, 2008 @ 01:21 AM