Class: Pot::Installers::Gem
- Inherits:
-
Pot::Installer
- Object
- Pot::Installer
- Pot::Installers::Gem
- Defined in:
- lib/pot/installers/gem.rb
Overview
Ruby Gem Package Installer
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
-
#gem ⇒ Object
:nodoc:.
Attributes inherited from Pot::Installer
#actor, #options, #package, #post, #pre
Instance Method Summary collapse
-
#initialize(parent, gem, options = {}, &block) ⇒ Gem
constructor
:nodoc:.
-
#source(location = nil) ⇒ Object
:nodoc:.
Methods inherited from Pot::Installer
#archives, #builds, #commands, #prefix, #process
Constructor Details
#initialize(parent, gem, options = {}, &block) ⇒ Gem
:nodoc:
34 35 36 37 |
# File 'lib/pot/installers/gem.rb', line 34 def initialize(parent, gem, = {}, &block) #:nodoc: super parent, , &block @gem = gem end |
Instance Attribute Details
#gem ⇒ Object
:nodoc:
32 33 34 |
# File 'lib/pot/installers/gem.rb', line 32 def gem @gem end |
Instance Method Details
#source(location = nil) ⇒ Object
:nodoc:
39 40 41 42 43 44 45 |
# File 'lib/pot/installers/gem.rb', line 39 def source(location = nil) #:nodoc: # package defines an installer called source so here we specify a method directly # rather than rely on the automatic options processing since packages' method missing # won't be run return @options[:source] unless location @options[:source] = location end |