<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>docs/nginx.README</filename>
    </added>
    <added>
      <filename>lib/capitate/plugins/upload.rb</filename>
    </added>
    <added>
      <filename>test/test_plugin_upload.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,8 @@
+== 0.1.9 2008-02-23
+
+* Adding config_script to mongrel_cluster recipe
+* Creating upload plugin that streams data
+
 == 0.1.8 2008-02-22
 
 * Fixing up documentation</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -17,6 +17,7 @@ lib/capitate/plugins/package.rb
 lib/capitate/plugins/profiles.rb
 lib/capitate/plugins/script.rb
 lib/capitate/plugins/templates.rb
+lib/capitate/plugins/upload.rb
 lib/capitate/plugins/wget.rb
 lib/capitate/plugins/yum.rb
 lib/capitate/recipes.rb
@@ -77,6 +78,7 @@ tasks/deployment.rake
 tasks/environment.rake
 tasks/website.rake
 test/test_helper.rb
+test/test_plugin_upload.rb
 test/test_recipes.rb
 test/test_templates.rb
 website/index.html</diff>
      <filename>Manifest.txt</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,8 @@ require 'capitate/plugins/templates'
 require 'capitate/plugins/wget'
 require 'capitate/plugins/yum'
 
+require 'capitate/plugins/upload'
+
 require &quot;capitate/cap_ext/connections&quot;
 require &quot;capitate/cap_ext/extension_proxy&quot;
 require &quot;capitate/cap_ext/variables&quot;</diff>
      <filename>lib/capitate.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,10 @@
+#--
+# =============================================================================
+# Copyright (c) 2007, Gabriel Handford (gabrielh@gmail.com)
+# All rights reserved.
+# =============================================================================
+#++
+
 require 'erb'
 require 'yaml'
 </diff>
      <filename>lib/capitate/plugins/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,18 @@
-# TODO: Document this class
+# Task node in the capistrano namespace, task hierarchy.
+#
 class Capitate::TaskNode
   
   include Capitate::Plugins::Base
   
   attr_reader :name, :nodes, :tasks, :parent
-    
+
+  # Create task node with name and parent
+  # For root not use name = &quot;top&quot;
+  #
+  # ==== Options
+  # +name+:: Node name (namespace name)
+  # +parent+:: Parent node
+  #
   def initialize(name, parent = nil)
     @name = name
     @parent = parent
@@ -12,10 +20,20 @@ class Capitate::TaskNode
     @tasks = []
   end
   
+  # Add &quot;child&quot; node.
+  #
+  # ==== Options
+  # +task_node+:: Node
+  #
   def add_node(task_node)
     @nodes &lt;&lt; task_node
   end
   
+  # Find node with name (namespace).
+  #
+  # ==== Options
+  # +name+:: Name to look for
+  #
   def find(name)
     @nodes.each do |node| 
       return node if node.name == name
@@ -23,15 +41,27 @@ class Capitate::TaskNode
     nil
   end
   
+  # Add task to this node.
+  #
+  # ==== Options
+  # +task+:: Add task associated with this node (namespace).
+  #
   def add_task(task)
     @tasks &lt;&lt; task
   end
   
+  # Get &quot;child&quot; nodes (sorted).
+  #
   def sorted_nodes
     nodes.sort_by(&amp;:name)
   end
   
-  # Depth first iteration
+  # Iterate over ALL &quot;child&quot; nodes, depth first.
+  # Yields |node, level|.
+  #
+  # ==== Options
+  # +level+:: Current level
+  #
   def each_node(level = 0, &amp;block)
     sorted_nodes.each do |node|
       yield(node, level)
@@ -39,6 +69,14 @@ class Capitate::TaskNode
     end
   end
   
+  # Get the full name, using delimeter
+  #
+  # ==== Options
+  # +delimeter+:: Delimeter
+  #
+  # ==== Examples
+  #   node.full_name(&quot;:&quot;) =&gt; &quot;mysql:centos&quot;  # On node mysql centos node (top -&gt; mysql -&gt; centos)
+  #
   def full_name(delimeter = &quot;-&quot;)
     if parent
       parent_name = parent.full_name
