Class: Precompiled::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 Precompiled::BaseCache

Instance Method Details

#contains?(spec) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#path_for(spec) ⇒ Object



35
36
37
# File 'lib/rubygems/precompiled.rb', line 35

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

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

Yields:



42
43
44
# File 'lib/rubygems/precompiled.rb', line 42

def retrieve(spec)
  yield path_for(spec)
end