Module: CapistranoSyncTask::Helper

Included in:
Db, Dir
Defined in:
lib/capistrano-sync/sync.rb

Instance Method Summary collapse

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, options={})
  output = ""
  cap.invoke_command(command, options.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_depsObject



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_commandObject



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