class Object

Public Instance Methods

remote_file_content_same_as?(full_path, content) click to toggle source
# File lib/capistrano/node-deploy.rb, line 13
def remote_file_content_same_as?(full_path, content)
  results = []
  invoke_command("md5sum #{full_path} | awk '{ print $1 }'") do |ch, stream, out|
    results << (out == Digest::MD5.hexdigest(content))
  end
  results == [true]
end
remote_file_differs?(full_path, content) click to toggle source
# File lib/capistrano/node-deploy.rb, line 21
def remote_file_differs?(full_path, content)
  exists = remote_file_exists?(full_path)
  !exists || exists && !remote_file_content_same_as?(full_path, content)
end
remote_file_exists?(full_path) click to toggle source
# File lib/capistrano/node-deploy.rb, line 5
def remote_file_exists?(full_path)
  results = []
  invoke_command("if [ -e '#{full_path}' ]; then echo -n 'true'; fi") do |ch, stream, out|
    results << (out == 'true')
  end
  results == [true]
end