Sha256: e436636202f63568b3f775c3e2e1fea4d0a64aaa1d732f77e538bcc2804e9c64

Contents?: true

Size: 810 Bytes

Versions: 45

Compression:

Stored size: 810 Bytes

Contents

module Fig; end

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

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

    versions[package.version] = package

    return
  end

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

    return versions[version]
  end

  # Don't care which one, just gimme.
  def get_any_version_of_package(name)
    versions = @packages[name]
    return if not versions

    return versions.values.first()
  end

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

    versions.delete(version)

    return
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
fig-1.23.0 lib/fig/package_cache.rb
fig-1.22.1.beta.1 lib/fig/package_cache.rb
fig-1.22.0 lib/fig/package_cache.rb
fig-1.21.1.beta.2 lib/fig/package_cache.rb
fig-1.21.1.beta.1 lib/fig/package_cache.rb
fig-1.21.0 lib/fig/package_cache.rb
fig-1.20.1.beta.1 lib/fig/package_cache.rb
fig-1.20.0 lib/fig/package_cache.rb
fig-1.19.0 lib/fig/package_cache.rb
fig-1.18.0 lib/fig/package_cache.rb
fig-1.17.0 lib/fig/package_cache.rb
fig-1.16.1.beta.1 lib/fig/package_cache.rb
fig-1.16.0 lib/fig/package_cache.rb
fig-1.15.1.beta.2 lib/fig/package_cache.rb
fig-1.15.1.beta.1 lib/fig/package_cache.rb
fig-1.15.0 lib/fig/package_cache.rb
fig-1.14.0 lib/fig/package_cache.rb
fig-1.13.0 lib/fig/package_cache.rb
fig-1.12.0 lib/fig/package_cache.rb
fig-1.11.0 lib/fig/package_cache.rb