class BundleDepot::FileSystemStore

Attributes

path[R]

Public Class Methods

new(path) click to toggle source
# File lib/bundle_depot/cache.rb, line 77
def initialize(path)
  @path = path
  FileUtils.mkdir_p(path)
end

Public Instance Methods

cached?(file) click to toggle source
# File lib/bundle_depot/cache.rb, line 73
def cached?(file)
  File.exists? File.join(path, file)
end
fetch(file, dest_dir) click to toggle source
# File lib/bundle_depot/cache.rb, line 86
def fetch(file, dest_dir)
  FileUtils.cp_r File.join(path, file), dest_dir
end
store(file) click to toggle source
# File lib/bundle_depot/cache.rb, line 82
def store(file)
  FileUtils.cp_r file, File.join(path, File.basename(file))
end