<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -32,14 +32,18 @@ This will place the contents of ~/path/to/my/site from your machine to /mnt/bob
       end
       
       def package_deploy_directory
-        ::Suitcase::Zipper.add(&quot;#{::File.expand_path(from)}&quot;, &quot;user_directory/&quot;)
+        ::Suitcase::Zipper.add(&quot;#{::File.expand_path(from)}&quot;, &quot;user_directory/#{name}/&quot;) # namespace by name
       end
       
       def add_unpack_directory
         has_directory(to)
         has_exec(&quot;unpack-#{::File.basename(to)}-deploy-directory&quot;,
           :requires =&gt; get_directory(to),
-          :command =&gt; &quot;cp -R /var/poolparty/dr_configure/user_directory/#{name}/* #{to}&quot;)
+                                                                        # zipper uses the from basename
+                                                                        # while this is sometimes redundant, 
+                                                                        # it allows for two directories that
+                                                                        # might have the same directory name
+          :command =&gt; &quot;cp -R /var/poolparty/dr_configure/user_directory/#{name}/#{File.basename(from)}/* #{to}&quot;) 
         if owner
           has_exec(:name =&gt; &quot;chown-#{name}&quot;, :command =&gt; &quot;chown #{owner} -R #{to}&quot;)
         end     </diff>
      <filename>lib/poolparty/plugins/deploy_directory.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,51 +1,62 @@
-# require File.dirname(__FILE__) + '/../spec_helper'
-# 
-# include PoolParty::Resources
-# 
-# class TestClass
-#   include PoolParty::Resources
-# end
-# describe &quot;Remote Instance&quot; do
-#   before(:each) do
-#     Kernel.stub!(:system).and_return true
-#   end
-#   describe &quot;wrapped&quot; do
-#     before(:each) do
-#       @tc = TestClass.new      
-#       @cloud = MyOpenStruct.new(:keypair =&gt; &quot;keys&quot;, :remote_keypair_path =&gt; &quot;/keypair_path&quot;, :name =&gt; &quot;cloudcloud&quot;)
-#       @cloud.stub!(:is_a?).with(PoolParty::Cloud::Cloud).and_return true
-#       @tc.stub!(:parent).and_return @cloud
-#       
-#       @options = {:name =&gt; &quot;deploydirectory&quot;, :from =&gt; ::File.dirname(__FILE__), :to =&gt; &quot;/var/www/deploydirectory&quot;, :testing =&gt; false}
-#     end
-#     it &quot;should be a string&quot; do
-#       @tc.has_deploydirectory(@options).to_string.should =~ /exec \{/
-#     end
-#     it &quot;should included the flushed out options&quot; do
-#       @tc.has_deploydirectory(@options).to_string.should =~ /command/
-#     end
-#     describe &quot;in resource&quot; do
-#       before(:each) do
-#         @tc.instance_eval do
-#           has_deploydirectory do
-#             name &quot;deploydirectory&quot;
-#             from ::File.dirname(__FILE__)
-#             to &quot;/var/www/deploydirectory&quot;
-#           end
-#         end
-#       end
-#       it &quot;should have the path set within the resource&quot; do
-#         @tc.resource(:deploydirectory).first.to_string.should =~ /exec \{/
-#       end
-#       it &quot;should not have the from in the to_string&quot; do
-#         @tc.resource(:deploydirectory).first.to_string.should_not =~ /from /
-#       end
-#       it &quot;should not have the to in the to_string&quot; do
-#         @tc.resource(:deploydirectory).first.to_string.should_not =~ /to /
-#       end
-#       it &quot;should have onlyif in the to_string&quot; do
-#         @tc.resource(:deploydirectory).first.to_string.should =~ /onlyif/
-#       end
-#     end
-#   end
-# end
\ No newline at end of file
+require File.dirname(__FILE__) + '/../spec_helper'
+
+class TestDeployDirectoryClass &lt; PoolParty::Cloud::Cloud
+end
+
+describe &quot;Remote Instance&quot; do
+  describe &quot;wrapped&quot; do
+    before(:each) do
+      reset!
+      @tc = cloud :test_deploy_directory_class_cloud do
+         has_deploy_directory(&quot;map-experiments&quot;, 
+                              :from =&gt; &quot;~/projects/westfield/map-experiments&quot;, 
+                              :to =&gt; &quot;/var/www/wifi-maps&quot;, 
+                              :mode =&gt; &quot;755&quot;,
+                              :owner =&gt; &quot;www-data&quot;)
+
+         has_deploy_directory(&quot;map-experiments-two&quot;, 
+                              :from =&gt; &quot;~/projects/westfield/map-experiments&quot;, 
+                              :to =&gt; &quot;/var/www/wifi-maps-two&quot;, 
+                              :mode =&gt; &quot;755&quot;,
+                              :owner =&gt; &quot;www-data&quot;)
+
+      end
+      @compiled = ChefResolver.new(@tc.to_properties_hash).compile
+    end
+
+    describe &quot;when being listed the first time&quot; do
+      it &quot;should be a string&quot; do
+        @compiled.should =~ /execute/
+      end
+
+      it &quot;should create the directory specified in 'to'&quot; do
+        @compiled.should =~ %r{directory &quot;/var/www/wifi-maps&quot;}
+      end
+
+      it &quot;should copy from the deploy directory&quot; do
+        @compiled.should =~ %r{command &quot;cp \-R /var/poolparty/dr_configure/user_directory/map-experiments/map-experiments/\* /var/www/wifi-maps&quot;}
+      end
+
+      it &quot;should chown if needed&quot; do
+        @compiled.should =~ %r{command &quot;chown www-data \-R /var/www/wifi-maps&quot;}
+      end
+
+      it &quot;should chmod if needed&quot; do
+        @compiled.should =~ %r{command &quot;chmod 755 /var/www/wifi-maps&quot;}
+      end
+    end
+
+    describe &quot;when being listed a second time with the same source&quot; do
+      it &quot;should create the directory specified in 'to'&quot; do
+        @compiled.should =~ %r{directory &quot;/var/www/wifi-maps-two&quot;}
+      end
+
+      it &quot;should copy from the right deploy directory&quot; do
+        @compiled.should =~ %r{command &quot;cp \-R /var/poolparty/dr_configure/user_directory/map-experiments-two/map-experiments/\* /var/www/wifi-maps-two&quot;}
+      end
+    end
+ 
+  end
+end
+
+# it should be able to have a different name and from
\ No newline at end of file</diff>
      <filename>spec/poolparty/plugins/deploydirectory_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>81570201876ef6716936930da5ccb6f98d27bd3e</id>
    </parent>
  </parents>
  <author>
    <name>Nate Murray</name>
    <email>nate@natemurray.com</email>
  </author>
  <url>http://github.com/yannlugrin/poolparty/commit/0daa8cc183b19c1929a3dc85fb1f1b2c06c79f6f</url>
  <id>0daa8cc183b19c1929a3dc85fb1f1b2c06c79f6f</id>
  <committed-date>2009-05-15T08:59:16-07:00</committed-date>
  <authored-date>2009-05-15T08:59:16-07:00</authored-date>
  <message>fixed deploy directory to allow multiple folders with the same name.
wrote a test</message>
  <tree>b875e55dfc1e8d6e74a164120023c7b2710ed041</tree>
  <committer>
    <name>Nate Murray</name>
    <email>nate@natemurray.com</email>
  </committer>
</commit>
