Class: Archive::Ar::Writer
- Inherits:
-
Object
- Object
- Archive::Ar::Writer
- Defined in:
- lib/archive/ar/writer.rb
Instance Method Summary collapse
- #build_ar ⇒ Object
- #build_ar_entry(file) ⇒ Object
-
#initialize(filenames) ⇒ Writer
constructor
A new instance of Writer.
- #write(dest_file, options = {}) ⇒ Object
Constructor Details
#initialize(filenames) ⇒ Writer
Returns a new instance of Writer.
4 5 6 |
# File 'lib/archive/ar/writer.rb', line 4 def initialize(filenames) @filenames = filenames end |
Instance Method Details
#build_ar ⇒ Object
14 15 16 17 18 |
# File 'lib/archive/ar/writer.rb', line 14 def build_ar @filenames.collect do |f| build_ar_entry(f) end end |
#build_ar_entry(file) ⇒ Object
8 9 10 11 12 |
# File 'lib/archive/ar/writer.rb', line 8 def build_ar_entry(file) header = Archive::Ar::Format.build_header(file) data = File.read(file) [header, data].join end |