Class: Ftpd::FtpServer
- Defined in:
- lib/ftpd/ftp_server.rb
Instance Attribute Summary collapse
-
#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.
-
#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:
# Return truthy if the user/password should be allowed to
# log in.
authenticate(user, password)
# Return the file system to use for a user. The file system
# should expose the same public methods as
# Ftpd::DiskFileSystem.
def file_system(user)
45 46 47 48 49 50 51 |
# File 'lib/ftpd/ftp_server.rb', line 45 def initialize(driver) super() @driver = driver @debug_path = '/dev/stdout' @debug = false @response_delay = 0 end |
Instance Attribute Details
#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 |
#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 |