Sha256: 07bd29cd032452dece7cda137aa1eb9834907461b9fe26d2bcfc7ad25131a5d3

Contents?: true

Size: 1.3 KB

Versions: 5

Compression:

Stored size: 1.3 KB

Contents

require "aws/s3"
require 'fileutils'

require 'tempfile'
require 'extensions/mktmpdir'

require 'astrails/safe/tmp_file'

require 'astrails/safe/config/node'
require 'astrails/safe/config/builder'

require 'astrails/safe/stream'

require 'astrails/safe/backup'

require 'astrails/safe/backup'

require 'astrails/safe/source'
require 'astrails/safe/mysqldump'
require 'astrails/safe/pgdump'
require 'astrails/safe/archive'
require 'astrails/safe/svndump'

require 'astrails/safe/pipe'
require 'astrails/safe/gpg'
require 'astrails/safe/gzip'

require 'astrails/safe/sink'
require 'astrails/safe/local'
require 'astrails/safe/s3'


module Astrails
  module Safe
    ROOT = File.join(File.dirname(__FILE__), "..", "..")

    def safe(&block)
      config = Config::Node.new(&block)
      #config.dump


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

      Astrails::Safe::TmpFile.cleanup
    end
    module_function :safe
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
astrails-safe-0.1.10 lib/astrails/safe.rb
astrails-safe-0.1.7 lib/astrails/safe.rb
astrails-safe-0.1.8 lib/astrails/safe.rb
astrails-safe-0.1.9 lib/astrails/safe.rb
astrails-safe-0.2.0 lib/astrails/safe.rb