Skip to content

Commit 2db3106

Browse files
author
Zachary Scott
committed
Use GzipWriter to open and write to the file
1 parent ad47a91 commit 2db3106

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/rdoc/generator/json_index.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@ def generate_gzipped
167167
search_index = search_index_file.read
168168

169169
debug_msg "Writing gzipped search index to %s" % outfile
170-
outfile.open 'w', 0644 do |io|
171-
gz = Zlib::GzipWriter.new(io)
170+
171+
Zlib::GzipWriter.open(outfile) do |gz|
172+
gz.mtime = File.mtime(search_index_file)
173+
gz.orig_name = search_index_file.to_s
172174
gz.write search_index
173175
gz.close
174176
end

0 commit comments

Comments
 (0)