Module: Ronin::Network::Mixins::FTP
Overview
Adds FTP convenience methods and connection parameters to a class.
Defines the following parameters:
host
(String
) - FTP host.port
(Integer
) - FTP port.ftp_user
(String
) - FTP user to login as.ftp_password
(String
) - FTP password to login with.ftp_account
(String
) - FTP account information to send.
Constant Summary
Constants included from FTP
FTP::DEFAULT_PORT, FTP::DEFAULT_USER
Class Method Summary collapse
-
.ftp_password ⇒ Object
FTP account information to send.
-
.ftp_password=(value) ⇒ Object
FTP account information to send.
-
.ftp_user ⇒ Object
FTP user to login as.
-
.ftp_user=(value) ⇒ Object
FTP user to login as.
-
.host ⇒ Object
FTP host.
-
.host=(value) ⇒ Object
FTP host.
-
.port ⇒ Object
FTP port.
-
.port=(value) ⇒ Object
FTP port.
Instance Method Summary collapse
-
#ftp_connect(options = {}) {|session| ... } ⇒ Net::FTP
protected
Creates a connection to the FTP server.
-
#ftp_password ⇒ Object
FTP account information to send.
-
#ftp_password=(value) ⇒ Object
FTP account information to send.
-
#ftp_session(options = {}) {|session| ... } ⇒ Object
protected
Starts a session with the FTP server.
-
#ftp_user ⇒ Object
FTP user to login as.
-
#ftp_user=(value) ⇒ Object
FTP user to login as.
-
#host ⇒ Object
FTP host.
-
#host=(value) ⇒ Object
FTP host.
-
#port ⇒ Object
FTP port.
-
#port=(value) ⇒ Object
FTP port.
Methods included from Mixin
Methods included from FTP
Class Method Details
.ftp_password ⇒ Object
FTP account information to send
55 56 |
# File 'lib/ronin/network/mixins/ftp.rb', line 55 parameter :ftp_password, :type => String, :description => 'FTP account information' |
.ftp_password=(value) ⇒ Object
FTP account information to send
55 56 |
# File 'lib/ronin/network/mixins/ftp.rb', line 55 parameter :ftp_password, :type => String, :description => 'FTP account information' |
.ftp_user ⇒ Object
FTP user to login as
51 52 |
# File 'lib/ronin/network/mixins/ftp.rb', line 51 parameter :ftp_user, :type => String, :description => 'FTP user to login as' |
.ftp_user=(value) ⇒ Object
FTP user to login as
51 52 |
# File 'lib/ronin/network/mixins/ftp.rb', line 51 parameter :ftp_user, :type => String, :description => 'FTP user to login as' |
.host ⇒ Object
FTP host
43 44 |
# File 'lib/ronin/network/mixins/ftp.rb', line 43 parameter :host, :type => String, :description => 'FTP host' |
.host=(value) ⇒ Object
FTP host
43 44 |
# File 'lib/ronin/network/mixins/ftp.rb', line 43 parameter :host, :type => String, :description => 'FTP host' |
Instance Method Details
#ftp_connect(options = {}) {|session| ... } ⇒ Net::FTP (protected)
Creates a connection to the FTP server. The host
, port
,
ftp_user
, ftp_password
and ftp_account
parameters
will also be used to connect to the server.
97 98 99 100 101 |
# File 'lib/ronin/network/mixins/ftp.rb', line 97 def ftp_connect(={},&block) print_info "Connecting to #{host_port} ..." return super(self.host,(),&block) end |
#ftp_password ⇒ Object
FTP account information to send
55 56 |
# File 'lib/ronin/network/mixins/ftp.rb', line 55 parameter :ftp_password, :type => String, :description => 'FTP account information' |
#ftp_password=(value) ⇒ Object
FTP account information to send
55 56 |
# File 'lib/ronin/network/mixins/ftp.rb', line 55 parameter :ftp_password, :type => String, :description => 'FTP account information' |
#ftp_session(options = {}) {|session| ... } ⇒ Object (protected)
Starts a session with the FTP server. The host
, port
,
ftp_login
, ftp_user
and ftp_password
parameters
will also be used to connect to the server.
119 120 121 122 123 124 125 126 127 128 |
# File 'lib/ronin/network/mixins/ftp.rb', line 119 def ftp_session(={},&block) super(()) do |sess| yield sess if block_given? print_info "Logging out ..." end print_info "Disconnected to #{host_port}" return nil end |
#ftp_user ⇒ Object
FTP user to login as
51 52 |
# File 'lib/ronin/network/mixins/ftp.rb', line 51 parameter :ftp_user, :type => String, :description => 'FTP user to login as' |
#ftp_user=(value) ⇒ Object
FTP user to login as
51 52 |
# File 'lib/ronin/network/mixins/ftp.rb', line 51 parameter :ftp_user, :type => String, :description => 'FTP user to login as' |
#host ⇒ Object
FTP host
43 44 |
# File 'lib/ronin/network/mixins/ftp.rb', line 43 parameter :host, :type => String, :description => 'FTP host' |
#host=(value) ⇒ Object
FTP host
43 44 |
# File 'lib/ronin/network/mixins/ftp.rb', line 43 parameter :host, :type => String, :description => 'FTP host' |