<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -148,8 +148,8 @@ Example configuration
     end
 
     keep do
-      local 2
-      s3 2
+      local 20
+      s3 30
     end
 
     mysqldump do
@@ -162,7 +162,10 @@ Example configuration
       database :blog
       database :servershape
       database :astrails_com
-      database :secret_project_com
+      database :secret_project_com do
+        skip_tables &quot;foo&quot;
+        skip_tables [&quot;bar&quot;, &quot;baz&quot;]
+      end
 
     end
 
@@ -189,7 +192,8 @@ Example configuration
 
       archive &quot;blog-astrails-com&quot; do
         files &quot;/var/www/blog.astrails.com/&quot;
-        exclude [&quot;/var/www/blog.astrails.com/log&quot;, &quot;/var/www/blog.astrails.com/tmp&quot;]
+        exclude &quot;/var/www/blog.astrails.com/log&quot;
+        exclude &quot;/var/www/blog.astrails.com/tmp&quot;
       end
 
       archive &quot;astrails-com&quot; do</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -181,4 +181,33 @@ describe Astrails::Safe::Config do
 
     config.to_hash.should == expected
   end
+
+  it &quot;should make an array from multivalues&quot; do
+    config = Astrails::Safe::Config::Node.new do
+      skip_tables &quot;a&quot;
+      skip_tables &quot;b&quot;
+      files &quot;/foo&quot;
+      files &quot;/bar&quot;
+      exclude &quot;/foo/bar&quot;
+      exclude &quot;/foo/bar/baz&quot;
+    end
+
+    expected = {
+      &quot;skip_tables&quot; =&gt; [&quot;a&quot;, &quot;b&quot;],
+      &quot;files&quot; =&gt; [&quot;/foo&quot;, &quot;/bar&quot;],
+      &quot;exclude&quot; =&gt; [&quot;/foo/bar&quot;, &quot;/foo/bar/baz&quot;],
+    }
+
+    config.to_hash.should == expected
+  end
+
+  it &quot;should raise error on key duplication&quot; do
+    proc do
+      Astrails::Safe::Config::Node.new do
+        path &quot;foo&quot;
+        path &quot;bar&quot;
+      end
+    end.should raise_error(ArgumentError, &quot;duplicate value for 'path'&quot;)
+  end
+
 end</diff>
      <filename>examples/unit/config_example.rb</filename>
    </modified>
    <modified>
      <diff>@@ -87,21 +87,21 @@ describe Astrails::Safe::Local do
 
   describe :cleanup do
     before(:each) do
