"warning: shadowing outer local variable - hook"

This patch fixes a Ruby warning "warning: shadowing outer local variable - hook".