Sha256: 7d1b51fed0d21cce87cf4872feb36f74d708cfcf1a24967e5559b666d78347a2

Contents?: true

Size: 758 Bytes

Versions: 11

Compression:

Stored size: 758 Bytes

Contents

module Sprinkle
  module Verifiers
    module Package
      Sprinkle::Verify.register(Sprinkle::Verifiers::Package)

      def has_package(*packages)
        if packages.is_a?(Array) && packages.first.is_a?(Array)
          packages = packages.first
        else
          packages = [packages] unless packages.is_a? Array
        end

        packages.each do |pak|
          case Sprinkle::Installers::InstallPackage.installer
            when :yum
              @commands << "[ -n \"`yum list installed #{pak} 2> /dev/null | egrep -e \\\"#{pak}\\\"`\" ]"
            else
              raise "Unknown InstallPackage.installer"
          end
        end
      end

      alias_method :has_packages, :has_package  
    end
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
sprinkle-0.4.2 lib/sprinkle/verifiers/package.rb
sprinkle-0.4.1 lib/sprinkle/verifiers/package.rb
sprinkle-0.4.0 lib/sprinkle/verifiers/package.rb
sprinkle-0.3.6 lib/sprinkle/verifiers/package.rb
sprinkle-0.3.5 lib/sprinkle/verifiers/package.rb
dhill-sprinkle-0.3.3.1 lib/sprinkle/verifiers/package.rb
sprinkle-0.3.4 lib/sprinkle/verifiers/package.rb
sprinkle-0.3.3 lib/sprinkle/verifiers/package.rb
sprinkle-0.3.2 lib/sprinkle/verifiers/package.rb
powcloud-sprinkle-0.3.4 lib/sprinkle/verifiers/package.rb
powcloud-sprinkle-0.3.0 lib/sprinkle/verifiers/package.rb