@@ -50,6 +88,13 @@ class Capitate::TaskNode
   end
   
   # Write doc for node (recursively)
+  #
+  # ==== Options
+  # +dir+:: Dir to write to
+  # +file_name+:: File name to write to, defaults to full name
+  # +title+:: Title and h1 for page, defaults to name
+  # +options+:: Options
+  #
   def write_doc(dir, file_name = nil, title = nil, options = {}, &amp;block)
     
     file_name ||= full_name
@@ -115,6 +160,8 @@ class Capitate::TaskNode
     end
   end
   
+  # Node to string. 
+  #
   def to_s(level = 0)
     spaces = &quot;     &quot;
     indent = (0...level).collect { spaces }.join(&quot;&quot;) 
@@ -133,9 +180,20 @@ class Capitate::TaskNode
     end
     s
   end
-      
+    
+  # Class methods  
   class &lt;&lt; self
     
+    # Create nodes and and task to node.
+    #
+    # If task is &quot;mysql:centos:install&quot;, the nodes will look like:
+    #
+    #   (top node) -&gt; (mysql node) -&gt; (centos node; w/ tasks: install)
+    #
+    # ==== Options
+    # +top_node+:: Node to start at
+    # +task+:: Task to add
+    #    
     def populate_with_task(top_node, task)
       node_names = task.namespace.fully_qualified_name.split(&quot;:&quot;)
       </diff>
      <filename>lib/capitate/task_node.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ module Capitate #:nodoc:
   module VERSION #:nodoc:
     MAJOR = 0
     MINOR = 1
-    TINY  = 8
+    TINY  = 9
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>lib/capitate/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,8 +4,6 @@ namespace :docs do
   task :recipes do
     top_node = capitate.task_tree
     
-    puts &quot;Tree:\n#{}&quot;
-    
     dir = &quot;docs/recipes&quot;
     FileUtils.rm_rf(dir)
     FileUtils.mkdir_p(dir)</diff>
      <filename>lib/recipes/docs.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,6 +13,10 @@ namespace :mongrel_cluster do
     
     set :mongrel_port, 9000
     
+  mongrel_config_script: Config script to load with mongrel.
+  
+    set :mongrel_config_script, &quot;config/mongrel_handler.rb&quot;
+    
   DESC
   task :setup_monit do
     
@@ -24,13 +28,30 @@ namespace :mongrel_cluster do
     # Settings
     fetch(:mongrel_size)
     fetch(:mongrel_port)
+    fetch_or_default(:mongrel_config_script, nil)
     
     processes = []
     ports = (0...mongrel_size).collect { |i| mongrel_port + i }
     ports.each do |port|
       
       pid_path = &quot;#{shared_path}/pids/mongrel.#{port}.pid&quot;
