<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>example/protectedlobster.ru</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -22,8 +22,12 @@ module Rack
       instance_eval(&amp;block)
     end
 
-    def use(middleware, *args)
-      @ins &lt;&lt; lambda { |app| middleware.new(app, *args) }
+    def use(middleware, *args, &amp;block)
+      @ins &lt;&lt; if block_given?
+        lambda { |app| middleware.new(app, *args, &amp;block) }
+      else
+        lambda { |app| middleware.new(app, *args) }
+      end
     end
 
     def run(app)</diff>
      <filename>lib/rack/builder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -25,4 +25,26 @@ context &quot;Rack::Builder&quot; do
     Rack::MockRequest.new(app).get(&quot;/&quot;).should.be.server_error
     Rack::MockRequest.new(app).get(&quot;/&quot;).should.be.server_error
   end
+
+  specify &quot;supports blocks on use&quot; do
+    app = Rack::Builder.new do
+      use Rack::ShowExceptions
+      use Rack::Auth::Basic do |username, password|
+        'secret' == password
+      end
+
+      run lambda { |env| [200, {}, 'Hi Boss'] }
+    end
+
+    response = Rack::MockRequest.new(app).get(&quot;/&quot;)
+    response.should.be.client_error
+    response.status.should.equal 401
+
+    # with auth...
+    response = Rack::MockRequest.new(app).get(&quot;/&quot;, 
+        'HTTP_AUTHORIZATION' =&gt; 'Basic ' + [&quot;joe:secret&quot;].pack(&quot;m*&quot;))
+    response.status.should.equal 200
+    response.body.to_s.should.equal 'Hi Boss'
+  end
+
 end</diff>
      <filename>test/spec_rack_builder.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>443896e2e9bcf46a3ba05cd085c0837c8d6a4c82</id>
    </parent>
  </parents>
  <author>
    <name>Christian Neukirchen</name>
    <email>chneukirchen@gmail.com</email>
  </author>
  <url>http://github.com/rtomayko/rack/commit/0639994b6b95ab737d5f86a97b110fa63a61dab3</url>
  <id>0639994b6b95ab737d5f86a97b110fa63a61dab3</id>
  <committed-date>2008-02-24T09:51:00-08:00</committed-date>
  <authored-date>2008-02-24T09:51:00-08:00</authored-date>
  <message>Let Rack::Builder#use accept blocks

Contributed by Corey Jewett.

darcs-hash:20080224175153-4fc50-92205606f938818e1a6e4e8d702ef3083f5e0c5a.gz</message>
  <tree>5e492a2e1aefac53b7ef6859fcd185c048097952</tree>
  <committer>
    <name>Christian Neukirchen</name>
    <email>chneukirchen@gmail.com</email>
  </committer>
</commit>
