lib/omnibus/cli/cache.rb in omnibus-3.1.1 vs lib/omnibus/cli/cache.rb in omnibus-3.2.0.rc.1
- old
+ new
@@ -17,24 +17,24 @@
module Omnibus
class Command::Cache < Command::Base
namespace :cache
#
- # List the existing source packages in the cache.
+ # List the existing software packages in the cache.
#
# $ omnibus cache existing
#
- desc 'existing', 'List source packages which exist in the cache'
+ desc 'existing', 'List software packages which exist in the cache'
def existing
- result = cache.list
+ 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 |source|
- say(" * #{source.name}")
+ result.each do |software|
+ say(" * #{software.name}-#{software.version}")
end
end
end
#
@@ -42,11 +42,11 @@
#
# $ omnibus cache list
#
desc 'list', 'List all cached files (by S3 key)'
def list
- result = cache.list_by_key
+ result = S3Cache.keys
if result.empty?
say('There is nothing in the cache!')
else
say('Cached files (by S3 key):')
@@ -55,52 +55,46 @@
end
end
end
#
- # List missing source packages.
+ # List missing software packages.
#
# $ omnibus cache missing
#
- desc 'missing', 'Lists source packages that are required but not yet cached'
+ desc 'missing', 'Lists software packages that are required but not yet cached'
def missing
- result = cache.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 |source|
- say(source.name)
+ result.each do |software|
+ say(" * #{software.name}-#{software.version}")
end
end
end
#
- # Fetch missing source packages locally
+ # Fetch missing software packages locally
#
# $ omnibus cache fetch
#
- desc 'fetch', 'Fetches missing source packages locally'
+ desc 'fetch', 'Fetches missing software packages locally'
def fetch
say('Fetching missing packages...')
- cache.fetch_missing
+ S3Cache.fetch_missing
end
#
# Populate the remote S3 cache from local.
#
# $ omnibus cache populate
#
desc 'populate', 'Populate the S3 Cache'
def populate
say('Populating the cache...')
- cache.populate
- end
-
- private
-
- def cache
- @cache ||= S3Cache.new
+ S3Cache.populate
end
end
end