Skip to content

Commit e4d80bd

Browse files
committed
[DOC] Suppress documentation for internals
1 parent 2e0ff52 commit e4d80bd

File tree

7 files changed

+117
-21
lines changed

7 files changed

+117
-21
lines changed

lib/net/http.rb

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,9 @@ def response_body_encoding=(value)
13211321
# Sets the proxy password;
13221322
# see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
13231323
attr_writer :proxy_pass
1324+
1325+
# Sets wheter the proxy uses SSL;
1326+
# see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
13241327
attr_writer :proxy_use_ssl
13251328

13261329
# Returns the IP address for the connection.
@@ -1632,6 +1635,21 @@ def start # :yield: http
16321635
self
16331636
end
16341637

1638+
# Finishes the \HTTP session:
1639+
#
1640+
# http = Net::HTTP.new(hostname)
1641+
# http.start
1642+
# http.started? # => true
1643+
# http.finish # => nil
1644+
# http.started? # => false
1645+
#
1646+
# Raises IOError if not in a session.
1647+
def finish
1648+
raise IOError, 'HTTP session not yet started' unless started?
1649+
do_finish
1650+
end
1651+
1652+
# :stopdoc:
16351653
def do_start
16361654
connect
16371655
@started = true
@@ -1758,20 +1776,6 @@ def on_connect
17581776
end
17591777
private :on_connect
17601778

1761-
# Finishes the \HTTP session:
1762-
#
1763-
# http = Net::HTTP.new(hostname)
1764-
# http.start
1765-
# http.started? # => true
1766-
# http.finish # => nil
1767-
# http.started? # => false
1768-
#
1769-
# Raises IOError if not in a session.
1770-
def finish
1771-
raise IOError, 'HTTP session not yet started' unless started?
1772-
do_finish
1773-
end
1774-
17751779
def do_finish
17761780
@started = false
17771781
@socket.close if @socket
@@ -1915,6 +1919,7 @@ def proxy_pass
19151919
alias proxyport proxy_port #:nodoc: obsolete
19161920

19171921
private
1922+
# :stopdoc:
19181923

19191924
def unescape(value)
19201925
require 'cgi/escape'
@@ -2397,6 +2402,8 @@ def send_entity(path, data, initheader, dest, type, &block)
23972402
res
23982403
end
23992404

2405+
# :stopdoc:
2406+
24002407
IDEMPOTENT_METHODS_ = %w/GET HEAD PUT DELETE OPTIONS TRACE/ # :nodoc:
24012408

24022409
def transport_request(req)

lib/net/http/exceptions.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Net
33
# Net::HTTP exception class.
44
# You cannot use Net::HTTPExceptions directly; instead, you must use
55
# its subclasses.
6-
module HTTPExceptions
6+
module HTTPExceptions # :nodoc:
77
def initialize(msg, res) #:nodoc:
88
super msg
99
@response = res
@@ -12,6 +12,7 @@ def initialize(msg, res) #:nodoc:
1212
alias data response #:nodoc: obsolete
1313
end
1414

15+
# :stopdoc:
1516
class HTTPError < ProtocolError
1617
include HTTPExceptions
1718
end

lib/net/http/generic_request.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ def update_uri(addr, port, ssl) # :nodoc: internal use only
264264

265265
private
266266

267+
# :stopdoc:
268+
267269
class Chunker #:nodoc:
268270
def initialize(sock)
269271
@sock = sock

lib/net/http/header.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@
179179
# - #each_value: Passes each string field value to the block.
180180
#
181181
module Net::HTTPHeader
182+
# The maximum length of HTTP header keys.
182183
MAX_KEY_LENGTH = 1024
184+
# The maximum length of HTTP header values.
183185
MAX_FIELD_LENGTH = 65536
184186

185187
def initialize_http_header(initheader) #:nodoc:
@@ -267,6 +269,7 @@ def add_field(key, val)
267269
end
268270
end
269271

272+
# :stopdoc:
270273
private def set_field(key, val)
271274
case val
272275
when Enumerable
@@ -294,6 +297,7 @@ def add_field(key, val)
294297
ary.push val
295298
end
296299
end
300+
# :startdoc:
297301

