Sha256: ed7b59d6ed8c6ea8aac472da6cc6b3d6ce135a34dfd233c9547430203b1094d6
Contents?: true
Size: 542 Bytes
Versions: 34
Compression:
Stored size: 542 Bytes
Contents
#!/usr/bin/env ruby unless $:.include?(File.dirname(__FILE__) + '/../lib') $:.unshift(File.dirname(__FILE__) + '/../lib') end require 'ftpd' require 'tmpdir' class Driver def initialize(temp_dir) @temp_dir = temp_dir end def authenticate(user, password) true end def file_system(user) Ftpd::DiskFileSystem.new(@temp_dir) end end Dir.mktmpdir do |temp_dir| driver = Driver.new(temp_dir) server = Ftpd::FtpServer.new(driver) server.start puts "Server listening on port #{server.bound_port}" gets end
Version data entries
34 entries across 34 versions & 2 rubygems