public
Description: Sprinkle is a software provisioning tool you can use to build remote servers with. eg. to install a Rails, or Sinatra stack on a brand new slice directly after its been created
Homepage: http://github.com/crafterm/sprinkle
Clone URL: git://github.com/crafterm/sprinkle.git
Click here to lend your support to: sprinkle and make a donation at www.pledgie.com !
sprinkle / lib / sprinkle / installers / opensolaris_pkg.rb
100644 44 lines (39 sloc) 1.069 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module Sprinkle
  module Installers
    # = OpenSolaris Package Installer
    #
    # The Pkg package installer installs OpenSolaris packages.
    #
    # == Example Usage
    #
    # Installing the magic_beans package.
    #
    # package :magic_beans do
    # opensolaris_pkg 'magic_beans'
    # end
    #
    # You may also specify multiple packages as an array:
    #
    # package :magic_beans do
    # opensolaris_pkg %w(magic_beans magic_sauce)
    # end
    #
    # == Note
    # If you are using capistrano as the deployment method
    # you will need to add the following lines to your deploy.rb
    # set :sudo, 'pfexec'
    # set :sudo_prompt, ''
    class OpensolarisPkg < 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 install #{@packages.join(' ')}"
        end
 
    end
  end
end