Ruby 元编程里原代码是这样的。。。using_test.rb 的单元测试出错。英文版 94 页
#using.rb
module Kernel
def using(resource)
begin
yield
ensure
resource.dispose
end
end
end```
#using_test.rb
#为什么下面这个没有拆为另一段代码显示效果
```ruby
require './using'
require 'using' #到这句就报错了。
....
C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- using (LoadError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
require'
from E:/Ruby/Project/ruby/meta/blocks/using_test.rb:12:in <top (required)>'
from -e:1:in
load'
from -e:1:in `
附 using_test.rb http://media.pragprog.com/titles/ppmetr/code/blocks/using_test.rb using.rb http://media.pragprog.com/titles/ppmetr/code/blocks/using.rb