diff options
Diffstat (limited to 'lib/yaml')
-rw-r--r-- | lib/yaml/store.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/yaml/store.rb b/lib/yaml/store.rb index 4f0384cc5e..e3a8e9fcdd 100644 --- a/lib/yaml/store.rb +++ b/lib/yaml/store.rb @@ -20,10 +20,24 @@ class YAML::Store < PStore end def load(content) - YAML::load(content) + table = YAML::load(content) + if table == false + {} + else + table + end end def marshal_dump_supports_canonical_option? false end + + EMPTY_MARSHAL_DATA = {}.to_yaml + EMPTY_MARSHAL_CHECKSUM = Digest::MD5.digest(EMPTY_MARSHAL_DATA) + def empty_marshal_data + EMPTY_MARSHAL_DATA + end + def empty_marshal_checksum + EMPTY_MARSHAL_CHECKSUM + end end |