Class: Zip::CentralDirectory

Inherits:
Object
  • Object
show all
Defined in:
lib/buildr/packaging/zip.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#write_to_stream(io) ⇒ Object

Patch to add entries in alphabetical order.



35
36
37
38
39
40
41
# File 'lib/buildr/packaging/zip.rb', line 35

def write_to_stream(io)
  offset = io.tell
  @entry_set.sort { |a,b| a.name <=> b.name }.each { |entry| entry.write_c_dir_entry(io) }
  eocd_offset = io.tell
  cdir_size = eocd_offset - offset
  write_e_o_c_d(io, offset, cdir_size)
end