module Multisync::Definition::Dsl

Public Instance Methods

check_from(flag=true) click to toggle source

Check source's host or path before sync can also be set as option of “from”

# File lib/multisync/definition/dsl.rb, line 52
def check_from flag=true
  @from_check = flag
end
check_to(flag=true) click to toggle source

Check destination's host or path before sync can also be set as option of “to”

# File lib/multisync/definition/dsl.rb, line 58
def check_to flag=true
  @to_check = flag
end
default() click to toggle source
# File lib/multisync/definition/dsl.rb, line 41
def default
  @default = true
end
from(value, options={}) click to toggle source
# File lib/multisync/definition/dsl.rb, line 22
def from value, options={}
  @from_value = value
  # Check source's host or path before sync
  @from_check = options[:check]
  @from_description = options[:description]
end
group(name, &block) click to toggle source

The DSL methods

# File lib/multisync/definition/dsl.rb, line 5
def group name, &block
  Multisync::Definition::Entity.new self, name, &block
end
include(name) click to toggle source
# File lib/multisync/definition/dsl.rb, line 17
def include name
  template = Multisync::Definition::Template.lookup name
  instance_eval &template.block
end
only_if(cmd, options={}) click to toggle source

Defines a check, that should pass in order to invoke the sync

# File lib/multisync/definition/dsl.rb, line 46
def only_if cmd, options={}
  @check = { cmd: cmd, message: options.fetch(:message, cmd) }
end
options(rsync_options, mode=:append) click to toggle source
# File lib/multisync/definition/dsl.rb, line 36
def options rsync_options, mode=:append
  @rsync_options_mode = mode
  @rsync_options = Array(rsync_options)
end
sync(name, &block) click to toggle source
# File lib/multisync/definition/dsl.rb, line 9
def sync name, &block
  Multisync::Definition::Entity.new self, name, &block
end
template(name, &block) click to toggle source
# File lib/multisync/definition/dsl.rb, line 13
def template name, &block
  Multisync::Definition::Template.new name, &block
end
to(value, options={}) click to toggle source
# File lib/multisync/definition/dsl.rb, line 29
def to value, options={}
  @to_value = value
  # Check destination's host or path before sync
  @to_check = options[:check]
  @to_description = options[:description]
end