298302
# Returns the array field value for the given +key+,
299303
# or +nil+ if there is no such field;
@@ -490,7 +494,7 @@ def each_capitalized
490494

491495
alias canonical_each each_capitalized
492496

493-
def capitalize(name)
497+
def capitalize(name) # :nodoc:
494498
name.to_s.split('-'.freeze).map {|s| s.capitalize }.join('-'.freeze)
495499
end
496500
private :capitalize
@@ -957,20 +961,20 @@ def proxy_basic_auth(account, password)
957961
@header['proxy-authorization'] = [basic_encode(account, password)]
958962
end
959963

960-
def basic_encode(account, password)
964+
def basic_encode(account, password) # :nodoc:
961965
'Basic ' + ["#{account}:#{password}"].pack('m0')
962966
end
963967
private :basic_encode
964968

965-
# Returns whether the HTTP session is to be closed.
969+
# Returns whether the HTTP session is to be closed.
966970
def connection_close?
967971
token = /(?:\A|,)\s*close\s*(?:\z|,)/i
968972
@header['connection']&.grep(token) {return true}
969973
@header['proxy-connection']&.grep(token) {return true}
970974
false
971975
end
972976

973-
# Returns whether the HTTP session is to be kept alive.
977+
# Returns whether the HTTP session is to be kept alive.
974978
def connection_keep_alive?
975979
token = /(?:\A|,)\s*keep-alive\s*(?:\z|,)/i
976980
@header['connection']&.grep(token) {return true}

