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

Fix string/socket documentation #292

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions ext/socket/lib/socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ class << self
# The value of the block is returned.
# The socket is closed when this method returns.
#
# If _port_ is 0, actual port number is choosen dynamically.
# If _port_ is 0, actual port number is chosen dynamically.
# However all sockets in the result has same port number.
#
# # tcp_server_sockets returns two sockets.
Expand All @@ -425,7 +425,7 @@ class << self
# #=> #<Addrinfo: [::]:1296 TCP>
# # #<Addrinfo: 0.0.0.0:1296 TCP>
#
# # IPv6 and IPv4 socket has same port number, 53114, even if it is choosen dynamically.
# # IPv6 and IPv4 socket has same port number, 53114, even if it is chosen dynamically.
# sockets = Socket.tcp_server_sockets(0)
# sockets.each {|s| p s.local_address }
# #=> #<Addrinfo: [::]:53114 TCP>
Expand Down Expand Up @@ -555,8 +555,8 @@ def self.tcp_server_loop(host=nil, port, &b) # :yield: socket, client_addrinfo
# The value of the block is returned.
# The sockets are closed when this method returns.
#
# If _port_ is zero, some port is choosen.
# But the choosen port is used for the all sockets.
# If _port_ is zero, some port is chosen.
# But the chosen port is used for the all sockets.
#
# # UDP/IP echo server
# Socket.udp_server_sockets(0) {|sockets|
Expand Down Expand Up @@ -718,9 +718,9 @@ def self.udp_server_loop(host=nil, port, &b) # :yield: message, message_source

# UDP/IP address information used by Socket.udp_server_loop.
class UDPSource
# +remote_adress+ is an Addrinfo object.
# +remote_address+ is an Addrinfo object.
#
# +local_adress+ is an Addrinfo object.
# +local_address+ is an Addrinfo object.
#
# +reply_proc+ is a Proc used to send reply back to the source.
def initialize(remote_address, local_address, &reply_proc)
Expand Down
2 changes: 1 addition & 1 deletion string.c
Original file line number Diff line number Diff line change
Expand Up @@ -4345,7 +4345,7 @@ rb_str_reverse_bang(VALUE str)
*
* "hello".include? "lo" #=> true
* "hello".include? "ol" #=> false
* "hello".include? ?h #=> true
* "hello".include? "h" #=> true
Copy link
Member

Choose a reason for hiding this comment

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

?h == "h", so this is not a fix...

Copy link
Author

Choose a reason for hiding this comment

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

@marcandre According to http://ruby-doc.org/core-2.0/String.html#method-i-include-3F
the ? gets stripped.

How should the ? be retained?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it should. Looks like a bug of rdoc?

Copy link
Author

Choose a reason for hiding this comment

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

Not sure. @drbrain thoughts?

*/

static VALUE
Expand Down