This class is used to read source paths from a (gzipped) tar archive. The archive can be remote (http(s) or ftp) or local.
For example, the following are all valid URIs:
http://example.com/directory/file.tgz /home/test/my.tar.gz ftp://ftp.example.com/archives/archive.tar
The glob (see File.fnmatch for details) that is used to specify which paths in the archive should be returned by paths.
Return all paths in the tar archive available at uri.
# File lib/webgen/source/tararchive.rb, line 58 def paths if !defined?(@paths) stream = open(@uri) stream = Zlib::GzipReader.new(stream) if @uri =~ /(\.tar\.gz|\.tgz)$/ Archive::Tar::Minitar::Input.open(stream) do |input| @paths = input.collect do |entry| path = entry.full_name next unless File.fnmatch(@glob, path, File::FNM_DOTMATCH|File::FNM_CASEFOLD|File::FNM_PATHNAME) path += '/' if entry.directory? && path[-1,1] != '/' path = '/' + path unless path[0,1] == '/' Path.new(path, entry.read, Time.at(entry.mtime), @uri) end.compact.to_set end end @paths end
Generated with the Darkfish Rdoc Generator 2.