<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,13 +4,16 @@ require 'thread'
 require 'fileutils'
 
 module Debugger
-  SOCKET_PATH = File.join(Dir.getwd, 'tmp', 'sockets', 'debugger')
+
+  DEFAULT_SOCKET_PATH = File.join(Dir.getwd, 'tmp', 'sockets', 'debugger')
 
   class &lt;&lt; self
-    def start_unix_socket_remote(socket_path=SOCKET_PATH, post_mortem = false)
+    def start_unix_socket_remote(socket_path, post_mortem = false)
       return if @thread
       return if started?
 
+      socket_path ||= DEFAULT_SOCKET_PATH
+
       self.interface = nil
       start
       self.post_mortem if post_mortem
@@ -47,9 +50,12 @@ module Debugger
     end
     alias_method :start_unix_socket_server, :start_unix_socket_remote
 
-    def start_unix_socket_control(socket_path=SOCKET_PATH) # :nodoc:
+    def start_unix_socket_control(socket_path) # :nodoc:
       raise &quot;Debugger is not started&quot; unless started?
       return if defined?(@control_thread) &amp;&amp; @control_thread
+
+      socket_path ||= DEFAULT_SOCKET_PATH
+
       File.unlink(socket_path) if File.exists?(socket_path)
       @control_thread = DebugThread.new do
         server = UNIXServer.open(socket_path)
@@ -61,7 +67,9 @@ module Debugger
       end
     end
 
-    def start_unix_socket_client(socket_path=SOCKET_PATH)
+    def start_unix_socket_client(socket_path)
+      socket_path ||= DEFAULT_SOCKET_PATH
+
       require &quot;socket&quot;
       interface = Debugger::LocalInterface.new
       socket = UNIXSocket.new(socket_path + '.server')</diff>
      <filename>lib/rack-debug/debugger.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,11 +8,7 @@ task :debug do
   require File.join(File.dirname(__FILE__), 'debugger')
 
   begin
-    if ENV['socket_path']
-      Debugger.start_unix_socket_client ENV['socket_path']
-    else
-      Debugger.start_unix_socket_client
-    end
+    Debugger.start_unix_socket_client ENV['SOCKET_PATH']
   rescue Errno::ENOENT
     puts &quot;Server is not running or Passenger has spooled down&quot;
   rescue StandardError =&gt; ex</diff>
      <filename>lib/rack-debug/tasks.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,23 +2,18 @@ require 'rack'
 
 class Rack::Debug
 
-  VERSION = '0.2.0'
+  attr_reader :app, :options
 
-  attr_reader :app
+  def initialize(app, options={})
+    @app     = app
+    @options = options
 
-  def initialize(app, socket_path = nil)
-    @socket_path = !socket_path.nil? ? File.expand_path(socket_path) : nil
     extend_ruby_debug!
-    @app = app
   end
 
   def call(env)
     LineCache::clear_file_cache
-    if @socket_path.nil?
-      Debugger.start_unix_socket_remote
-    else
-      Debugger.start_unix_socket_remote(@socket_path)
-    end
+    Debugger.start_unix_socket_remote(socket_path)
     app.call(env)
   end
 
@@ -28,4 +23,8 @@ private ######################################################################
     require File.join(File.dirname(__FILE__), '..', 'rack-debug', 'debugger')
   end
 
+  def socket_path
+    options[:socket_path]
+  end
+
 end</diff>
      <filename>lib/rack/debug.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>eb47b50103b64cd907ccb89bad9161120cc70347</id>
    </parent>
  </parents>
  <author>
    <name>David Dollar</name>
    <email>ddollar@gmail.com</email>
  </author>
  <url>http://github.com/ddollar/rack-debug/commit/6fe20f4aabf181d70a5b1e3fb11feaea205526f0</url>
  <id>6fe20f4aabf181d70a5b1e3fb11feaea205526f0</id>
  <committed-date>2009-11-05T16:23:32-08:00</committed-date>
  <authored-date>2009-11-05T16:23:32-08:00</authored-date>
  <message>better handling of :socket_path option</message>
  <tree>ad608984da8d38252b13d190d1a7aac6fe9c83b2</tree>
  <committer>
    <name>David Dollar</name>
    <email>ddollar@gmail.com</email>
  </committer>
</commit>
