Can’t seem to find a clean solution to this.
I have nested includes in a gem I’m developing.
So I have:
supereasy/
lib/
supereasy/
easy_this
My supereasy.rb includes easy_this, and I want easy_this to install a
before_filter into the controller it is ultimately being mixed into.
Doesn’t work to do the usual
self.included base
base.send :before_filter
end
because this gets called at the point where I include easy_this into supereasy,
so base here is supereasy which has no idea what I’m going on about.
I could obviously at this point define my included handler up into supereasy,
but then what if I want to add a included handler in supereasy? At that point,
I might as well just put this stuff in supereasy.rb, but I wanted to modularize
this more cleanly.
Plus, it seems like one would like to have something like an included_in_class,
which gets called up the inheritance chain, being given the class.
Seems like I might well be trying to reinvent the wheel here, or missing
another solution entirely...
--
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby