Skip to content

Commit 9bb327f

Browse files
committed
* 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
1 parent 02e4428 commit 9bb327f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Sun Oct 2 11:28:09 2011 Aaron Patterson <aaron@tenderlovemaking.com>
2+
3+
* lib/yaml/store.rb: make initialize method signature match the
4+
superclass signature.
5+
16
Sun Oct 2 10:44:01 2011 Kazuki Tsujimoto <kazuki@callcc.net>
27

38
* io.c: fix documentation of ARGF.lineno=.

lib/yaml/store.rb

+5-10
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,15 @@ class YAML::Store < PStore
4646
#
4747
# Options passed in through +yaml_opts+ will be used when converting the
4848
# store to YAML via Hash#to_yaml().
49-
def initialize( *o )
50-
@opt = {}
51-
if String === o.first
52-
super(o.shift)
53-
end
54-
if o.last.is_a? Hash
55-
@opt.update(o.pop)
56-
end
49+
def initialize file_name, yaml_opts = {}
50+
@opt = yaml_opts
51+
super
5752
end
5853

5954
# :stopdoc:
6055

6156
def dump(table)
62-
@table.to_yaml(@opt)
57+
YAML.dump @table
6358
end
6459

6560
def load(content)
@@ -75,7 +70,7 @@ def marshal_dump_supports_canonical_option?
7570
false
7671
end
7772

78-
EMPTY_MARSHAL_DATA = {}.to_yaml
73+
EMPTY_MARSHAL_DATA = YAML.dump({})
7974
EMPTY_MARSHAL_CHECKSUM = Digest::MD5.digest(EMPTY_MARSHAL_DATA)
8075
def empty_marshal_data
8176
EMPTY_MARSHAL_DATA

0 commit comments

Comments
 (0)