-      start_options = &quot;-d -e production -a 127.0.0.1 -c #{current_path} --user #{user} --group #{user} -p #{port} -P #{pid_path} -l log/mongrel.#{port}.log&quot;
+      
+      default_options = [
+        [ &quot;-d&quot; ], 
+        [ &quot;-e&quot;, &quot;production&quot; ],
+        [ &quot;-a&quot;, &quot;127.0.0.1&quot; ],
+        [ &quot;-c&quot;, current_path ],
+        [ &quot;--user&quot;, user ], 
+        [ &quot;--group&quot;, user ],
+        [ &quot;-p&quot;, port ], 
+        [ &quot;-P&quot;, pid_path ],
+        [ &quot;-l&quot;, &quot;log/mongrel.#{port}.log&quot; ]
+      ]
+      
+      default_options &lt;&lt; [ &quot;-S&quot;, mongrel_config_script ] if mongrel_config_script 
+      
+      start_options = default_options.collect { |a| a.join(&quot; &quot;) }.join(&quot; &quot;)      
+      #start_options = &quot;-d -e production -a 127.0.0.1 -c #{current_path} --user #{user} --group #{user} -p #{port} -P #{pid_path} -l log/mongrel.#{port}.log&quot;
       stop_options = &quot;-p #{port} -P #{pid_path}&quot;
       
       processes &lt;&lt; { :port =&gt; port, :start_options =&gt; start_options, :stop_options =&gt; stop_options, :name =&gt; &quot;/usr/bin/mongrel_rails&quot;, :pid_path =&gt; pid_path }</diff>
      <filename>lib/recipes/mongrel_cluster.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,3 +8,4 @@ pid_file: &lt;%= pid_path %&gt;/mongrel.pid
 servers: &lt;%= mongrel_size %&gt;
 user: &lt;%= user %&gt;
 group: &lt;%= user %&gt;
+config_script: &lt;%= mongrel_config_script %&gt;</diff>
      <filename>lib/templates/mongrel/mongrel_cluster.yml.erb</filename>
    </modified>
    <modified>
      <diff>@@ -4,10 +4,18 @@
 # See vhost conf for site specific stuff.
 #
 # ==== References:
+# http://brainspl.at/articles/2006/08/23/nginx-my-new-favorite-front-end-for-mongrel-cluster
 # http://brainspl.at/articles/2007/01/03/new-nginx-conf-with-optimizations
 # http://topfunky.net/svn/shovel/nginx
 # http://robsanheim.com/2008/02/07/beware-the-default-nginx-config-old-ie6-hates-gzip/
 #
+# Nginx + memcached:
+# http://www.igvita.com/2008/02/11/nginx-and-memcached-a-400-boost/
+# http://blog.kovyrin.net/2007/08/05/using-nginx-ssi-and-memcache-to-make-your-web-applications-faster/
+#
+# Fair balancing:
+# http://brainspl.at/articles/2007/11/09/a-fair-proxy-balancer-for-nginx-and-mongrel
+ 
 
 # user and group to run as
 user nginx nginx;</diff>
      <filename>lib/templates/nginx/nginx.conf.erb</filename>
    </modified>
    <modified>
      <diff>@@ -40,35 +40,41 @@ def convert_syntax(syntax, source)
   return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^&lt;pre&gt;|&lt;/pre&gt;$!,'')
 end
 
-if ARGV.length &gt;= 1
-  src, template = ARGV
-  template ||= File.join(File.dirname(__FILE__), '/../website/template.rhtml')
-  
+if ARGV.length &gt;= 3
+  src_glob, template, output_dir = ARGV  
+  src_files = Dir[src_glob]
 else
