Sha256: aeac77bc46653e4b9da0d4973ad64acedd4335470118ece2c16b84333cc0059c
Contents?: true
Size: 861 Bytes
Versions: 13
Compression:
Stored size: 861 Bytes
Contents
$autoload_path = [nil,File.join('droiuby','wrappers')] module MissingHandler def const_missing(name) @looked_for ||= {} str_name = name.to_s raise "Class not found: #{name}" if @looked_for[str_name] == :missing name_parts = name.to_s.split('::').collect { |n| n.underscore } $autoload_path.each do |path| path_array = unless path.nil? [path] + name_parts else name_parts end require_path = File.join(*path_array) begin require require_path klass = const_get(name) return klass if klass rescue LoadError=>e end end @looked_for[str_name] = :missing raise "Class not found: #{name}" end end class Object class << self alias :const_missing_old :const_missing include MissingHandler end end
Version data entries
13 entries across 13 versions & 1 rubygems