Module: Multisync::Definition::Dsl
Instance Method Summary collapse
-
#check_from(flag = true) ⇒ Object
Check source’s host or path before sync can also be set as option of “from”.
-
#check_to(flag = true) ⇒ Object
Check destination’s host or path before sync can also be set as option of “to”.
- #default ⇒ Object
- #from(value, options = {}) ⇒ Object
-
#group(name, &block) ⇒ Object
The DSL methods.
- #include(name) ⇒ Object
-
#only_if(cmd, options = {}) ⇒ Object
Defines a check, that should pass in order to invoke the sync.
- #options(rsync_options, mode = :append) ⇒ Object
- #sync(name, &block) ⇒ Object
- #template(name, &block) ⇒ Object
- #to(value, options = {}) ⇒ Object
Instance Method Details
#check_from(flag = true) ⇒ Object
Check source’s host or path before sync can also be set as option of “from”
50 51 52 |
# File 'lib/multisync/definition/dsl.rb', line 50 def check_from flag = true @from_check = flag end |
#check_to(flag = true) ⇒ Object
Check destination’s host or path before sync can also be set as option of “to”
56 57 58 |
# File 'lib/multisync/definition/dsl.rb', line 56 def check_to flag = true @to_check = flag end |
#default ⇒ Object
39 40 41 |
# File 'lib/multisync/definition/dsl.rb', line 39 def default @default = true end |
#from(value, options = {}) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/multisync/definition/dsl.rb', line 20 def from value, = {} @from_value = value # Check source's host or path before sync @from_check = [:check] @from_description = [:description] end |
#group(name, &block) ⇒ Object
The DSL methods
3 4 5 |
# File 'lib/multisync/definition/dsl.rb', line 3 def group name, &block Multisync::Definition::Entity.new self, name, &block end |
#include(name) ⇒ Object
15 16 17 18 |
# File 'lib/multisync/definition/dsl.rb', line 15 def include name template = Multisync::Definition::Template.lookup name instance_eval(&template.block) end |
#only_if(cmd, options = {}) ⇒ Object
Defines a check, that should pass in order to invoke the sync
44 45 46 |
# File 'lib/multisync/definition/dsl.rb', line 44 def only_if cmd, = {} @check = {cmd: cmd, message: .fetch(:message, cmd)} end |
#options(rsync_options, mode = :append) ⇒ Object
34 35 36 37 |
# File 'lib/multisync/definition/dsl.rb', line 34 def , mode = :append = mode = Array() end |
#sync(name, &block) ⇒ Object
7 8 9 |
# File 'lib/multisync/definition/dsl.rb', line 7 def sync name, &block Multisync::Definition::Entity.new self, name, &block end |
#template(name, &block) ⇒ Object
11 12 13 |
# File 'lib/multisync/definition/dsl.rb', line 11 def template name, &block Multisync::Definition::Template.new name, &block end |
#to(value, options = {}) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/multisync/definition/dsl.rb', line 27 def to value, = {} @to_value = value # Check destination's host or path before sync @to_check = [:check] @to_description = [:description] end |