<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -9,11 +9,13 @@ Thin is a Ruby web server that glues together 3 of the best Ruby libraries in we
 Which makes it, with all humility, the most secure, stable, fast and extensible Ruby web server
 bundled in an easy to use gem for your own pleasure.
 
-=== Installation
-IMPORTANT: Until EventMachine 0.11.0 is out, you have to install it from trunk or from my gem server:
-
- sudo gem install eventmachine --source http://code.macournoyer.com
+Site:  http://code.macournoyer.com/thin/
+Group: http://groups.google.com/group/thin-ruby/topics
+Bugs:  http://thin.lighthouseapp.com/projects/7212-thin
+Code:  http://github.com/macournoyer/thin
+IRC:   #thin on freenode
 
+=== Installation
 For the latest stable version:
 
  sudo gem install thin
@@ -28,6 +30,10 @@ Or from source:
  cd thin
  rake install
 
+To use Thin with UNIX domain sockets you need EventMachine 0.11.0 from my gem server:
+
+ gem install eventmachine --source http://code.macournoyer.com
+
 === Usage
 A +thin+ script offers an easy way to start your Rails application:
 </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,12 @@ module Thin
     # * connection/disconnection to the server
     # * initialization of the connections
     # * manitoring of the active connections.
+    #
+    # == Implementing your own backend
+    # You can create your own minimal backend by inheriting this class and
+    # defining the +connect+ and +disconnect+ method.
+    # If your backend is not based on EventMachine you also need to redefine
+    # the +start+, +stop+, &lt;tt&gt;stop!&lt;/tt&gt; and +config+ methods.
     class Base
       # Server serving the connections throught the backend
       attr_accessor :server
@@ -28,6 +34,7 @@ module Thin
         @maximum_persistent_connections = Server::DEFAULT_MAXIMUM_PERSISTENT_CONNECTIONS
       end
       
+      # Start the backend and connect it.
       def start
         @stopping = false
         
@@ -37,6 +44,7 @@ module Thin
         end
       end
       
+      # Stop of the backend from accepting new connections.
       def stop
         @running  = false
         @stopping = true
@@ -46,6 +54,7 @@ module Thin
         stop! if @connections.empty?
       end
       
+      # Force stop of the backend NOW, too bad for the current connections.
       def stop!
         @running  = false
         @stopping = false
@@ -55,6 +64,8 @@ module Thin
         close
       end
       
+      # Configure the backend. This method will be called before droping superuser privileges,
+      # so you can do crazy stuff that require godlike powers here.
       def config
         # See http://rubyeventmachine.com/pub/rdoc/files/EPOLL.html
         EventMachine.epoll
@@ -69,6 +80,7 @@ module Thin
       def close
       end
       
+      # Returns +true+ if the backend is connected and running.
       def running?
         @running
       end</diff>
      <filename>lib/thin/backends/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 module Thin
   module Backends
+    # Backend to act as a Swiftiply client (http://swiftiply.swiftcore.org).
     class SwiftiplyClient &lt; Base
       attr_accessor :key
       </diff>
      <filename>lib/thin/backends/swiftiply_client.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 module Thin
   module Backends
-    # Connectior to act as a TCP socket server.
+    # Backend to act as a TCP socket server.
     class TcpServer &lt; Base
       # Address and port on which the server is listening for connections.
       attr_accessor :host, :port</diff>
      <filename>lib/thin/backends/tcp_server.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ module Thin
   class Connection &lt; EventMachine::Connection
     include Logging
     
-    # Rack application served by this connection.
+    # Rack application (adapter) served by this connection.
     attr_accessor :app
     
     # Backend to the server
@@ -16,7 +16,7 @@ module Thin
     # Current request served by the connection
     attr_accessor :request
     
-    # Next response sent through connection
+    # Next response sent through the connection
     attr_accessor :response
     
     # Get the connection ready to process a request.
@@ -36,12 +36,12 @@ module Thin
     end
     
     # Called when all data was received and the request
-    # is ready to being processed.
+    # is ready to be processed.
     def process
       # Add client info to the request env
       @request.remote_address = remote_address
       
-      # Process the request
+      # Process the request calling the Rack adapter
       @response.status, @response.headers, @response.body = @app.call(@request.env)
       
       # Make the response persistent if requested by the client</diff>
      <filename>lib/thin/connection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,8 @@
 require 'yaml'
 
 module Thin
