<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -615,7 +615,7 @@ module Merb
     end
 
     # ==== Parameters
-    # *rakefiles:: Rakefile pathss to add to the list of Rakefiles.
+    # *rakefiles:: Rakefile paths to add to the list of Rakefiles.
     #
     # ==== Notes
     # Recommended way to add Rakefiles load path for plugins authors.
@@ -634,6 +634,15 @@ module Merb
       @generators += generators
     end
 
+    # Install a signal handler for a given signal unless signals have
+    # been disabled with Merb.disable(:signals)
+    # ==== Parameters
+    # signal:: The name of the signal to install a handler for.
+    # &amp;block:: The block to be run when the given signal is received.
+    def trap(signal, &amp;block)
+      Kernel.trap(signal, &amp;block) unless Merb.disabled?(:signals)
+    end
+
   end
 end
 </diff>
      <filename>lib/merb-core.rb</filename>
    </modified>
    <modified>
      <diff>@@ -383,11 +383,11 @@ class Merb::BootLoader::LoadClasses &lt; Merb::BootLoader
 
       @ran = true
       $0 = &quot;merb#{&quot; : &quot; + Merb::Config[:name] if Merb::Config[:name]} : master&quot;
-      
+
       if Merb::Config[:fork_for_class_load] &amp;&amp; Merb.env != &quot;test&quot;
         start_transaction
       else
-        trap('INT') do 
+        Merb.trap('INT') do
           Merb.logger.warn! &quot;Killing children&quot;
           kill_children
         end
@@ -412,31 +412,31 @@ class Merb::BootLoader::LoadClasses &lt; Merb::BootLoader
       Merb::Server.remove_pid(&quot;main&quot;)
       exit
     end
-    
+
     # If using fork-based code reloading, set up the BEGIN
     # point and set up any signals in the parent and child.
     def start_transaction
       Merb.logger.warn! &quot;Parent pid: #{Process.pid}&quot;
       reader, writer = nil, nil
-      
+
       if GC.respond_to?(:copy_on_write_friendly=)
         GC.copy_on_write_friendly = true
-      end      
-            
+      end
+
       loop do
         reader, @writer = IO.pipe
         pid = Kernel.fork
-        
+
         # pid means we're in the parent; only stay in the loop in that case
         break unless pid
         @writer.close
 
         Merb::Server.store_pid(&quot;main&quot;)
-        
+
         if Merb::Config[:console_trap]
-          trap(&quot;INT&quot;) {}
+          Merb.trap(&quot;INT&quot;) {}
         else
-          trap(&quot;INT&quot;) do 
+          Merb.trap(&quot;INT&quot;) do
             Merb.logger.warn! &quot;Killing children&quot;
             begin
               Process.kill(&quot;ABRT&quot;, pid)
@@ -445,8 +445,8 @@ class Merb::BootLoader::LoadClasses &lt; Merb::BootLoader
             exit_gracefully
           end
         end
-        
-        trap(&quot;HUP&quot;) do 
+
+        Merb.trap(&quot;HUP&quot;) do
           Merb.logger.warn! &quot;Doing a fast deploy\n&quot;
           Process.kill(&quot;HUP&quot;, pid)
         end
@@ -471,20 +471,20 @@ class Merb::BootLoader::LoadClasses &lt; Merb::BootLoader
           end
         end
       end
- 
+
       reader.close
- 
+
       # add traps to the child
       if Merb::Config[:console_trap]
         Merb::Server.add_irb_trap
         at_exit { kill_children }
       else
-        trap('INT') {}
-        trap('ABRT') { kill_children }
-        trap('HUP') { kill_children(128) }
+        Merb.trap('INT') {}
+        Merb.trap('ABRT') { kill_children }
+        Merb.trap('HUP') { kill_children(128) }
       end
     end
-    
+
     # Kill any children of the spawner process and exit with
     # an appropriate status code.
     #</diff>
      <filename>lib/merb-core/bootloader.rb</filename>
    </modified>
    <modified>
      <diff>@@ -97,7 +97,7 @@ module Merb
         # we let the master process' ctrl-c control the cluster
         # of workers.
         if Merb::Config[:daemonize]
-          trap('INT') do
+          Merb.trap('INT') do
             stop
             Merb.logger.warn! &quot;Exiting port #{port}\n&quot;
             exit_process
@@ -105,19 +105,19 @@ module Merb
           # If it was not fork_for_class_load, we already set up
           # ctrl-c handlers in the master thread.
         elsif Merb::Config[:fork_for_class_load]
-          trap('INT') { 1 }
+          Merb.trap('INT') { 1 }
         end
 
         # In daemonized mode or not, support HUPing the process to
         # restart it.
-        trap('HUP') do
+        Merb.trap('HUP') do
           stop
           Merb.logger.warn! &quot;Exiting port #{port} on #{Process.pid}\n&quot;
           exit_process
         end
 
         # ABRTing the process will kill it, and it will not be respawned.
-        trap('ABRT') do
+        Merb.trap('ABRT') do
           stopped = stop(128)
           Merb.logger.warn! &quot;Exiting port #{port}\n&quot; if stopped
           exit_process(128)</diff>
      <filename>lib/merb-core/rack/adapter/abstract.rb</filename>
    </modified>
    <modified>
      <diff>@@ -141,9 +141,9 @@ module Merb
       rescue NotImplementedError =&gt; e
         Merb.fatal! &quot;Daemonized mode is not supported on your platform&quot;, e
       end
-      
+
       def bootup
-        trap('TERM') { exit }
+        Merb.trap('TERM') { exit }
 
         puts &quot;Running bootloaders...&quot; if Merb::Config[:verbose]
         BootLoader.run
@@ -290,12 +290,12 @@ module Merb
       end
 
       def add_irb_trap
-        trap('INT') do
+        Merb.trap('INT') do
           if @interrupted
             puts &quot;Exiting\n&quot;
             exit
           end
-          
+
           @interrupted = true
           puts &quot;Interrupt a second time to quit&quot;
           Kernel.sleep 1.5
@@ -308,7 +308,7 @@ module Merb
             IRB.conf[:MAIN_CONTEXT] = @irb.context
           end
 
-          trap(:INT) { @irb.signal_handle }
+          Merb.trap(:INT) { @irb.signal_handle }
           catch(:IRB_EXIT) { @irb.eval_input }
 
           puts &quot;Exiting IRB mode, back in server mode&quot;</diff>
      <filename>lib/merb-core/server.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2d31e4b35f7698fc9667ccca5d5b3e9528486a90</id>
    </parent>
  </parents>
  <author>
    <name>Dudley Flanders</name>
    <email>dudley@misnomer.us</email>
  </author>
  <url>http://github.com/wycats/merb-core/commit/fed193936802af5d3563acf1ba5c8f9f33a72351</url>
  <id>fed193936802af5d3563acf1ba5c8f9f33a72351</id>
  <committed-date>2008-10-04T21:45:33-07:00</committed-date>
  <authored-date>2008-10-04T20:23:32-07:00</authored-date>
  <message>Allow Merb.disable(:signals) to keep Merb from installing any signal handlers.

Signed-off-by: Yehuda Katz &lt;wycats@gmail.com&gt;</message>
  <tree>4deb3e9dfb7025e984e99624c12c6b2585c6ab52</tree>
  <committer>
    <name>Yehuda Katz</name>
    <email>wycats@gmail.com</email>
  </committer>
</commit>
