lib/twitter_ebooks/model.rb in twitter_ebooks-2.1.8 vs lib/twitter_ebooks/model.rb in twitter_ebooks-2.1.9

- old
+ new

@@ -12,11 +12,11 @@ def self.consume(txtpath) Model.new.consume(txtpath) end def self.load(path) - Marshal.load(File.read(path)) + Marshal.load(File.open(path, 'rb') { |f| f.read }) end def consume(path) content = File.read(path) @hash = Digest::MD5.hexdigest(content) @@ -74,10 +74,10 @@ self end def save(path) - File.open(path, 'w') do |f| + File.open(path, 'wb') do |f| f.write(Marshal.dump(self)) end self end