Class: FPM::Cookery::SourceHandler::Template
- Inherits:
-
Object
- Object
- FPM::Cookery::SourceHandler::Template
- Includes:
- Utils
- Defined in:
- lib/fpm/cookery/source_handler/template.rb
Constant Summary collapse
- NAME =
:template
- CHECKSUM =
true
Instance Attribute Summary collapse
-
#builddir ⇒ Object
readonly
Returns the value of attribute builddir.
-
#cachedir ⇒ Object
readonly
Returns the value of attribute cachedir.
-
#has_checksum ⇒ Object
readonly
Returns the value of attribute has_checksum.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #checksum? ⇒ Boolean
- #extract ⇒ Object
- #fetch ⇒ Object
-
#initialize(source_url, options, cachedir, builddir) ⇒ Template
constructor
A new instance of Template.
- #local_path ⇒ Object
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, , cachedir, builddir) @url = source_url @options = @cachedir = cachedir @builddir = builddir @has_checksum = self.class::CHECKSUM @name = self.class::NAME end |
Instance Attribute Details
#builddir ⇒ Object (readonly)
Returns the value of attribute builddir.
12 13 14 |
# File 'lib/fpm/cookery/source_handler/template.rb', line 12 def builddir @builddir end |
#cachedir ⇒ Object (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_checksum ⇒ Object (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 |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/fpm/cookery/source_handler/template.rb', line 12 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/fpm/cookery/source_handler/template.rb', line 12 def @options end |
#url ⇒ Object (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
31 32 33 |
# File 'lib/fpm/cookery/source_handler/template.rb', line 31 def checksum? @has_checksum end |
#extract ⇒ Object
27 28 29 |
# File 'lib/fpm/cookery/source_handler/template.rb', line 27 def extract raise "#{self}#extract not implemented!" end |
#fetch ⇒ Object
23 24 25 |
# File 'lib/fpm/cookery/source_handler/template.rb', line 23 def fetch raise "#{self}#fetch not implemented!" end |
#local_path ⇒ Object
35 36 37 |
# File 'lib/fpm/cookery/source_handler/template.rb', line 35 def local_path @local_path ||= cachedir/([:as] || File.basename(url)) end |