Class: Omnizip::ArchiveHandlers::TarHandler::EntryProxy
- Inherits:
-
Object
- Object
- Omnizip::ArchiveHandlers::TarHandler::EntryProxy
- Defined in:
- lib/omnizip/archive_handlers/tar_handler.rb
Overview
Translates the generic add(name, source_path) interface:
a bare add(name) is a directory ENTRY (no source on disk
relative to the caller), which the Tar writer's own add
would misread as a CWD-relative path.
Instance Method Summary collapse
- #add(name, source_path = nil) ⇒ Object
- #add_data(name, data) ⇒ Object
-
#initialize(writer) ⇒ EntryProxy
constructor
A new instance of EntryProxy.
Constructor Details
#initialize(writer) ⇒ EntryProxy
Returns a new instance of EntryProxy.
46 47 48 |
# File 'lib/omnizip/archive_handlers/tar_handler.rb', line 46 def initialize(writer) @writer = writer end |
Instance Method Details
#add(name, source_path = nil) ⇒ Object
50 51 52 53 54 |
# File 'lib/omnizip/archive_handlers/tar_handler.rb', line 50 def add(name, source_path = nil) return @writer.add_directory(name) if source_path.nil? @writer.add(name, source_path) end |
#add_data(name, data) ⇒ Object
56 57 58 |
# File 'lib/omnizip/archive_handlers/tar_handler.rb', line 56 def add_data(name, data) @writer.add_data(name, data) end |