Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced RDoc for Net::HTTP #130

Merged
merged 4 commits into from
Mar 8, 2023
Merged

Enhanced RDoc for Net::HTTP #130

merged 4 commits into from
Mar 8, 2023

Conversation

BurdetteLamar
Copy link
Member

Treats a couple of methods; most are private or nodoc.

Comment on lines 243 to 247
# res.body_encoding # => false
# res.body_encoding = Encoding::US_ASCII
# res.body_encoding # => #<Encoding:US-ASCII>
# res.body_encoding = 'US-ASCII'
# res.body_encoding # => #<Encoding:US-ASCII>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example doesn't really show what the purpose of this method is. It just show that it is a setter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean. Suggestion?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is that this example isn't showing the purpose of the #body_encoding=.

An example like this shows the purpose:

http = Net::HTTP.new(hostname)
req = Net::HTTP::Get.new('/')

http.request(req) do |res|
  p res.body.encoding # => #<Encoding:ASCII-8BIT>
end

http.request(req) do |res|
  res.body_encoding = "UTF-8"
  p res.body.encoding # => #<Encoding:UTF-8>
end

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Substituted in, and thanks.

lib/net/http/response.rb Outdated Show resolved Hide resolved
@BurdetteLamar
Copy link
Member Author

@peterzhu2118, ready for you.

@peterzhu2118 peterzhu2118 merged commit 698e18c into ruby:master Mar 8, 2023
nagachika added a commit to nagachika/ruby that referenced this pull request Dec 16, 2023
…0a5659cadb49f1640b20896cd750decdbbd701,c8c3431b0a5995d58f97c511ffa0a39e0f19c75e,755c379d877c66916d20840f07738d6050da3ca2,030f39822ac9d6d7dcdb639e099b320d3517c19c,2f19c5b7e080f75c3373c5b1671b4d4cfab6d334:

	[ruby/net-http] [DOC] What's Here for Net:HTTP
	 (ruby/net-http#128)

	ruby/net-http@39e70f0f9b
	---
	 lib/net/http.rb | 269 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
	 1 file changed, 267 insertions(+), 2 deletions(-)

	Replaced non-ascii charactor. It fails version detection at
	 `net-http.gemspec`.

	  >#   Returns the X509 certificate chain for the session<E2><80><99>s socket peer.
	---
	 lib/net/http.rb | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	[ruby/net-http] Test building packages

	Also revert commit ruby/net-http@d22ca54904de "Replaced
	non-ascii charactor. It fails version detection at `net-http.gemspec`."

	ruby/net-http@fbeb247d93
	---
	 lib/net/http.rb | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	[ruby/net-http] Read in binary mode to get rid of invalid byte
	 sequence

	ruby/net-http@38de3d17a7
	---
	 lib/net/http/net-http.gemspec | 11 ++++++++---
	 1 file changed, 8 insertions(+), 3 deletions(-)

	[ruby/net-http] Exclude git related files

	ruby/net-http@2767df580d
	---
	 lib/net/http/net-http.gemspec | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	[ruby/net-http] Re-apply
	 ruby/net-http@d22ca54904de after testing

	ruby/net-http@7ac7401a9c
	---
	 lib/net/http.rb | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	[ruby/net-http] Enhanced RDoc for Net::HTTP
	 (ruby/net-http#130)

	ruby/net-http@698e18cfc1
	---
	 lib/net/http/response.rb | 53 ++++++++++++++++++++++++++++++++----------------
	 1 file changed, 36 insertions(+), 17 deletions(-)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants