Class: LCSP::LCSPCache
- Inherits:
-
Object
- Object
- LCSP::LCSPCache
- Defined in:
- lib/common/cache.rb
Overview
Base LCSP cache
Instance Method Summary collapse
-
#initialize(user, repository) ⇒ LCSPCache
constructor
Initializes a new instance of LCSPCache.
-
#path ⇒ String
Returns the path to the local cache directory for the specified repository.
Constructor Details
#initialize(user, repository) ⇒ LCSPCache
Initializes a new instance of LCSPCache.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/common/cache.rb', line 16 def initialize(user, repository) @user = user @repository = repository return if exists? ::Git.clone( URI("https://github.com/#{@user}/#{@repository.downcase}"), ::Pathname.new("cache_#{@user}-#{@repository.downcase}") ) end |
Instance Method Details
#path ⇒ String
Returns the path to the local cache directory for the specified repository.
31 32 33 |
# File 'lib/common/cache.rb', line 31 def path "#{::Dir.pwd}/cache_#{@user}-#{@repository.downcase}" end |