<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -14,6 +14,15 @@ virtual host by running:
 
   $ cap capinatra:vhost
 
+You can also choose to copy the Rack configuration
+template to your directory by running:
+
+  $ cap capinatra:copy_config
+
+This is useful if you want to override the defaults we've
+set for you.  This copied file will take precedence over
+the Capinatra-supplied template.
+
 Then it's the usual drill:
 
   $ cap deploy:setup</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,12 @@ Capistrano::Configuration.instance(:must_exist).load do
   after &quot;deploy:update_code&quot;, &quot;capinatra:config&quot;
   
   namespace :capinatra do
+    desc &quot;Copies the Rack configuration template to the current directory (useful if you want to override behavior)&quot;
+    task :copy_config do
+      require 'fileutils'
+      FileUtils.cp File.join(File.dirname(__FILE__), '..', 'templates', 'config.ru.erb'), File.join(Dir.pwd, 'config.ru.erb')
+    end
+    
     desc &quot;Sets up apache vhost&quot;
     task :vhost do
       logger.info 'compiling vhost template'
@@ -21,13 +27,20 @@ Capistrano::Configuration.instance(:must_exist).load do
     
     desc &quot;Adds config.ru file&quot;
     task :config do
-      logger.info 'compiling config.ru template'
       template = File.read(File.join(File.dirname(__FILE__), '..', 'templates', 'config.ru.erb'))
+      if File.exist?(File.join(Dir.pwd, 'config.ru.erb'))
+        template = File.join(Dir.pwd, 'config.ru.erb')
+        logger.info 'using custom Rack configuration template'
+      else
+        logger.info 'using supplied Rack configuration template'
+      end
+      
+      logger.info 'compiling config.ru template'
+      put ERB.new(template).result(binding), &quot;config.ru&quot;
 
       logger.info 'uploading config.ru file'
-      put ERB.new(template).result(binding), &quot;config.ru&quot;
 
-      logger.info 'moving vhost file to ' + apache_vhost_dir
+      logger.info 'moving config.ru file to ' + release_path
       sudo &quot;mv config.ru #{release_path}&quot;
     end
   end</diff>
      <filename>lib/capinatra.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,20 +1,21 @@
 require 'rubygems'
-&lt;% if app_class # modern way of declaring Sinatra apps %&gt;
+&lt;%- if defined?(app_class) &amp;&amp; app_class # modern way of declaring Sinatra apps -%&gt;
 require 'sinatra/base'
-&lt;% else # old way of declaring Sinatra apps %&gt;
+&lt;%- else # old way of declaring Sinatra apps -%&gt;
 require 'sinatra'
 
 root = File.dirname(__FILE__)
 
-Sinatra::Application.default_options.merge! \
-  :run =&gt; false,
-  :root =&gt; root,
-  :app_file =&gt; File.join(root, '&lt;%= app_file %&gt;'),
-  :views =&gt; File.join(root, 'views')
-&lt;% end %&gt;
+Sinatra::Application.set :run =&gt; false
+Sinatra::Application.set :root =&gt; root
+Sinatra::Application.set :app_file =&gt; File.join(root, '&lt;%= app_file %&gt;')
+Sinatra::Application.set :views =&gt; File.join(root, 'views')
+&lt;%- end -%&gt;
 
 load File.join(File.dirname(__FILE__), '&lt;%= app_file %&gt;')
 
-&lt;% if app_class %&gt;
+&lt;%- if defined?(app_class) &amp;&amp; app_class -%&gt;
 run &lt;%= app_class %&gt;
-&lt;% end %&gt;
\ No newline at end of file
+&lt;%- else -%&gt;
+run Sinatra::Application
+&lt;%- end -%&gt;
\ No newline at end of file</diff>
      <filename>templates/config.ru.erb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cbad611c53a9cace4c34b2f0a283df7d7252eb28</id>
    </parent>
  </parents>
  <author>
    <name>Jason Rogers</name>
    <email>jacaetevha@gmail.com</email>
  </author>
  <url>http://github.com/nakajima/capinatra/commit/8a0e599e34d267282fdf017a1527d43af2f633c1</url>
  <id>8a0e599e34d267282fdf017a1527d43af2f633c1</id>
  <committed-date>2009-02-26T19:02:18-08:00</committed-date>
  <authored-date>2009-02-26T19:02:18-08:00</authored-date>
  <message>config.ru changes

added new task to copy the config.ru.erb template to user's directory and updated README accordingly
cleaned up the config.ru.erb so that it doesn't output so much whitespace
fixed error in config.ru.erb when Sinatra::Base is not in use (check whether or not app_class is defined first)
fixed logger messages in the config task</message>
  <tree>2ef5f8315795f7875ddd9b78b7eed0f1f929ad4f</tree>
  <committer>
    <name>Jason Rogers</name>
    <email>jacaetevha@gmail.com</email>
  </committer>
</commit>
