From: Takahiro Kambe Date: 2011-08-09T10:22:35+09:00 Subject: [ruby-list:48289] Re: require 'dbi' の警告について こんにちは。 どこにつなごうか悩みましたが、一応こんな変更を加えると回避できるでしょ う。用途によっては警告の出力自体が邪魔になるケースもあるでしょう。 (dbi以外にdeprecated使っているのがあるかどうかは定かではありませんし、 そもそもちゃんと保守されているのかなぁ、dbi自体...。) -- 神戸 隆博 (かんべ たかひろ) at 仕事場 deprecatedの方: --- lib/deprecated.rb.orig 2011-08-09 00:21:03.000000000 +0000 +++ lib/deprecated.rb @@ -195,5 +195,3 @@ Module.send(:define_method, :deprecate, end) Deprecated.set_action(:warn) - -Deprecate = Deprecated dbiの方: --- lib/dbi.rb.orig 2011-08-09 00:22:44.000000000 +0000 +++ lib/dbi.rb @@ -69,7 +69,7 @@ class Class end end -Deprecate.set_action( +Deprecated.set_action( proc do |call| klass, meth = call.split(/[#.]/) klass = klass.split(/::/).inject(Module) { |a,x| a.const_get(x) } @@ -83,7 +83,7 @@ Deprecate.set_action( warn "ColumnInfo methods that do not match a component are deprecated and will eventually be removed" end - warn "You may change the result of calling deprecated code via Deprecate.set_action; Trace follows:" + warn "You may change the result of calling deprecated code via Deprecated.set_action; Trace follows:" warn caller[2..-1].join("\n") end )