You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A fix is required for new_anon method, which does not work correctly for subclasses, most notably controllers and reblessing. The new subclass of Kelp it creates will have all the module methods attached to it, while the other subclasses will have none. This seemingly obvious bug has gone unnoticed for quite some time, which probably means it's not seeing much use.
A better alternative would be to use what was done for #62 and mark new_anon instances with a special field. Then, Kelp::Module would check that field and change how the method is installed - from adding a method to a class, to adding a method to a hash used by autoload. This must also be adjusted for KelpX::Hooks, which now assumes methods are installed into the package.
Using each Kelp app as a singleton would still be the recommended way, but it would be nice to have new_anon method fixed.
The text was updated successfully, but these errors were encountered:
Idea: add helper functions to Kelp::Util, for example add_method_to_package and replace_method_in_package, and implement all the details inside them. Then use them in both Kelp::Module and KelpX::Hooks.
A fix is required for
new_anon
method, which does not work correctly for subclasses, most notably controllers and reblessing. The new subclass of Kelp it creates will have all the module methods attached to it, while the other subclasses will have none. This seemingly obvious bug has gone unnoticed for quite some time, which probably means it's not seeing much use.A better alternative would be to use what was done for #62 and mark
new_anon
instances with a special field. Then,Kelp::Module
would check that field and change how the method is installed - from adding a method to a class, to adding a method to a hash used by autoload. This must also be adjusted for KelpX::Hooks, which now assumes methods are installed into the package.Using each Kelp app as a singleton would still be the recommended way, but it would be nice to have
new_anon
method fixed.The text was updated successfully, but these errors were encountered: