Class: Sprinkle::Installers::Gem

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

Instance Attribute Summary collapse

Attributes inherited from Installer

#delivery, #options, #package

Instance Method Summary collapse

Methods inherited from Installer

#defaults, #method_missing, #process

Constructor Details

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

Returns a new instance of Gem.



6
7
8
9
# File 'lib/sprinkle/installers/gem.rb', line 6

def initialize(parent, gem, options = {}, &block)
  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

Returns the value of attribute gem.



4
5
6
# File 'lib/sprinkle/installers/gem.rb', line 4

def gem
  @gem
end

Instance Method Details

#source(location = nil) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/sprinkle/installers/gem.rb', line 11

def source(location = nil)
  # 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