Implement Remote::FS#has_file?

This commit is contained in:
Thibault Jouan
2013-09-25 23:58:07 +00:00
parent 91f2bc3567
commit 3492382968
2 changed files with 52 additions and 0 deletions

View File

@@ -11,6 +11,12 @@ module Producer
def sftp
@sftp ||= @remote.session.sftp.connect
end
def has_file?(path)
sftp.stat!(path).file?
rescue Net::SFTP::StatusException
false
end
end
end
end