Implement Remote::FS#dir?

This commit is contained in:
Thibault Jouan
2014-01-21 15:01:27 +00:00
parent dba8a7aeee
commit 9d7af04d28
2 changed files with 45 additions and 0 deletions

View File

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