diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-11 07:43:31 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-11 07:43:31 +0000 |
commit | 3f0387830924822fde321e3613ced1607ffc27c6 (patch) | |
tree | 8f45c73975b97dda9094a58f52815cc5b8230031 /lib/pstore.rb | |
parent | 4a407ec3a7be0b6d92b9a9b68c5d10b041f1120e (diff) |
* lib/yaml/store.rb (YAML::load): modified to support empty
database.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/pstore.rb')
-rw-r--r-- | lib/pstore.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/pstore.rb b/lib/pstore.rb index 54d4e7c3a6..a1ad768fbf 100644 --- a/lib/pstore.rb +++ b/lib/pstore.rb @@ -413,8 +413,8 @@ class PStore if data.empty? # This seems to be a newly-created file. table = {} - checksum = EMPTY_MARSHAL_CHECKSUM - size = EMPTY_MARSHAL_DATA.size + checksum = empty_marshal_checksum + size = empty_marshal_data.size else table = load(data) checksum = Digest::MD5.digest(data) @@ -511,6 +511,13 @@ class PStore def load(content) # :nodoc: Marshal::load(content) end + + def empty_marshal_data + EMPTY_MARSHAL_DATA + end + def empty_marshal_checksum + EMPTY_MARSHAL_CHECKSUM + end end # :enddoc: |