Sha256: c92f775176938bfdb755f23376e5b4ee6b5b344abec6dd3050f6b434bb32466a

Contents?: true

Size: 670 Bytes

Versions: 14

Compression:

Stored size: 670 Bytes

Contents

module Ftpd

  # Functions for manipulating LIST and NLST arguments

  module ListPath

    # Turn the argument to LIST/NLST into a path
    #
    # @param argument [String] The argument, or nil if not present
    # @return [String] The path
    #
    # Although compliant with the spec, this function does not do
    # these things that traditional Unix FTP servers do:
    #
    # * Allow multiple paths
    # * Handle switches such as "-a"
    #
    # See: http://cr.yp.to/ftp/list.html sections "LIST parameters"
    # and "LIST wildcards"

    def list_path(argument)
      argument ||= '.'
      argument = '' if argument =~ /^-/
      argument
    end

  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
ftpd-1.1.1 lib/ftpd/list_path.rb
ftpd-1.1.0 lib/ftpd/list_path.rb
investtools-ftpd-1.0.1 lib/ftpd/list_path.rb
ftpd-1.0.1 lib/ftpd/list_path.rb
ftpd-1.0.0 lib/ftpd/list_path.rb
ftpd-0.17.0 lib/ftpd/list_path.rb
ftpd-0.16.0 lib/ftpd/list_path.rb
ftpd-0.15.0 lib/ftpd/list_path.rb
ftpd-0.14.0 lib/ftpd/list_path.rb
ftpd-0.13.0 lib/ftpd/list_path.rb
ftpd-0.12.0 lib/ftpd/list_path.rb
ftpd-0.11.0 lib/ftpd/list_path.rb
ftpd-0.10.0 lib/ftpd/list_path.rb
ftpd-0.9.0 lib/ftpd/list_path.rb