Sha256: 27bc3a0d267fc3a1bc3df381cf57b5d9d635e1085ce744fee5471aa2ce11f4b3

Contents?: true

Size: 598 Bytes

Versions: 3

Compression:

Stored size: 598 Bytes

Contents

require 'pathname'

module AppStore; end

module AppStore::Emigrant
  
  # Cache mechanism
  class Cache
    
    PATH = begin
      path = Pathname.new('~/.ase-cache').expand_path
      unless path.directory?
        path.mkpath
      end
      path
    end
    
    # Whether cache has this item
    def self.has? item
      PATH.join(item).file?
    end
    
    # Path to given item (whether existent or not)
    def self.path_to item
      PATH.join(item).to_s
    end
    
    # Forcefully clears the cache
    def self.clear!
      # TODO: Implement clearing cache
    end
    
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
app-store-emigrant-0.0.7 lib/app-store-emigrant/cache.rb
app-store-emigrant-0.0.6 lib/app-store-emigrant/cache.rb
app-store-emigrant-0.0.5 lib/app-store-emigrant/cache.rb