Creates a new SyncContext object which handles a single directory from the Syncer::Base @directories array.
# File lib/backup/syncer/cloud/base.rb, line 73 def initialize(directory, bucket, path) @directory, @bucket, @path = directory, bucket, path @remote_base = File.join(path, File.basename(directory)) end
Performs the sync operation using the provided techniques (mirroring/concurrency).
# File lib/backup/syncer/cloud/base.rb, line 81 def sync!(mirror = false, concurrency_type = false, concurrency_level = 2) block = Proc.new { |relative_path| sync_file relative_path, mirror } case concurrency_type when FalseClass all_file_names.each(&block) when :threads Parallel.each all_file_names, :in_threads => concurrency_level, &block when :processes Parallel.each all_file_names, :in_processes => concurrency_level, &block else raise Errors::Syncer::Cloud::ConfigurationError, "Unknown concurrency_type setting: #{ concurrency_type.inspect }" end end
Generated with the Darkfish Rdoc Generator 2.