Parent

Class/Module Index [+]

Quicksearch

Backup::Syncer::Base

Attributes

excludes[R]
mirror[RW]

Flag for mirroring the files/directories

path[RW]

Path to store the synced files/directories to

syncer_id[R]

Optional user-defined identifier to differentiate multiple syncers defined within a single backup model. Currently this is only used in the log messages.

Public Class Methods

new(syncer_id = nil) click to toggle source
# File lib/backup/syncer/base.rb, line 24
def initialize(syncer_id = nil)
  @syncer_id = syncer_id

  load_defaults!

  @mirror ||= false
  @directories = []
  @excludes = []
end

Public Instance Methods

add(path) click to toggle source
# File lib/backup/syncer/base.rb, line 41
def add(path)
  directories << path
end
directories(&block) click to toggle source

Syntactical suger for the DSL for adding directories

# File lib/backup/syncer/base.rb, line 36
def directories(&block)
  return @directories unless block_given?
  instance_eval(&block)
end
exclude(pattern) click to toggle source

For Cloud Syncers, pattern can be a string (with shell-style wildcards) or a regex. For RSync, each pattern will be passed to rsync’s –exclude option.

# File lib/backup/syncer/base.rb, line 48
def exclude(pattern)
  excludes << pattern
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.