Class: Ftpd::FtpServer
- Defined in:
- lib/ftpd/ftp_server.rb
Instance Attribute Summary collapse
-
#auth_level ⇒ Integer
One of: * Ftpd::AUTH_USER * Ftpd::AUTH_PASSWORD (default) * Ftpd::AUTH_ACCOUNT.
-
#debug ⇒ Object
If truthy, emit debug information (such as replies received and responses sent) to the file named by #debug_path.
-
#debug_path ⇒ Object
The path to which to write debug information.
-
#list_formatter ⇒ Object
The class for formatting for LIST output.
-
#response_delay ⇒ Object
The number of seconds to delay before replying.
Attributes inherited from TlsServer
Attributes inherited from Server
Instance Method Summary collapse
-
#initialize(driver) ⇒ FtpServer
constructor
Create a new FTP server.
Methods inherited from Server
Constructor Details
#initialize(driver) ⇒ FtpServer
Create a new FTP server. The server won’t start until the #start method is called.
The driver should expose these public methods:
52 53 54 55 56 57 58 59 60 |
# File 'lib/ftpd/ftp_server.rb', line 52 def initialize(driver) super() @driver = driver @debug_path = '/dev/stdout' @debug = false @response_delay = 0 @list_formatter = ListFormat::Ls @auth_level = AUTH_PASSWORD end |
Instance Attribute Details
#auth_level ⇒ Integer
One of:
-
Ftpd::AUTH_USER
-
Ftpd::AUTH_PASSWORD (default)
-
Ftpd::AUTH_ACCOUNT
40 41 42 |
# File 'lib/ftpd/ftp_server.rb', line 40 def auth_level @auth_level end |
#debug ⇒ Object
If truthy, emit debug information (such as replies received and responses sent) to the file named by #debug_path.
Change to this attribute only take effect for new sessions.
11 12 13 |
# File 'lib/ftpd/ftp_server.rb', line 11 def debug @debug end |
#debug_path ⇒ Object
The path to which to write debug information. Defaults to ‘/dev/stdout’
Change to this attribute only take effect for new sessions.
18 19 20 |
# File 'lib/ftpd/ftp_server.rb', line 18 def debug_path @debug_path end |
#list_formatter ⇒ Object
The class for formatting for LIST output. Defaults to ListFormat::Ls. Changes to this attribute only take effect for new sessions.
32 33 34 |
# File 'lib/ftpd/ftp_server.rb', line 32 def list_formatter @list_formatter end |
#response_delay ⇒ Object
The number of seconds to delay before replying. This is for testing, when you need to test, for example, client timeouts. Defaults to 0 (no delay).
Change to this attribute only take effect for new sessions.
26 27 28 |
# File 'lib/ftpd/ftp_server.rb', line 26 def response_delay @response_delay end |