HTTPS clone URL

Subversion checkout URL

Make Proc::from_env duplicate a passed object (env) and reset its klass if the
receiver class is different from env's class to support following code:
class MyProc < Proc
end
MyProc.new(&proc) # => should return an instance of MyProc
By this modification, we shoudn't use the Proc::from_env to assign a block
to a method parameter like this:
def each(&block)
# ...
end
Instead, we should use the original Proc::from_env. The reason is that when a
sub-classed proc instance is passed to such a method, the proc would
unnecessarily be converted to a Proc by the modified Proc::from_env.