Sha256: e613e483f35d6e36ff9a554c119f10ae1ba16ea86f18e2fe5cbdad047c99f9da

Contents?: true

Size: 889 Bytes

Versions: 1

Compression:

Stored size: 889 Bytes

Contents

#encoding: UTF-8
module MPatch

  Dir.glob(File.join(File.absolute_path(File.dirname(__FILE__)),"mpatch","**","*.{rb,ru}")).each{|e|require e}

  [
      MPatch::Process,
      MPatch::String,
      MPatch::Proc,
      MPatch::YAML,
      MPatch::Object,
      MPatch::File,
      MPatch::Array,
      MPatch::Integer,
      MPatch::Hash
  ].each do |module_name|

    constant= ::Object
    name=     module_name.to_s.split('::').last
    constant = constant.const_defined?(name, false) ? constant.const_get(name) : constant.const_missing(name)

    constant.__send__ :include, module_name

  end

  [
      MPatch::Random
  ].each do |module_name|

    constant= ::Object
    name=     module_name.to_s.split('::').last
    constant = constant.const_defined?(name, false) ? constant.const_get(name) : constant.const_missing(name)

    constant.__send__ :extend, module_name

  end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mpatch-2.0.0 lib/mpatch.rb