提交 974ff0dd 编写于 作者: A Aaron Patterson

singleton method added is no longer needed

上级 0bea9fd6
......@@ -332,7 +332,7 @@ def migrate(direction)
end
result = nil
time = Benchmark.measure { result = send("#{direction}") }
time = Benchmark.measure { result = send(direction) }
case direction
when :up then announce "migrated (%.4fs)" % time.real; write
......@@ -342,24 +342,6 @@ def migrate(direction)
result
end
# Because the method added may do an alias_method, it can be invoked
# recursively. We use @ignore_new_methods as a guard to indicate whether
# it is safe for the call to proceed.
def singleton_method_added(sym) #:nodoc:
return if defined?(@ignore_new_methods) && @ignore_new_methods
begin
@ignore_new_methods = true
case sym
when :up, :down
singleton_class.send(:alias_method_chain, sym, "benchmarks")
end
ensure
@ignore_new_methods = false
end
end
def write(text="")
puts(text) if verbose
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册