Sha256: 80f024f4b21656ba959d14a00a56cd12a3da27f7706ee52620501764d2707cb2
Contents?: true
Size: 794 Bytes
Versions: 3
Compression:
Stored size: 794 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.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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
fig-0.1.62 | lib/fig/packagecache.rb |
fig-0.1.61 | lib/fig/packagecache.rb |
fig-0.1.59 | lib/fig/packagecache.rb |