From: Ayumu AIZAWA Date: 2011-09-20T18:34:36+09:00 Subject: [ruby-dev:44519] [Ruby 1.9 - Bug #5305] YAML::DBM#update、#replace のコメントの間違いを修正する Issue #5305 has been updated by Ayumu AIZAWA. Assignee set to Ayumu AIZAWA Target version set to 1.9.x ruby -v changed from - to ruby 1.9.4dev (2011-09-19 trunk 33297) [x86_64-linux] I think, YAML::DBM#update be able to rewrite without #keys. --- lib/yaml/dbm.rb +++ lib/yaml/dbm.rb @@ -185,8 +185,8 @@ class DBM < ::DBM # # Returns +self+. def update( hsh ) - hsh.keys.each do |k| - self.store( k, hsh.fetch( k ) ) + hsh.each_pair do |k,v| + self.store( k, v ) end self end ---- But there are no test for YAML::DBM, so I'm writing test for these now. After my work, this issue would be closed. ---------------------------------------- Bug #5305: YAML::DBM#update、#replace のコメントの間違いを修正する http://redmine.ruby-lang.org/issues/5305 Author: Sho Hashimoto Status: Open Priority: Low Assignee: Ayumu AIZAWA Category: Target version: 1.9.x ruby -v: ruby 1.9.4dev (2011-09-19 trunk 33297) [x86_64-linux] YAML::DBM#update、#replace のコメントに each メソッドや each_pair メソッドがあれば引数として指定できる旨の記述がありますが、実際には keys.each しているため、正しくないようです。 -- http://redmine.ruby-lang.org