lib/fig/protocol/ssh.rb
# Determine whether we need to update something.  Returns nil to indicate
# "don't know".
Determine whether we need to update something.  Returns nil to indicate
"don't know".
Determine whether we need to update something . Returns nil to indicate " don ' t know " .
def path_up_to_date?(uri, path, prompt_for_login)
    unescaped_path = CGI.unescape uri.path
    size_mtime = ssh(uri.host, 'stat', '--format="%s %Z"', unescaped_path) {
      |error_message|
      raise Fig::NetworkError.new(
        "Unable to get size and modification time for remote path #{path}: #{error_message}",
      )
    }
    remote_size, remote_mtime = size_mtime.split
    remote_size  = remote_size.to_i
    remote_mtime = remote_mtime.to_i
    if remote_size != ::File.size(path)
      return false
    end
    if remote_mtime <= ::File.mtime(path).to_i
      return true
    end
    return false
  end
def path_up_to_date? ( uri , path , prompt_for_login ) unescaped_path = CGI . unescape uri . path size_mtime = ssh ( uri . host , 'stat' , '--format="%s %Z"' , unescaped_path ) { | error_message | raise Fig :: NetworkError . new ( "Unable to get size and modification time for remote path #{path}: #{error_message}" , ) } remote_size , remote_mtime = size_mtime . split remote_size = remote_size . to_i remote_mtime = remote_mtime . to_i if remote_size != :: File . size ( path ) return false end if remote_mtime <= :: File . mtime ( path ) . to_i return true end return false end
Determine whether we need to update something.
Determine whether we need to update something .
uri
path
prompt_for_login