<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -27,6 +27,7 @@ module RailsTestServing
         'tmp/sockets/test_server.sock'
       end
       FileUtils.mkdir_p(File.dirname(service_uri))
+      service_uri
     end
     &quot;drbunix:&quot; + @@service_uri
   end
@@ -134,6 +135,8 @@ module RailsTestServing
     
     def initialize
       ENV['RAILS_ENV'] = 'test'
+      @options = (defined? TEST_SERVER_OPTIONS) ? TEST_SERVER_OPTIONS : {}
+      @options[:reload] ||= []
       enable_dependency_tracking
       start_cleaner
       load_framework
@@ -172,7 +175,7 @@ module RailsTestServing
     end
     
     def start_cleaner
-      @cleaner = Cleaner.new
+      @cleaner = Cleaner.new(@options)
     end
     
     def load_framework
@@ -316,7 +319,8 @@ module RailsTestServing
                                 ActionController::IntegrationTest
                                 ActionMailer::TestCase )
     
-    def initialize
+    def initialize(options = {})
+      @options = options
       start_worker
     end
     
@@ -360,6 +364,23 @@ module RailsTestServing
     
     def clean_up_app
       ActionController::Dispatcher.new(StringIO.new).cleanup_application
+      if @options[:reload].length &gt; 0
+        matched_files = []
+        
+        # Force a reload by removing matched files from $&quot;
+        $&quot;.delete_if do |path|
+          if @options[:reload].any? { |regex| File.expand_path(path).gsub(RAILS_ROOT, '') =~ Regexp.new(regex) }
+            matched_files &lt;&lt; path
+            true
+          else
+            false
+          end
+        end
+        matched_files.each do |file|
+          # Expanding the path to prevent files from requiring twice
+          require File.expand_path(file)
+        end
+      end
     end
     
     def remove_tests</diff>
      <filename>lib/rails_test_serving.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>rails-test-serving.gemspec</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>c1477eaee8e6dcddc72b9642b103c6e6aa79f1f3</id>
    </parent>
  </parents>
  <author>
    <name>Jack Chen</name>
    <email>chendo@chendo.net</email>
  </author>
  <url>http://github.com/Roman2K/rails-test-serving/commit/c14cd8e61386cdceb5c50049c2368e70a3d2b189</url>
  <id>c14cd8e61386cdceb5c50049c2368e70a3d2b189</id>
  <committed-date>2008-11-18T00:08:45-08:00</committed-date>
  <authored-date>2008-11-18T00:08:45-08:00</authored-date>
  <message>* Fixes the service_uri function to return the proper path, not the socket directory
* Added TEST_SERVER_OPTIONS that currently take allow a hash that contains :reload, which is an array
  of regexes or strings that lets you specify which files to reload after cleanup. I did this because
  machinist blueprints gets nuked after you clean_up_app.</message>
  <tree>dfef8d59b5693a1b6fd4bd6792af11723e4d8a03</tree>
  <committer>
    <name>Jack Chen</name>
    <email>chendo@chendo.net</email>
  </committer>
</commit>
