Class: Falkor::Extract::Gem
- Inherits:
-
Object
- Object
- Falkor::Extract::Gem
- Defined in:
- lib/falkor/extract/gem.rb
Instance Method Summary collapse
- #extract ⇒ Object
-
#initialize(file_name) ⇒ Gem
constructor
A new instance of Gem.
Constructor Details
#initialize(file_name) ⇒ Gem
Returns a new instance of Gem.
6 7 8 |
# File 'lib/falkor/extract/gem.rb', line 6 def initialize(file_name) @file_name = file_name end |
Instance Method Details
#extract ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/falkor/extract/gem.rb', line 10 def extract ::Gem::Package::FileSource.new(file_name).with_read_io do |io| ::Gem::Package::TarReader.new(io).each do |entry| next if entry.full_name != "data.tar.gz" write_tar_file(entry.read) remove_file break # ignore further entries end end tar_file_name end |