This project is archived and is in readonly mode.

#627 ✓wontfix
Peter Kovacs

Rails::Initializer.load_application_initializers is overzealously globbing SCCS directories

Reported by Peter Kovacs | July 15th, 2008 @ 09:11 PM | in 2.x

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.

Comments and changes to this ticket

  • josh

    josh July 19th, 2008 @ 09:43 PM

    • 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 :)

  • Peter Kovacs

    Peter Kovacs July 20th, 2008 @ 01:21 AM

    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?

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages