Sha256: 85d74f03bafa2e7c0d2960af722229d7118b88095540c17cf8575cde2a4432c7

Contents?: true

Size: 958 Bytes

Versions: 8

Compression:

Stored size: 958 Bytes

Contents

# encoding: utf-8

module Backup
  module Syncer
    module RSync
      class Local < Base

        def initialize(syncer_id = nil, &block)
          super
          instance_eval(&block) if block_given?
        end

        def perform!
          log!(:started)

          create_dest_path!
          run("#{ rsync_command } #{ paths_to_push } '#{ dest_path }'")

          log!(:finished)
        end

        private

        # Expand path, since this is local and shell-quoted.
        def dest_path
          @dest_path ||= File.expand_path(path)
        end

        def create_dest_path!
          FileUtils.mkdir_p dest_path
        end

        attr_deprecate :additional_options, :version => '3.2.0',
                       :message => 'Use #additional_rsync_options instead.',
                       :action => lambda {|klass, val|
                         klass.additional_rsync_options = val
                       }
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
backup-3.6.0 lib/backup/syncer/rsync/local.rb
backup-3.5.1 lib/backup/syncer/rsync/local.rb
backup-3.5.0 lib/backup/syncer/rsync/local.rb
backup-3.4.0 lib/backup/syncer/rsync/local.rb
backup-3.3.2 lib/backup/syncer/rsync/local.rb
backup-3.3.1 lib/backup/syncer/rsync/local.rb
backup-3.3.0 lib/backup/syncer/rsync/local.rb
backup-3.2.0 lib/backup/syncer/rsync/local.rb