From: tadayoshi funaba Date: 2009-03-28T17:33:10+09:00 Subject: [ruby-core:23041] [Bug #1135] Problem renaming CMath.hypot in Ruby1.9 Issue #1135 has been updated by tadayoshi funaba. I wrote an independence version. It seems to be defference between them evaluaters. module CMath include Math module_function :hypot end Object.instance_eval{remove_const :Math} Math = CMath class Module def alias_method_chain( target, feature ) alias_method "#{target}_without_#{feature}", target alias_method target, "#{target}_with_#{feature}" end end Math.module_eval do define_method( :hypot_with_test ) do |a,b| puts "hypot_with_test( #{a}, #{b} )" hypot_without_test( a, b ) end alias_method_chain :hypot, :test module_function :hypot_without_test module_function :hypot end puts Math.hypot( 3, 4 ) ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1135 ---------------------------------------- http://redmine.ruby-lang.org