Module: Astrails::Safe

Defined in:
lib/astrails/safe.rb,
lib/astrails/safe/s3.rb,
lib/astrails/safe/ftp.rb,
lib/astrails/safe/gpg.rb,
lib/astrails/safe/gzip.rb,
lib/astrails/safe/pipe.rb,
lib/astrails/safe/sftp.rb,
lib/astrails/safe/sink.rb,
lib/astrails/safe/local.rb,
lib/astrails/safe/backup.rb,
lib/astrails/safe/pgdump.rb,
lib/astrails/safe/source.rb,
lib/astrails/safe/stream.rb,
lib/astrails/safe/archive.rb,
lib/astrails/safe/svndump.rb,
lib/astrails/safe/version.rb,
lib/astrails/safe/tmp_file.rb,
lib/astrails/safe/mongodump.rb,
lib/astrails/safe/mysqldump.rb,
lib/astrails/safe/cloudfiles.rb,
lib/astrails/safe/config/node.rb,
lib/astrails/safe/config/builder.rb

Defined Under Namespace

Modules: Config, TmpFile Classes: Archive, Backup, Cloudfiles, Ftp, Gpg, Gzip, Local, Mongodump, Mysqldump, Pgdump, Pipe, S3, Sftp, Sink, Source, Stream, Svndump

Constant Summary collapse

ROOT =
File.join(File.dirname(__FILE__), "..", "..")
VERSION =
"0.3.1"

Class Method Summary collapse

Class Method Details

.process(config) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/astrails/safe.rb', line 48

def process(config)

  [[Mysqldump, [:mysqldump, :databases]],
   [Pgdump,    [:pgdump,    :databases]],
   [Mongodump, [:mongodump, :databases]],
   [Archive,   [:tar,       :archives]],
   [Svndump,   [:svndump,   :repos]]
  ].each do |klass, path|
    if collection = config[*path]
      collection.each do |name, c|
        klass.new(name, c).backup.run(c, :gpg, :gzip, :local, :s3, :cloudfiles, :sftp, :ftp)
      end
    end
  end

  Astrails::Safe::TmpFile.cleanup
end

.safe(&block) ⇒ Object



44
45
46
# File 'lib/astrails/safe.rb', line 44

def safe(&block)
  Config::Node.new(&block)
end