Top Level Namespace

Defined Under Namespace

Modules: Gem

Instance Method Summary collapse

Instance Method Details

#__require__Object



19
# File 'lib/gem/cache.rb', line 19

alias __require__ require

#require(str) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/gem/cache.rb', line 21

def require(str)
  unless Gem::LoadCache::TRIE.trie
    path = File.expand_path("~/.gem/cache")
    Gem::LoadCache::TRIE.trie = Trie.read(path)
    Gem::LoadCache::TRIE.values = Marshal.load(File.read "#{path}.list")
  end 
  __require__ Gem::LoadCache::TRIE.get(str) || str
end