<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,4 @@
-Copyright (c) 2007 Jeremy Evans
+Copyright (c) 2007-2008 Jeremy Evans
 Copyright (c) 2004 Zed A. Shaw
 
 Permission is hereby granted, free of charge, to any person obtaining</diff>
      <filename>LICENSE</filename>
    </modified>
    <modified>
      <diff>@@ -31,7 +31,6 @@ Subversion access is available at svn://code.jeremyevans.net/ruby-scgi/.
 * Simple to configure with your web server. 
 * Completely free code licensed under Rails's own license.
 * No external dependencies other than Ruby
-* The core implementation is easily extensible for other Ruby web frameworks.
 
 == Comparison With FastCGI
 
@@ -75,13 +74,13 @@ ruby-scgi on a totally different machine with this.
 
 ruby-scgi is now just a library and doesn't come with a tool to run Rails. The
 previous command line tool (scgi_ctrl) has been greatly enhanced and is now
-available as a standalone gem called style.
+available as a standalone gem called ruby-style.
 
 == Example configurations
 
 Note that ruby-scgi is only tested on Lighttpd.  Also, note that Lighttpd
 1.4.16 has a bug which breaks redirects using server.error-handler-404, so
-either use mod_magnet, use 1.4.17, or apply the patch in ticket 1270 on
+either use mod_magnet, use 1.4.18, or apply the patch in ticket 1270 on
 Lighttpd's Trac.
 
 Lighttpd:
@@ -141,9 +140,22 @@ Apache:
     &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
 
+== Changes from version 0.8.0
+
+* You can pass a socket to SCGI::Processor.new via settings[:socket]
+* You can have a socket created for you in new if you pass
+  settings[:host] and settings[:port]
+* You can pass an existing logger to new via settings[:log]
+* Passing a socket to listen is now optional, if you passed a socket or
+  had one created in new
+* Improved RDoc for new
+* Most SCGI::Processor methods are now private
+* SCGI::Processor is easier to subclass because it will use preexisting
+  instance variables
+
 == Changes from version 0.7.0
 
-* Command line tool is now in a seperate gem called style
+* Command line tool is now in a seperate gem called ruby-style
 * You now must pass a socket to SCGI::Processor#listen
 * SCGI::Processor's @log and @maxconns now have defaults
 * SCGI::Processor's @host and @port are no longer used </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -81,22 +81,33 @@ module SCGI
   # It might be useful for shared hosting people to have domain sockets, but
   # they aren't supported in Apache, and in lighttpd they're unreliable.
   # Also, domain sockets don't work so well on Windows.
+  #
+  # Available settings:
+  # :socket =&gt; Use this socket
+  # :host =&gt; Create a socket bound to this IP (if :port is also used)
+  # :port =&gt; Create a socket bound to this IP (if :host is also used)
+  # :log =&gt; Use this logger instead of creating one
+  # :logfile =&gt; Use this logfile instead of log/scgi.log
+  # :maxconns =&gt; Allow this many max connections, more than this are redirected
+  #    to /busy.html (default: 2**30 - 1)
   class Processor &lt; Monitor
     def initialize(settings = {})
-      @total_conns = 0
-      @shutdown = false
-      @dead = false
-      @threads = Queue.new
-      @log = LogFactory.instance.create(settings[:logfile] || 'log/scgi.log')
-      @maxconns = settings[:maxconns] || 2**30-1
+      @socket ||= settings[:socket] || (TCPServer.new(settings[:host], settings[:port]) if settings[:host] &amp;&amp; settings[:port])
+      @total_conns ||= 0
+      @shutdown ||= false
+      @dead ||= false
+      @threads ||= Queue.new
+      @log ||= settings[:log] || LogFactory.instance.create(settings[:logfile] || 'log/scgi.log')
+      @maxconns ||= settings[:maxconns] || 2**30-1
       super()
       setup_signals
     end
         
-    # Starts the SCGI::Processor having it listen on the given socket. This
+    # Starts the SCGI::Processor having it listen on the given socket, if one
+    # is provided, or the one established in new, if not. This
     # function does not return until a shutdown.
-    def listen(socket)
-      @socket = socket
+    def listen(socket = nil)
+      @socket ||= socket
       
       # we also need a small collector thread that does nothing
       # but pull threads off the thread queue and joins them
@@ -122,6 +133,32 @@ module SCGI
       @log.info(&quot;Exited accept loop. Shutdown complete.&quot;)
     end
     
