Class: Zine::UploaderSFTP
- Inherits:
-
Object
- Object
- Zine::UploaderSFTP
- Defined in:
- lib/zine/uploader_sftp.rb
Overview
Deploy changes to a remote host, via SFTP
Defined Under Namespace
Classes: Node
Instance Method Summary collapse
-
#initialize(build_dir, options, credentials, delete_file_array, upload_file_array) ⇒ UploaderSFTP
constructor
A new instance of UploaderSFTP.
- #upload ⇒ Object
Constructor Details
#initialize(build_dir, options, credentials, delete_file_array, upload_file_array) ⇒ UploaderSFTP
Returns a new instance of UploaderSFTP.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/zine/uploader_sftp.rb', line 14 def initialize(build_dir, , credentials, delete_file_array, upload_file_array) return unless ['method'] == 'sftp' @build_dir = build_dir @host = ['host'] @path = ['path_or_repo'] @verbose = ['verbose'] @credentials = credentials @delete_file_array = delete_file_array @upload_file_array = upload_file_array end |
Instance Method Details
#upload ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/zine/uploader_sftp.rb', line 27 def upload delete deploy rescue Errno::ENETUNREACH puts Rainbow("Unable to connect to #{@host}").red rescue Net::SSH::AuthenticationFailed, NameError puts Rainbow("Authentication failed for #{@host}").red puts 'Check your credential file, and maybe run ssh-add?' end |