+  # Build and control one Thin server.
+  # Hey Controller pattern is not only for web apps yo!
   module Controllers
     # Raised when a mandatory option is missing to run a command.
     class OptionRequired &lt; RuntimeError
@@ -27,6 +29,7 @@ module Thin
       end
     
       def start
+        # Select proper backend
         server = case
         when @options.has_key?(:socket)
           Server.new(@options[:socket])
@@ -35,16 +38,19 @@ module Thin
         else
           Server.new(@options[:address], @options[:port])
         end
-
+        
+        # Set options
         server.pid_file                       = @options[:pid]
         server.log_file                       = @options[:log]
         server.timeout                        = @options[:timeout]
         server.maximum_connections            = @options[:max_conns]
         server.maximum_persistent_connections = @options[:max_persistent_conns]
 
+        # Detach the process, after this line the current process returns
         server.daemonize if @options[:daemonize]
 
-        server.config # Must be called before changing privileges since it might require superuser power.
+        # +config+ must be called before changing privileges since it might require superuser power.
+        server.config
         
         server.change_privilege @options[:user], @options[:group] if @options[:user] &amp;&amp; @options[:group]
 
@@ -64,7 +70,8 @@ module Thin
         # If a stats URL is specified, wrap in Stats adapter
         server.app = Stats::Adapter.new(server.app, @options[:stats]) if @options[:stats]
 
-        # Register restart procedure
+        # Register restart procedure which just start another process with same options,
+        # so that's why this is done here.
         server.on_restart { Command.run(:start, @options) }
 
         server.start</diff>
      <filename>lib/thin/controllers/controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,7 @@ module Thin
       def silent?;  @silent            end
     end
     
-    # Deprecated silencer methods, those are now a module methods
+    # Deprecated silencer methods, those are now module methods
     def silent
       warn &quot;`#{self.class.name}\#silent` deprecated, use `Thin::Logging.silent?` instead&quot;
       Logging.silent?</diff>
      <filename>lib/thin/logging.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 module Thin
   # The uterly famous Thin HTTP server.
-  # It listen for incoming request through a given backend
+  # It listen for incoming request through a given +backend+
   # and forward all request to +app+.
   #
   # == TCP server
@@ -41,6 +41,10 @@ module Thin
   #     end
   #   end
   #
+  # == Controlling with signals
+  # * QUIT: Gracefull shutdown (see Server#stop)
+  # * INT and TERM: Force shutdown (see Server#stop!)
+  #
   class Server
     include Logging
     include Daemonizable
@@ -165,12 +169,14 @@ module Thin
     end
     
     # == Configure the server
-    # The process might need to have superuser privilege to set configure
+    # The process might need to have superuser privilege to configure
     # server with optimal options.
     def config
       @backend.config
     end
-        
+    
+    # Name of the server and type of backend used.
+    # This is also the name of the process in which Thin is running as a daemon.
     def name
       &quot;thin server (#{@backend})&quot;
     end
@@ -191,6 +197,7 @@ module Thin
       end
       
       # Taken from Mongrel cgi_multipart_eof_fix
+      # Ruby 1.8.5 has a security bug in cgi.rb, we need to patch it.
       def load_cgi_multipart_eof_fix
         version = RUBY_VERSION.split('.').map { |i| i.to_i }
         </diff>
      <filename>lib/thin/server.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2c01c5f75680d291d2ce1003bad1219b5a5079ae</id>
    </parent>
  </parents>
  <author>
    <name>macournoyer</name>
    <email>macournoyer@gmail.com</email>
  </author>
  <url>http://github.com/macournoyer/thin/commit/0fd4de53ce67d782aec5bacb763c091b011c0720</url>
  <id>0fd4de53ce67d782aec5bacb763c091b011c0720</id>
  <committed-date>2008-03-06T17:27:20-08:00</committed-date>
  <authored-date>2008-03-06T17:27:20-08:00</authored-date>
  <message>Doc love</message>
  <tree>77528050e686145b9ca0eb431d065c7384999516</tree>
  <committer>
    <name>macournoyer</name>
    <email>macournoyer@gmail.com</email>
  </committer>
</commit>
