Skip to content

Commit

Permalink
Compatible with Ruby 1.9.1, updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
winton committed Nov 29, 2009
1 parent c738450 commit 04b00ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions README.markdown
Expand Up @@ -3,12 +3,16 @@ rbackup

Backup your stuff with Ruby and Rsync.

Compatibility
-------------

Tested with Ruby 1.8.6, 1.8.7, and 1.9.1.

Setup
-----

<pre>
gem sources -a http://gems.github.com
sudo gem install winton-rbackup
sudo gem install rbackup --source http://gemcutter.org
</pre>

Create ~/.rbackup.yml
Expand Down
8 changes: 4 additions & 4 deletions lib/rbackup.rb
Expand Up @@ -54,7 +54,7 @@ def error(e)
end

def esc(paths)
paths = paths.to_a
paths = [ paths ].flatten
paths.collect! { |path| path.gsub('SPEC', SPEC) } if $TESTING
paths.collect { |path| path.gsub(' ', '\ ') }.join(' ')
end
Expand All @@ -63,7 +63,7 @@ def rsync(profile)
inc1ude = []
exclude = []
destination = profile['destination']
source = profile['source'].to_a
source = [ profile['source'] ].flatten

options = "--delete --numeric-ids --safe-links -axzSvL"
# --delete delete extraneous files from dest dirs
Expand All @@ -86,11 +86,11 @@ def rsync(profile)

if profile['include']
exclude = %w(*) unless profile['exclude']
inc1ude = profile['include'].to_a
inc1ude = [ profile['include'] ].flatten
end

if profile['exclude']
exclude += profile['exclude'].to_a
exclude += [ profile['exclude'] ].flatten
end

inc1ude = inc1ude.collect { |i| "--include='#{i}'" }.join(' ')
Expand Down

0 comments on commit 04b00ed

Please sign in to comment.