Module: Omnizip::Formats::Rpm
- Defined in:
- lib/omnizip/formats/rpm.rb,
lib/omnizip/formats/rpm/tag.rb,
lib/omnizip/formats/rpm/lead.rb,
lib/omnizip/formats/rpm/entry.rb,
lib/omnizip/formats/rpm/header.rb,
lib/omnizip/formats/rpm/writer.rb,
lib/omnizip/formats/rpm/constants.rb
Overview
RPM package format support
Provides read and write access to RPM packages, extracting metadata and file contents from the payload.
Defined Under Namespace
Modules: Constants Classes: Entry, Header, Lead, Reader, Tag, Writer
Class Method Summary collapse
-
.extract(rpm_path, output_dir) ⇒ Object
Extract RPM to directory.
-
.info(path) ⇒ Hash
Get RPM information.
-
.list(path) ⇒ Array<String>
List files in RPM.
-
.open(path) {|reader| ... } ⇒ Reader
Open RPM package.
Class Method Details
.extract(rpm_path, output_dir) ⇒ Object
Extract RPM to directory
72 73 74 75 76 |
# File 'lib/omnizip/formats/rpm.rb', line 72 def extract(rpm_path, output_dir) self.open(rpm_path) do |rpm| rpm.extract(output_dir) end end |
.info(path) ⇒ Hash
Get RPM information
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/omnizip/formats/rpm.rb', line 82 def info(path) self.open(path) do |rpm| { name: rpm.name, version: rpm.version, release: rpm.release, epoch: rpm.epoch, arch: rpm.architecture, summary: rpm.summary, description: rpm.description, license: rpm.license, vendor: rpm.vendor, build_time: rpm.build_time, file_count: rpm.files.size, } end end |
.list(path) ⇒ Array<String>
List files in RPM
64 65 66 |
# File 'lib/omnizip/formats/rpm.rb', line 64 def list(path) self.open(path, &:files) end |