summaryrefslogtreecommitdiff
path: root/lib/pstore.rb
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-12-01 14:07:01 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-12-01 14:07:01 +0000
commit31e15f76063304e4bcffb3c6c5e7b28d26cc44e5 (patch)
treeb356ffec163f79faf0c3a7c980f459d24077b941 /lib/pstore.rb
parent3dfb98cea26048453641e0f3e5f795d9568420d4 (diff)
Reflect the update of the MD5 module which is now Digest::MD5.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 0543986..4a3434b 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)