Sha256: 7786ff8feb9ee610dc3ec4e5dafbe810d3f5c214d0f651aa0783d9ca65f4f6db

Contents?: true

Size: 738 Bytes

Versions: 3

Compression:

Stored size: 738 Bytes

Contents

require "daemon_controller"

class FtpServer

  INSTALL_PATH = File.expand_path("../../../../vendor/apache-ftpserver", __FILE__)
  HOME_PATH    = INSTALL_PATH + "/res/home"

  def self.start
    daemon_controller.start unless daemon_controller.running?
  end

  def self.clear
    FileUtils.rm_r(Dir.glob(HOME_PATH + "/*"))
  end

  private

  def self.daemon_controller
    @daemon_controller ||= DaemonController.new(
      :identifier     => "Apache FtpServer",
      :start_command  => "cd #{INSTALL_PATH}; ./bin/ftpd.sh res/conf/ftpd-typical.xml",
      :ping_command   => [:tcp, '127.0.0.1', 2121],
      :pid_file       => INSTALL_PATH + "/res/ftpd.pid",
      :log_file       => INSTALL_PATH + "/res/log/ftpd.log"
    )
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
paperclip-storage-ftp-1.0.0 spec/support/integration/ftp_server.rb
paperclip-storage-ftp-1.0.0.rc3 spec/support/integration/ftp_server.rb
paperclip-storage-ftp-1.0.0.rc2 spec/support/integration/ftp_server.rb