backupgem 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -4,3 +4,9 @@
4
4
 
5
5
  * First stable code in place.
6
6
  * Packaged in an gem format
7
+
8
+ == Version 0.0.3
9
+
10
+ * Fixed a critical bug that did not allow re-defining the :delivery or :rotate
11
+ methods. Thanks to James Healy for pointing this out.
12
+
data/README CHANGED
@@ -218,9 +218,9 @@ or your own:
218
218
  ====Action====
219
219
  Delivery is supported via <tt>scp</tt>, <tt>ftp</tt>, and <tt>mv</tt>
220
220
 
221
- action :delivery, :method => :scp
222
- action :delivery, :method => :ftp
223
- action :delivery, :method => :mv
221
+ action :deliver, :method => :scp
222
+ action :deliver, :method => :ftp
223
+ action :deliver, :method => :mv
224
224
 
225
225
  The <tt>:mv</tt> action is defined like any user-defined action:
226
226
 
@@ -338,7 +338,7 @@ Thankfully, this is incredibly simple:
338
338
  dump # make sure you return the name of the file
339
339
  end
340
340
 
341
- action :delivery, :method => :scp
341
+ action :deliver, :method => :scp
342
342
  action :rotate, :method => :via_ssh
343
343
 
344
344
  set :servers, %w{ my.server.com }
data/doc/index.html CHANGED
@@ -324,9 +324,9 @@ or your own:
324
324
  <p><i>Full <span class="caps">FTP</span> support is <a href="#Known_Bugs_and_Limitations_TODO">unfinished</a>. Currently, only <code><span class="ident">scp</span></code> and <code><span class="ident">mv</span></code> fully support rotation</i></p>
325
325
 
326
326
 
327
- <div class='example'><pre><code> <span class="ident">action</span> <span class="symbol">:delivery</span><span class="punct">,</span> <span class="symbol">:method</span> <span class="punct">=&gt;</span> <span class="symbol">:scp</span>
328
- <span class="ident">action</span> <span class="symbol">:delivery</span><span class="punct">,</span> <span class="symbol">:method</span> <span class="punct">=&gt;</span> <span class="symbol">:ftp</span>
329
- <span class="ident">action</span> <span class="symbol">:delivery</span><span class="punct">,</span> <span class="symbol">:method</span> <span class="punct">=&gt;</span> <span class="symbol">:mv</span></code></pre></div>
327
+ <div class='example'><pre><code> <span class="ident">action</span> <span class="symbol">:deliver</span><span class="punct">,</span> <span class="symbol">:method</span> <span class="punct">=&gt;</span> <span class="symbol">:scp</span>
328
+ <span class="ident">action</span> <span class="symbol">:deliver</span><span class="punct">,</span> <span class="symbol">:method</span> <span class="punct">=&gt;</span> <span class="symbol">:ftp</span>
329
+ <span class="ident">action</span> <span class="symbol">:deliver</span><span class="punct">,</span> <span class="symbol">:method</span> <span class="punct">=&gt;</span> <span class="symbol">:mv</span></code></pre></div>
330
330
  The <code><span class="symbol">:mv</span></code> action is defined (in <code><span class="ident">backup</span><span class="punct">/</span><span class="ident">recipes</span><span class="punct">/</span><span class="ident">standard</span><span class="punct">.</span><span class="ident">rb</span></code>) like any user-defined action:
331
331
  <div class='example'><pre><code> <span class="ident">action</span><span class="punct">(</span><span class="symbol">:mv</span><span class="punct">)</span> <span class="keyword">do</span>
332
332
  <span class="ident">sh</span> <span class="punct">&quot;</span><span class="string">mv <span class="expr">#{last_result}</span> <span class="expr">#{c[:backup_path]}</span>/</span><span class="punct">&quot;</span>
@@ -482,7 +482,7 @@ Thankfully, this is incredibly simple:
482
482
  <span class="ident">dump</span> <span class="comment"># make sure you return the name of the file</span>
483
483
  <span class="keyword">end</span>
484
484
 
485
- <span class="ident">action</span> <span class="symbol">:delivery</span><span class="punct">,</span> <span class="symbol">:method</span> <span class="punct">=&gt;</span> <span class="symbol">:scp</span>
485
+ <span class="ident">action</span> <span class="symbol">:deliver</span><span class="punct">,</span> <span class="symbol">:method</span> <span class="punct">=&gt;</span> <span class="symbol">:scp</span>
486
486
  <span class="ident">action</span> <span class="symbol">:rotate</span><span class="punct">,</span> <span class="symbol">:method</span> <span class="punct">=&gt;</span> <span class="symbol">:via_ssh</span>
487
487
 
488
488
  <span class="ident">set</span> <span class="symbol">:servers</span><span class="punct">,</span> <span class="punct">%w{</span><span class="string"> my.server.com </span><span class="punct">}</span>
@@ -705,7 +705,7 @@ Thankfully, this is incredibly simple:
705
705
 
706
706
  <div id="footer">
707
707
  <p>
708
- &copy; 2006 <a href="mailto:nate+backupgem@natemurray.com">Nate Murray</a>. <span class="last_updated">Last updated Fri Oct 06 15:11:51 PDT 2006</span>
708
+ &copy; 2006 <a href="mailto:nate+backupgem@natemurray.com">Nate Murray</a>. <span class="last_updated">Last updated Tue Oct 10 09:20:53 PDT 2006</span>
709
709
  </p>
710
710
 
711
711
  </div>
@@ -13,7 +13,7 @@ action(:content) do
13
13
  end
14
14
 
15
15
  # action :compress, :method => :tar_bz2 # could be set in global
16
- # action :delivery, :method => :scp # could be set in global
16
+ # action :deliver, :method => :scp # could be set in global
17
17
 
18
18
  # settings for backup servers are global unless specified otherwise
19
19
  # rotate settings are global unless specified herer
data/lib/backup/actor.rb CHANGED
@@ -71,7 +71,7 @@ module Backup
71
71
  def define_action(name, options={}, &block)
72
72
  @action[name] = (options[:action_class] || Action).new(name, self, options)
73
73
 
74
- if self.respond_to?(name) && !block_given?
74
+ if self.respond_to?(name) && !( block_given? || options[:method] )
75
75
  # if it was already defined and we aren't trying to re-define it then
76
76
  # what we are trying to do is define it the same way it is defined now
77
77
  # only with options being sent to it.
@@ -130,7 +130,6 @@ module Backup
130
130
  options = options.merge(:desc => @next_description)
131
131
  @next_description = nil
132
132
  end
133
-
134
133
  actor.define_action(name, options, &block)
135
134
  end
136
135
 
data/tests/ssh_test.rb CHANGED
@@ -4,7 +4,7 @@ class SSHTest < Test::Unit::TestCase
4
4
  def setup
5
5
  @config = Backup::Configuration.new
6
6
  @config.load "standard"
7
- @config.action :deliver, :method => :via_ssh
7
+ @config.action :deliver, :method => :ssh
8
8
  @actor = Backup::SshActor.new(@config)
9
9
  end
10
10
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: backupgem
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.2
7
- date: 2006-10-06 00:00:00 -07:00
6
+ version: 0.0.3
7
+ date: 2006-10-10 00:00:00 -07:00
8
8
  summary: Beginning-to-end solution for backups and rotation.
9
9
  require_paths:
10
10
  - lib