Sha256: 82dc487882c40c7bca386fb837186dfa5f731a890bd56a9eb4c8d8b83cab717f

Contents?: true

Size: 892 Bytes

Versions: 1

Compression:

Stored size: 892 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::Module,
      MPatch::Class,
      MPatch::String,
      MPatch::Proc,
      MPatch::Object,
      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::Process, MPatch::Random, MPatch::YAML ].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.1.3 lib/mpatch.rb