Class: FPM::Cookery::SourceHandler::Template

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/fpm/cookery/source_handler/template.rb

Direct Known Subclasses

Curl, Git, Hg, LocalPath, Svn

Constant Summary collapse

NAME =
:template
CHECKSUM =
true

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Template.



14
15
16
17
18
19
20
21
# File 'lib/fpm/cookery/source_handler/template.rb', line 14

def initialize(source_url, options, cachedir, builddir)
  @url = source_url
  @options = options
  @cachedir = cachedir
  @builddir = builddir
  @has_checksum = self.class::CHECKSUM
  @name = self.class::NAME
end

Instance Attribute Details

#builddirObject (readonly)

Returns the value of attribute builddir.



12
13
14
# File 'lib/fpm/cookery/source_handler/template.rb', line 12

def builddir
  @builddir
end

#cachedirObject (readonly)

Returns the value of attribute cachedir.



12
13
14
# File 'lib/fpm/cookery/source_handler/template.rb', line 12

def cachedir
  @cachedir
end

#has_checksumObject (readonly)

Returns the value of attribute has_checksum.



12
13
14
# File 'lib/fpm/cookery/source_handler/template.rb', line 12

def has_checksum
  @has_checksum
end

#nameObject (readonly)

Returns the value of attribute name.



12
13
14
# File 'lib/fpm/cookery/source_handler/template.rb', line 12

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



12
13
14
# File 'lib/fpm/cookery/source_handler/template.rb', line 12

def options
  @options
end

#urlObject (readonly)

Returns the value of attribute url.



12
13
14
# File 'lib/fpm/cookery/source_handler/template.rb', line 12

def url
  @url
end

Instance Method Details

#checksum?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/fpm/cookery/source_handler/template.rb', line 35

def checksum?
  @has_checksum
end

#extractObject



31
32
33
# File 'lib/fpm/cookery/source_handler/template.rb', line 31

def extract
  raise "#{self}#extract not implemented!"
end

#fetchObject



27
28
29
# File 'lib/fpm/cookery/source_handler/template.rb', line 27

def fetch
  raise "#{self}#fetch not implemented!"
end

#local_pathObject



39
40
41
# File 'lib/fpm/cookery/source_handler/template.rb', line 39

def local_path
  @local_path ||= cachedir/(options[:as] || File.basename(url))
end

#sourceObject



23
24
25
# File 'lib/fpm/cookery/source_handler/template.rb', line 23

def source
  @url
end