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

Version Path
ftpd-2.1.0 examples/hello_world.rb
ftpd-2.0.5 examples/hello_world.rb
ftpd-2.0.4 examples/hello_world.rb
ftpd-2.0.3 examples/hello_world.rb
ftpd-2.0.2 examples/hello_world.rb
ftpd-2.0.1 examples/hello_world.rb
ftpd-2.0.0 examples/hello_world.rb
ftpd-1.1.1 examples/hello_world.rb
ftpd-1.1.0 examples/hello_world.rb
investtools-ftpd-1.0.1 examples/hello_world.rb
ftpd-1.0.1 examples/hello_world.rb
ftpd-1.0.0 examples/hello_world.rb
ftpd-0.17.0 examples/hello_world.rb
ftpd-0.16.0 examples/hello_world.rb
ftpd-0.15.0 examples/hello_world.rb
ftpd-0.14.0 examples/hello_world.rb
ftpd-0.13.0 examples/hello_world.rb
ftpd-0.12.0 examples/hello_world.rb
ftpd-0.11.0 examples/hello_world.rb
ftpd-0.10.0 examples/hello_world.rb