class Omnibus::Command::Cache

Public Instance Methods

existing() click to toggle source
# File lib/omnibus/cli/cache.rb, line 27
def existing
  result = S3Cache.list

  if result.empty?
    say("There are no packages in the cache!")
  else
    say("The following packages are in the cache:")
    result.each do |software|
      say("  * #{software.name}-#{software.version}")
    end
  end
end
fetch() click to toggle source
# File lib/omnibus/cli/cache.rb, line 84
def fetch
  say("Fetching missing packages...")
  S3Cache.fetch_missing
end
list() click to toggle source
# File lib/omnibus/cli/cache.rb, line 46
def list
  result = S3Cache.keys

  if result.empty?
    say("There is nothing in the cache!")
  else
    say("Cached files (by S3 key):")
    result.each do |key|
      say("  * #{key}")
    end
  end
end
missing() click to toggle source
# File lib/omnibus/cli/cache.rb, line 65
def missing
  result = S3Cache.missing

  if result.empty?
    say("There are no missing packages in the cache.")
  else
    say("The following packages are missing from the cache:")
    result.each do |software|
      say("  * #{software.name}-#{software.version}")
    end
  end
end
populate() click to toggle source
# File lib/omnibus/cli/cache.rb, line 95
def populate
  say("Populating the cache...")
  S3Cache.populate
end