Feature #3848 » openuri-ftp-auth.patch
(current document) | ||
---|---|---|
# The access sequence is defined by RFC 1738
|
||
ftp = Net::FTP.open(self.host)
|
||
# todo: extract user/passwd from .netrc.
|
||
user = 'anonymous'
|
||
passwd = nil
|
||
if options.include? :http_basic_authentication
|
||
user, passwd = options[:http_basic_authentication]
|
||
else
|
||
user = 'anonymous'
|
||
passwd = nil
|
||
end
|
||
user, passwd = self.userinfo.split(/:/) if self.userinfo
|
||
ftp.login(user, passwd)
|
||
directories.each {|cwd|
|