Class: FPM::Cookery::SourceHandler::Directory

Inherits:
Template
  • Object
show all
Defined in:
lib/fpm/cookery/source_handler/directory.rb

Constant Summary collapse

CHECKSUM =
false
NAME =
:directory

Instance Attribute Summary

Attributes inherited from Template

#builddir, #cachedir, #has_checksum, #name, #options, #url

Instance Method Summary collapse

Methods inherited from Template

#checksum?, #fetchable?, #initialize, #local_path, #source

Constructor Details

This class inherits a constructor from FPM::Cookery::SourceHandler::Template

Instance Method Details

#extract(config = {}) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fpm/cookery/source_handler/directory.rb', line 17

def extract(config = {})
  path = FPM::Cookery::Path.new(source.path)

  unless path.absolute?
    Log.error("Source path needs to be absolute: #{source.path}")
    raise "Source path needs to be absolute: #{source.path}"
  end

  Log.info("Copying files from #{path}")
  FileUtils.cp_r(path, builddir)
  builddir
end

#fetch(config = {}) ⇒ Object



13
14
15
# File 'lib/fpm/cookery/source_handler/directory.rb', line 13

def fetch(config = {})
  cachedir
end