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,
lib/fpm/cookery/source_handler/local_path.rb

Defined Under Namespace

Classes: Curl, Git, Hg, LocalPath, Svn, Template

Constant Summary collapse

DEFAULT_HANDLER =
:curl
LOCAL_HANDLER =
:local_path

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, cachedir, builddir) ⇒ SourceHandler

Returns a new instance of SourceHandler.



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

def initialize(source, cachedir, builddir)
  @source = source
  @cachedir = cachedir
  @builddir = builddir

  if @source.provider?
    @source_provider = @source.provider
  elsif @source.local?
    @source_provider = LOCAL_HANDLER
  else
    @source_provider = DEFAULT_HANDLER
  end

  @handler = get_source_handler(@source_provider)
end

Instance Attribute Details

#source_urlObject (readonly)

Returns the value of attribute source_url.



18
19
20
# File 'lib/fpm/cookery/source_handler.rb', line 18

def source_url
  @source_url
end