<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,7 +4,6 @@ Manifest.txt
 PostInstall.txt
 README.txt
 Rakefile
-Ruby DocTest.tmproj
 bin/rubydoctest
 config/hoe.rb
 config/requirements.rb</diff>
      <filename>Manifest.txt</filename>
    </modified>
    <modified>
      <diff>@@ -13,8 +13,10 @@ USAGE: rubydoctest [options] &lt;files&gt;
   
   Options:
     General:
-      --help  - show this usage / help information
-      -t&lt;n&gt;   - only run test number n, e.g. -t1 -t3
+      --help   - show this usage / help information
+      --single - run all tests in the same ruby environment
+      -r&lt;file&gt; - filename to require (use one -r switch per file)
+      -t&lt;n&gt;    - only run test number n, e.g. -t1 -t3
     
     Output Format:
       --html  - output in HTML format
@@ -30,8 +32,12 @@ USAGE: rubydoctest [options] &lt;files&gt;
   exit 0
 end
 
+single = options.include?(&quot;--single&quot;)
+
 requires = ['rubygems', File.dirname(__FILE__) + &quot;/../lib/rubydoctest&quot;]
 requires &lt;&lt; 'ruby-debug' if options.include?(&quot;--debugger&quot;)
+requires.concat options.select{|o|o=~/^-r/}.map{|o|o.gsub(/^-r\s*/,&quot;&quot;)}
+
 ruby_lines = []
 ruby_lines &lt;&lt; &quot;RubyDocTest.trace = true;&quot; if options.include?(&quot;--trace&quot;)
 ruby_lines &lt;&lt; &quot;RubyDocTest.ignore_interactive = true;&quot; if options.include?(&quot;--ignore-interactive&quot;)
@@ -41,20 +47,29 @@ ruby_lines &lt;&lt; &quot;RubyDocTest.tests = #{tests.inspect};&quot; if tests.size &gt; 0
 
 requires = requires.map {|lib| &quot;require '#{lib}'; &quot;}.join
 
-def files_runner(command, files, requires, lines)
-  files.reverse_each do |f|
-    system %(#{command} -e &quot;#{requires} #{lines.join(&quot; &quot;)} RubyDocTest::Runner.new(File.read('#{f}'), '#{f}').run&quot;)
+def files_runner(command, files, requires, lines, single=false)
+  if single
+    script = %(#{command} -e &quot;#{requires} #{lines.join(&quot; &quot;)} )
+    files.reverse_each do |f|
+      script &lt;&lt; %(RubyDocTest::Runner.new(File.read('#{f}'), '#{f}').run; )
+    end
+    script &lt;&lt; %(nil&quot;)
+    system script
+  else
+    files.reverse_each do |f|
+      system %(#{command} -e &quot;#{requires} #{lines.join(&quot; &quot;)} RubyDocTest::Runner.new(File.read('#{f}'), '#{f}').run&quot;)
+    end
   end
 end
 
 if options.include?(&quot;--plain&quot;)
   ruby_lines &lt;&lt; &quot;RubyDocTest.output_format = :plain;&quot; 
-  files_runner(&quot;ruby&quot;, files, requires, ruby_lines)
+  files_runner(&quot;ruby&quot;, files, requires, ruby_lines, single)
 elsif options.include?(&quot;--html&quot;)
   ruby_lines &lt;&lt; &quot;RubyDocTest.output_format = :html;&quot; 
   puts &quot;&lt;html&gt;&lt;body&gt;&lt;pre&gt;&quot;
-  files_runner(&quot;ruby&quot;, files, requires, ruby_lines)
+  files_runner(&quot;ruby&quot;, files, requires, ruby_lines, single)
   puts &quot;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;&quot;
 else
-  files_runner(&quot;ruby&quot;, files, requires, ruby_lines)
+  files_runner(&quot;ruby&quot;, files, requires, ruby_lines, single)
 end</diff>
      <filename>bin/rubydoctest</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e1d099550bd852e7f49c5e21718beed73dc681eb</id>
    </parent>
  </parents>
  <author>
    <name>Brendan Baldwin</name>
    <email>brendan@usergenic.com</email>
  </author>
  <url>http://github.com/tablatom/rubydoctest/commit/68ee742841767ba450b836d17583c15a8c7a0245</url>
  <id>68ee742841767ba450b836d17583c15a8c7a0245</id>
  <committed-date>2009-10-14T08:45:51-07:00</committed-date>
  <authored-date>2009-10-13T16:14:30-07:00</authored-date>
  <message>I updated the bin/rubydoctest to support command-line options to require specific files and/or run all tests within the same Ruby environment (useful when you're working with an environment that has to boot up and you don't want to pay that expense for *every* file you want to test.)</message>
  <tree>6c63583603ddd3d448f3282f643333be58934b11</tree>
  <committer>
    <name>Tom Locke</name>
    <email>tom@tomlocke.com</email>
  </committer>
</commit>
