aboutsummaryrefslogtreecommitdiffstats
path: root/lib/pstore.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pstore.rb')
-rw-r--r--lib/pstore.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pstore.rb b/lib/pstore.rb
index 0543986ae5..4a3434b283 100644
--- a/lib/pstore.rb
+++ b/lib/pstore.rb
@@ -13,7 +13,7 @@
# end
require "ftools"
-require "md5"
+require "digest/md5"
class PStore
class Error < StandardError
@@ -99,7 +99,7 @@ class PStore
content = file.read
@table = Marshal::load(content)
size = content.size
- md5 = MD5.new(content).digest
+ md5 = Digest::MD5.digest(content)
content = nil # unreference huge data
else
@table = {}
@@ -115,7 +115,7 @@ class PStore
if !read_only && !@abort
file.rewind
content = Marshal::dump(@table)
- if !md5 || size != content.size || md5 != MD5.new(content).digest
+ if !md5 || size != content.size || md5 != Digest::MD5.digest(content)
File::copy @filename, backup
begin
file.write(content)