Sha256: 039d999cf1512addd376167ff4e102345717616a32018a5746720211d98cff67

Contents?: true

Size: 637 Bytes

Versions: 3

Compression:

Stored size: 637 Bytes

Contents

module Fig; end

# Simple double-level cache of Packages.
class Fig::PackageCache
  def initialize()
    @packages = {}
  end

  def add_package(package)
    versions = @packages[package.package_name]
    if not versions
      versions = {}
      @packages[package.package_name] = versions
    end

    versions[package.version_name] = package

    return
  end

  def get_package(name, version)
    versions = @packages[name]
    return if not versions

    return versions[version]
  end

  def remove_package(name, version)
    versions = @packages[name]
    return if not versions

    versions.delete(version)

    return
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fig-0.1.54 lib/fig/packagecache.rb
fig-0.1.53 lib/fig/packagecache.rb
fig-0.1.52 lib/fig/packagecache.rb