Sha256: 0b976e64fbca5ebbf58cd618a4e6bd1297e5421176e4c39c8eb8dcc70ca22154

Contents?: true

Size: 505 Bytes

Versions: 2

Compression:

Stored size: 505 Bytes

Contents

module Ftpd

  # This class is a proxy file system driver that sends "450" replies
  # when the wrapped file system driver raises a FileSystemError.

  class FileSystemErrorTranslator

    include Error

    def initialize(file_system)
      @file_system = file_system
    end

    def respond_to?(method)
      @file_system.respond_to?(method)
    end

    def method_missing(method, *args)
      @file_system.send(method, *args)
    rescue FileSystemError => e
      error "450 #{e}"
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ftpd-0.2.0 lib/ftpd/file_system_error_translator.rb
ftpd-0.1.1 lib/ftpd/file_system_error_translator.rb