Class: Suvii::Extract
- Inherits:
-
Object
- Object
- Suvii::Extract
- Defined in:
- lib/suvii/extract.rb,
lib/suvii/extract/zip.rb,
lib/suvii/extract/targz.rb
Overview
Defined Under Namespace
Constant Summary collapse
- UnknownFormatError =
Class.new(StandardError)
- TARGZ_RE =
/\.t(ar\.)?gz\z/
- ZIP_RE =
/\.zip\z/
Instance Attribute Summary collapse
- #source ⇒ String readonly
- #strip_components ⇒ Integer? readonly
Class Method Summary collapse
-
.class_for(source) ⇒ Targz, Zip
Detects proper class for given archive path.
Instance Method Summary collapse
-
#extract_to(destination) ⇒ String
Performs archive extraction.
-
#initialize(source, options = {}) ⇒ Extract
constructor
A new instance of Extract.
Constructor Details
#initialize(source, options = {}) ⇒ Extract
Returns a new instance of Extract.
31 32 33 34 |
# File 'lib/suvii/extract.rb', line 31 def initialize(source, = {}) @source = source @strip_components = [:strip_components] end |
Instance Attribute Details
#source ⇒ String (readonly)
22 23 24 |
# File 'lib/suvii/extract.rb', line 22 def source @source end |
#strip_components ⇒ Integer? (readonly)
25 26 27 |
# File 'lib/suvii/extract.rb', line 25 def strip_components @strip_components end |
Class Method Details
Instance Method Details
#extract_to(destination) ⇒ String
Performs archive extraction.
40 41 42 |
# File 'lib/suvii/extract.rb', line 40 def extract_to(destination) raise NotImplementedError end |