Use binary read/write mode for Windows
This commit is contained in:
parent
0ac940a1e0
commit
34b8c5d0a0
1 changed files with 2 additions and 2 deletions
|
@ -14,7 +14,7 @@ module Ebooks
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.load(path)
|
def self.load(path)
|
||||||
Marshal.load(File.read(path))
|
Marshal.load(File.open(path, 'rb') { |f| f.read })
|
||||||
end
|
end
|
||||||
|
|
||||||
def consume(path)
|
def consume(path)
|
||||||
|
@ -76,7 +76,7 @@ module Ebooks
|
||||||
end
|
end
|
||||||
|
|
||||||
def save(path)
|
def save(path)
|
||||||
File.open(path, 'w') do |f|
|
File.open(path, 'wb') do |f|
|
||||||
f.write(Marshal.dump(self))
|
f.write(Marshal.dump(self))
|
||||||
end
|
end
|
||||||
self
|
self
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue