* lib/yaml/store.rb: make initialize method signature match the
superclass signature. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
02e4428ec5
commit
9bb327f132
@ -1,3 +1,8 @@
|
|||||||
|
Sun Oct 2 11:28:09 2011 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
|
* lib/yaml/store.rb: make initialize method signature match the
|
||||||
|
superclass signature.
|
||||||
|
|
||||||
Sun Oct 2 10:44:01 2011 Kazuki Tsujimoto <kazuki@callcc.net>
|
Sun Oct 2 10:44:01 2011 Kazuki Tsujimoto <kazuki@callcc.net>
|
||||||
|
|
||||||
* io.c: fix documentation of ARGF.lineno=.
|
* io.c: fix documentation of ARGF.lineno=.
|
||||||
|
@ -46,20 +46,15 @@ class YAML::Store < PStore
|
|||||||
#
|
#
|
||||||
# Options passed in through +yaml_opts+ will be used when converting the
|
# Options passed in through +yaml_opts+ will be used when converting the
|
||||||
# store to YAML via Hash#to_yaml().
|
# store to YAML via Hash#to_yaml().
|
||||||
def initialize( *o )
|
def initialize file_name, yaml_opts = {}
|
||||||
@opt = {}
|
@opt = yaml_opts
|
||||||
if String === o.first
|
super
|
||||||
super(o.shift)
|
|
||||||
end
|
|
||||||
if o.last.is_a? Hash
|
|
||||||
@opt.update(o.pop)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# :stopdoc:
|
# :stopdoc:
|
||||||
|
|
||||||
def dump(table)
|
def dump(table)
|
||||||
@table.to_yaml(@opt)
|
YAML.dump @table
|
||||||
end
|
end
|
||||||
|
|
||||||
def load(content)
|
def load(content)
|
||||||
@ -75,7 +70,7 @@ class YAML::Store < PStore
|
|||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
EMPTY_MARSHAL_DATA = {}.to_yaml
|
EMPTY_MARSHAL_DATA = YAML.dump({})
|
||||||
EMPTY_MARSHAL_CHECKSUM = Digest::MD5.digest(EMPTY_MARSHAL_DATA)
|
EMPTY_MARSHAL_CHECKSUM = Digest::MD5.digest(EMPTY_MARSHAL_DATA)
|
||||||
def empty_marshal_data
|
def empty_marshal_data
|
||||||
EMPTY_MARSHAL_DATA
|
EMPTY_MARSHAL_DATA
|
||||||
|
Loading…
x
Reference in New Issue
Block a user