Class: Sprinkle::Installers::Gem

Inherits:
Installer show all
Defined in:
lib/sprinkle/installers/gem.rb

Overview

The gem package installer installs Ruby gems.

The installer has a single optional configuration: source. By changing source you can specify a given ruby gems repository from which to install.

Example Usage

First, a simple installation of the magic_beans gem:

package :magic_beans do
  description "Beans beans they're good for your heart..."
  gem 'magic_beans'
end

Second, install magic_beans gem from github:

package :magic_beans do
  gem 'magic_beans_package' do
    source 'http://gems.github.com'
  end
end

As you can see, setting options is as simple as creating a block and calling the option as a method with the value as its parameter.

Instance Attribute Summary collapse

Attributes inherited from Installer

#delivery, #options, #package, #post, #pre

Instance Method Summary collapse

Methods inherited from Installer

#announce, api, #commands_from_block, #defer, #escape_shell_arg, inherited, #install_sequence, #method_missing, #per_host?, #post_process, #process, subclasses, verify_api

Methods included from Sudo

#sudo?, #sudo_cmd, #sudo_stack

Methods included from Attributes

#defaults, #set_defaults

Constructor Details

#initialize(parent, gem, options = {}, &block) ⇒ Gem

:nodoc:



40
41
42
43
# File 'lib/sprinkle/installers/gem.rb', line 40

def initialize(parent, gem, options = {}, &block) #:nodoc:
  super parent, options, &block
  @gem = gem
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Sprinkle::Installers::Installer

Instance Attribute Details

#gemObject

:nodoc:



38
39
40
# File 'lib/sprinkle/installers/gem.rb', line 38

def gem
  @gem
end