Permalink
Browse files

Finally releasing version 3.0.17

  • Loading branch information...
2 parents 05793f1 + 72a6179 commit b0bca5e81ce6a9038290c1fae41a51a502d5685f Michael van Rooijen committed Sep 9, 2011
Showing with 1,524 additions and 252 deletions.
  1. +50 −47 Gemfile.lock
  2. +2 −2 Guardfile
  3. +43 −1 README.md
  4. +29 −8 bin/backup
  5. +25 −15 lib/backup.rb
  6. +30 −2 lib/backup/cli.rb
  7. +63 −0 lib/backup/compressor/lzma.rb
  8. +23 −0 lib/backup/configuration/compressor/lzma.rb
  9. +10 −4 lib/backup/configuration/helpers.rb
  10. +5 −0 lib/backup/configuration/notifier/mail.rb
  11. +19 −4 lib/backup/configuration/storage/dropbox.rb
  12. +4 −0 lib/backup/configuration/storage/ftp.rb
  13. +17 −0 lib/backup/configuration/storage/local.rb
  14. +20 −0 lib/backup/configuration/storage/ninefold.rb
  15. +4 −0 lib/backup/configuration/storage/rsync.rb
  16. +12 −3 lib/backup/database/postgresql.rb
  17. +5 −1 lib/backup/database/redis.rb
  18. +16 −11 lib/backup/dependency.rb
  19. +2 −0 lib/backup/encryptor/gpg.rb
  20. +8 −0 lib/backup/exception/command_failed.rb
  21. +49 −9 lib/backup/finder.rb
  22. +7 −1 lib/backup/notifier/mail.rb
  23. +1 −1 lib/backup/notifier/twitter.rb
  24. +93 −16 lib/backup/storage/dropbox.rb
  25. +10 −3 lib/backup/storage/ftp.rb
  26. +78 −0 lib/backup/storage/local.rb
  27. +96 −0 lib/backup/storage/ninefold.rb
  28. +37 −20 lib/backup/storage/rsync.rb
  29. +1 −1 lib/backup/storage/s3.rb
  30. +1 −1 lib/backup/storage/scp.rb
  31. +1 −1 lib/backup/syncer/rsync.rb
  32. +1 −1 lib/backup/version.rb
  33. +7 −0 lib/templates/compressor/lzma
  34. +2 −2 lib/templates/storage/dropbox
  35. +8 −7 lib/templates/storage/ftp
  36. +7 −0 lib/templates/storage/local
  37. +1 −0 lib/templates/storage/rsync
  38. +59 −0 spec/compressor/lzma_spec.rb
  39. +28 −0 spec/configuration/compressor/bzip2_spec.rb
  40. +28 −0 spec/configuration/compressor/lzma_spec.rb
  41. +16 −0 spec/configuration/database/mongodb_spec.rb
  42. +17 −0 spec/configuration/database/mysql_spec.rb
  43. +17 −0 spec/configuration/database/postgresql_spec.rb
  44. +16 −0 spec/configuration/database/redis_spec.rb
  45. +11 −0 spec/configuration/notifier/campfire_spec.rb
  46. +20 −0 spec/configuration/notifier/mail_spec.rb
  47. +34 −0 spec/configuration/notifier/presently_spec.rb
  48. +12 −0 spec/configuration/notifier/twitter_spec.rb
  49. +1 −6 spec/configuration/storage/dropbox_spec.rb
  50. +16 −13 spec/configuration/storage/ftp_spec.rb
  51. +28 −0 spec/configuration/storage/local_spec.rb
  52. +31 −0 spec/configuration/storage/ninefold_spec.rb
  53. +2 −0 spec/configuration/storage/rsync_spec.rb
  54. +31 −10 spec/database/postgresql_spec.rb
  55. +9 −2 spec/database/redis_spec.rb
  56. +1 −1 spec/encryptor/gpg_spec.rb
  57. +6 −4 spec/logger_spec.rb
  58. +15 −13 spec/model_spec.rb
  59. +47 −13 spec/storage/dropbox_spec.rb
  60. +26 −14 spec/storage/ftp_spec.rb
  61. +84 −0 spec/storage/local_spec.rb
  62. +143 −0 spec/storage/ninefold_spec.rb
  63. +16 −6 spec/storage/rsync_spec.rb
  64. +4 −2 spec/storage/s3_spec.rb
  65. +14 −7 spec/syncer/rsync_spec.rb
  66. +5 −0 spec/syncer/s3_spec.rb
