lib/configurable/module_methods.rb in configurable-0.5.0 vs lib/configurable/module_methods.rb in configurable-0.6.0

- old
+ new

@@ -1,28 +1,18 @@ +require 'lazydoc' require 'configurable/class_methods' module Configurable module ModuleMethods + module_function # Extends including classes with Configurable::ClassMethods - def included(mod) - mod.extend ClassMethods - mod.extend ModuleMethods unless mod.kind_of?(Class) + def included(base) + base.extend ClassMethods + base.extend Lazydoc::Attributes + base.extend ModuleMethods unless base.kind_of?(Class) - unless mod.instance_variable_defined?(:@source_file) - caller[1] =~ Lazydoc::CALLER_REGEXP - mod.instance_variable_set(:@source_file, File.expand_path($1)) - end - - unless mod.instance_variable_defined?(:@configurations) - mod.send(:initialize_configurations).extend(IndifferentAccess) - end - - # add module configurations - configurations.each_pair do |key, config| - mod.configurations[key] = config.dup - end unless self == Configurable - + ClassMethods.initialize(base) super end end extend ModuleMethods \ No newline at end of file