Class: FileLoaders::Adapters::Sftp
- Defined in:
- lib/file_loaders/adapters/sftp.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from FileLoaders::Adapters::Base
Instance Method Details
#each ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/file_loaders/adapters/sftp.rb', line 6 def each tempdir = make_tempdir Net::SFTP.start settings.host, settings.user do |sftp| entries(sftp).each do |entry| filename = download!(sftp, entry, tempdir) move_to_processed(sftp, entry) if yield(filename, entry) end end ensure FileUtils.remove_dir(tempdir, true) end |