<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>spec/public/controller/controllers/streaming.rb</filename>
    </added>
    <added>
      <filename>spec/public/controller/streaming_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -51,7 +51,7 @@ spec = Gem::Specification.new do |s|
   s.description  = PROJECT_DESCRIPTION
   s.executables  = %w( merb )
   s.require_path = &quot;lib&quot;
-  s.files        = %w( LICENSE README Rakefile TODO CHANGELOG PUBLIC_CHANGELOG CONTRIBUTORS ) + Dir[&quot;{bin,lib}/**/*&quot;]
+  s.files        = %w( LICENSE README Rakefile TODO CHANGELOG PUBLIC_CHANGELOG CONTRIBUTORS ) + Dir[&quot;{doc/rdoc,bin,lib}/**/*&quot;]
 
   # use minigems by default
   # s.minigems         = true</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -10,9 +10,9 @@ root = root.to_a.empty? ? Dir.getwd : root
 if File.directory?(gems_dir = File.join(root, 'gems'))
   $BUNDLE = true; Gem.clear_paths; Gem.path.unshift(gems_dir)
   # Warn if local merb-core is available but not loaded.
-  if !($0 =~ /^(\.\/)?bin\/merb$/) &amp;&amp; 
+  if File.expand_path($0).index(root) != 0 &amp;&amp; 
     (local_mc = Dir[File.join(gems_dir, 'specifications', 'merb-core-*.gemspec')].last)
-    puts &quot;Warning: please use bin/merb to load #{File.basename(local_mc, '.gemspec')} from ./gems&quot;
+    puts &quot;Warning: please use bin/#{File.basename($0)} to load #{File.basename(local_mc, '.gemspec')} from ./gems&quot;
   end
 end
 </diff>
      <filename>lib/merb-core.rb</filename>
    </modified>
    <modified>
      <diff>@@ -237,7 +237,11 @@ module Merb
           opts.on(&quot;-V&quot;, &quot;--verbose&quot;, &quot;Print extra information&quot;) do
             options[:verbose] = true
           end
-          
+
+          opts.on(&quot;-C&quot;, &quot;--console-trap&quot;, &quot;Enter an irb console on ^C&quot;) do
+            options[:console_trap] = true
+          end
+
           opts.on(&quot;-?&quot;, &quot;-H&quot;, &quot;--help&quot;, &quot;Show this help message&quot;) do
             puts opts
             exit</diff>
      <filename>lib/merb-core/config.rb</filename>
    </modified>
    <modified>
      <diff>@@ -239,10 +239,30 @@ module Merb
     # from nginx. For more information, see the nginx wiki:
     # http://wiki.codemongers.com/NginxXSendfile
     #
+    # and the following sample gist:
+    # http://gist.github.com/11225
+    #
+    # there's also example application up on GitHub:
+    #
+    # http://github.com/michaelklishin/nginx-x-accel-redirect-example-application/tree/master
+    #
+    # Unless Content-Disposition is set before calling this method,
+    # it is set to attachment with streamed file name.
+    #
     # ==== Parameters
-    # file&lt;String&gt;:: Path to file to send to the client.
-    def nginx_send_file(file)
-      headers['X-Accel-Redirect'] = file
+    # path&lt;String&gt;:: Path to file to send to the client.
+    # content_type&lt;String&gt;:: content type header value. By default is set to empty string to let
+    #                        Nginx detect it.
+    #
+    # ==== Return
+    # One space string.
+    def nginx_send_file(path, content_type = &quot;&quot;)
+      # Let Nginx detect content type unless it is explicitly set
+      headers['Content-Type']        = content_type
+      headers[&quot;Content-Disposition&quot;] ||= &quot;attachment; filename=#{path.split('/').last}&quot;
+      
+      headers['X-Accel-Redirect']    = path
+      
       return ' '
     end  
   </diff>
      <filename>lib/merb-core/controller/mixins/controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -46,7 +46,13 @@ module Merb
           end
         else
           trap('TERM') { exit }
-          trap('INT') { puts &quot;\nExiting&quot;; exit }
+
+          if Merb::Config[:console_trap]
+            add_irb_trap
+          else
+            trap('INT') { puts &quot;\nExiting&quot;; exit }
+          end
+
           puts &quot;Running bootloaders...&quot; if Merb::Config[:verbose]
           BootLoader.run
           puts &quot;Starting Rack adapter...&quot; if Merb::Config[:verbose]
