Class Sprout::SFTPTask
In: sprout/lib/sprout/tasks/sftp_task.rb
Parent: Rake::Task

The SFTPTask provides a simple rake task interface to the SFTP client RubyGem. This task can allow you to easily push build artifacts to a remote server with a single shell command.

Methods

new  

Attributes

dir_mode  [RW]  the mode for created directories. Defaults to 0755
file_mode  [RW]  The mode for transmitted files. Defaults to 0644
files  [RW]  Collection of files that should be transmitted to the remote server
host  [RW]  Host name of the server to connect to with no protocol prefix, like: sub.yourhost.com
local_path  [RW]  The local path to mask from transmitted files. This is key feature for automated file transmission. For example, if you are sending a file:
  bin/assets/img/SomeImage.jpg

into a directory on your server like:

  /var/www/someproject/

You don‘t necessarily want the ‘bin’ folder copied over, so you set the local_path to ‘bin’ like:

  t.local_path = 'bin'

and your server will have the file uploaded to:

  /var/www/someproject/assets/img/SomeImage.jpg
password  [RW]  Password to send to the remote host. You will be prompted for this value if it is left null.

NOTE: You should never check a file into version control with this field filled in, it is provided here as a convenience for getting set up.

remote_path  [RW]  The Remote base path where files should be transmitted, can be absolute or relative.
username  [RW]  Username to send to the remote host. You will be prompted for this value if it is left null.

NOTE: You should never check a file into version control with this field filled in, it is provided here as a convenience for getting set up.

Public Class methods

[Source]

# File sprout/lib/sprout/tasks/sftp_task.rb, line 80
    def initialize(task_name, app)
      super(task_name, app)
      @name = name
      @files = []
      @dir_mode = 0755
      @file_mode = 0644
      @host = nil
    end

[Validate]