From 5f8a6543932a8b4f1fcdb02a7b1308e06aef0564 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 26 Jul 2012 22:00:25 -0700 Subject: [PATCH] Goodbye, instance_eval on Vagrant::Action::Builder! --- lib/vagrant/action/builder.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/vagrant/action/builder.rb b/lib/vagrant/action/builder.rb index da95af792..fdd7d9a6e 100644 --- a/lib/vagrant/action/builder.rb +++ b/lib/vagrant/action/builder.rb @@ -9,20 +9,14 @@ module Vagrant # # Building an action sequence is very easy: # - # app = Vagrant::Action::Builder.new do - # use MiddlewareA - # use MiddlewareB + # app = Vagrant::Action::Builder.new.tap do |b| + # b.use MiddlewareA + # b.use MiddlewareB # end # # Vagrant::Action.run(app) # class Builder - # Initializes the builder. An optional block can be passed which - # will be evaluated in the context of the instance. - def initialize(&block) - instance_eval(&block) if block_given? - end - # Returns a mergeable version of the builder. If `use` is called with # the return value of this method, then the stack will merge, instead # of being treated as a separate single middleware.