Sha256: 746de18871ac2db4917d4f59533f6f60951c1e536b5cae97de2e004a166db0aa

Contents?: true

Size: 916 Bytes

Versions: 2

Compression:

Stored size: 916 Bytes

Contents

module Sprinkle
  module Installers
    # = RPM Package Installer
    #
    # The RPM package installer installs RPM packages.
    # 
    # == Example Usage
    #
    # Installing the magic_beans RPM. Its all the craze these days.
    #
    #   package :magic_beans do
    #     rpm 'magic_beans'
    #     verify { has_rpm 'magic_beans' }
    #   end
    #
    # You may also specify multiple rpms as an array:
    #
    #   package :magic_beans do
    #     rpm %w(magic_beans magic_sauce)
    #   end
    class Rpm < PackageInstaller

      ##
      # install RPM packages
      # :method: rpm
      # :call-seq:
      #   rpm(*packages)
      auto_api
      
      verify_api do
        def has_rpm(package)
          @commands << "rpm -qa | grep #{package}"
        end
      end

      protected

        def install_commands #:nodoc:
          "rpm -Uvh #{@packages.join(' ')}"
        end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sprinkle-0.7.3 lib/sprinkle/installers/rpm.rb
sprinkle-0.7.2 lib/sprinkle/installers/rpm.rb