Sha256: 17d8be4318b90110cc226ee2395e5c6f9f113bfb0ea45e03038b02a6835a0610

Contents?: true

Size: 807 Bytes

Versions: 3

Compression:

Stored size: 807 Bytes

Contents

# encoding: utf-8

module Backup
  module Syncer
    class Base
      include Backup::CLI::Helpers
      include Backup::Configuration::Helpers

      ##
      # Directories to sync
      attr_accessor :directories

      ##
      # Path to store the synced files/directories to
      attr_accessor :path

      ##
      # Flag for mirroring the files/directories
      attr_accessor :mirror

      ##
      # Syntactical suger for the DSL for adding directories
      def directories(&block)
        return @directories unless block_given?
        instance_eval(&block)
      end

      ##
      # Adds a path to the @directories array
      def add(path)
        @directories << path
      end

      private

      def syncer_name
        self.class.to_s.sub('Backup::', '')
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
backup_checksum-3.0.23 lib/backup/syncer/base.rb
backup-3.0.23 lib/backup/syncer/base.rb
backup-3.0.22 lib/backup/syncer/base.rb