Sha256: f95eb6148b4211fab30f2944c03d81f4e5cbb85b12d1a53cf2e527b39947b06e

Contents?: true

Size: 1.59 KB

Versions: 10

Compression:

Stored size: 1.59 KB

Contents

#
# Copyright:: Copyright (c) 2013 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require 'omnibus/cli/base'
require 'omnibus/s3_cacher'

module Omnibus
  module CLI
    class Cache < Base

      class_option :path,
        :aliases => [:p],
        :type => :string,
        :default => Dir.pwd,
        :desc => "Path to the Omnibus project root."

      namespace :cache

      desc "existing", "List source packages which exist in the cache"
      def existing
        S3Cache.new.list.each {|s| puts s.name}
      end

      desc "list", "List all cached files (by S3 key)"
      def list
        S3Cache.new.list_by_key.each {|k| puts k}
      end

      desc "missing", "Lists source packages that are required but not yet cached"
      def missing
        S3Cache.new.missing.each {|s| puts s.name}
      end

      desc "fetch", "Fetches missing source packages to local tmp dir"
      def fetch
        S3Cache.new.fetch_missing
      end

      desc "populate", "Populate the S3 Cache"
      def populate
        S3Cache.new.populate
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
omnibus-1.3.0 lib/omnibus/cli/cache.rb
omnibus-sonian-1.2.0.1 lib/omnibus/cli/cache.rb
omnibus-1.2.0 lib/omnibus/cli/cache.rb
omnibus-1.1.1 lib/omnibus/cli/cache.rb
omnibus-1.1.0 lib/omnibus/cli/cache.rb
omnibus-1.0.4 lib/omnibus/cli/cache.rb
omnibus-1.0.3 lib/omnibus/cli/cache.rb
omnibus-1.0.2 lib/omnibus/cli/cache.rb
omnibus-1.0.1 lib/omnibus/cli/cache.rb
omnibus-1.0.0 lib/omnibus/cli/cache.rb