/usr/lib/ruby/1.8/ramaze/snippets/proc/locals.rb is in libramaze-ruby1.8 2010.06.18-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | module Ramaze
module CoreExtensions
# Extensions for Proc
module Proc
# returns a hash of localvar/localvar-values from proc, useful for template
# engines that do not accept bindings/proc and force passing locals via
# hash
# usage: x = 42; p Proc.new.locals #=> {'x'=> 42}
def locals
instance_eval('binding').locals
end
end
end
end
|