Michael Koziarski wrote:
The 1.2 boat has sailed, but perhaps there's room for something like
this in 2.0. A few things to consider though:
* Why'd you change deprecation.rb?
Because you can't presently deprecate setter methods (methods with
ending in "="). A setter method can't take a block.
* Should .template_root= override or supplement previously supplied
values to .view_paths=
The patch presently does this:
But it could also be defined like this:
self.view_paths = [path]
* Should we just expose the array, or provide methods to 'add_view_path'
I really like just exposing the array. It harmonizes well with
Config#additional_load_paths and Config#controller_paths.
* Does this play right with people's expectations around inheritance.
Inheritance is tricky. I thought about creating a custom class
InheritedArray that would allow changes to the parent class's array to
filter down, but decided it would be overkill.
It presently is defined like this:
if paths = @@view_paths[name]
Which causes the subclass to return a frozen version of the
superclass's array if it doesn't have it's own array defined. This is
to prevent modification of the superclass's array when doing:
subclass.view_paths << 'additional/path' # raises an error
Instead you need to set it directly:
subclass.view_paths += [ 'additional/path' ]
Somewhat messy, but it seemed the nicer alternative.