Sha256: 27a5f3946eb854a4a9e491a08e187a6ab6f25d210e4be5766ab1d6e5d4039881

Contents?: true

Size: 547 Bytes

Versions: 2

Compression:

Stored size: 547 Bytes

Contents

require "extensible/extension_kernel_template".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)
        kernel = ExtensionKernelTemplate.clone
        submodule.const_set(:ExtensionKernel, kernel)
        submodule.extend kernel
      end

      self
    end

    self
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
extensible-0.0.4 lib/extensible/extension_kernel.rb
extensible-0.0.3 lib/extensible/extension_kernel.rb