Class: FPM::Cookery::SourceHandler

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/fpm/cookery/source_handler.rb,
lib/fpm/cookery/source_handler/hg.rb,
lib/fpm/cookery/source_handler/git.rb,
lib/fpm/cookery/source_handler/svn.rb,
lib/fpm/cookery/source_handler/curl.rb,
lib/fpm/cookery/source_handler/template.rb

Defined Under Namespace

Classes: Curl, Git, Hg, Svn, Template

Constant Summary collapse

DEFAULT_HANDLER =
:curl

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_url, options, cachedir, builddir) ⇒ SourceHandler

Returns a new instance of SourceHandler.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fpm/cookery/source_handler.rb', line 18

def initialize(source_url, options, cachedir, builddir)
  # The reason for these checks is related to the test cases
  # Test cases for individual recipe attributes
  # are not setting spec before hand (due to delegation chain?)
  # Additionally, one test actually has options being sent as a String
  if ( options.nil? || options.class == String || options.has_key?(:with) == false)
    @source_provider = DEFAULT_HANDLER
  else
    @source_provider = options[:with]
  end
  @source_url = source_url
  @options = options
  @cachedir = cachedir
  @builddir = builddir
  @handler = get_source_handler(@source_provider)
end

Instance Attribute Details

#source_urlObject (readonly)

Returns the value of attribute source_url.



16
17
18
# File 'lib/fpm/cookery/source_handler.rb', line 16

def source_url
  @source_url
end