Module: Ronin::Support::Archive::Zip
- Defined in:
- lib/ronin/support/archive/zip.rb,
lib/ronin/support/archive/zip/reader.rb,
lib/ronin/support/archive/zip/writer.rb,
lib/ronin/support/archive/zip/reader/entry.rb,
lib/ronin/support/archive/zip/reader/statistics.rb
Overview
Handles zip archive reading/writing.
Defined Under Namespace
Class Method Summary collapse
-
.new(path, mode: 'r') {|zip| ... } ⇒ Reader, Writer
Creates a zip archive reader or writer object.
-
.open(path, mode: 'r') {|gz| ... } ⇒ Reader, Writer
Opens a zip file for reading or writing.
Class Method Details
.new(path, mode: 'r') {|zip| ... } ⇒ Reader, Writer
Creates a zip archive reader or writer object.
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/ronin/support/archive/zip.rb', line 56 def self.new(path, mode: 'r', &block) zip_class = if mode.include?('w') || mode.include?('a') Writer elsif mode.include?('r') Reader else raise(ArgumentError,"mode argument must include either 'r', 'w', or 'a': #{mode.inspect}") end return zip_class.new(path,&block) end |
.open(path, mode: 'r') {|gz| ... } ⇒ Reader, Writer
Opens a zip file for reading or writing.
91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/ronin/support/archive/zip.rb', line 91 def self.open(path, mode: 'r', &block) zip_class = if mode.include?('w') || mode.include?('a') Writer elsif mode.include?('r') Reader else raise(ArgumentError,"mode argument must include either 'r', 'w', or 'a'") end return zip_class.open(path,&block) end |