End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
URI::FTP.new
new(scheme, userinfo, host, port, registry, path, opaque, query, fragment, parser = nil, arg_check = false)
lib/uri/ftp.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/uri/ftp.rb, line 133
def initialize(scheme,
userinfo, host, port, registry,
path, opaque,
query,
fragment,
parser = nil,
arg_check = false)
raise InvalidURIError unless path
path = path.sub(/^\//,'')
path.sub!(/^%2F/,'/')
super(scheme, userinfo, host, port, registry, path, opaque,
query, fragment, parser, arg_check)
@typecode = nil
if tmp = @path.index(TYPECODE_PREFIX)
typecode = @path[tmp + TYPECODE_PREFIX.size..-1]
@path = @path[0..tmp - 1]
if arg_check
self.typecode = typecode
else
self.set_typecode(typecode)
end
end
end
Description
Creates a new URI::FTP object from generic URL components with no syntax checking.
Unlike build(), this method does not escape the path component as required by RFC1738; instead it is treated as per RFC2396.
Arguments are scheme, userinfo, host, port, registry, path, opaque, query, and fragment, in that order.