Class: Middleman::Deploy::Methods::Sftp
- Defined in:
- lib/middleman-deploy/methods/sftp.rb
Instance Attribute Summary
Attributes inherited from Ftp
#host, #pass, #path, #port, #user
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Ftp
Methods inherited from Base
Constructor Details
This class inherits a constructor from Middleman::Deploy::Methods::Ftp
Instance Method Details
#process ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/middleman-deploy/methods/sftp.rb', line 8 def process puts "## Deploying via sftp to #{self.user}@#{self.host}:#{path}" # `nil` is a valid value for user and/or pass. Net::SFTP.start(self.host, self.user, password: self.pass, port: self.port) do |sftp| sftp.mkdir(self.path) Dir.chdir(self.server_instance.build_dir) do filtered_files.each do |filename| if File.directory?(filename) upload_directory(sftp, filename) else upload_file(sftp, filename) end end end end end |