lib/tasks/zip.rb in buildr-1.2.1 vs lib/tasks/zip.rb in buildr-1.2.2

- old
+ new

@@ -577,19 +577,16 @@ end module Zip #:nodoc: - class ZipEntrySet #:nodoc: - # Make sure entries are returned in sorted order so the ZIP - # index is human readable instead of random hashtable order. - def entries() - @entrySet.values.sort + class ZipCentralDirectory #:nodoc: + # Patch to add entries in alphabetical order. + def write_to_stream(io) + offset = io.tell + @entrySet.sort { |a,b| a.name <=> b.name }.each { |entry| entry.write_c_dir_entry(io) } + write_e_o_c_d(io, offset) end - - def each(&block) - entries.each(&block) - end - end + end