lib/extensible/extension_kernel.rb in extensible-0.0.4 vs lib/extensible/extension_kernel.rb in extensible-0.0.5
- old
+ new
@@ -1,16 +1,17 @@
require "extensible/extension_kernel_template".freeze
+require "extensible/utils".freeze
module Extensible
##
# A custom ExtensionKernelTemplate clone that is extended by Extensible to make it, well, extensible.
ExtensionKernel = ExtensionKernelTemplate.clone.module_eval do
private
def extended(submodule)
super
- unless submodule.const_defined?(:ExtensionKernel, false)
+ unless Utils.own_const_defined?(submodule, :ExtensionKernel)
kernel = ExtensionKernelTemplate.clone
submodule.const_set(:ExtensionKernel, kernel)
submodule.extend kernel
end