Class: Grifork::Executor::Carrier
- Inherits:
-
Object
- Object
- Grifork::Executor::Carrier
- Includes:
- Grifork::Executable
- Defined in:
- lib/grifork/executor/carrier.rb
Instance Method Summary collapse
- #dst ⇒ Object private
-
#initialize(type, &task) ⇒ Carrier
constructor
Initialize with task.
-
#rsync(from, to = nil) ⇒ Object
private
Wrapper for Grifork::Executable#rsync.
-
#rsync_remote(from, to = nil) ⇒ Object
private
Wrapper for Grifork::Executable#rsync_remote.
-
#run(src, dst) ⇒ Object
Run the task.
- #src ⇒ Object private
Methods included from Grifork::Executable
Methods included from Loggable
Methods included from Configured
Constructor Details
#initialize(type, &task) ⇒ Carrier
Initialize with task
6 7 8 9 |
# File 'lib/grifork/executor/carrier.rb', line 6 def initialize(type, &task) @type = type @task = task end |
Instance Method Details
#dst ⇒ Object (private)
26 27 28 |
# File 'lib/grifork/executor/carrier.rb', line 26 def dst Thread.current[:dst] end |
#rsync(from, to = nil) ⇒ Object (private)
Wrapper for Grifork::Executable#rsync
31 32 33 |
# File 'lib/grifork/executor/carrier.rb', line 31 def rsync(from, to = nil) super(dst, from, to) end |
#rsync_remote(from, to = nil) ⇒ Object (private)
Note:
This is for remote
task on :standalone
mode
Wrapper for Grifork::Executable#rsync_remote
37 38 39 |
# File 'lib/grifork/executor/carrier.rb', line 37 def rsync_remote(from, to = nil) super(src, dst, from, to) end |
#run(src, dst) ⇒ Object
Run the task
14 15 16 17 18 |
# File 'lib/grifork/executor/carrier.rb', line 14 def run(src, dst) Thread.current[:src] = src Thread.current[:dst] = dst instance_eval(&@task) end |
#src ⇒ Object (private)
22 23 24 |
# File 'lib/grifork/executor/carrier.rb', line 22 def src Thread.current[:src] end |