Class: Gem::Installer::FileCache

Inherits:
BaseCache show all
Defined in:
lib/rubygems/precompiled.rb

Instance Method Summary collapse

Methods inherited from BaseCache

#cache_key, #initialize

Constructor Details

This class inherits a constructor from Gem::Installer::BaseCache

Instance Method Details

#contains?(spec) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/rubygems/precompiled.rb', line 33

def contains?(spec)
  File.exists?(path_for(spec))
end

#path_for(spec) ⇒ Object



30
31
32
# File 'lib/rubygems/precompiled.rb', line 30

def path_for(spec)
  File.join(@root_uri.path, cache_key(spec))
end

#retrieve(spec) {|path_for(spec)| ... } ⇒ Object

Yields:



37
38
39
# File 'lib/rubygems/precompiled.rb', line 37

def retrieve(spec)
  yield path_for(spec)
end