View
@@ -1,34 +1,34 @@
GEM
remote: http://rubygems.org/
specs:
- activesupport (3.0.5)
- addressable (2.2.4)
+ Platform (0.4.0)
+ addressable (2.2.6)
builder (3.0.0)
crack (0.1.8)
diff-lcs (1.1.2)
- dropbox (1.2.3)
+ dropbox (1.3.0)
json (>= 1.2.0)
- mechanize (>= 1.0.0)
- multipart-post (>= 1.0)
+ multipart-post (>= 1.1.0)
oauth (>= 0.3.6)
- excon (0.5.6)
- faraday (0.5.7)
- addressable (~> 2.2.4)
+ excon (0.6.6)
+ faraday (0.7.4)
+ addressable (~> 2.2.6)
multipart-post (~> 1.1.0)
- rack (< 2, >= 1.1.0)
- faraday_middleware (0.3.2)
- faraday (~> 0.5.4)
+ rack (>= 1.1.0, < 2)
+ faraday_middleware (0.7.0)
+ faraday (~> 0.7.3)
ffi (1.0.9)
- fog (0.7.0)
+ fog (0.11.0)
builder
- excon (>= 0.5.5)
- formatador (>= 0.1.1)
- json
+ excon (~> 0.6.5)
+ formatador (~> 0.2.0)
mime-types
- net-ssh (>= 2.0.23)
- nokogiri (>= 1.4.4)
+ multi_json (~> 1.0.3)
+ net-scp (~> 1.0.4)
+ net-ssh (~> 2.1.4)
+ nokogiri (~> 1.5.0)
ruby-hmac
- formatador (0.1.1)
+ formatador (0.2.1)
fuubar (0.0.5)
rspec (~> 2.0)
rspec-instafail (~> 0.1.4)
@@ -38,33 +38,34 @@ GEM
thor (~> 0.14.6)
guard-rspec (0.3.1)
guard (>= 0.2.2)
- hashie (1.0.0)
+ hashie (1.1.0)
httparty (0.7.4)
crack (= 0.1.8)
- i18n (0.5.0)
- json (1.5.1)
+ i18n (0.6.0)
+ json (1.5.4)
libnotify (0.5.5)
- mail (2.2.15)
- activesupport (>= 2.3.6)
+ mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mechanize (1.0.0)
- nokogiri (>= 1.2.1)
mime-types (1.16)
mocha (0.9.12)
- multi_json (0.0.5)
- multi_xml (0.2.1)
- multipart-post (1.1.0)
+ multi_json (1.0.3)
+ multi_xml (0.3.0)
+ multipart-post (1.1.3)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-sftp (2.0.5)
net-ssh (>= 2.0.9)
- net-ssh (2.1.3)
- nokogiri (1.4.4)
- oauth (0.4.4)
- polyglot (0.3.1)
- rack (1.2.2)
+ net-ssh (2.1.4)
+ nokogiri (1.5.0)
+ oauth (0.4.5)
+ open4 (1.1.0)
+ polyglot (0.3.2)
+ popen4 (0.1.2)
+ Platform (>= 0.4.0)
+ open4 (>= 0.4.0)
+ rack (1.3.2)
rb-fsevent (0.4.0)
rb-inotify (0.8.5)
ffi (>= 0.5.0)
@@ -79,39 +80,41 @@ GEM
rspec-mocks (2.5.0)
ruby-hmac (0.4.0)
ruby-progressbar (0.0.10)
- simple_oauth (0.1.4)
+ simple_oauth (0.1.5)
thor (0.14.6)
timecop (0.3.5)
- treetop (1.4.9)
+ treetop (1.4.10)
+ polyglot
polyglot (>= 0.3.1)
- twitter (1.1.2)
- faraday (~> 0.5.4)
- faraday_middleware (~> 0.3.1)
- hashie (~> 1.0.0)
- multi_json (~> 0.0.5)
- multi_xml (~> 0.2.0)
- simple_oauth (~> 0.1.3)
+ twitter (1.7.1)
+ faraday (~> 0.7.4)
+ faraday_middleware (~> 0.7.0)
+ hashie (~> 1.1.0)
+ multi_json (~> 1.0.0)
+ multi_xml (~> 0.3.0)
+ simple_oauth (~> 0.1.5)
PLATFORMS
ruby
DEPENDENCIES
- dropbox (~> 1.2.3)
- fog (~> 0.7.0)
+ dropbox (~> 1.3.0)
+ fog (>= 0.11.0)
fuubar
growl
guard
guard-rspec
httparty (~> 0.7.4)
json (~> 1.5.1)
libnotify
- mail (~> 2.2.15)
+ mail (~> 2.3.0)
mocha
net-scp (~> 1.0.4)
net-sftp (~> 2.0.5)
- net-ssh (~> 2.1.3)
+ net-ssh (~> 2.1.4)
+ popen4 (~> 0.1.2)
rb-fsevent
rb-inotify
rspec
timecop
- twitter (~> 1.1.2)
+ twitter (>= 1.7.1)
View
@@ -9,8 +9,8 @@ guard 'rspec',
:version => 2,
:rvm => ['1.9.2', '1.8.7', 'ree'],
:bundler => true,
- :cli => '--color --format Fuubar --fail-fast' do
-
+ :cli => '--color --format Fuubar' do
+
watch(%r{^spec/.+_spec\.rb})
watch(%r{^lib/(.+)\.rb}) { 'spec' }
watch('spec/spec_helper.rb') { 'spec' }
View
@@ -85,6 +85,7 @@ Compressors
- Gzip
- Bzip2
+- Lzma
[Compressors Wiki Page](https://github.com/meskyanichi/backup/wiki/Compressors)
@@ -280,6 +281,46 @@ Contributors
<td><a href="https://github.com/bgarret" target="_blank">Benoit Garret ( bgarret )</a></td>
<td>Presently notifier</td>
</tr>
+ <tr>
+ <td><a href="https://github.com/lleirborras" target="_blank">Lleïr Borràs Metje ( lleirborras )</a></td>
+ <td>Lzma Compressor</td>
+ </tr>
+ <tr>
+ <td><a href="https://github.com/jof" target="_blank">Jonathan Lassoff ( jof )</a></td>
+ <td>Bugfixes and more secure GPG storage</td>
+ </tr>
+ <tr>
+ <td><a href="https://github.com/mikz" target="_blank">Michal Cichra ( mikz )</a></td>
+ <td>Wildcard Triggers</td>
+ </tr>
+ <tr>
+ <td><a href="https://github.com/trybeee" target="_blank">Dmitry Novotochinov ( trybeee )</a></td>
+ <td>Dropbox Storage</td>
+ </tr>
+ <tr>
+ <td><a href="https://github.com/Emerson" target="_blank">Emerson Lackey ( Emerson )</a></td>
+ <td>Local RSync Storage</td>
+ </tr>
+ <tr>
+ <td><a href="https://github.com/digilord" target="_blank">digilord</a></td>
+ <td>OpenSSL Verify Mode for Mail Notifier</td>
+ </tr>
+ <tr>
+ <td><a href="https://github.com/stemps" target="_blank">stemps</a></td>
+ <td>FTP Passive Mode</td>
+ </tr>
+ <tr>
+ <td><a href="https://github.com/dkowis" target="_blank">David Kowis ( dkowis )</a></td>
+ <td>Fixed PostgreSQL Password issues</td>
+ </tr>
+ <tr>
+ <td><a href="https://github.com/jotto" target="_blank">Jonathan Otto ( jotto )</a></td>
+ <td>Allow for running PostgreSQL as another UNIX user</td>
+ </tr>
+ <tr>
+ <td><a href="https://github.com/joaovitor" target="_blank">João Vitor ( joaovitor )</a></td>
+ <td>Changed default PostgreSQL example options to appropriate ones</td>
+ </tr>
</table>
@@ -300,6 +341,7 @@ Easily run tests against all three Ruby versions
Install [RVM](https://rvm.beginrescueend.com/) and use it to install Ruby 1.9.2, 1.8.7 and REE.
+ rvm get latest && rvm reload
rvm install 1.9.2 && rvm install 1.8.7 && rvm install ree
Once these are installed, go ahead and install all the necessary dependencies.
@@ -311,7 +353,7 @@ Once these are installed, go ahead and install all the necessary dependencies.
The Backup gem uses [Guard](https://github.com/guard/guard) along with [Guard::RSpec](https://github.com/guard/guard-rspec) to quickly and easily test Backup's code against all three Rubies. If you've done the above, all you have to do is run:
- guard start
+ bundle exec guard
from Backup's root and that's it. It'll now test against all three Rubies each time you adjust a file in the `lib` or `spec` directories.
View
@@ -1,4 +1,4 @@
-#! /usr/bin/env ruby
+#!/usr/bin/env ruby
##
# Load RubyGems for Ruby <= 1.8.7
@@ -19,6 +19,8 @@ end
# Load the Backup source
require File.expand_path("../../lib/backup", __FILE__)
+Backup::Dependency.load('popen4')
+
##
# Build the Backup Command Line Interface using Thor
class BackupCLI < Thor
@@ -29,15 +31,16 @@ class BackupCLI < Thor
##
# [Perform]
# Performs the backup process. The only required option is the --trigger [-t].
- # If the other options (--config_file, --data_path, --tmp_path) aren't specified
+ # If the other options (--config-file, --data-path, --cache--path, --tmp-path) aren't specified
# it'll fallback to the (good) defaults
method_option :trigger, :type => :string, :aliases => ['-t', '--triggers'], :required => true
method_option :config_file, :type => :string, :aliases => '-c'
method_option :data_path, :type => :string, :aliases => '-d'
method_option :log_path, :type => :string, :aliases => '-l'
+ method_option :cache_path, :type => :string
method_option :tmp_path, :type => :string
method_option :quiet, :type => :boolean, :aliases => '-q'
- desc 'perform', "Performs the backup for the specified trigger.\n" +
+ desc 'perform', "Performs the backup for the specified trigger.\n" +
"You may perform multiple backups by providing multiple triggers, separated by commas.\n\n" +
"Example:\n\s\s$ backup perform --triggers backup1,backup2,backup3,backup4\n\n" +
"This will invoke 4 backups, and they will run in the order specified (not asynchronous)."
@@ -65,15 +68,22 @@ class BackupCLI < Thor
end
##
+ # Overwrites the CACHE_PATH location, if --cache-path was specified
+ if options[:cache_path]
+ Backup.send(:remove_const, :CACHE_PATH)
+ Backup.send(:const_set, :CACHE_PATH, options[:cache_path])
+ end
+
+ ##
# Overwrites the TMP_PATH location, if --tmp-path was specified
if options[:tmp_path]
Backup.send(:remove_const, :TMP_PATH)
Backup.send(:const_set, :TMP_PATH, options[:tmp_path])
end
##
- # Ensure the TMP_PATH and LOG_PATH are created if they do not yet exist
- Array.new([Backup::TMP_PATH, Backup::LOG_PATH]).each do |path|
+ # Ensure the CACHE_PATH, TMP_PATH and LOG_PATH are created if they do not yet exist
+ Array.new([Backup::CACHE_PATH, Backup::TMP_PATH, Backup::LOG_PATH]).each do |path|
FileUtils.mkdir_p(path)
end
@@ -84,8 +94,19 @@ class BackupCLI < Thor
end
##
+ # Prepare all trigger names by splitting them by ','
+ # and finding trigger names matching wildcard
+ triggers = options[:trigger].split(",")
+ triggers.map!(&:strip).map!{ |t|
+ t.include?(Backup::Finder::WILDCARD) ?
+ Backup::Finder.new(t).matching : t
+ }.flatten!
+
+ #triggers.unique! # Uncomment if its undesirable to call triggers twice
+
+ ##
# Process each trigger
- options[:trigger].split(",").map(&:strip).each do |trigger|
+ triggers.each do |trigger|
##
# Defines the TRIGGER constant
@@ -101,7 +122,7 @@ class BackupCLI < Thor
##
# Parses the backup configuration file and returns the model instance by trigger
- model = Backup::Finder.new(trigger, Backup::CONFIG_FILE).find
+ model = Backup::Finder.new(trigger).find
##
# Runs the returned model
@@ -177,7 +198,7 @@ class BackupCLI < Thor
file.write( File.read(temp_file.path) )
puts "Generated configuration file in '#{ config }'"
end
- end
+ end
temp_file.unlink
end
Oops, something went wrong. Retry.

0 comments on commit b0bca5e

Please sign in to comment.