Class: FtpDeploy::Ftp
- Inherits:
-
Object
- Object
- FtpDeploy::Ftp
- Defined in:
- lib/scms/deploy-ftp.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#passive ⇒ Object
readonly
Returns the value of attribute passive.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(host, port = 21, options = Hash.new) ⇒ Ftp
constructor
A new instance of Ftp.
- #sync(local, distant) ⇒ Object
Constructor Details
#initialize(host, port = 21, options = Hash.new) ⇒ Ftp
Returns a new instance of Ftp.
63 64 65 66 67 68 |
# File 'lib/scms/deploy-ftp.rb', line 63 def initialize(host, port = 21, = Hash.new) = {:username => nil, :password => nil}.merge() @host, @port = host, port @username, @password = [:username], [:password] @passive = [:passive] end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
61 62 63 |
# File 'lib/scms/deploy-ftp.rb', line 61 def host @host end |
#passive ⇒ Object (readonly)
Returns the value of attribute passive.
61 62 63 |
# File 'lib/scms/deploy-ftp.rb', line 61 def passive @passive end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
61 62 63 |
# File 'lib/scms/deploy-ftp.rb', line 61 def password @password end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
61 62 63 |
# File 'lib/scms/deploy-ftp.rb', line 61 def port @port end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
61 62 63 |
# File 'lib/scms/deploy-ftp.rb', line 61 def username @username end |
Instance Method Details
#sync(local, distant) ⇒ Object
70 71 72 73 74 |
# File 'lib/scms/deploy-ftp.rb', line 70 def sync(local, distant) connect do |ftp| send_dir(ftp, local, distant) end end |