Fix reading of binary metadata file

This commit is contained in:
Florian Weingarten 2015-07-09 13:40:36 -04:00
parent 90514b3536
commit 8bdfdae0ab
1 changed files with 2 additions and 4 deletions

View File

@ -130,9 +130,7 @@ module Jekyll
# #
# Returns nothing. # Returns nothing.
def write_metadata def write_metadata
File.open(metadata_file, 'wb') do |f| File.binwrite(metadata_file, Marshal.dump(metadata))
f.write(Marshal.dump(metadata))
end
end end
# Produce the absolute path of the metadata file # Produce the absolute path of the metadata file
@ -158,7 +156,7 @@ module Jekyll
# Returns the read metadata. # Returns the read metadata.
def read_metadata def read_metadata
@metadata = if !disabled? && File.file?(metadata_file) @metadata = if !disabled? && File.file?(metadata_file)
content = File.read(metadata_file) content = File.binread(metadata_file)
begin begin
Marshal.load(content) Marshal.load(content)