Class: Excavate::Extractors::RpmExtractor

Inherits:
Extractor
  • Object
show all
Defined in:
lib/excavate/extractors/rpm_extractor.rb

Instance Method Summary collapse

Methods inherited from Extractor

#initialize

Constructor Details

This class inherits a constructor from Excavate::Extractors::Extractor

Instance Method Details

#extract(target) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/excavate/extractors/rpm_extractor.rb', line 14

def extract(target)
  File.open(@archive, "rb") do |file|
    rpm = RPM::File.new(file)
    content = rpm.payload.read
    path = target_path(@archive, rpm.tags, target)

    File.write(path, content, mode: "wb")
  end
end