Class: Rupert::RPM::Signature::Store
- Inherits:
-
Object
- Object
- Rupert::RPM::Signature::Store
- Defined in:
- lib/rupert/rpm/signature/store.rb
Overview
Package information is mostly contained in headers. Headers are composed of an index and a store. The (raw) store holds semantic RPM information in an undefined order and without any structure (i.e. by concatenating all pieces together). Addressing of resources in the store is handled by header entries, which define data format, position and size. Responsibility of the store is to take care of extracting these pieces given proper addressing information.
Instance Method Summary collapse
-
#fetch(entry) ⇒ String
Fetches data pointed by given entry.
-
#initialize(io) ⇒ Store
constructor
Creates a new store by wrapping given chunck of raw data into a Store object.
Constructor Details
#initialize(io) ⇒ Store
Creates a new store by wrapping given chunck of raw data into a Store object.
19 20 21 |
# File 'lib/rupert/rpm/signature/store.rb', line 19 def initialize(io) @io = io end |
Instance Method Details
#fetch(entry) ⇒ String
Fetches data pointed by given entry.
28 29 30 31 |
# File 'lib/rupert/rpm/signature/store.rb', line 28 def fetch(entry) @io.seek(entry.offset, IO::SEEK_SET) @io.read(entry.count) end |