+    # When called it will set the @shutdown flag indicating to the 
+    # SCGI::Processor.listen function that all new connections should
+    # be set to /busy.html, and all current connections should be 
+    # &quot;valved&quot; off.  Once all the current connections are gone the
+    # SCGI::Processor.listen function will exit.
+    #
+    # Use the force=true parameter to force an immediate shutdown.
+    # This is done by closing the listening socket, so it's rather
+    # violent.
+    def shutdown(force = false)
+      synchronize do
+        @shutdown = true
+        
+        if @threads.length == 0 
+          @log.info(&quot;Immediate shutdown since nobody is connected.&quot;)
+          @socket.close
+        elsif force
+          @log.info(&quot;Forcing shutdown.  You may see exceptions.&quot;)
+          @socket.close
+        else
+          @log.info(&quot;Shutdown requested.  Beginning graceful shutdown with #{@threads.length} connected.&quot;)
+        end
+      end
+    end   
+    
+    private
     def collect_thread(thread)
       begin
         thread.join
@@ -148,7 +185,6 @@ module SCGI
     # and deals with the graceful shutdown.  The important part 
     # of graceful shutdown is that new requests get redirected to
     # the /busy.html file.
-    #
     def handle_client(socket)
       # ruby's GC seems to do weird things if we don't assign the thread to a local variable
       @threads &lt;&lt; Thread.new do
@@ -231,30 +267,5 @@ module SCGI
       :shutdown =&gt; @shutdown, :dead =&gt; @dead, :total_conns =&gt; @total_conns
       }.inspect
     end
-        
-    # When called it will set the @shutdown flag indicating to the 
-    # SCGI::Processor.listen function that all new connections should
-    # be set to /busy.html, and all current connections should be 
-    # &quot;valved&quot; off.  Once all the current connections are gone the
-    # SCGI::Processor.listen function will exit.
-    #
-    # Use the force=true parameter to force an immediate shutdown.
-    # This is done by closing the listening socket, so it's rather
-    # violent.
-    def shutdown(force = false)
-      synchronize do
-        @shutdown = true
-        
-        if @threads.length == 0 
-          @log.info(&quot;Immediate shutdown since nobody is connected.&quot;)
-          @socket.close
-        elsif force
-          @log.info(&quot;Forcing shutdown.  You may see exceptions.&quot;)
-          @socket.close
-        else
-          @log.info(&quot;Shutdown requested.  Beginning graceful shutdown with #{@threads.length} connected.&quot;)
-        end
-      end
-    end        
   end
 end</diff>
      <filename>lib/scgi.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,12 @@
 spec = Gem::Specification.new do |s| 
   s.name = &quot;scgi&quot;
-  s.version = &quot;0.8.0&quot;
+  s.version = &quot;0.9.0&quot;
   s.author = &quot;Jeremy Evans&quot;
   s.email = &quot;code@jeremyevans.net&quot;
   s.platform = Gem::Platform::RUBY
   s.summary = &quot;Simple support for using SCGI in ruby apps, such as Rails&quot;
   s.files = %w'LICENSE README lib/scgi.rb'
+  s.extra_rdoc_files = ['README']
   s.require_paths = [&quot;lib&quot;]
   s.has_rdoc = true
   s.rdoc_options = %w'--inline-source --line-numbers'</diff>
      <filename>scgi.gemspec</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1a10962e2bf5c91539150cc7b4049d4a3231904d</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Evans</name>
    <email>code@jeremyevans.net</email>
  </author>
  <url>http://github.com/jeremyevans/ruby-scgi/commit/2b6451850aa3df09785a6896ef1450f1081e744d</url>
  <id>2b6451850aa3df09785a6896ef1450f1081e744d</id>
  <committed-date>2008-01-23T13:16:58-08:00</committed-date>
  <authored-date>2008-01-23T13:16:58-08:00</authored-date>
  <message>Make most SCGI::Processor methods private (just listen and shutdown are public)
Add :socket, :host, :port, and :log settings available in new
Make new use preexisting instance variables
Document settings available to new
Make the socket argument to listen optional
Bump copyright year to 2008
Bump version to 0.9.0
Add README to extra_rdoc_files
Some style-&gt;ruby-style changes in README</message>
  <tree>7fe7128385e0beb8cedbf4c1c151de0664be95e4</tree>
  <committer>
    <name>Jeremy Evans</name>
    <email>code@jeremyevans.net</email>
  </committer>
</commit>
