Class: IronWorkerNG::Code::Container::Zip
- Defined in:
- lib/iron_worker_ng/code/container/zip.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #add(dest, src) ⇒ Object
- #close ⇒ Object
- #commit ⇒ Object
- #get_output_stream(dest, &block) ⇒ Object
-
#initialize ⇒ Zip
constructor
A new instance of Zip.
Methods inherited from Base
Constructor Details
#initialize ⇒ Zip
Returns a new instance of Zip.
9 10 11 12 13 14 |
# File 'lib/iron_worker_ng/code/container/zip.rb', line 9 def initialize super @name = @name + '.zip' @zip = ::Zip::File.open(@name, ::Zip::File::CREATE) end |
Instance Method Details
#add(dest, src) ⇒ Object
16 17 18 |
# File 'lib/iron_worker_ng/code/container/zip.rb', line 16 def add(dest, src) @zip.add(clear_dest(dest), src) end |
#close ⇒ Object
28 29 30 |
# File 'lib/iron_worker_ng/code/container/zip.rb', line 28 def close @zip.close end |
#commit ⇒ Object
20 21 22 |
# File 'lib/iron_worker_ng/code/container/zip.rb', line 20 def commit @zip.commit end |
#get_output_stream(dest, &block) ⇒ Object
24 25 26 |
# File 'lib/iron_worker_ng/code/container/zip.rb', line 24 def get_output_stream(dest, &block) @zip.get_output_stream(clear_dest(dest), &block) end |