Class: Pack::Writer
- Inherits:
-
Object
- Object
- Pack::Writer
- Defined in:
- lib/pack/writer.rb
Instance Method Summary collapse
-
#initialize(output, database, options = {}) ⇒ Writer
constructor
A new instance of Writer.
- #write_objects(rev_list) ⇒ Object
Constructor Details
#initialize(output, database, options = {}) ⇒ Writer
Returns a new instance of Writer.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/pack/writer.rb', line 11 def initialize(output, database, = {}) @output = output @database = database @digest = Digest::SHA1.new @offset = 0 @compression = .fetch(:compression, Zlib::DEFAULT_COMPRESSION) @allow_ofs = [:allow_ofs] @progress = [:progress] end |
Instance Method Details
#write_objects(rev_list) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/pack/writer.rb', line 22 def write_objects(rev_list) prepare_pack_list(rev_list) compress_objects write_header write_entries @output.write(@digest.digest) end |