lib/net/http/requests.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
# - Net::HTTP#get: sends +GET+ request, returns response object.
3030
#
3131
class Net::HTTP::Get < Net::HTTPRequest
32+
# :stopdoc:
3233
METHOD = 'GET'
3334
REQUEST_HAS_BODY = false
3435
RESPONSE_HAS_BODY = true
@@ -60,6 +61,7 @@ class Net::HTTP::Get < Net::HTTPRequest
6061
# - Net::HTTP#head: sends +HEAD+ request, returns response object.
6162
#
6263
class Net::HTTP::Head < Net::HTTPRequest
64+
# :stopdoc:
6365
METHOD = 'HEAD'
6466
REQUEST_HAS_BODY = false
6567
RESPONSE_HAS_BODY = false
@@ -95,6 +97,7 @@ class Net::HTTP::Head < Net::HTTPRequest
9597
# - Net::HTTP#post: sends +POST+ request, returns response object.
9698
#
9799
class Net::HTTP::Post < Net::HTTPRequest
100+
# :stopdoc:
98101
METHOD = 'POST'
99102
REQUEST_HAS_BODY = true
100103
RESPONSE_HAS_BODY = true
@@ -130,6 +133,7 @@ class Net::HTTP::Post < Net::HTTPRequest
130133
# - Net::HTTP#put: sends +PUT+ request, returns response object.
131134
#
132135
class Net::HTTP::Put < Net::HTTPRequest
136+
# :stopdoc:
133137
METHOD = 'PUT'
134138
REQUEST_HAS_BODY = true
135139
RESPONSE_HAS_BODY = true
@@ -162,6 +166,7 @@ class Net::HTTP::Put < Net::HTTPRequest
162166
# - Net::HTTP#delete: sends +DELETE+ request, returns response object.
163167
#
164168
class Net::HTTP::Delete < Net::HTTPRequest
169+
# :stopdoc:
165170
METHOD = 'DELETE'
166171
REQUEST_HAS_BODY = false
167172
RESPONSE_HAS_BODY = true
@@ -193,6 +198,7 @@ class Net::HTTP::Delete < Net::HTTPRequest
193198
# - Net::HTTP#options: sends +OPTIONS+ request, returns response object.
194199
#
195200
class Net::HTTP::Options < Net::HTTPRequest
201+
# :stopdoc:
196202
METHOD = 'OPTIONS'
197203
REQUEST_HAS_BODY = false
198204
RESPONSE_HAS_BODY = true
@@ -224,6 +230,7 @@ class Net::HTTP::Options < Net::HTTPRequest
224230
# - Net::HTTP#trace: sends +TRACE+ request, returns response object.
225231
#
226232
class Net::HTTP::Trace < Net::HTTPRequest
233+
# :stopdoc:
227234
METHOD = 'TRACE'
228235
REQUEST_HAS_BODY = false
229236
RESPONSE_HAS_BODY = true
@@ -258,6 +265,7 @@ class Net::HTTP::Trace < Net::HTTPRequest
258265
# - Net::HTTP#patch: sends +PATCH+ request, returns response object.
259266
#
260267
class Net::HTTP::Patch < Net::HTTPRequest
268+
# :stopdoc:
261269
METHOD = 'PATCH'
262270
REQUEST_HAS_BODY = true
263271
RESPONSE_HAS_BODY = true
@@ -285,6 +293,7 @@ class Net::HTTP::Patch < Net::HTTPRequest
285293
# - Net::HTTP#propfind: sends +PROPFIND+ request, returns response object.
286294
#
287295
class Net::HTTP::Propfind < Net::HTTPRequest
296+
# :stopdoc:
288297
METHOD = 'PROPFIND'
289298
REQUEST_HAS_BODY = true
290299
RESPONSE_HAS_BODY = true
@@ -308,6 +317,7 @@ class Net::HTTP::Propfind < Net::HTTPRequest
308317
# - Net::HTTP#proppatch: sends +PROPPATCH+ request, returns response object.
309318
#
310319
class Net::HTTP::Proppatch < Net::HTTPRequest
320+
# :stopdoc:
311321
METHOD = 'PROPPATCH'
312322
REQUEST_HAS_BODY = true
313323
RESPONSE_HAS_BODY = true
@@ -331,6 +341,7 @@ class Net::HTTP::Proppatch < Net::HTTPRequest
331341
# - Net::HTTP#mkcol: sends +MKCOL+ request, returns response object.
332342
#
333343
class Net::HTTP::Mkcol < Net::HTTPRequest
344+
# :stopdoc:
334345
METHOD = 'MKCOL'
335346
REQUEST_HAS_BODY = true
336347
RESPONSE_HAS_BODY = true
@@ -354,6 +365,7 @@ class Net::HTTP::Mkcol < Net::HTTPRequest
354365
# - Net::HTTP#copy: sends +COPY+ request, returns response object.
355366
#
356367
class Net::HTTP::Copy < Net::HTTPRequest
368+
# :stopdoc:
357369
METHOD = 'COPY'
358370
REQUEST_HAS_BODY = false
359371
RESPONSE_HAS_BODY = true
@@ -377,6 +389,7 @@ class Net::HTTP::Copy < Net::HTTPRequest
377389
# - Net::HTTP#move: sends +MOVE+ request, returns response object.
378390
#
379391
class Net::HTTP::Move < Net::HTTPRequest
392+
# :stopdoc:
380393
METHOD = 'MOVE'
381394
REQUEST_HAS_BODY = false
382395
RESPONSE_HAS_BODY = true
@@ -400,6 +413,7 @@ class Net::HTTP::Move < Net::HTTPRequest
400413
# - Net::HTTP#lock: sends +LOCK+ request, returns response object.
401414
#
402415
class Net::HTTP::Lock < Net::HTTPRequest
416+
# :stopdoc:
403417
METHOD = 'LOCK'
404418
REQUEST_HAS_BODY = true
405419
RESPONSE_HAS_BODY = true
@@ -423,8 +437,8 @@ class Net::HTTP::Lock < Net::HTTPRequest
423437
# - Net::HTTP#unlock: sends +UNLOCK+ request, returns response object.
424438
#
425439
class Net::HTTP::Unlock < Net::HTTPRequest
440+
# :stopdoc:
426441
METHOD = 'UNLOCK'
427442
REQUEST_HAS_BODY = true
428443
RESPONSE_HAS_BODY = true
429444
end
430-

lib/net/http/response.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ def read_new(sock) #:nodoc: internal use only
153153
end
154154

155155
private
156+
# :stopdoc:
156157

157158
def read_status_line(sock)
158159
str = sock.readline
@@ -259,7 +260,7 @@ def body_encoding=(value)
259260
# header.
260261
attr_accessor :ignore_eof
261262

262-
def inspect
263+
def inspect # :nodoc:
263264
"#<#{self.class} #{@code} #{@message} readbody=#{@read}>"
264265
end
265266

0 commit comments

Comments
 (0)