From: "U.Nakamura" Date: 2007-02-06T03:46:24+09:00 Subject: [ruby-dev:30274] Object#*methods こんにちは、なかむら(う)です。 Object#*methodsがSymbol配列を返すようになったのと、SymbolがString のサブクラスじゃなくなったのとで、動かなくなったコードがある ようです。 影響範囲が調べきれないのですが、とりあえず気付いたところだけ パッチです。 Index: rss/parser.rb =================================================================== --- rss/parser.rb (revision 11633) +++ rss/parser.rb (working copy) @@ -4,7 +4,7 @@ rescue LoadError require "uri" end -unless Kernel.methods.include?("URI") +unless Kernel.methods.include?(:URI) module Kernel def URI(uri_str) # :doc: URI.parse(uri_str) @@ -230,7 +230,7 @@ def def_get_text_element(uri, name, file, line) register_uri(uri, name) - unless private_instance_methods(false).include?("start_#{name}") + unless private_instance_methods(false).include?("start_#{name}".to_sym) module_eval(<<-EOT, file, line) def start_#{name}(name, prefix, attrs, ns) uri = ns[prefix] Index: rss/rss.rb =================================================================== --- rss/rss.rb (revision 11633) +++ rss/rss.rb (working copy) @@ -25,13 +25,13 @@ end end - unless instance_methods.include?("w3cdtf") + unless instance_methods.include?(:w3cdtf) alias w3cdtf iso8601 end end module Enumerable - unless instance_methods.include?("sort_by") + unless instance_methods.include?(:sort_by) def sort_by collect do |x| [yield(x), x] @@ -45,7 +45,7 @@ end class Hash - unless instance_methods.include?("merge") + unless instance_methods.include?(:merge) def merge(other) dup.update(other) end @@ -53,7 +53,7 @@ end module Kernel - unless methods.include?("funcall") + unless methods.include?(:funcall) def funcall(*args, &block) __send__(*args, &block) end @@ -812,7 +812,7 @@ def other_element(need_convert, indent='') rv = [] private_methods.each do |meth| - if /\A([^_]+)_[^_]+_elements?\z/ =~ meth and + if /\A([^_]+)_[^_]+_elements?\z/ =~ meth.to_s and self.class::NSPOOL.has_key?($1) res = __send__(meth, need_convert, indent) rv << res if /\A\s*\z/ !~ res それでは。 -- U.Nakamura