rails/rails — pull request #6910 by mulder (2012-06-29 15:23:54+00:00)
Title: Persist glob when replacing a path

When Rails::Paths::Root's []= is used to replace a path it should persist the previous path's glob. Without passing the glob along we get gnarly bugs when trying to wire up things like engines.

/cc @josevalim
______
From rails/engine.rb docs:
```
# class MyEngine < Rails::Engine
# paths["app/controllers"] = "lib/controllers"
# end
```
This works great. but if you did the same with something that was configured with a glob, like app/initializers, you get errors like this:

```
lib/active_support/dependencies.rb:245:in `load': cannot load such file -- /Users/nick/Desktop/foo_engine/lib/foo_engine/initializers (LoadError)
```

``` ruby
module FooEngine
class Engine < ::Rails::Engine
isolate_namespace FooEngine

config.paths['config/initializers'] = "lib/foo_engine/initializers"
end
end

# Before the initializer override:
>> FooEngine::Engine.config.paths["config/initializers"].glob
=> "**/*.rb"

# After the initializer override:
>> FooEngine::Engine.config.paths["config/initializers"].glob
=> nil
```