aboutsummaryrefslogtreecommitdiffstats
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* Fix typos in rdocknu2017-11-081-3/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* pathname.c: improve docs for Pathnamestomar2017-11-071-3/+3
| | | | | | | | * ext/pathname/pathname.c: [DOC] improve example for Pathname.glob, by using a more common glob pattern, and improve the reference to the `base' keyword argument for Pathname#glob. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* socket.c,tcpsocket.c: improve deprecation noticesstomar2017-11-072-12/+12
| | | | | | | * ext/socket/socket.c: [DOC] fix grammar in deprecation notices. * ext/socket/tcpsocket.c: [DOC] ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/socket/ifaddr.c: [DOC] fix typostomar2017-11-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* etc.c: improve docs for sysconfdirstomar2017-11-071-3/+3
| | | | | | * ext/etc/etc.c: [DOC] small language fixes for etc_sysconfdir docs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add details on the min/time parameters to the rdocknu2017-11-071-0/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lexer.rb: Ripper::Lexer::Statenobu2017-11-051-27/+13
| | | | | | | | | | * ext/ripper/lib/ripper/lexer.rb (Ripper::Lexer::State): wrapper of lex_state values. * parse.y (rb_parser_lex_state_name): return shared strings. lex state combinations are very restricted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/win32ole/lib/win32ole.rb (metods): rescue WIN32OLEQueryInterfaceError.suke2017-11-051-1/+9
| | | | | | | test/win32ole/test_win32ole.rb: add test for WIN32OLE#methods git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole_error.c: add WIN32OLEQueryInterfaceError.suke2017-11-054-4/+6
| | | | | | | | | | | | | | * ext/win32ole/win32ole_error.h: ditto. * ext/win32ole/win32ole.c(typeinfo_from_ole): raise WIN32OLEQueryInterfaceError in ole_methods. * ext/win32ole/win32ole_method.c(ole_methods_from_typeinfo): ditto. M ext/win32ole/win32ole.c M ext/win32ole/win32ole_error.c M ext/win32ole/win32ole_error.h M ext/win32ole/win32ole_method.c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove RNODE cast from NODE utility functionsmame2017-11-041-4/+0
| | | | | | | | Now, casting NODE to VALUE is not recommended. This change requires an explicit cast from VALUE to NODE to use the NODE utility functions such as `nd_type`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Rename imemo_strterm to imemo_parser_strtermmame2017-11-041-1/+1
| | | | | | Per ko1's request. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/objspace/objspace.c: add imemo_strtermmame2017-11-041-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix a typo [ci skip]kazu2017-11-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/lib/win32ole.rb :add WIN32OLE#methods. WIN32OLE might worksuke2017-11-031-0/+25
| | | | | | | well with did_you_mean gem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Pathname: get rid of a -Wcomment warning [DOC]nobu2017-11-011-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Pathname: Simplify example [DOC] [ci-skip]marcandre2017-10-311-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* null byte at Psych::Emitter.hsbt2017-10-312-8/+8
| | | | | | | Check null byte. Patched by tommy (Masahiro Tomita). [Bug #13993][ruby-dev:50285] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use NODE_CASE2 if case expressions don't existyui-knk2017-10-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When NODE_WHEN is compiled by iseq_compile_each0, the node passed to compile_when is NODE_WHEN (not NODE_CASE). So we can not handle the location of NODE_CASE of case statements which don't have case expressions. e.g. : ``` case; when 1; foo; when 2; bar; else baz; end ``` This commit adds NODE_CASE2, and compiles it by iseq_compile_each0. * compile.c (compile_case): Does not call COMPILE_ when NODE_CASE does not have case expressions. * compile.c (compile_case2): Compile NODE_CASE2 by compile_case2. * compile.c (compile_when): Delete an obsoleted function. * compile.c (iseq_compile_each0): Compile NODE_CASE2. * ext/objspace/objspace.c (count_nodes): Add NODE_CASE2 case. * node.c (dump_node, rb_gc_mark_node): Add NODE_CASE2 case. * node.h (node_type): Add NODE_CASE2. * node.h (NEW_CASE2): Add a macro which generates NODE_CASE2. * parse.y: Generate NODE_CASE2 if case expressions don't exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* socket: fix BasicSocket#*_nonblock buffering bugs from r58400normal2017-10-274-7/+118
| | | | | | | | | | | | | | | | | | | | | IO#read_nonblock and IO#write_nonblock take into account buffered data, so the Linux-only BasicSocket#read_nonblock and BasicSocket#write_nonblock methods must, too. This bug was only introduced in r58400 ("socket: avoid fcntl for read/write_nonblock on Linux") and does not affect any stable release. * ext/socket/basicsocket.c (rsock_init_basicsocket): * ext/socket/init.c (rsock_s_recvfrom_nonblock): * ext/socket/init.c (rsock_init_socket_init): * ext/socket/lib/socket.rb (def read_nonblock): * ext/socket/lib/socket.rb (def write_nonblock): * ext/socket/rubysocket.h (static inline void rsock_maybe_wait_fd): * test/socket/test_basicsocket.rb (def test_read_write_nonblock): [Feature #13362] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* sysconfdir on Windowsnobu2017-10-242-3/+6
| | | | | | | | | | | | | * ext/etc/etc.c (etc_sysconfdir): mentioned special case on Windows. [ruby-core:43110] [Bug #6121] * ext/etc/extconf.rb: define SYSCONFDIR only if sysconfdir is set in RbConfig::CONFIG and not empty. * win32/Makefile.sub (config.status): sysconfdir is not used on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "sysconfdir on Windows"naruse2017-10-241-2/+1
| | | | | | | | This reverts commit r60279. This breaks mswin build: https://ci.appveyor.com/project/ruby/ruby/build/1.0.5571 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Removed NODE_OPT_Nnobu2017-10-241-1/+0
| | | | | | | | | * node.h (NODE_OPT_N): removed. * parse.y (parser_append_options): expand -n option loop to while gets loop. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* multiple arguments to writenobu2017-10-231-1/+2
| | | | | | | Make write methods of IO-like objects accept multiple arguments, as well as IO#write. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* zlib.c: multiple arguments to writenobu2017-10-231-11/+16
| | | | | | * ext/zlib/zlib.c (rb_gzwriter_write): accepts multiple arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stringio.c: write multiple argumentsnobu2017-10-231-3/+15
| | | | | | | * ext/stringio/stringio.c (strio_write_m): make StringIO#write accept multiple arguments, as well as IO#write. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add column numbers to branch coverageyui-knk2017-10-221-4/+6
| | | | | | | | | | | | | | | * compile.c (DECL_BRANCH_BASE, ADD_TRACE_BRANCH_COVERAGE): Add column to arguments. * compile.c (compile_if, compile_case, compile_when, compile_loop, iseq_compile_each0): Pass column numbers to macros. * ext/coverage/coverage.c (branch_coverage): Add column numbers to a return value. * test/coverage/test_coverage.rb: Follow-up these changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fixed misspelling words.hsbt2017-10-223-3/+3
| | | | | | These are detected by https://github.com/client9/misspell git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix a typo [ci skip]kazu2017-10-221-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gdbm, dbm, sdbm: remove unnecessary conditionsrhe2017-10-223-23/+15
| | | | | | The dfree and dsize callback functions are never called with NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gdbm, dbm, sdbm: prevent memory leak in #initializerhe2017-10-223-19/+18
| | | | | | | | Have the allocator function allocate struct dbmdata too. #initialize should not call ALLOC() after opening a file since it can fail with NoMemoryError, leaking the opened file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add missing `buf` parameter to `recv_nonblock` doc [ci skip]nobu2017-10-221-0/+1
| | | | | | | [Fix GH-1725] From: yuuji.yaginuma <yuuji.yaginuma@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* objspace.c: missing typesnobu2017-10-221-3/+8
| | | | | | | * ext/objspace/objspace.c (count_nodes): added recently added node types that were missing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove NODE_DREGX_ONCEnobu2017-10-221-1/+0
| | | | | | | * node.h (enum node_type): remove NODE_DREGX_ONCE which is not used anymore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove not used node_type NODE_BMETHODyui-knk2017-10-221-1/+0
| | | | | | | | | * ext/objspace/objspace.c (count_nodes): This node_type has not been used since r24128. * node.c (dump_node): ditto * node.h (node_type, NEW_BMETHOD): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove not used node_type NODE_BLOCK_ARGyui-knk2017-10-221-1/+0
| | | | | | | | | * ext/objspace/objspace.c (count_nodes): This node_type has not been used since r11840. * node.c (dump_node, rb_gc_mark_node): ditto * node.h (node_type, NEW_BLOCK_ARG): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove not used node_type NODE_TO_ARYyui-knk2017-10-221-1/+0
| | | | | | | | | * ext/objspace/objspace.c (count_nodes): This node_type has not been used since r13236. * node.c (dump_node, rb_gc_mark_node): ditto * node.h (node_type, NEW_TO_ARY): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/win32ole/win32ole.c (fole_missing): set receiver in NoMethodError.suke2017-10-211-12/+30
| | | | | | | test/win32ole/test_win32ole.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* reference Socket.getaddrinfo to Addrinfo.getaddrinfo.akr2017-10-211-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* deprecate TCPSocket.gethostbyname.akr2017-10-211-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | TCPSocket.gethostbyname has problems similar to Socket.gethostbyname. An example of the problem which only the address family of the first address is returned: ``` pp TCPSocket.gethostbyname("www.wide.ad.jp") #=> ["www.wide.ad.jp", [], 10, "2001:200:dff:fff1:216:3eff:fe4b:651c", "203.178.137.58"] ``` The address family of the first address, AF_INET6 (10), is returned but the address family of the second address, AF_INET, is not returned. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: merge test fix from upstreamrhe2017-10-211-0/+4
| | | | | | | | | | Merge a commit from upstream: d1cbf6d75280 test/test_ssl_session: skip tests for session_remove_cb Tests using SSL::SSLContext#session_remove_cb= are now skipped. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix OpenSSL::SSL::SSLContext#min_version doesn't worknaruse2017-10-211-2/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove not used node_type NODE_CVDECLyui-knk2017-10-211-1/+0
| | | | | | | | | | * compile.c (defined_expr0): This node_type has not been used since r11614. * ext/objspace/objspace.c (count_nodes): ditto * node.c (dump_node): ditto * node.h (node_type, NEW_CVDECL): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove not used node_type NODE_IASGN2yui-knk2017-10-211-1/+0
| | | | | | | | | | | * compile.c (compile_massign_opt, iseq_compile_each0): This node_type has not been used since r11813. * ext/objspace/objspace.c (count_nodes): ditto * node.c (dump_node, rb_gc_mark_node): ditto * node.h (node_type, NEW_IASGN2): ditto * parse.y (node_assign_gen): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Added explicitly require to example code.hsbt2017-10-211-0/+3
| | | | | | | | https://github.com/ruby/ruby/pull/1666 Patch by @guilherme [fix GH-1666] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use caller with length to reduce unused stringskazu2017-10-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Describe recommended-methods.akr2017-10-211-0/+2
| | | | | | | | | | | | Addrinfo.getaddrinfo is recommended instead of Socket.gethostbyname. Addrinfo#getnameinfo is recommended instead of Socket.gethostbyaddr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* sysconfdir on Windowsnobu2017-10-211-1/+2
| | | | | | | | | | * ext/etc/etc.c (etc_sysconfdir): mentioned special case on Windows. [ruby-core:43110] [Bug #6121] * win32/Makefile.sub (config.status): sysconfdir is not used on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* kill "discards ‘const’ qualifier" warningkosaki2017-10-211-1/+1
| | | | | | | | | | | Kill following warning. ../../../ext/psych/yaml/emitter.c: In function ‘yaml_emitter_write_block_scalar_hints’: ../../../ext/psych/yaml/emitter.c:2196:20: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] chomp_hint = "-"; ^ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* kill "discards ‘const’ qualifier" warningkosaki2017-10-211-2/+2
| | | | | | | | | | | Kill following warning. ../../../ext/psych/yaml/emitter.c: In function ‘yaml_emitter_write_folded_scalar’: ../../../ext/psych/yaml/emitter.c:2283:5: warning: passing argument 2 of ‘yaml_emitter_write_indicator’ discards ‘const’ qualifier from pointer target type [enabled by default] if (!yaml_emitter_write_indicator(emitter, ">", 1, 0, 0)) ^ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Deprecation document for gethostbyname,gethostbyaddr.akr2017-10-211-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Feature #13097] I confirmed current ruby (Ruby 2.4 and trunk) uses gethostbyname() and gethostbyaddr(). Socket.gethostbyname uses getaddrinfo() and gethostbyname(). Socket.gethostbyaddr uses gethostbyaddr(). Socket.gethostbyname uses gethostbyname() to obtain alias hostnames. RFC 3493 defines getaddrinfo()/getnameinfo() and describes the problems of gethostbyname()/gethostbyaddr(). The problems are difficult protocol handling and thread-unsafety. Since Ruby has GVL, the thread-unsafety doesn't cause wrong result. But it may block other threads until finishing DNS query. Socket.gethostbyname has the protocol handling problem. It returns only one address family: ``` % ruby -rpp -rsocket -e 'pp Socket.gethostbyname("www.wide.ad.jp")' ["www.wide.ad.jp", [], 10, " \x01\x02\x00\r\xFF\xFF\xF1\x02\x16>\xFF\xFEKe\x1C", "\xCB\xB2\x89:"] ``` www.wide.ad.jp has one IPv6 address and one IPv4 address. But Socket.gethostbyname returns only one address family, 10 (AF_INET6), which is the address family of the first address. Also, Socket.gethostbyname and Socket.gethostbyaddr uses 4-bytes binary IPv4 address and 16-bytes binary IPv6 address. This is not usual in other socket API in Ruby. (Most socket API uses binary sockaddr string or Addrinfo object) I think Socket.gethostbyname and Socket.gethostbyaddr are too far from recommendable API. So, I added deprecation description for documents for them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e