Webgen::Source::TarArchive

Description

The tar archive source can be used to include the files from a (possibly gzipped) tar archive. The used archive can be stored locally on the file system but it is also possible to use archives accessible via the http(s) and ftp protcols.

This extension is only available if you have installed the archive-tar-minitar library. The preferred way to do this is via Rubygems:

gem install archive-tar-minitar

The first parameter for the tar archive source is the URL of the archive and the second, optional, parameter specifies a path pattern (see File.fnmatch) for selecting the to-be-used files/directories in the tar archive.

Examples

The used sources can be specified via the sources configuration option, so each of the examples below can be specified in the config.yaml file.

  1. Using all files/directories from a local tar archive in addition the default configuration:

    sources:
      - [/, Webgen::Source::FileSystem, src]
      - [/, Webgen::Source::TarArchive, archive.tar]
    
  2. Using images stored in a remote gzipped tar archive in addition to the default configuration:

    sources:
      - [/, Webgen::Source::FileSystem, src]
      - [/, Webgen::Source::TarArchive, http://www.example.com/archive/data.tgz, **/*.jpg]