Class: Archive::Writer
- Inherits:
-
Object
- Object
- Archive::Writer
- Defined in:
- lib/libarchive_rs.rb
Instance Method Summary collapse
-
#new_entry ⇒ Object
Creates a new Entry.
-
#write_data(data = nil) ⇒ Object
Write data to Archive.
Instance Method Details
#new_entry ⇒ Object
Creates a new Entry. An Entry holds the meta data for an item stored in an Archive, such as filetype, mode, owner, etc. It is typically populated by a call to copy_stat. It is written before the actual data.
129 130 131 132 133 134 135 136 |
# File 'lib/libarchive_rs.rb', line 129 def new_entry() entry = self.new_entry_helper if block_given? yield entry else return entry end end |
#write_data(data = nil) ⇒ Object
Write data to Archive. If a block is given, data returned from the block is stored until the block returns nil.
143 144 145 146 147 148 149 150 151 |
# File 'lib/libarchive_rs.rb', line 143 def write_data(data = nil) if block_given? while data = yield self.write_data_helper(data) end else self.write_data_helper(data) end end |