Module: CapistranoSyncTask::Helper
Instance Method Summary collapse
-
#_capture(command, options = {}) ⇒ Object
missing capture.
- #check_deps ⇒ Object
- #get_ssh_command ⇒ Object
- #log(*args) ⇒ Object
Instance Method Details
#_capture(command, options = {}) ⇒ Object
missing capture
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/capistrano-sync/sync.rb', line 19 def _capture(command, ={}) output = "" cap.invoke_command(command, .merge(:once => true)) do |ch, stream, data| case stream when :out then output << data when :err then warn "[err :: #{ch[:server]}] #{data}" end end output end |
#check_deps ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/capistrano-sync/sync.rb', line 30 def check_deps system "which pv 2> /dev/null" unless ($?.to_i == 0) puts "FATAL: pv (Pipe Viewer) command not found, please install 'port install pv' or 'brew install pv'" exit(1) end end |
#get_ssh_command ⇒ Object
7 8 9 10 11 12 |
# File 'lib/capistrano-sync/sync.rb', line 7 def get_ssh_command() server = cap.find_servers.first srv = server.host srv += ":#{server.port}" if server.port ["ssh -l #{cap[:user]} #{srv}", srv] end |
#log(*args) ⇒ Object
14 15 16 |
# File 'lib/capistrano-sync/sync.rb', line 14 def log(*args) cap.logger.info *args end |