class Polisher::GemCache

Constants

DIR

Public Class Methods

clear!() click to toggle source
# File lib/polisher/util/gem_cache.rb, line 16
def self.clear!
  FileUtils.rm_rf(DIR)
end
create!() click to toggle source
# File lib/polisher/util/gem_cache.rb, line 12
def self.create!
  FileUtils.mkdir_p(DIR) unless File.directory?(DIR)
end
get(name, version) click to toggle source
# File lib/polisher/util/gem_cache.rb, line 24
def self.get(name, version)
  path = path_for(name, version)
  File.exist?(path) ? File.read(path) : nil
end
path_for(name, version) click to toggle source
# File lib/polisher/util/gem_cache.rb, line 20
def self.path_for(name, version)
  "#{DIR}/#{name}-#{version}.gem"
end
set(name, version, gem) click to toggle source
# File lib/polisher/util/gem_cache.rb, line 29
def self.set(name, version, gem)
  self.create!
  File.write(path_for(name, version), gem)
end