Small changes to documentation; mainly hiding things from RDoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ed8152d68c
commit
f3f7c40c49
@ -14,13 +14,15 @@
|
|||||||
require "socket"
|
require "socket"
|
||||||
require "monitor"
|
require "monitor"
|
||||||
|
|
||||||
module Net
|
module Net # :nodoc:
|
||||||
|
|
||||||
|
# :stopdoc:
|
||||||
class FTPError < StandardError; end
|
class FTPError < StandardError; end
|
||||||
class FTPReplyError < FTPError; end
|
class FTPReplyError < FTPError; end
|
||||||
class FTPTempError < FTPError; end
|
class FTPTempError < FTPError; end
|
||||||
class FTPPermError < FTPError; end
|
class FTPPermError < FTPError; end
|
||||||
class FTPProtoError < FTPError; end
|
class FTPProtoError < FTPError; end
|
||||||
|
# :startdoc:
|
||||||
|
|
||||||
#
|
#
|
||||||
# This class implements the File Transfer Protocol. If you have used a
|
# This class implements the File Transfer Protocol. If you have used a
|
||||||
@ -32,6 +34,8 @@ module Net
|
|||||||
#
|
#
|
||||||
# require 'net/ftp'
|
# require 'net/ftp'
|
||||||
#
|
#
|
||||||
|
# === Example 1
|
||||||
|
#
|
||||||
# ftp = Net::FTP.new('ftp.netlab.co.jp')
|
# ftp = Net::FTP.new('ftp.netlab.co.jp')
|
||||||
# ftp.login
|
# ftp.login
|
||||||
# files = ftp.chdir('pub/lang/ruby/contrib')
|
# files = ftp.chdir('pub/lang/ruby/contrib')
|
||||||
@ -39,6 +43,15 @@ module Net
|
|||||||
# ftp.getbinaryfile('nif.rb-0.91.gz', 'nif.gz', 1024)
|
# ftp.getbinaryfile('nif.rb-0.91.gz', 'nif.gz', 1024)
|
||||||
# ftp.close
|
# ftp.close
|
||||||
#
|
#
|
||||||
|
# === Example 2
|
||||||
|
#
|
||||||
|
# Net::FTP.open('ftp.netlab.co.jp') do |ftp|
|
||||||
|
# ftp.login
|
||||||
|
# files = ftp.chdir('pub/lang/ruby/contrib')
|
||||||
|
# files = ftp.list('n*')
|
||||||
|
# ftp.getbinaryfile('nif.rb-0.91.gz', 'nif.gz', 1024)
|
||||||
|
# end
|
||||||
|
#
|
||||||
# == Major Methods
|
# == Major Methods
|
||||||
#
|
#
|
||||||
# The following are the methods most likely to be useful to users:
|
# The following are the methods most likely to be useful to users:
|
||||||
@ -56,10 +69,11 @@ module Net
|
|||||||
class FTP
|
class FTP
|
||||||
include MonitorMixin
|
include MonitorMixin
|
||||||
|
|
||||||
|
# :stopdoc:
|
||||||
FTP_PORT = 21
|
FTP_PORT = 21
|
||||||
CRLF = "\r\n"
|
CRLF = "\r\n"
|
||||||
|
|
||||||
DEFAULT_BLOCKSIZE = 4096
|
DEFAULT_BLOCKSIZE = 4096
|
||||||
|
# :startdoc:
|
||||||
|
|
||||||
# When +true+, transfers are performed in binary mode. Default: +true+.
|
# When +true+, transfers are performed in binary mode. Default: +true+.
|
||||||
attr_accessor :binary
|
attr_accessor :binary
|
||||||
@ -123,11 +137,13 @@ module Net
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Obsolete
|
||||||
def return_code
|
def return_code
|
||||||
$stderr.puts("warning: Net::FTP#return_code is obsolete and do nothing")
|
$stderr.puts("warning: Net::FTP#return_code is obsolete and do nothing")
|
||||||
return "\n"
|
return "\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Obsolete
|
||||||
def return_code=(s)
|
def return_code=(s)
|
||||||
$stderr.puts("warning: Net::FTP#return_code= is obsolete and do nothing")
|
$stderr.puts("warning: Net::FTP#return_code= is obsolete and do nothing")
|
||||||
end
|
end
|
||||||
@ -524,7 +540,7 @@ module Net
|
|||||||
# data in +blocksize+ chunks.
|
# data in +blocksize+ chunks.
|
||||||
#
|
#
|
||||||
def putbinaryfile(localfile, remotefile = File.basename(localfile),
|
def putbinaryfile(localfile, remotefile = File.basename(localfile),
|
||||||
blocksize = DEFAULT_BLOCKSIZE, &block) # :yield: line/data
|
blocksize = DEFAULT_BLOCKSIZE, &block) # :yield: data
|
||||||
if @resume
|
if @resume
|
||||||
begin
|
begin
|
||||||
rest_offset = size(remotefile)
|
rest_offset = size(remotefile)
|
||||||
@ -670,7 +686,7 @@ module Net
|
|||||||
return resp[3..-1].strip.to_i
|
return resp[3..-1].strip.to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
MDTM_REGEXP = /^(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/
|
MDTM_REGEXP = /^(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/ # :nodoc:
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns the last modification time of the (remote) file. If +local+ is
|
# Returns the last modification time of the (remote) file. If +local+ is
|
||||||
|
@ -133,6 +133,8 @@
|
|||||||
#
|
#
|
||||||
# === HTTP Response Classes
|
# === HTTP Response Classes
|
||||||
#
|
#
|
||||||
|
# TODO: write me.
|
||||||
|
#
|
||||||
# == Switching Net::HTTP versions
|
# == Switching Net::HTTP versions
|
||||||
#
|
#
|
||||||
# You can use net/http.rb 1.1 features (bundled with Ruby 1.6)
|
# You can use net/http.rb 1.1 features (bundled with Ruby 1.6)
|
||||||
@ -155,10 +157,12 @@ require 'net/protocol'
|
|||||||
require 'uri'
|
require 'uri'
|
||||||
|
|
||||||
|
|
||||||
module Net
|
module Net # :nodoc:
|
||||||
|
|
||||||
|
# :stopdoc:
|
||||||
class HTTPBadResponse < StandardError; end
|
class HTTPBadResponse < StandardError; end
|
||||||
class HTTPHeaderSyntaxError < StandardError; end
|
class HTTPHeaderSyntaxError < StandardError; end
|
||||||
|
# :startdoc:
|
||||||
|
|
||||||
#
|
#
|
||||||
# Class providing both short-cut class methods for retrieving entities,
|
# Class providing both short-cut class methods for retrieving entities,
|
||||||
@ -168,15 +172,11 @@ module Net
|
|||||||
#
|
#
|
||||||
class HTTP < Protocol
|
class HTTP < Protocol
|
||||||
|
|
||||||
|
# :stopdoc:
|
||||||
Revision = %q$Revision$.split[1]
|
Revision = %q$Revision$.split[1]
|
||||||
|
|
||||||
HTTPVersion = '1.1'
|
HTTPVersion = '1.1'
|
||||||
|
@@newimpl = true # for backward compatability
|
||||||
#
|
# :startdoc:
|
||||||
# for backward compatibility
|
|
||||||
#
|
|
||||||
|
|
||||||
@@newimpl = true
|
|
||||||
|
|
||||||
# Turns on net/http 1.2 (ruby 1.8) features.
|
# Turns on net/http 1.2 (ruby 1.8) features.
|
||||||
# Defaults to ON in ruby 1.8.
|
# Defaults to ON in ruby 1.8.
|
||||||
@ -411,7 +411,7 @@ module Net
|
|||||||
# When called with a block, returns the return value of the
|
# When called with a block, returns the return value of the
|
||||||
# block; otherwise, returns self.
|
# block; otherwise, returns self.
|
||||||
#
|
#
|
||||||
def start # :yield: +http+
|
def start # :yield: http
|
||||||
raise IOError, 'HTTP session already opened' if @started
|
raise IOError, 'HTTP session already opened' if @started
|
||||||
if block_given?
|
if block_given?
|
||||||
begin
|
begin
|
||||||
@ -1319,6 +1319,8 @@ module Net
|
|||||||
end
|
end
|
||||||
end # redefined after
|
end # redefined after
|
||||||
|
|
||||||
|
# :stopdoc:
|
||||||
|
|
||||||
class HTTPUnknownResponse < HTTPResponse
|
class HTTPUnknownResponse < HTTPResponse
|
||||||
HAS_BODY = true
|
HAS_BODY = true
|
||||||
EXCEPTION_TYPE = HTTPError
|
EXCEPTION_TYPE = HTTPError
|
||||||
@ -1472,6 +1474,8 @@ module Net
|
|||||||
HAS_BODY = true
|
HAS_BODY = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# :startdoc:
|
||||||
|
|
||||||
|
|
||||||
class HTTPResponse # redefine
|
class HTTPResponse # redefine
|
||||||
|
|
||||||
@ -1778,12 +1782,14 @@ module Net
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# :enddoc:
|
||||||
|
|
||||||
#--
|
#--
|
||||||
# for backward compatibility
|
# for backward compatibility
|
||||||
class HTTP
|
class HTTP
|
||||||
ProxyMod = ProxyDelta
|
ProxyMod = ProxyDelta
|
||||||
end
|
end
|
||||||
module NetPrivate #:nodoc:
|
module NetPrivate
|
||||||
HTTPRequest = ::Net::HTTPRequest
|
HTTPRequest = ::Net::HTTPRequest
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ begin
|
|||||||
rescue LoadError
|
rescue LoadError
|
||||||
end
|
end
|
||||||
|
|
||||||
module Net
|
module Net # :nodoc:
|
||||||
|
|
||||||
# Net::IMAP implements Internet Message Access Protocol (IMAP) client
|
# Net::IMAP implements Internet Message Access Protocol (IMAP) client
|
||||||
# functionality. The protocol is described in [IMAP].
|
# functionality. The protocol is described in [IMAP].
|
||||||
@ -834,8 +834,8 @@ module Net
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
CRLF = "\r\n"
|
CRLF = "\r\n" # :nodoc:
|
||||||
PORT = 143
|
PORT = 143 # :nodoc:
|
||||||
|
|
||||||
@@debug = false
|
@@debug = false
|
||||||
@@authenticators = {}
|
@@authenticators = {}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
require 'socket'
|
require 'socket'
|
||||||
require 'timeout'
|
require 'timeout'
|
||||||
|
|
||||||
module Net
|
module Net # :nodoc:
|
||||||
|
|
||||||
class Protocol #:nodoc: internal use only
|
class Protocol #:nodoc: internal use only
|
||||||
private
|
private
|
||||||
|
@ -122,7 +122,7 @@ require 'net/protocol'
|
|||||||
require 'digest/md5'
|
require 'digest/md5'
|
||||||
|
|
||||||
|
|
||||||
module Net
|
module Net # :nodoc:
|
||||||
|
|
||||||
# Module mixed in to all SMTP error classes
|
# Module mixed in to all SMTP error classes
|
||||||
module SMTPError
|
module SMTPError
|
||||||
|
Loading…
x
Reference in New Issue
Block a user