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”
52 53 54 |
# File 'lib/multisync/definition/dsl.rb', line 52 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”
58 59 60 |
# File 'lib/multisync/definition/dsl.rb', line 58 def check_to flag=true @to_check = flag end |
#default ⇒ Object
41 42 43 |
# File 'lib/multisync/definition/dsl.rb', line 41 def default @default = true end |
#from(value, options = {}) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/multisync/definition/dsl.rb', line 22 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
5 6 7 |
# File 'lib/multisync/definition/dsl.rb', line 5 def group name, &block Multisync::Definition::Entity.new self, name, &block end |
#include(name) ⇒ Object
17 18 19 20 |
# 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 = {}) ⇒ Object
Defines a check, that should pass in order to invoke the sync
46 47 48 |
# File 'lib/multisync/definition/dsl.rb', line 46 def only_if cmd, ={} @check = { cmd: cmd, message: .fetch(:message, cmd) } end |
#options(rsync_options, mode = :append) ⇒ Object
36 37 38 39 |
# File 'lib/multisync/definition/dsl.rb', line 36 def , mode=:append @rsync_options_mode = mode @rsync_options = Array() end |
#sync(name, &block) ⇒ Object
9 10 11 |
# File 'lib/multisync/definition/dsl.rb', line 9 def sync name, &block Multisync::Definition::Entity.new self, name, &block end |
#template(name, &block) ⇒ Object
13 14 15 |
# File 'lib/multisync/definition/dsl.rb', line 13 def template name, &block Multisync::Definition::Template.new name, &block end |
#to(value, options = {}) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/multisync/definition/dsl.rb', line 29 def to value, ={} @to_value = value # Check destination's host or path before sync @to_check = [:check] @to_description = [:description] end |