From: Jean-denis Vauguet Date: 2010-03-21T11:46:02+09:00 Subject: A plugin system using extend Hi. I tried to design a simple plugin system using :extend called upon instance (http://ruby-doc.org/core/classes/Object.html#M000335 usual documented behavior), so as to inject some methods redefinitions while keeping the ability to call super in order to fall back on the default behavior if needed. It looks like this: http://gist.github.com/339025 It works as expected, as one can see by reading the commented output at the end of the file: the inheritance chain is altered, with the plugin "subclassing" the original class of the plugin receiver. Yet, I tried to introduce some modularity in the system, so I went for: http://gist.github.com/339028 It fails but I don't understand why. The inheritance chain is not altered. I tried to use :include instead of :extend, which gives merely the same behavior (overwriting instance methods), but this time the plugin module is added as the parent of the original class within the inheritance chain, so it is useless for the purpose ;) I'll be glad if someone could give me a hint on this :) Thank you! -- Posted via http://www.ruby-forum.com/.