Class: Middleman::Deploy::Methods::Ftp
- Defined in:
- lib/middleman-deploy/methods/ftp.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#pass ⇒ Object
readonly
Returns the value of attribute pass.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(server_instance, options = {}) ⇒ Ftp
constructor
A new instance of Ftp.
- #process ⇒ Object
Constructor Details
#initialize(server_instance, options = {}) ⇒ Ftp
Returns a new instance of Ftp.
10 11 12 13 14 15 16 17 18 |
# File 'lib/middleman-deploy/methods/ftp.rb', line 10 def initialize(server_instance, = {}) super(server_instance, ) @host = self..host @user = self..user @pass = self..password @path = self..path @port = self..port end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
8 9 10 |
# File 'lib/middleman-deploy/methods/ftp.rb', line 8 def host @host end |
#pass ⇒ Object (readonly)
Returns the value of attribute pass.
8 9 10 |
# File 'lib/middleman-deploy/methods/ftp.rb', line 8 def pass @pass end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/middleman-deploy/methods/ftp.rb', line 8 def path @path end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
8 9 10 |
# File 'lib/middleman-deploy/methods/ftp.rb', line 8 def port @port end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
8 9 10 |
# File 'lib/middleman-deploy/methods/ftp.rb', line 8 def user @user end |
Instance Method Details
#process ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/middleman-deploy/methods/ftp.rb', line 20 def process puts "## Deploying via ftp to #{self.user}@#{self.host}:#{self.path}" ftp = open_connection Dir.chdir(self.server_instance.build_dir) do filtered_files.each do |filename| if File.directory?(filename) upload_directory(ftp, filename) else upload_binary(ftp, filename) end end end ftp.close end |