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
 | 
			
		||||
 | 
			
		||||
    def self.load(path)
 | 
			
		||||
      Marshal.load(File.read(path))
 | 
			
		||||
      Marshal.load(File.open(path, 'rb') { |f| f.read })
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    def consume(path)
 | 
			
		||||
| 
						 | 
				
			
			@ -76,7 +76,7 @@ module Ebooks
 | 
			
		|||
    end
 | 
			
		||||
 | 
			
		||||
    def save(path)
 | 
			
		||||
      File.open(path, 'w') do |f|
 | 
			
		||||
      File.open(path, 'wb') do |f|
 | 
			
		||||
        f.write(Marshal.dump(self))
 | 
			
		||||
      end
 | 
			
		||||
      self
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue