Class: Backup::Checksum::Base

Inherits:
Object
  • Object
show all
Includes:
Backup::CLI::Helpers, Backup::Configuration::Helpers
Defined in:
lib/backup/checksum/base.rb

Direct Known Subclasses

Shasum

Constant Summary

Constants included from Backup::CLI::Helpers

Backup::CLI::Helpers::UTILITY

Instance Method Summary collapse

Methods included from Backup::Configuration::Helpers

#clear_defaults!, #load_defaults!

Methods included from Backup::CLI::Helpers

#command_name, #raise_if_command_failed!, #run, #utility

Constructor Details

#initializeBase

Returns a new instance of Base.



9
10
11
# File 'lib/backup/checksum/base.rb', line 9

def initialize
  load_defaults!
end

Instance Method Details

#process_checksum_file_before_transfer(file_names_hash, checksum_name, local_path) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/backup/checksum/base.rb', line 13

def process_checksum_file_before_transfer(file_names_hash, checksum_name, local_path)
  file_names_hash.each do |local, remote|
    replace_in_file(File.join(local_path, checksum_name), /#{File.join(local_path, local)}/) do |match|
      remote
    end
  end
end