<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/tasks/rspec.rake</filename>
    </added>
    <added>
      <filename>script/autospec</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,10 @@
 #!/usr/bin/env ruby
-$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + &quot;/../vendor/plugins/rspec/lib&quot;))
-require 'spec'
-exit ::Spec::Runner::CommandLine.run(::Spec::Runner::OptionParser.parse(ARGV, STDERR, STDOUT))
+if ARGV.any? {|arg| %w[--drb -X --generate-options -G --help -h --version -v].include?(arg)}
+  require 'rubygems' unless ENV['NO_RUBYGEMS']
+else
+  gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f &gt;= 1.9
+  ENV[&quot;RAILS_ENV&quot;] ||= 'test'
+  require File.dirname(__FILE__) + &quot;/../config/environment&quot; unless defined?(RAILS_ROOT)
+end
+require 'spec/autorun'
+exit ::Spec::Runner::CommandLine.run</diff>
      <filename>script/spec</filename>
    </modified>
    <modified>
      <diff>@@ -1,116 +1,9 @@
 #!/usr/bin/env ruby
-$LOAD_PATH.unshift File.dirname(__FILE__) + '/../vendor/plugins/rspec/lib' # For rspec installed as plugin
-require 'rubygems'
-require 'drb/drb'
-require 'rbconfig'
-require 'spec'
-require 'optparse'
-
-# This is based on Florian Weber's TDDMate
-module Spec
-  module Runner
-    class RailsSpecServer
-      def run(argv, stderr, stdout)
-        $stdout = stdout
-        $stderr = stderr
-
-        base = ActiveRecord::Base
-        def base.clear_reloadable_connections!
-          active_connections.each do |name, conn|
-            if conn.requires_reloading?
-              conn.disconnect!
-              active_connections.delete(name)
-            end
-          end
-        end
-
-        if ActionController.const_defined?(:Dispatcher)
-          dispatcher = ::ActionController::Dispatcher.new($stdout)
-          dispatcher.cleanup_application
-        elsif ::Dispatcher.respond_to?(:reset_application!)
-          ::Dispatcher.reset_application!
-        else
-          raise &quot;Application reloading failed&quot;
-        end
-        if Object.const_defined?(:Fixtures) &amp;&amp; Fixtures.respond_to?(:reset_cache)
-          Fixtures.reset_cache
-        end
-
-        ::Dependencies.mechanism = :load
-        require_dependency('application.rb') unless Object.const_defined?(:ApplicationController)
-        load File.dirname(__FILE__) + '/../spec/spec_helper.rb'
-
-        if in_memory_database?
-          load &quot;#{RAILS_ROOT}/db/schema.rb&quot; # use db agnostic schema by default
-          ActiveRecord::Migrator.up('db/migrate') # use migrations
-        end
-
-        ::Spec::Runner::CommandLine.run(
-          ::Spec::Runner::OptionParser.parse(
-            argv,
-            $stderr,
-            $stdout
-          )
-        )
-      end
+gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f &gt;= 1.9
 
-      def in_memory_database?
-        ENV[&quot;RAILS_ENV&quot;] == &quot;test&quot; and
-        ::ActiveRecord::Base.connection.class.to_s == &quot;ActiveRecord::ConnectionAdapters::SQLite3Adapter&quot; and
-        ::Rails::Configuration.new.database_configuration['test']['database'] == ':memory:'
-      end
-    end
-  end
-end
 puts &quot;Loading Rails environment&quot;
+ENV[&quot;RAILS_ENV&quot;] ||= 'test'
+require File.dirname(__FILE__) + &quot;/../config/environment&quot; unless defined?(RAILS_ROOT)
 
-ENV[&quot;RAILS_ENV&quot;] = &quot;test&quot;
-require File.expand_path(File.dirname(__FILE__) + &quot;/../config/environment&quot;)
-require 'dispatcher'
-
-def restart_test_server
-  puts &quot;restarting&quot;
-  config       = ::Config::CONFIG
-  ruby         = File::join(config['bindir'], config['ruby_install_name']) + config['EXEEXT']
-  command_line = [ruby, $0, ARGV].flatten.join(' ')
-  exec(command_line)
-end
-
-def daemonize(pid_file = nil)
-  return yield if $DEBUG
-  pid = Process.fork{
-    Process.setsid
-    Dir.chdir(RAILS_ROOT)
-    trap(&quot;SIGINT&quot;){ exit! 0 }
-    trap(&quot;SIGTERM&quot;){ exit! 0 }
-    trap(&quot;SIGHUP&quot;){ restart_test_server }
-    File.open(&quot;/dev/null&quot;){|f|
-      STDERR.reopen f
-      STDIN.reopen  f
-      STDOUT.reopen f
-    }
-    yield
-  }
-  puts &quot;spec_server launched. (PID: %d)&quot; % pid
-  File.open(pid_file,&quot;w&quot;){|f| f.puts pid } if pid_file
-  exit! 0
-end
-
-options = Hash.new
-opts = OptionParser.new
-opts.on(&quot;-d&quot;, &quot;--daemon&quot;){|v| options[:daemon] = true }
-opts.on(&quot;-p&quot;, &quot;--pid PIDFILE&quot;){|v| options[:pid] = v }
-opts.parse!(ARGV)
-
-puts &quot;Ready&quot;
-exec_server = lambda {
-  trap(&quot;USR2&quot;) { restart_test_server } if Signal.list.has_key?(&quot;USR2&quot;)
-  DRb.start_service(&quot;druby://127.0.0.1:8989&quot;, Spec::Runner::RailsSpecServer.new)
-  DRb.thread.join
-}
-
-if options[:daemon]
-  daemonize(options[:pid], &amp;exec_server)
-else
-  exec_server.call
-end
+require 'optparse'
+require 'spec/rails/spec_server'</diff>
      <filename>script/spec_server</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8bb08c4491fe30c5fb209951633d9ec8150e1f2b</id>
    </parent>
  </parents>
  <author>
    <name>Michael Hartl</name>
    <email>michael@michaelhartl.com</email>
  </author>
  <url>http://github.com/insoshi/insoshi/commit/23ec976d17e5b0fd79257352684ff9b4d9d7671b</url>
  <id>23ec976d17e5b0fd79257352684ff9b4d9d7671b</id>
  <committed-date>2009-04-22T14:48:41-07:00</committed-date>
  <authored-date>2009-04-22T14:48:41-07:00</authored-date>
  <message>Reboostrapped RSpec</message>
  <tree>917f13cf26f15fb44b240d9fc8077b941f87a258</tree>
  <committer>
    <name>Michael Hartl</name>
    <email>michael@michaelhartl.com</email>
  </committer>
</commit>