@@ -249,6 +255,30 @@ module Merb
       rescue Errno::EPERM =&gt; e
         puts &quot;Couldn't change user and group to #{user}:#{group}: #{e}&quot;
       end
+
+      def add_irb_trap
+        trap('INT') do
+          exit if @interrupted
+          @interrupted = true
+          puts &quot;Interrupt a second time to quit&quot;
+          Kernel.sleep 1.5
+          ARGV.clear # Avoid passing args to IRB
+
+          if @irb.nil?
+            require 'irb'
+            IRB.setup(nil)
+            @irb = IRB::Irb.new(nil)
+            IRB.conf[:MAIN_CONTEXT] = @irb.context
+          end
+
+          trap(:INT) { @irb.signal_handle }
+          catch(:IRB_EXIT) { @irb.eval_input }
+
+          puts &quot;Exiting IRB mode, back in server mode&quot;
+          @interrupted = false
+          add_irb_trap
+        end
+      end
     end
   end
 end</diff>
      <filename>lib/merb-core/server.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,5 +9,6 @@ require File.join(__DIR__, &quot;controllers&quot;, &quot;authentication&quot;)
 require File.join(__DIR__, &quot;controllers&quot;, &quot;redirect&quot;)
 require File.join(__DIR__, &quot;controllers&quot;, &quot;cookies&quot;)
 require File.join(__DIR__, &quot;controllers&quot;, &quot;conditional_get&quot;)
+require File.join(__DIR__, &quot;controllers&quot;, &quot;streaming&quot;)
 
 Merb.start :environment =&gt; 'test', :init_file =&gt; File.join(__DIR__, 'config', 'init')</diff>
      <filename>spec/public/controller/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>tools/allison-2.0.2/cache/BODY</filename>
    </removed>
    <removed>
      <filename>tools/allison-2.0.2/cache/CLASS_INDEX</filename>
    </removed>
    <removed>
      <filename>tools/allison-2.0.2/cache/CLASS_PAGE</filename>
    </removed>
    <removed>
      <filename>tools/allison-2.0.2/cache/FILE_INDEX</filename>
    </removed>
    <removed>
      <filename>tools/allison-2.0.2/cache/FILE_PAGE</filename>
    </removed>
    <removed>
      <filename>tools/allison-2.0.2/cache/FONTS</filename>
    </removed>
    <removed>
      <filename>tools/allison-2.0.2/cache/FR_INDEX_BODY</filename>
    </removed>
    <removed>
      <filename>tools/allison-2.0.2/cache/INDEX</filename>
    </removed>
    <removed>
      <filename>tools/allison-2.0.2/cache/JAVASCRIPT</filename>
    </removed>
    <removed>
      <filename>tools/allison-2.0.2/cache/METHOD_INDEX</filename>
    </removed>
    <removed>
      <filename>tools/allison-2.0.2/cache/METHOD_LIST</filename>
    </removed>
    <removed>
      <filename>tools/allison-2.0.2/cache/PROJECT</filename>
    </removed>
    <removed>
      <filename>tools/allison-2.0.2/cache/SRC_PAGE</filename>
    </removed>
    <removed>
      <filename>tools/allison-2.0.2/cache/STYLE</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>f447f2bd7e7a408f279da7e9f47323e42a0b94e8</id>
    </parent>
    <parent>
      <id>bc4ce1d748021893cd2ac1486529af534565d776</id>
    </parent>
  </parents>
  <author>
    <name>Fabien Franzen</name>
    <email>info@atelierfabien.be</email>
  </author>
  <url>http://github.com/wycats/merb-core/commit/3d0d9f05b71cb0e442a72356a96cd74705938cdc</url>
  <id>3d0d9f05b71cb0e442a72356a96cd74705938cdc</id>
  <committed-date>2008-09-18T07:46:55-07:00</committed-date>
  <authored-date>2008-09-18T07:46:55-07:00</authored-date>
  <message>Merge branch 'master' into experiments</message>
  <tree>986f426495c885eab53ac4003e5bd63c700fe7a5</tree>
  <committer>
    <name>Fabien Franzen</name>
    <email>info@atelierfabien.be</email>
  </committer>
</commit>
