Class: CapistranoSyncTask::Dir
- Inherits:
-
Object
- Object
- CapistranoSyncTask::Dir
- Includes:
- Helper
- Defined in:
- lib/capistrano-sync/sync.rb
Instance Attribute Summary collapse
-
#cap ⇒ Object
Returns the value of attribute cap.
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(cap, from, to) ⇒ Dir
constructor
A new instance of Dir.
- #sync ⇒ Object
Methods included from Helper
#_capture, #check_deps, #get_ssh_command
Constructor Details
#initialize(cap, from, to) ⇒ Dir
Returns a new instance of Dir.
155 156 157 158 159 |
# File 'lib/capistrano-sync/sync.rb', line 155 def initialize(cap, from, to) self.from = from self.to = to self.cap = cap end |
Instance Attribute Details
#cap ⇒ Object
Returns the value of attribute cap.
154 155 156 |
# File 'lib/capistrano-sync/sync.rb', line 154 def cap @cap end |
#from ⇒ Object
Returns the value of attribute from.
154 155 156 |
# File 'lib/capistrano-sync/sync.rb', line 154 def from @from end |
#to ⇒ Object
Returns the value of attribute to.
154 155 156 |
# File 'lib/capistrano-sync/sync.rb', line 154 def to @to end |
Instance Method Details
#sync ⇒ Object
161 162 163 164 165 166 167 168 |
# File 'lib/capistrano-sync/sync.rb', line 161 def sync check_deps ssh_cmd, server = get_ssh_command log "rsync #{server}:#{from} -> local:#{to} (see progress)" cmd = "#{ssh_cmd} \"tar -cC #{from} .\" |pv -s #{total} | tar -x -C #{to}" cmd = [rsync_command, cat_files_command, pv_command, trash_output_command].join(" | ") system cmd end |