Sha256: 5cda0d2530f4603cf3f47bc04c7f60ee6b8452c76c6b2a5e10cddec090dd53bb

Contents?: true

Size: 909 Bytes

Versions: 6

Compression:

Stored size: 909 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

6 entries across 6 versions & 1 rubygems

Version Path
sprinkle-0.7.7 lib/sprinkle/installers/rpm.rb
sprinkle-0.7.6.2 lib/sprinkle/installers/rpm.rb
sprinkle-0.7.6.1 lib/sprinkle/installers/rpm.rb
sprinkle-0.7.6 lib/sprinkle/installers/rpm.rb
sprinkle-0.7.5 lib/sprinkle/installers/rpm.rb
sprinkle-0.7.4 lib/sprinkle/installers/rpm.rb