lib/backup-agent.rb in backup-agent-1.0.9 vs lib/backup-agent.rb in backup-agent-2.0.0

- old
+ new

@@ -1,19 +1,34 @@ -puts "Ruby version #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" +# encoding: UTF-8 +# frozen_string_literal: true -%w( rubygems aws-sdk fileutils confo-config shellwords ).each { |el| require(el) } +require "fileutils" +require "tempfile" +require "shellwords" +require "open3" +require "singleton" +require "aws-sdk" +require "method-not-implemented" +require "active_support/core_ext/object/blank" +require "active_support/core_ext/string/filters" +require "active_support/core_ext/string/multibyte" +require "active_support/core_ext/numeric/time" -%w( abstract_storage abstract_storage_config abstract_storage_object - s3_storage s3_config s3_object - features task performer ).each { |el| require_relative("backup-agent/#{el}") } +["ruby", "tar", "gzip", "xz", "mysql", "mysqldump"].each do |x| + puts Open3.capture3(x, "--version")[0...2].map(&:squish).reject(&:blank?).join(' ') +end -module Backup - class << self - def perform(storage, &block) - Performer.new.perform_backup(storage, Task.new(&block)) - end +$LOAD_PATH << __dir__ unless $LOAD_PATH.include?(__dir__) - def features - @features ||= Features.new - end - end -end \ No newline at end of file +require "backup-agent/dsl" +require "backup-agent/credentials" +require "backup-agent/performer" + +require "backup-agent/storages" +require "backup-agent/storages/base" +require "backup-agent/storages/local" +require "backup-agent/storages/amazon-s3" + +require "backup-agent/tasks/directory" +require "backup-agent/tasks/mysql" + +include Backup::DSL