<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -131,7 +131,8 @@ below in your Rakefile.
     t.distributed_hosts = %w[host1 host2]
     t.sync_options = {
       :source =&gt; &lt;absolute path of project root on machine&gt;,
-      :username =&gt; &quot;username&quot;
+      :username =&gt; &quot;username&quot;,
+      :remote_base_dir =&gt; &lt;absolute path to keep working copies in on remote machine&gt; # defaults to /tmp
     }
   end
 </diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -48,7 +48,8 @@ DeepTest::TestTask.new(:distributed_test) do |t|
   t.pattern = &quot;test/**/*_test.rb&quot;
   t.distributed_hosts = %w[localhost]
   t.sync_options = {:source =&gt; File.dirname(__FILE__), 
-                    :rsync_options =&gt; &quot;--exclude=.svn&quot;}
+                    :rsync_options =&gt; &quot;--exclude=.svn&quot;,
+                    :remote_base_dir =&gt; &quot;/tmp/deep_test&quot;}
 end
 
 Spec::Rake::SpecTask.new(:spec) do |t|</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ DeepTest.logger.debug { &quot;mirror establish_beachhead for #{options.origin_hostnam
 STDIN.close
 
 beachhead_port = DeepTest::Distributed::Beachhead.new(
-  File.join(options.mirror_path('/tmp'), File.basename(options.sync_options[:source])), 
+  File.join(options.mirror_path, File.basename(options.sync_options[:source])), 
   options
 ).daemonize
 </diff>
      <filename>lib/deep_test/distributed/establish_beachhead.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,8 +6,7 @@ module DeepTest
       end
 
       def push_code(options)
-        path = options.mirror_path(@config[:work_dir])
-        RSync.push(@config[:address], options.sync_options, path)
+        RSync.push(@config[:address], options.sync_options, options.mirror_path)
       end
 
       def establish_beachhead(options)
@@ -49,7 +48,7 @@ module DeepTest
 
       def spawn_command(options)
         &quot;#{ShellEnvironment.like_login} &amp;&amp; &quot; + 
-        &quot;cd #{options.mirror_path(@config[:work_dir])} &amp;&amp; &quot; + 
+        &quot;cd #{options.mirror_path} &amp;&amp; &quot; + 
         &quot;OPTIONS=#{options.to_command_line} &quot; + 
         &quot;ruby lib/deep_test/distributed/establish_beachhead.rb&quot; 
       end</diff>
      <filename>lib/deep_test/distributed/landing_ship.rb</filename>
    </modified>
    <modified>
      <diff>@@ -78,10 +78,10 @@ module DeepTest
       Base64.encode64(Marshal.dump(self)).gsub(&quot;\n&quot;,&quot;&quot;)
     end
 
-    def mirror_path(base)
+    def mirror_path
       raise &quot;No source directory specified in sync_options&quot; unless sync_options[:source]
       relative_mirror_path = @origin_hostname + sync_options[:source].gsub('/','_')
-      &quot;#{base}/#{relative_mirror_path}&quot;
+      &quot;#{sync_options[:remote_base_dir] || '/tmp'}/#{relative_mirror_path}&quot;
     end
 
     def new_deployment
@@ -94,7 +94,7 @@ module DeepTest
 
     def new_landing_fleet
       landing_ships = distributed_hosts.map do |host|
-        Distributed::LandingShip.new :address =&gt; host, :work_dir =&gt; '/tmp'
+        Distributed::LandingShip.new :address =&gt; host
       end
       Distributed::LandingFleet.new self, landing_ships
     end</diff>
      <filename>lib/deep_test/options.rb</filename>
    </modified>
    <modified>
      <diff>@@ -172,20 +172,25 @@ module DeepTest
       yielded_wire.should == :wire
     end
 
-    it &quot;should be able to calculate mirror_path based on base an sync_options&quot; do
+    it &quot;should be able to calculate mirror_path based on sync_options&quot; do
       Socket.should_receive(:gethostname).and_return(&quot;hostname&quot;)
-      options = Options.new(:sync_options =&gt; {:source =&gt; &quot;/my/source/path&quot;})
-      options.mirror_path(&quot;/mirror/base/path&quot;).should == 
-        &quot;/mirror/base/path/hostname_my_source_path&quot;
+      options = Options.new(:sync_options =&gt; {:source =&gt; &quot;/my/source/path&quot;, :remote_base_dir =&gt; &quot;/mirror/base/path&quot;})
+      options.mirror_path.should == &quot;/mirror/base/path/hostname_my_source_path&quot;
     end
 
     it &quot;should raise a useful error if no source is specified&quot; do
-      options = DeepTest::Options.new(:sync_options =&gt; {})
+      options = DeepTest::Options.new(:sync_options =&gt; {:remote_base_dir =&gt; &quot;/mirror/base/path/&quot;})
       lambda {
-        options.mirror_path(&quot;base&quot;)
+        options.mirror_path
       }.should raise_error(&quot;No source directory specified in sync_options&quot;)
     end
 
+    it &quot;should default to /tmp if no remote_base_dir is specified in sync_options&quot; do
+      Socket.should_receive(:gethostname).and_return(&quot;hostname&quot;)
+      options = DeepTest::Options.new(:sync_options =&gt; {:source =&gt; &quot;/my/source/path&quot;})
+      options.mirror_path.should == &quot;/tmp/hostname_my_source_path&quot;
+    end
+
     it &quot;should be gathering metrics if metrics file is set&quot; do
       options = DeepTest::Options.new(:metrics_file =&gt; &quot;filename&quot;)
       options.should be_gathering_metrics</diff>
      <filename>spec/deep_test/options_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ module DeepTest
       test &quot;generates a local working copy path based on host and source of request&quot; do
         Socket.stubs(:gethostname).returns(&quot;myhost&quot;)
         Telegraph::Wire.stubs(:connect).returns :wire
-        landing_ship = LandingShip.new(:address =&gt; &quot;host&quot;, :work_dir =&gt; &quot;/tmp&quot;)
+        landing_ship = LandingShip.new(:address =&gt; &quot;host&quot;)
         options = Options.new(:sync_options =&gt; {:source =&gt; &quot;/my/local/dir&quot;})
         RSync.expects(:push).with(&quot;host&quot;, options.sync_options, &quot;/tmp/myhost_my_local_dir&quot;)
         landing_ship.push_code(options)
@@ -15,7 +15,7 @@ module DeepTest
       test &quot;establish_beachhead launches beachhead process on remote machine&quot; do
         Socket.stubs(:gethostname).returns(&quot;myhost&quot;)
         Telegraph::Wire.stubs(:connect).returns :wire
-        landing_ship = LandingShip.new(:address =&gt; &quot;remote_host&quot;, :work_dir =&gt; &quot;/tmp&quot;)
+        landing_ship = LandingShip.new(:address =&gt; &quot;remote_host&quot;)
         options = Options.new(:sync_options =&gt; {:source =&gt; &quot;/my/local/dir&quot;})
 
         landing_ship.expects(:`).with(
@@ -31,7 +31,7 @@ module DeepTest
       test &quot;establish_beachhead launches beachhead process on remote machine with usernames specified in sync_options&quot; do
         Socket.stubs(:gethostname).returns(&quot;myhost&quot;)
         Telegraph::Wire.stubs(:connect).returns :wire
-        landing_ship = LandingShip.new(:address =&gt; &quot;remote_host&quot;, :work_dir =&gt; &quot;/tmp&quot;)
+        landing_ship = LandingShip.new(:address =&gt; &quot;remote_host&quot;)
         options = Options.new(:sync_options =&gt; {:username =&gt; &quot;me&quot;, :source =&gt; &quot;/my/local/dir&quot;})
 
         landing_ship.expects(:`).with(</diff>
      <filename>test/deep_test/distributed/landing_ship_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d1b1a57a6fccc18afb38f8ebaa9d25cd85c072fa</id>
    </parent>
  </parents>
  <author>
    <name>qxjit (David Vollbracht)</name>
    <email>david.vollbracht@gmail.com</email>
  </author>
  <url>http://github.com/qxjit/deep-test/commit/c9a000ebcf5d61d8660336e39de4c1a44270289e</url>
  <id>c9a000ebcf5d61d8660336e39de4c1a44270289e</id>
  <committed-date>2009-08-03T20:59:26-07:00</committed-date>
  <authored-date>2009-08-03T20:59:26-07:00</authored-date>
  <message>add remote_base_dir to sync_options to specify where working copies are stored remotely</message>
  <tree>53a4c597c99549801b71d60c52af9e9b1b02a51f</tree>
  <committer>
    <name>qxjit (David Vollbracht)</name>
    <email>david.vollbracht@gmail.com</email>
  </committer>
</commit>
