- Relax method_source gem dependency to
">= 0.8.2", "< 2.0.0"
- Pauses singleton method recording inside a super_module_included block to avoid replaying on submodules
- Support aliased methods
- Support safely calling self.included(base) in super module via super_module_included {|base| ... }
- Fixed issue with super module containing class methods with default arguments
- Dropped support for SuperModule 2 Beta syntax, reverting to V1 syntax as the default
- Added
included_super_module
method to allow modules to call it if they need to redefineself.included
for meta-programming.
- Relaxed dependency on
method_source
gem version
- Standalone super module usage (e.g. direct class method invocation)
- New
super_module(name)
syntax - Much simpler implementation with guaranteed correctness and no performance hit
- Less memory footprint by not requiring method_source Ruby gem for v2 syntax
- Backwards compatibility with v1 syntax
- Added support for private and protected methods
- Added many more RSpec test cases, including testing of empty and comment containing singleton methods
- Brand new
self
-friendly algorithm that ensures true mixing of super module singleton methods into the including base class or module, thus always returning the actual base class or moduleself
when invoking a super module inherited singleton method (thanks to Banister for reporting previous limitation on Reddit and providing suggestions) - New
included_super_modules
inherited singleton method that provides developer with a list of all included super modules similar to the Rubyincluded_modules
method. - No more use for method_missing (Thanks to Marc-André Lafortune for bringing up as a previous limitation in AirPair article reviews)
- New dependency on Banister's method_source library to have the self-friendly algorithm eval inherited class method sources into the including base class or module.
- Refactorings, including break-up of the original SuperModule into 3 modules in separate files
- More RSpec test coverage, including additional method definition scenarios, such as when adding dynamically via
class_eval
anddefine_method