summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-05 03:57:32 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-05 03:57:32 +0000
commit4043565023531d173478c216e2a9cc6228f44a7e (patch)
tree4fed65eea80438d797c2acec1efb09bf4cb8a6b7
parent0d81bbcbbc0681e9006543f40a3286a442935a80 (diff)
* ext/socket/*.c: Add proper require for example to work.
[fix GH-1378][ci skip] Patch by @schneems git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/socket/ancdata.c2
-rw-r--r--ext/socket/basicsocket.c2
-rw-r--r--ext/socket/ipsocket.c2
-rw-r--r--ext/socket/option.c2
-rw-r--r--ext/socket/socket.c2
-rw-r--r--ext/socket/udpsocket.c2
-rw-r--r--ext/socket/unixserver.c2
-rw-r--r--ext/socket/unixsocket.c2
9 files changed, 21 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index ef167b1c55..3645fd3bc6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Oct 5 12:57:21 2016 Richard Schneeman <richard.schneeman+foo@gmail.com>
+
+ * ext/socket/*.c: Add proper require for example to work.
+ [fix GH-1378][ci skip] Patch by @schneems
+
Wed Oct 5 11:47:19 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
* io.c: Fixed equivalent ruby code with core implemention.
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index 02766ba5d2..f5451c9569 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -360,6 +360,8 @@ ancillary_timestamp(VALUE self)
*
* The size and endian is dependent on the host.
*
+ * require 'socket'
+ *
* p Socket::AncillaryData.int(:UNIX, :SOCKET, :RIGHTS, STDERR.fileno)
* #=> #<Socket::AncillaryData: UNIX SOCKET RIGHTS 2>
*/
diff --git a/ext/socket/basicsocket.c b/ext/socket/basicsocket.c
index 2d2b22e1a9..ee967c7b7a 100644
--- a/ext/socket/basicsocket.c
+++ b/ext/socket/basicsocket.c
@@ -565,6 +565,8 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
*
* Gets the do_not_reverse_lookup flag of _basicsocket_.
*
+ * require 'socket'
+ *
* BasicSocket.do_not_reverse_lookup = false
* TCPSocket.open("www.ruby-lang.org", 80) {|sock|
* p sock.do_not_reverse_lookup #=> false
diff --git a/ext/socket/ipsocket.c b/ext/socket/ipsocket.c
index 9981fd43ad..dbf403b39a 100644
--- a/ext/socket/ipsocket.c
+++ b/ext/socket/ipsocket.c
@@ -303,6 +303,8 @@ ip_recvfrom(int argc, VALUE *argv, VALUE sock)
*
* Lookups the IP address of _host_.
*
+ * require 'socket'
+ *
* IPSocket.getaddress("localhost") #=> "127.0.0.1"
* IPSocket.getaddress("ip6-localhost") #=> "::1"
*
diff --git a/ext/socket/option.c b/ext/socket/option.c
index 4c75fe046d..bf3af171a2 100644
--- a/ext/socket/option.c
+++ b/ext/socket/option.c
@@ -272,6 +272,8 @@ sockopt_int(VALUE self)
* Creates a new Socket::Option object which contains boolean as data.
* Actually 0 or 1 as int is used.
*
+ * require 'socket'
+ *
* p Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, true)
* #=> #<Socket::Option: INET SOCKET KEEPALIVE 1>
*
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 542cd02ed6..14e069bb8d 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -1955,6 +1955,8 @@ Init_socket(void)
*
* Let's create an internet socket using the IPv4 protocol in a C-like manner:
*
+ * require 'socket'
+ *
* s = Socket.new Socket::AF_INET, Socket::SOCK_STREAM
* s.connect Socket.pack_sockaddr_in(80, 'example.com')
*
diff --git a/ext/socket/udpsocket.c b/ext/socket/udpsocket.c
index 7b7b34f04d..c2e273c2a3 100644
--- a/ext/socket/udpsocket.c
+++ b/ext/socket/udpsocket.c
@@ -19,6 +19,8 @@
* _address_family_ should be an integer, a string or a symbol:
* Socket::AF_INET, "AF_INET", :INET, etc.
*
+ * require 'socket'
+ *
* UDPSocket.new #=> #<UDPSocket:fd 3>
* UDPSocket.new(Socket::AF_INET6) #=> #<UDPSocket:fd 4>
*
diff --git a/ext/socket/unixserver.c b/ext/socket/unixserver.c
index 799dcffb00..b1f2a38547 100644
--- a/ext/socket/unixserver.c
+++ b/ext/socket/unixserver.c
@@ -17,6 +17,8 @@
*
* Creates a new UNIX server socket bound to _path_.
*
+ * require 'socket'
+ *
* serv = UNIXServer.new("/tmp/sock")
* s = serv.accept
* p s.read
diff --git a/ext/socket/unixsocket.c b/ext/socket/unixsocket.c
index d1cf1e2b2a..5a44b552f8 100644
--- a/ext/socket/unixsocket.c
+++ b/ext/socket/unixsocket.c
@@ -93,6 +93,8 @@ rsock_init_unixsock(VALUE sock, VALUE path, int server)
*
* Creates a new UNIX client socket connected to _path_.
*
+ * require 'socket'
+ *
* s = UNIXSocket.new("/tmp/sock")
* s.send "hello", 0
*