Class: Omnizip::ArchiveHandlers::SevenZipHandler::FileProxy
- Inherits:
-
Object
- Object
- Omnizip::ArchiveHandlers::SevenZipHandler::FileProxy
- Defined in:
- lib/omnizip/archive_handlers/seven_zip_handler.rb
Overview
Translates the generic add(name, source_path) interface to
the 7z writer's add_file(file_path, archive_path).
Instance Method Summary collapse
- #add(name, source_path = nil) ⇒ Object
-
#initialize(writer) ⇒ FileProxy
constructor
A new instance of FileProxy.
Constructor Details
#initialize(writer) ⇒ FileProxy
Returns a new instance of FileProxy.
39 40 41 |
# File 'lib/omnizip/archive_handlers/seven_zip_handler.rb', line 39 def initialize(writer) @writer = writer end |
Instance Method Details
#add(name, source_path = nil) ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/omnizip/archive_handlers/seven_zip_handler.rb', line 43 def add(name, source_path = nil) if source_path.nil? raise ArgumentError, "directory entries are not supported in .7z " \ "convenience compression" end @writer.add_file(source_path, name) end |