Module: Ronin::Support::Archive
- Defined in:
- lib/ronin/support/archive.rb,
lib/ronin/support/archive/tar.rb,
lib/ronin/support/archive/zip.rb,
lib/ronin/support/archive/mixin.rb,
lib/ronin/support/archive/tar/reader.rb,
lib/ronin/support/archive/tar/writer.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
Methods for reading or writing archive files.
Core-Ext Methods
Defined Under Namespace
Class Method Summary collapse
-
.tar(path) {|tar| ... } ⇒ Tar::Writer
Opens the tar file for writing.
-
.tar_open(path, mode: 'r') {|tar| ... } ⇒ Tar::Writer
Opens a tar file for reading or writing.
-
.tar_stream(io, mode: 'r') {|tar| ... } ⇒ Tar::Reader, Tar::Writer
Creates a tar stream around the IO object.
-
.untar(path) {|tar| ... } ⇒ Tar::Reader
Opens the tarped file for reading.
-
.unzip(path) {|zip| ... } ⇒ Zip::Reader
Opens the zipped file for reading.
-
.zip(path) {|zip| ... } ⇒ Zip::Writer
Opens the zip file for writing.
-
.zip_open(path, mode: 'r') {|zip| ... } ⇒ Zip::Writer
Opens a zip file for reading or writing.
Class Method Details
.tar(path) {|tar| ... } ⇒ Tar::Writer
Opens the tar file for writing.
140 141 142 |
# File 'lib/ronin/support/archive.rb', line 140 def self.tar(path,&block) tar_open(path, mode: 'w', &block) end |
.tar_open(path, mode: 'r') {|tar| ... } ⇒ Tar::Writer
Opens a tar file for reading or writing.
94 95 96 |
# File 'lib/ronin/support/archive.rb', line 94 def self.tar_open(path, mode: 'r', &block) Tar.open(path, mode: mode, &block) end |
.tar_stream(io, mode: 'r') {|tar| ... } ⇒ Tar::Reader, Tar::Writer
Creates a tar stream around the IO object.
65 66 67 |
# File 'lib/ronin/support/archive.rb', line 65 def self.tar_stream(io, mode: 'r', &block) Tar.new(io, mode: mode, &block) end |
.untar(path) {|tar| ... } ⇒ Tar::Reader
Opens the tarped file for reading.
117 118 119 |
# File 'lib/ronin/support/archive.rb', line 117 def self.untar(path,&block) tar_open(path,&block) end |
.unzip(path) {|zip| ... } ⇒ Zip::Reader
Opens the zipped file for reading.
192 193 194 |
# File 'lib/ronin/support/archive.rb', line 192 def self.unzip(path,&block) zip_open(path,&block) end |
.zip(path) {|zip| ... } ⇒ Zip::Writer
Opens the zip file for writing.
215 216 217 |
# File 'lib/ronin/support/archive.rb', line 215 def self.zip(path,&block) zip_open(path, mode: 'w', &block) end |
.zip_open(path, mode: 'r') {|zip| ... } ⇒ Zip::Writer
Opens a zip file for reading or writing.
169 170 171 |
# File 'lib/ronin/support/archive.rb', line 169 def self.zip_open(path, mode: 'r', &block) Zip.open(path, mode: mode, &block) end |