-      @local = local
       @files = [4,1,3,2].to_a.map { |i| &quot;/mysqldump~blog~NoW/qweqwe.#{i}&quot; }
-      stub(Dir).[](&quot;/mysqldump~blog~NoW/qweqwe.*&quot;) {@files}
       stub(File).file?(anything) {true}
       stub(File).size(anything) {1}
       stub(File).unlink
     end
 
     it &quot;should check [:keep, :local]&quot; do
-      @local.config[:keep][:local] = nil
+      @local = local(def_config.merge(:keep =&gt; {}))
       dont_allow(Dir).[]
       @local.send :cleanup
     end
 
     it &quot;should delete extra files&quot; do
+      @local = local
+      mock(Dir).[](&quot;/mysqldump~blog~NoW/qweqwe.*&quot;) {@files}
       mock(File).unlink(&quot;/mysqldump~blog~NoW/qweqwe.1&quot;)
       mock(File).unlink(&quot;/mysqldump~blog~NoW/qweqwe.2&quot;)
       @local.send :cleanup</diff>
      <filename>examples/unit/local_example.rb</filename>
    </modified>
    <modified>
      <diff>@@ -44,7 +44,7 @@ describe Astrails::Safe::S3 do
     end
 
     it &quot;should check [:keep, :s3]&quot; do
-      @s3.config[:keep][:s3] = nil
+      @s3.config[:keep].data[&quot;s3&quot;] = nil
       dont_allow(@s3.backup).filename
       @s3.send :cleanup
     end
@@ -67,17 +67,17 @@ describe Astrails::Safe::S3 do
     end
 
     it &quot;should be false if bucket is missing&quot; do
-      @s3.config[:s3][:bucket] = nil
+      @s3.config[:s3].data[&quot;bucket&quot;] = nil
       @s3.should_not be_active
     end
 
     it &quot;should be false if key is missing&quot; do
-      @s3.config[:s3][:key] = nil
+      @s3.config[:s3].data[&quot;key&quot;] = nil
       @s3.should_not be_active
     end
 
     it &quot;should be false if secret is missing&quot; do
-      @s3.config[:s3][:secret] = nil
+      @s3.config[:s3].data[&quot;secret&quot;] = nil
       @s3.should_not be_active
     end
   end
@@ -87,7 +87,7 @@ describe Astrails::Safe::S3 do
       @s3 = s3
     end
     it &quot;should use s3/path 1st&quot; do
-      @s3.config[:s3][:path] = &quot;s3_path&quot;
+      @s3.config[:s3].data[&quot;path&quot;] = &quot;s3_path&quot;
       @s3.config[:local] = {:path =&gt; &quot;local_path&quot;}
       @s3.send(:path).should == &quot;s3_path&quot;
     end</diff>
      <filename>examples/unit/s3_example.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ module Astrails
     module Config
       class Node
         attr_reader :parent
+        attr_reader :data
         def initialize(parent = nil, data = {}, &amp;block)
           @parent, @data = parent, {}
           data.each { |k, v| self[k] = v }
@@ -26,12 +27,17 @@ module Astrails
         end
         alias :[] :find
 
+        MULTIVALUES = %w/skip_tables exclude files/
         def set(key, value, &amp;block)
+          if @data[key.to_s]
+            raise(ArgumentError, &quot;duplicate value for '#{key}'&quot;) if value.is_a?(Hash) || !MULTIVALUES.include?(key.to_s)
+          end
+
           if value.is_a?(Hash)
-            @data[key.to_s] = Node.new(self, value, &amp;block) 
+            @data[key.to_s] = Node.new(self, value, &amp;block)
           else
             raise(ArgumentError, &quot;#{key}: no block supported for simple values&quot;) if block
-            if @data[key.to_s] &amp;&amp; value
+            if @data[key.to_s]
               @data[key.to_s] = @data[key.to_s].to_a + value.to_a
             else
               @data[key.to_s] = value</diff>
      <filename>lib/astrails/safe/config/node.rb</filename>
    </modified>
    <modified>
      <diff>@@ -74,8 +74,12 @@ safe do
     #   gpg do
     #     password &quot;custom-production-pass&quot;
     #   end
-
-    #   skip_tables [:logger_exceptions, :request_logs] # skip those tables during backup
+    #   # skip those tables during backup
+    #   # you can pass an array
+    #   skip_tables [:logger_exceptions, :request_logs]
+    #   # or pass them all separately
+    #   skip_tables :test1
+    #   skip_tables :test2
     # end
 
   end
@@ -99,12 +103,16 @@ safe do
     # archive &quot;git-repositories&quot; do
     #   # files and directories to backup
     #   files &quot;/home/git/repositories&quot;
+    #   # can have more then one 'files' lines or/and use an array
+    #   files [&quot;/home/dev/work/foo&quot;, &quot;/home/dev/work/bar&quot;]
     # end
 
     # archive &quot;etc-files&quot; do
     #   files &quot;/etc&quot;
     #   # exlude those files/directories
     #   exclude &quot;/etc/puppet/other&quot;
+    #   # can have multiple 'exclude' lines or/and use an array
+    #   exclude [&quot;/etc/tmp/a&quot;, &quot;/etc/tmp/b&quot;]
     # end
 
     # archive &quot;dot-configs&quot; do</diff>
      <filename>templates/script.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e9d495d2cc02ef654ead3288b80e35b43bdb5bc5</id>
    </parent>
  </parents>
  <author>
    <name>Vitaly Kushner</name>
    <email>vitaly@astrails.com</email>
  </author>
  <url>http://github.com/astrails/safe/commit/d52e8bcf8f8f392a1c7a3c048b21995793b5d74d</url>
  <id>d52e8bcf8f8f392a1c7a3c048b21995793b5d74d</id>
  <committed-date>2009-10-20T09:23:42-07:00</committed-date>
  <authored-date>2009-10-20T09:23:42-07:00</authored-date>
  <message>disable non-multi-value config keys overwrite

multi-values: skip_tables exclude files</message>
  <tree>a2a27f29acc9fff442b2bec50ea21d0c01bf9c81</tree>
  <committer>
    <name>Vitaly Kushner</name>
    <email>vitaly@astrails.com</email>
  </committer>
</commit>
