Project

General

Profile

Actions

Bug #5045

closed

wrong method in doc of Net::HTTP

Added by Eregon (Benoit Daloze) over 12 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.4dev (2011-07-16 trunk 32562) [x86_64-darwin10.7.0]
Backport:
[ruby-core:38163]

Description

Hello,

I found a small typo in the documentation of Net::HTTP:

diff --git a/lib/net/http.rb b/lib/net/http.rb
index f898588..7c9032a 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -108,7 +108,7 @@ module Net #:nodoc:

If you wish to re-use a connection across multiple HTTP requests without

automatically closing it you can use ::new instead of ::start. #request

will automatically open a connection to the server if one is not currently

  • open. You can manually close the connection with #close.

  • open. You can manually close the connection with #finish.

    === Response Data

There is no method #close, it is named #finish.

I find #close clearer, and #finish being the opposite of ::start is unfortunate (because ::start automatically close the connection at the end of the block, while #new not, as written upper).
Another way to solve this might be to alias #close to #finish, what do you think ?

Actions #1

Updated by drbrain (Eric Hodel) over 12 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r32614.
Benoit, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/net/http.rb: Net::HTTP#finish is used to manually close
    connections. [Ruby 1.9 - Bug #5045]
Actions

Also available in: Atom PDF

Like0
Like0