class Bundler::URI::FTP

def self.build(args)


uri2.to_s # => "ftp://ftp.example.com/ruby/src"
:path => 'ruby/src'})
uri2 = Bundler::URI::FTP.build({:host => 'ftp.example.com',

uri1.to_s # => "ftp://user:password@ftp.example.com/%2Fpath/file.zip;type=i"
'/path/file.zip', 'i'])
uri1 = Bundler::URI::FTP.build(['user:password', 'ftp.example.com', nil,

require 'bundler/vendor/uri/lib/uri'

Examples:

make it absolute in the Bundler::URI.
If the path supplied is absolute, it will be escaped in order to

order [userinfo, host, port, path, typecode].
If an Array is used, the components must be passed in the

with keys formed by preceding the component names with a colon.
The components should be provided either as an Array, or as a Hash

+typecode+.
The components accepted are +userinfo+, +host+, +port+, +path+, and

Creates a new Bundler::URI::FTP object from components, with syntax checking.

== Description
def self.build(args)
  # Fix the incoming path to be generic URL syntax
  # FTP path  ->  URL path
  # foo/bar       /foo/bar
  # /foo/bar      /%2Ffoo/bar
  #
  if args.kind_of?(Array)
    args[3] = '/' + args[3].sub(/^\//, '%2F')
  else
    args[:path] = '/' + args[:path].sub(/^\//, '%2F')
  end
  tmp = Util::make_components_hash(self, args)
  if tmp[:typecode]
    if tmp[:typecode].size == 1
      tmp[:typecode] = TYPECODE_PREFIX + tmp[:typecode]
    end
    tmp[:path] << tmp[:typecode]
  end
  return super(tmp)
end