Sha256: 42e9e6c496040233c43eeadf0783700bc7592b157e4292534cdff9b89588fb71

Contents?: true

Size: 851 Bytes

Versions: 48

Compression:

Stored size: 851 Bytes

Contents

module Sprinkle
  module Installers
    # = FreeBSD Package Installer
    #
    # The Pkg package installer installs FreeBSD packages.
    # 
    # == Example Usage
    #
    # Installing the magic_beans package.
    #
    #   package :magic_beans do
    #     freebsd_pkg 'magic_beans'
    #   end
    #
    # You may also specify multiple packages as an array:
    #
    #   package :magic_beans do
    #     freebsd_pkg %w(magic_beans magic_sauce)
    #   end
    class FreebsdPkg < Installer
      attr_accessor :packages #:nodoc:

      def initialize(parent, packages, &block) #:nodoc:
        super parent, &block
        packages = [packages] unless packages.is_a? Array
        @packages = packages
      end

      protected

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

    end
  end
end

Version data entries

48 entries across 48 versions & 10 rubygems

Version Path
sprinkle-0.3.0 lib/sprinkle/installers/freebsd_pkg.rb
maxmpz-sprinkle-0.2.6.1 lib/sprinkle/installers/freebsd_pkg.rb
sprinkle-0.2.6 lib/sprinkle/installers/freebsd_pkg.rb
sprinkle-0.2.3 lib/sprinkle/installers/freebsd_pkg.rb
sprinkle-0.2.4 lib/sprinkle/installers/freebsd_pkg.rb
sprinkle-0.2.5 lib/sprinkle/installers/freebsd_pkg.rb
sprinkle-0.2.2 lib/sprinkle/installers/freebsd_pkg.rb
sprinkle-0.2.1 lib/sprinkle/installers/freebsd_pkg.rb