lib/yaml/store.rb in rubysl-yaml-2.0.0 vs lib/yaml/store.rb in rubysl-yaml-2.0.2

- old
+ new

@@ -44,24 +44,19 @@ # If the file does not already exist, it will be created. # # # Options passed in through +yaml_opts+ will be used when converting the # store to YAML via Hash#to_yaml(). - def initialize( *o ) - @opt = {} - if String === o.first - super(o.shift) - end - if o.last.is_a? Hash - @opt.update(o.pop) - end + def initialize file_name, yaml_opts = {} + @opt = yaml_opts + super end # :stopdoc: def dump(table) - @table.to_yaml(@opt) + YAML.dump @table end def load(content) table = YAML.load(content) if table == false @@ -73,10 +68,10 @@ def marshal_dump_supports_canonical_option? false end - EMPTY_MARSHAL_DATA = {}.to_yaml + EMPTY_MARSHAL_DATA = YAML.dump({}) EMPTY_MARSHAL_CHECKSUM = Digest::MD5.digest(EMPTY_MARSHAL_DATA) def empty_marshal_data EMPTY_MARSHAL_DATA end def empty_marshal_checksum