Permalink
Browse files

Merge branch 'master' of github.com:sinatra/sinatra

  • Loading branch information...
2 parents 9542b5a + 22cb80c commit b5d8dbca1c2304b1d6894f107df5e09e727fa693 @rkh rkh committed Mar 15, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/sinatra/base.rb
View
9 lib/sinatra/base.rb
@@ -1380,15 +1380,16 @@ def prototype
# pipeline. The object is guaranteed to respond to #call but may not be
# an instance of the class new was called on.
def new(*args, &bk)
- build(Rack::Builder.new, *args, &bk).to_app
+ build(new!(*args, &bk)).to_app
end
# Creates a Rack::Builder instance with all the middleware set up and
- # an instance of this class as end point.
- def build(builder, *args, &bk)
+ # the given +app+ as end point.
+ def build(app)
+ builder = Rack::Builder.new
setup_default_middleware builder
setup_middleware builder
- builder.run new!(*args, &bk)
+ builder.run app
builder
end

0 comments on commit b5d8dbc

Please sign in to comment.