-  puts(&quot;Usage: #{File.split($0).last} source.txt [template.rhtml] &gt; output.html&quot;)
+  puts(&quot;Usage: #{File.split($0).last} path/to/source*.txt template.rhtml output_dir&quot;)
   exit!
 end
 
 template = ERB.new(File.open(template).read)
 
-title = nil
-body = nil
-File.open(src) do |fsrc|
-  title_text = fsrc.readline
-  body_text = fsrc.read
-  syntax_items = []
-  body_text.gsub!(%r!&lt;(pre|code)[^&gt;]*?syntax=['&quot;]([^'&quot;]+)[^&gt;]*&gt;(.*?)&lt;/\1&gt;!m){
-    ident = syntax_items.length
-    element, syntax, source = $1, $2, $3
-    syntax_items &lt;&lt; &quot;&lt;#{element} class='syntax'&gt;#{convert_syntax(syntax, source)}&lt;/#{element}&gt;&quot;
-    &quot;syntax-temp-#{ident}&quot;
-  }
-  title = RedCloth.new(title_text).to_html.gsub(%r!&lt;.*?&gt;!,'').strip
-  body = RedCloth.new(body_text).to_html
-  body.gsub!(%r!(?:&lt;pre&gt;&lt;code&gt;)?syntax-temp-(\d+)(?:&lt;/code&gt;&lt;/pre&gt;)?!){ syntax_items[$1.to_i] }
-end
-stat = File.stat(src)
-created = stat.ctime
-modified = stat.mtime
+src_files.each do |src|
+  title = nil
+  body = nil
+  File.open(src) do |fsrc|
+    title_text = fsrc.readline
+    body_text = fsrc.read
+    syntax_items = []
+    body_text.gsub!(%r!&lt;(pre|code)[^&gt;]*?syntax=['&quot;]([^'&quot;]+)[^&gt;]*&gt;(.*?)&lt;/\1&gt;!m){
+      ident = syntax_items.length
+      element, syntax, source = $1, $2, $3
+      syntax_items &lt;&lt; &quot;&lt;#{element} class='syntax'&gt;#{convert_syntax(syntax, source)}&lt;/#{element}&gt;&quot;
+      &quot;syntax-temp-#{ident}&quot;
+    }
+    title = RedCloth.new(title_text).to_html.gsub(%r!&lt;.*?&gt;!,'').strip
+    body = RedCloth.new(body_text).to_html
+    body.gsub!(%r!(?:&lt;pre&gt;&lt;code&gt;)?syntax-temp-(\d+)(?:&lt;/code&gt;&lt;/pre&gt;)?!){ syntax_items[$1.to_i] }
+  end
+  stat = File.stat(src)
+  created = stat.ctime
+  modified = stat.mtime
 
-$stdout &lt;&lt; template.result(binding)
+  #$stdout &lt;&lt; template.result(binding)
+  output_file_path = src.split(&quot;/&quot;).last.gsub(/txt$/, &quot;html&quot;)
+  output_path = output_dir + &quot;/&quot; + output_file_path
+  puts &quot;    create #{output_path}&quot;
+  File.open(output_path, &quot;w&quot;) { |file| file.puts template.result(binding) }
+  
+end
\ No newline at end of file</diff>
      <filename>script/txt2html</filename>
    </modified>
    <modified>
      <diff>@@ -1,17 +1,14 @@
 desc 'Generate website files'
 task :website_generate =&gt; :ruby_env do
