Sha256: 4ddbbef63c180e2484a0f980d1b3fb850a0fb86445fb15c78ba97d814b755395

Contents?: true

Size: 703 Bytes

Versions: 11

Compression:

Stored size: 703 Bytes

Contents

#
# YAML::Store
#
require 'yaml'
require 'pstore'

class YAML::Store < PStore
  def initialize( *o )
    @opt = YAML::DEFAULTS.dup
    if String === o.first
      super(o.shift)
    end
    if o.last.is_a? Hash
      @opt.update(o.pop)
    end
  end

  def dump(table)
    @table.to_yaml(@opt)
  end

  def 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

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
rubysl-yaml-1.1.0 lib/yaml/store.rb
rubysl-yaml-1.0.1 lib/yaml/store.rb
ruby_on_ruby-0.0.1 vendor/javascripts/emscripted-ruby/lib/yaml/store.rb
shoesgem-0.1514.0 shoes/ruby/lib/yaml/store.rb
shoesgem-0.1480.0 shoes/ruby/lib/yaml/store.rb
shoesgem-0.1469.0 shoes/ruby/lib/yaml/store.rb
shoesgem-0.1430.0 shoes/ruby/lib/yaml/store.rb
shoesgem-0.1429.0 shoes/ruby/lib/yaml/store.rb
shoesgem-0.1428.0 shoes/ruby/lib/yaml/store.rb
shoesgem-0.1426.0 shoes/ruby/lib/yaml/store.rb
shoesgem-0.1424.0 shoes/ruby/lib/yaml/store.rb