Sha256: 2c67ecb3f44f086466f3adeace914d4bd2d514798bf49c5c6a7de267cdc7cf2b

Contents?: true

Size: 640 Bytes

Versions: 3

Compression:

Stored size: 640 Bytes

Contents

module Sprinkle::Package
  class Chooser #:nodoc:
    def self.select_package(name, packages)
      if packages.size <= 1
        package = packages.first
      else
        package = choose do |menu|
          menu.prompt = "Multiple choices exist for virtual package #{name}"
          menu.choices *packages.collect(&:to_s)
        end
        package = Sprinkle::Package::PACKAGES.first(package)
      end

      cloud_info "Selecting #{package.to_s} for virtual package #{name}"

      package
    end
    
    def self.cloud_info(message)
      logger.info(message) if Sprinkle::OPTIONS[:cloud] or logger.debug?
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sprinkle-0.7.4 lib/sprinkle/package/chooser.rb
sprinkle-0.7.3 lib/sprinkle/package/chooser.rb
sprinkle-0.7.2 lib/sprinkle/package/chooser.rb