-  (Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt|
-    sh %{ #{RUBY_APP} script/txt2html #{txt} &gt; #{txt.gsub(/txt$/,'html')} }
-  end
+  template = File.join(File.dirname(__FILE__), '/../website/template.rhtml')
+  sh %{ #{RUBY_APP} script/txt2html &quot;website/**/*.txt&quot; #{template} website }
   
   # Clean and re-create
   FileUtils.rm_rf(&quot;website/recipes&quot;)
   FileUtils.mkdir_p(&quot;website/recipes&quot;)  
   sh &quot;cap docs:recipes&quot;
   template = File.join(File.dirname(__FILE__), '/../website/template_recipe.rhtml')
-  Dir['docs/recipes/**/*.txt'].each do |txt|
-    sh %{ #{RUBY_APP} script/txt2html #{txt} #{template} &gt; website/recipes/#{txt.split(&quot;/&quot;).last.gsub(/txt$/,'html')} }
-  end
+  sh %{ #{RUBY_APP} script/txt2html &quot;docs/recipes/**/*.txt&quot; #{template} website/recipes }
 end
 
 desc 'Upload website files to rubyforge'</diff>
      <filename>tasks/website.rake</filename>
    </modified>
    <modified>
      <diff>@@ -38,7 +38,7 @@
 
     &lt;div id=&quot;version&quot; class=&quot;clickable box&quot; onclick='document.location = &quot;http://rubyforge.org/projects/capitate&quot;; return false'&gt;
       &lt;p&gt;Get Version&lt;/p&gt;
-      &lt;a href=&quot;http://rubyforge.org/projects/capitate&quot; class=&quot;numbers&quot;&gt;0.1.8&lt;/a&gt;
+      &lt;a href=&quot;http://rubyforge.org/projects/capitate&quot; class=&quot;numbers&quot;&gt;0.1.9&lt;/a&gt;
     &lt;/div&gt;
     
     &lt;div id=&quot;recipes&quot; class=&quot;box&quot;&gt;
@@ -65,10 +65,9 @@
 	&lt;p&gt;Add capitate to your Capfile. Copy this somewhere near the top:&lt;/p&gt;
 
 
-	&lt;p&gt;&lt;pre class='syntax'&gt;
-  &lt;span class=&quot;ident&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;symbol&quot;&gt;:project_root&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;constant&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;dirname&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;constant&quot;&gt;__FILE__&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;)&lt;/span&gt;
-  &lt;span class=&quot;ident&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;capitate&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;'&lt;/span&gt;  
-  &lt;span class=&quot;ident&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;capitate/recipes&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;'&lt;/span&gt;
+	&lt;p&gt;&lt;pre class='syntax'&gt;&lt;span class=&quot;ident&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;capitate&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;'&lt;/span&gt;  
+&lt;span class=&quot;ident&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;capitate/recipes&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;'&lt;/span&gt;
+&lt;span class=&quot;ident&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;symbol&quot;&gt;:project_root&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;constant&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;dirname&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;constant&quot;&gt;__FILE__&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;)&lt;/span&gt;
 &lt;/pre&gt;&lt;/p&gt;
 
 
@@ -152,7 +151,7 @@
 	&lt;p&gt;Comments are welcome. Send an email to &lt;a href=&quot;mailto:gabrielh@gmail.com&quot;&gt;Gabriel Handford&lt;/a&gt; via the &lt;a href=&quot;http://groups.google.com/group/capitate&quot;&gt;forum&lt;/a&gt;&lt;/p&gt;
     &lt;/div&gt;
     &lt;p class=&quot;coda&quot;&gt;
-      &lt;a href=&quot;FIXME email&quot;&gt;Gabriel Handford&lt;/a&gt;, 21st February 2008&lt;br&gt;
+      &lt;a href=&quot;FIXME email&quot;&gt;Gabriel Handford&lt;/a&gt;, 22nd February 2008&lt;br&gt;
       Theme extended from &lt;a href=&quot;http://rb2js.rubyforge.org/&quot;&gt;Paul Battley&lt;/a&gt;
     &lt;/p&gt;
 &lt;/div&gt;</diff>
      <filename>website/index.html</filename>
    </modified>
    <modified>
      <diff>@@ -13,10 +13,9 @@ h2. Running
 
 Add capitate to your Capfile. Copy this somewhere near the top:
 
-&lt;pre syntax=&quot;ruby&quot;&gt;
-  set :project_root, File.dirname(__FILE__)
-  require 'capitate'  
-  require 'capitate/recipes'
+&lt;pre syntax=&quot;ruby&quot;&gt;require 'capitate'  
+require 'capitate/recipes'
+set :project_root, File.dirname(__FILE__)
 &lt;/pre&gt;
 
 </diff>
      <filename>website/index.txt</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d39472daf490afc35acd79b1f2d4cad3da146211</id>
    </parent>
  </parents>
  <author>
    <name>Gabriel Handford</name>
    <email>gabrielh@gmail.com</email>
  </author>
  <url>http://github.com/gabriel/capitate/commit/2dee1a07d0bdfa7017b744f7ac0168af7de45703</url>
  <id>2dee1a07d0bdfa7017b744f7ac0168af7de45703</id>
  <committed-date>2008-02-22T15:13:58-08:00</committed-date>
  <authored-date>2008-02-22T15:13:58-08:00</authored-date>
  <message>fixing website gen, upload plugin, mongrel cluster fix</message>
  <tree>a5dddaf827a69129d019e5992b515b733510072c</tree>
  <committer>
    <name>Gabriel Handford</name>
    <email>gabrielh@gmail.com</email>
  </committer>
</commit>
