Граф коммитов

2247 Коммитов

Автор SHA1 Сообщение Дата
akr bed4294451 * ext/socket/ancdata.c (ancillary_unix_rights): method renamed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-19 12:13:38 +00:00
akr 18afbc891c * ext/socket/ancdata.c (ancillary_rights): new method.
(make_io_for_rights): new function to allocate
  IOs for FDs in SCM_RIGHTS message.
  (bsock_recvmsg_internal): use make_io_for_rights.  So the FDs can be
  closed by GC.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-18 18:43:15 +00:00
mame 234bc1d7a9 * test/ruby/test_file_exhaustive.rb: skip some tests if euid == 0.
a patch from Lucas Nussbaum in [ruby-core:22209].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-18 18:17:26 +00:00
nobu 829ab73879 * file.c (rb_file_s_extname): fix for spaces before extention.
[ruby-dev:38044]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-18 03:38:42 +00:00
akr 536adb5d7c care EWOULDBLOCK of accept_nonblock.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-17 11:05:35 +00:00
nobu 0958624759 * test/ostruct/test_ostruct.rb (test_frozen): added assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-17 09:57:12 +00:00
nobu a4eb339564 * lib/ostruct.rb (OpenStruct#new_ostruct_member): checks if frozen.
[ruby-talk:328195], [ruby-core:22142]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-15 12:43:46 +00:00
akr 08638ed7b8 add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-15 05:19:39 +00:00
akr 29f73c43a5 * test/test_pp.rb: extract from lib/pp.rb.
* test/test_prettyprint.rb: extract from lib/prettyprint.rb.

* test/test_tsort.rb: extract from lib/tsort.rb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14 23:36:45 +00:00
akr 1b4c1f715e * lib/time.rb (Time.parse): raise ArgumentError if Date._parse don't
extract date information.  [ruby-core:20912]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14 22:03:28 +00:00
mame a48f90b05b * hash.c (rb_hash): always return a fixnum value because a return
value of rb_hash may be used as a hash value itself and bignums have
  no unique VALUE.

* test/ruby/test_hash.rb: add a test for above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14 18:53:40 +00:00
nobu 766df600db * array.c (rb_ary_uniq_bang, rb_ary_uniq): unique by the result of
given block.  [ruby-dev:37998]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14 15:45:43 +00:00
akr 5b512b7fa9 * test/test_time.rb: extracted from lib/time.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14 11:19:52 +00:00
akr 9ddde2773f add timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14 11:06:23 +00:00
nobu e4917c6dcb * test/ruby/test_{proc,method}.rb: updated tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-13 09:10:28 +00:00
ko1 c5d7d78dae * cont.c (rb_fiber_alive_p): fix to return true instead of 1.
[ruby-dev:37991]
* test/ruby/test_fiber.rb: add a test for Fiber#alive?



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-13 06:04:25 +00:00
akr a61786398a * test/socket/test_socket.rb (test_udp_server): filter out unreachable
addresses.  [ruby-dev:37970]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12 14:24:11 +00:00
akr 97a922e2ff test only if Socket::AncillaryData exists.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12 12:45:24 +00:00
nobu 48149dff32 * test/stringio/test_stringio.rb (test_ungetc_pos): added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12 10:41:48 +00:00
akr 3032bdb1d3 test updated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 15:29:35 +00:00
akr 3f0d724dc3 * ext/socket/lib/socket.rb (Socket.unix_server_socket): close the
socket when the block exits.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 07:54:52 +00:00
akr 0a954e9117 * ext/socket/lib/socket.rb (Socket.unix_server_socket): call the block
if given.  remove the socket file when the block exits.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 07:51:53 +00:00
akr ff955766d4 * ext/socket/ancdata.c (ancillary_s_ip_pktinfo): make 3rd argument
optional.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 07:44:53 +00:00
akr 6e6676a223 add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 04:31:19 +00:00
akr a8de15e0b5 rename tests classes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 04:17:57 +00:00
akr c9c3437b20 add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 04:11:48 +00:00
akr b4e50055c3 * ext/socket/extconf.rb: check getpeereid.
* ext/socket/basicsocket.c (bsock_getpeereid): new method.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 01:22:08 +00:00
akr 1463f1dfe7 * ext/socket/lib/socket.rb (Socket.udp_server_sockets): new method.
(Socket.udp_server_loop_on): new method.
  (Socket.udp_server_loop): new method
  (Socket.ip_sockets_port0): extracted from tcp_server_sockets_port0.
  (Socket::UDPSource): new class.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10 12:38:16 +00:00
akr 98d3eca7fc * ext/socket/option.c (sockopt_s_bool): new method.
(sockopt_bool): new method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10 12:09:57 +00:00
akr fd9c7e8af1 * ext/socket/ancdata.c (ancillary_initialize): add family argument.
(ancdata_new): ditto.
  (ancillary_s_int): ditto.
  (ancillary_family): new function.
  (ancillary_family_m): new method.
  (ancillary_s_ip_pktinfo): follow ancdata_new change.
  (ancillary_s_ipv6_pktinfo): ditto.
  (bsock_recvmsg_internal): examine the socket address family.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 10:49:16 +00:00
akr 64f12a46d5 * ext/socket/option.c (inspect_peercred): struct ucred contains
effective uid/gid.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 17:04:40 +00:00
akr 2992642245 LOCAL_PEERCRED is also available on MacOS X.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 15:49:35 +00:00
akr f11d2b55f7 * ext/socket/option.c (inspect_local_peercred): cr_uid is a effective
uid, not a real uid.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 15:42:17 +00:00
akr 9e45748143 * ext/socket/extconf.rb: check sys/param.h and sys/ucred.h.
* ext/socket/rubysocket.h: include sys/param.h and sys/ucred.h.

* ext/socket/option.c (inspect_local_peercred): new function to show
  LOCAL_PEERCRED socket option on FreeBSD.
  (sockopt_inspect): show as LOCAL_* socket option if AF_UNIX and level
  is 0.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 15:37:55 +00:00
mame 3e11901f1c * enumerator.c (enumerator_with_index): receives one argument which
represents a start offset.  [ruby-dev:37921]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 14:42:01 +00:00
akr e5f588c83d remove debug print.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 14:39:59 +00:00
akr 8f9d6d1863 * ext/socket/option.c (inspect_peercred): new function to show
SO_PEERCRED socket option.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 14:23:16 +00:00
akr 411e9997d2 * ext/socket/extconf.rb: check struct cmsgcred.
* ext/socket/ancdata.c (anc_inspect_passcred_credentials): add
  "(ucred)".
  (anc_inspect_socket_creds): show struct cmsgcred too, for FreeBSD.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 12:53:55 +00:00
akr eb636217f6 test renamed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 11:37:39 +00:00
akr e960cf417a * ext/socket/extconf.rb: check struct sockcred.
* ext/socket/ancdata.c (anc_inspect_socket_creds): new function to
  show SCM_CREDS on NetBSD.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 11:36:18 +00:00
akr 732b695163 add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 11:30:26 +00:00
akr 03149710e8 * ext/socket/raddrinfo.c (init_unix_addrinfo): add socktype argument.
(addrinfo_initialize): follow init_unix_addrinfo change.
  (addrinfo_s_unix): add optional argument: socktype



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 04:53:17 +00:00
akr 6294d065bb select before read_nonblock.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 02:01:22 +00:00
akr ad235344c4 specify exception class for rescue clause.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 00:10:13 +00:00
akr b83188dc1e add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-07 12:33:25 +00:00
akr 2b8ab6c54f * test/socket/test_addrinfo.rb (test_family_addrinfo): don't use
www.ruby-lang.org.
  http://d.hatena.ne.jp/nagachika/20090204/working_for_0f0e


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-07 12:28:15 +00:00
akr af14ba145e test setrlimit in a child process.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-07 10:22:20 +00:00
nobu d89dbc4d3b * test/etc/test_etc.rb: trivial.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-06 15:26:36 +00:00
akr fb128ef26f no need to restore rlimit in child process.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-06 11:36:23 +00:00
akr 88f04bdd32 * ext/socket: AddrInfo is renamed to Addrinfo. [ruby-dev:37876]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-05 11:01:43 +00:00
akr 0d0fe1a5ad don't connect to unspecified address (0.0.0.0). OpenBSD reject it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-05 00:09:39 +00:00
akr 1934c7a80b test relaxed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-04 15:42:13 +00:00
akr 3eab19122b add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-04 15:34:32 +00:00
akr e2f0aeb497 relax tests for MacOS X.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-04 15:12:53 +00:00
akr 9845b50c11 relax tests for IPv4 compat/mapped IPv6 addresss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-04 13:38:24 +00:00
mame c07b4ef145 * test/etc/test_etc.rb(test_getpwnam, test_getgrgid, test_getgrnam):
support an envirionment that has duplicative entries.  a patch from
  Tomoyuki Chikanaga <chikanag at nippon-control-system.co.jp> in
  [ruby-dev:37882].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 15:39:44 +00:00
akr 5a56fc35ec don't connect to unspecified address.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 14:50:50 +00:00
kouji d60cd5b379 * ext/readline/extconf.rb: checked rl_set_screen_size and
rl_get_screen_size.

* ext/readline/readline.c (readline_s_set_screen_size): added
  Readline.set_screen_size.

* ext/readline/readline.c (readline_s_get_screen_size): added
  Readline.get_screen_size.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 12:21:08 +00:00
akr 24eafe8376 * ext/socket/lib/socket.rb (Socket.tcp_server_sockets_port0): new
private function for allocating same port both IPv4 and IPv6.
  (Socket.tcp_server_sockets): use tcp_server_sockets_port0 for port 0.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 07:25:57 +00:00
akr 260d0d0399 add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 06:37:06 +00:00
akr 4aec56ba71 add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 06:27:07 +00:00
akr 1643d1c28a add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 06:12:23 +00:00
akr 2df1053c1d add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 23:30:46 +00:00
nobu fe39ce87dd * test/ruby/test_readpartial.rb (make_pipe): readpartial does not
work in text mode.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 23:21:10 +00:00
yugui 1d551324bb adds a test case for r21955 and r21917.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 11:33:08 +00:00
akr 352dcd9ee7 * test/socket/test_addrinfo.rb: use AddrInfo.getaddrinfo to generate
IPv6 address.  AddrInfo.ip generates IPv4 address for IPv4 mapped
  IPv6 address if --with-lookup-order-hack=INET.
  [ruby-dev:37868]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 10:59:17 +00:00
akr 41eb896e09 * version.h: bump up to 1.9.2 patchlevel -1.
yugui recommend "-1" strongly.

* lib/rubygems/version.rb: accept negative patchlevel.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 07:07:59 +00:00
akr 5ad05f37a5 * ext/socket/socket.c (sock_initialize): make 3rd argument, protocol,
optional.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 05:55:56 +00:00
nobu ce720ca0dc * sample/test.rb (valid_syntax?), test/ruby/test_system.rb
(TestSystem::valid_syntax?): use catch and throw instead of
  return inside BEGIN block.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 03:39:01 +00:00
akr 61fc0c6cf4 * ext/socket/rubysocket.h (cmsg_type_arg): declared.
(Init_ancdata): ditto.

* ext/socket/init.c (Init_socket_init): call Init_ancdata.

* ext/socket/constants.c (cmsg_type_arg): defined.

* ext/socket/depend: add dependency for ancdata.o.

* ext/socket/mkconstants.rb: generate scm_optname_to_int.
  more constants.

* ext/socket/extconf.rb: add ancdata.o.

* ext/socket/ancdata.c: new file.  new method
  BasicSocket#{sendmsg,sendmsg_nonblock,recvmsg,recvmsg_nonblock}



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 02:51:02 +00:00
akr ef9206bbea * ext/socket/rubysocket.h (rb_cSockOpt): declared.
(sockopt_new): ditto.
  (Init_sockopt): ditto.

* ext/socket/init.c (Init_socket_init): call Init_sockopt.

* ext/socket/depend: add dependency for option.o

* ext/socket/mkconstants.rb: generate intern_level, intern_so_optname,
  intern_ip_optname, intern_ipv6_optname, intern_tcp_optname,
  intern_udp_optname and intern_scm_optname.

* ext/socket/extconf.rb: add option.o.

* ext/socket/basicsocket.c (bsock_setsockopt): accept Socket::Option
  object.
  (bsock_getsockopt): return Socket::Option object.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 01:53:02 +00:00
akr f1137963e3 * ext/socket/raddrinfo.c (addrinfo_ipv4_private_p): new method.
(addrinfo_ipv4_loopback_p): ditto.
  (addrinfo_ipv4_multicast_p): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-01 12:28:50 +00:00
akr 849e730f15 * ext/socket/raddrinfo.c (addrinfo_ipv6_unspecified_p): new method.
(addrinfo_ipv6_loopback_p): ditto.
  (addrinfo_ipv6_multicast_p): ditto.
  (addrinfo_ipv6_linklocal_p): ditto.
  (addrinfo_ipv6_sitelocal_p): ditto.
  (addrinfo_ipv6_v4mapped_p): ditto.
  (addrinfo_ipv6_v4compat_p): ditto.
  (addrinfo_ipv6_mc_nodelocal_p): ditto.
  (addrinfo_ipv6_mc_linklocal_p): ditto.
  (addrinfo_ipv6_mc_sitelocal_p): ditto.
  (addrinfo_ipv6_mc_orglocal_p): ditto.
  (addrinfo_ipv6_mc_global_p): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-31 11:09:51 +00:00
akr b9faa6b74c add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-31 10:15:30 +00:00
akr e94e674d0e * lib/pathname.rb (Pathname#realdirpath): new method.
[ruby-dev:36290]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-30 12:50:55 +00:00
akr e0469eea59 add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-29 18:02:25 +00:00
akr efdef4dbe2 * ext/socket/socket.c (socket_s_ip_address_list): renamed from
socket_s_list_ip_address.  [ruby-dev:37806]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-25 07:36:45 +00:00
technorama 7361a2ecb3 * ext/openssl/ossl_ssl.c: Server Name Indication support.
new methods SSLContext#server_name_cb=, SSLSocket#hostname=.

* test/openssl/test_ssl.rb: Tests for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-24 21:45:42 +00:00
naruse 770d89c5fa Recover default_default_internal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-22 11:59:26 +00:00
xibbar 9dce4d52ca * lib/cgi/core.rb (CGI.parse): generate only key on params hash
if request have only key uri parameters.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-22 08:25:44 +00:00
nobu 018e1e4f5e * lib/rubygems/installer.rb (Gem::Installer#initialize): fixed
typos.

* test/rubygems/test_gem.rb (test_self_dir): removed false
  assertions.

* test/rubygems/test_gem.rb (test_self_set_paths): checks if paths
  are included.

* test/rubygems/test_gem_commands_install_command.rb
  (test_execute_remote): checks diagnostic message too.

* test/rubygems/test_gem_installer.rb (load): uses Gem.ruby.

* test/rubygems/gemutilities.rb (Gem.ruby): initializes from the
  environment variable to run without installation.

* test/rubygems/gemutilities.rb (RubyGemTestCase#util_build_gem):
  creates cache directory.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-22 07:28:35 +00:00
usa 7e4ca52669 * test/ruby/test_process.rb: mswin specs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-22 06:27:44 +00:00
nobu 33f7e74998 * test/ruby/test_process.rb (MANDATORY_ENVS): needs RUBYLIB to run
tests without install.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-22 05:52:14 +00:00
naruse f0cc645afa Add test for String#encode.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-21 08:41:47 +00:00
usa 6ff613fc09 * array.c (take_items): to_ary() raises ArgumentError if cannot to
convert to Array. [ruby-dev:37797]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-21 05:43:04 +00:00
ryan 7bcd50555b Imported minitest 1.3.1 r4532.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-20 23:26:55 +00:00
akr bd3cdcf394 * ext/socket/socket.c (socket_s_list_ip_address): new method.
(sockaddr_obj): new function.

* ext/socket/rubysocket.h: include ifaddrs.h, sys/ioctl.h,
  sys/sockio.h, net/if.h if available.
  (addrinfo_new): declared.

* ext/socket/raddrinfo.c (addrinfo_new): exported.

* ext/socket/extconf.rb: check ifaddrs.h, sys/ioctl.h, sys/sockio.h,
  net/if.h and getifaddrs.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-20 11:19:09 +00:00
nobu cab67c3197 * array.c (take_items), enum.c (enum_zip): tries to convert to
array first.  [ruby-core:21442]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19 21:47:48 +00:00
akr db881044bc * ext/socket/raddrinfo.c (addrinfo_inspect_sockaddr): new
method AddrInfo#inspect_sockaddr.
  (inspect_sockaddr): extracted from addrinfo_inspect.
  (addrinfo_inspect): use inspect_sockaddr.
  (Init_addrinfo): define the new method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-18 08:03:24 +00:00
akr d620500dda * ext/socket/raddrinfo.c (addrinfo_ip_address): new method
AddrInfo#ip_address.
  (addrinfo_ip_port): new method AddrInfo#ip_port.
  (Init_addrinfo): define the methods above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-18 07:47:35 +00:00
akr 86aa5043d8 * ext/socket/raddrinfo.c (addrinfo_mdump): new method.
(addrinfo_mload): new method.
  (Init_addrinfo): define the method above.

* ext/socket/constants.c (constant_arg): str_to_int's first argument
  constified.

* ext/socket/mkconstants.rb (gen_name_to_int_decl): generated
  function's first argument constified.
  (gen_name_to_int_func_in_guard): ditto.
  (ipproto_to_int): generated.

* ext/socket/rubysocket.h (IS_IP_FAMILY): moved from raddrinfo.c.




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 18:14:34 +00:00
akr e2f8800667 * ext/socket/socket.c (sock_s_getnameinfo): accept AddrInfo object.
* ext/socket/raddrinfo.c (rb_check_sockaddr_string_type): defined.

* ext/socket/rubysocket.h (rb_check_sockaddr_string_type): declared.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 16:39:03 +00:00
akr 29aff19f1a extract TestBasicSocket from test_socket.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 09:39:14 +00:00
akr aaddab6dea * ext/socket/socket.c (addrinfo_s_ip): new method AddrInfo.ip.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-15 17:06:37 +00:00
duerst 82c673d3a1 * enc/trans/gb18030.trans, gb18030-tbl.rb:
new Chinese GB18030 transcoding (from Yoshihiro Kambayashi)

* test/ruby/test_transcode.rb: added tests for the above
  (from Yoshihiro Kambayashi)

* transcode_data.h, transcode.c, tool/transcode_tblgen.rb:
  added support for GB18030-specific 4-byte sequences
  (with Yoshihiro Kambayashi)



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-14 11:12:30 +00:00
yugui ed15422759 * lib/ostruct.rb (OpenStruct#inspect): fixed the recursion check.
Patch by Kornelius Kalnbach.  [ruby-core:20992].

* test/ostruct/test_ostruct.rb: test for inspect.
  Patch by Kornelius Kalnbach.  [ruby-core:20992].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-13 12:52:23 +00:00
akr 91ff87c05d * ext/socket/socket.c (sock_s_unpack_sockaddr_in): check too short
sockaddr.
  (sock_s_unpack_sockaddr_un): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-12 16:00:03 +00:00
akr 73757753ae * ext/socket/socket.c (addrinfo_ip_unpack): new method
AddrInfo#ip_unpack.
  (addrinfo_unix_path): new method AddrInfo#unix_path.
  (Init_socket): define above methods.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-12 14:58:25 +00:00
akr 839214e1e6 add test for AddrInfo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-12 08:52:37 +00:00
nobu 729b4a813b * win32/win32.c (open_dir_handle): extracted from rb_w32_opendir.
* win32/win32.c (winnt_stat): gets rid of strange behavior of
  GetFileAttributes().  [ruby-core:21269]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-12 07:45:31 +00:00
seki 2d53925643 remove PercentScanner. fixed % after %> bug. [ruby-dev:37751] [Bug #997]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-11 07:58:02 +00:00
naruse 832740d15c * test/ruby/test_process.rb (TestProcess#test_wait_and_sigchild):
Add rescue NotImplementedError.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-11 01:30:59 +00:00
akr 8de603784a test update for version string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-10 11:58:58 +00:00
nobu a931f96111 * test/ruby/test_process.rb (TestProcess::MANDATORY_ENVS): some
platforms need environments for shared objects.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-09 01:40:16 +00:00
nobu 0e9023acd0 * test/rubygems/test_gem.rb (test_self_user_home_user_drive_and_path): removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-07 14:33:17 +00:00
akr 55b2bf4dec * ext/socket/socket.c (rb_cAddrInfo): new class AddrInfo.
(s_recvfrom): return AddrInfo as address.
  (s_recvfrom_nonblock): ditto.
  (sock_accept): ditto.
  (sock_accept_nonblock): ditto.
  (sock_sysaccept): ditto.
  (bsock_send): accept AddrInfo as address argument.
  (sock_connect): ditto.
  (sock_connect_nonblock): ditto.
  (sock_bind): ditto.
  (sock_s_unpack_sockaddr_in): ditto.
  (sock_s_unpack_sockaddr_un): ditto.
  (bsock_local_address): new method BasicSocket#local_address.
  (bsock_remote_address): new method BasicSocket#remote_address.
  (addrinfo_initialize): new method AddrInfo#initialize.
  (addrinfo_inspect): new method AddrInfo#inspect.
  (addrinfo_afamily): new method AddrInfo#afamily.
  (addrinfo_pfamily): new method AddrInfo#pfamily.
  (addrinfo_socktype): new method AddrInfo#socktype.
  (addrinfo_protocol): new method AddrInfo#protocol.
  (addrinfo_to_sockaddr): new method AddrInfo#to_sockaddr.
  (addrinfo_canonname): new method AddrInfo#canonname.
  (addrinfo_ip_p): new method AddrInfo#ip?.
  (addrinfo_ipv4_p): new method AddrInfo#ipv4?.
  (addrinfo_ipv6_p): new method AddrInfo#ipv6?.
  (addrinfo_unix_p): new method AddrInfo#unix?.
  (addrinfo_getnameinfo): new method AddrInfo#getnameinfo.
  (addrinfo_s_getaddrinfo): new method AddrInfo.getaddrinfo.
  (addrinfo_s_tcp): new method AddrInfo.tcp.
  (addrinfo_s_udp): new method AddrInfo.udp.
  (addrinfo_s_unix): new method AddrInfo.unix.
  (Init_socket): define new class and methods.
  (sock_getaddrinfo): apply socktype hack regardless of ai_flags.
  (addrinfo_new): defined.
  (get_afamily): ditto.
  (fd_socket_addrinfo): ditto.
  (io_socket_addrinfo): ditto.
  (SockAddrStringValue): ditto.
  (SockAddrStringValuePtr): ditto.
  (sockaddr_string_value): ditto.
  (sockaddr_string_value_ptr): ditto.
  (rb_addrinfo_t): ditto.
  (addrinfo_mark): ditto.
  (addrinfo_free): ditto.
  (addrinfo_s_allocate): ditto.
  (IS_ADDRINFO): ditto.
  (check_addrinfo): ditto.
  (get_addrinfo): ditto.
  (alloc_addrinfo): ditto.
  (init_addrinfo): ditto.
  (addrinfo_new): ditto.
  (call_getaddrinfo): ditto.
  (init_addrinfo_getaddrinfo): ditto.
  (make_inspectname): ditto.
  (addrinfo_firstonly_new): ditto.
  (addrinfo_list_new): ditto.
  (init_unix_addrinfo): ditto.
  (ai_get_afamily): ditto.

* ext/socket/mkconstants.rb: generate intern_protocol_family,
  intern_socktype and intern_ipproto.

  [ruby-dev:37692]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-07 14:20:15 +00:00
akr 0cd078e358 don't get a name for anonymous Unix socket.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-05 13:40:42 +00:00
duerst deeade6f3e * enc/trans/gbk.trans, gbk-tbl.rb:
new Chinese GBK transcoding (from Yoshihiro Kambayashi)

* test/ruby/test_transcode.rb: added tests for the above
  (from Yoshihiro Kambayashi)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-04 09:12:14 +00:00
duerst fecce9e5e5 * test/ruby/test_transcode.rb: added tests for GB2312
(from Yoshihiro Kambayashi)

* enc/trans/chinese.trans: set valid byte patterns for
  GB2312 and GB12345


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-04 08:55:04 +00:00
duerst 3bc30f0b73 * enc/trans/big5.trans, big5-tbl.rb:
new Chinese Big5 transcoding (from Yoshihiro Kambayashi)

* test/ruby/test_transcode.rb: added tests for the above
  (from Yoshihiro Kambayashi)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-04 08:40:26 +00:00
seki da3eba7551 merged r20850, r17881, r16811, r16763, r16748, r15829, r15794 and r15698 from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-03 15:36:14 +00:00
mame 1e516be711 * test/ruby/test_sleep.rb (test_sleep_5sec): stop gc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 14:49:58 +00:00
mame d8d5cda2d4 * test/ruby/test_process.rb (test_wait_and_sigchild): remove debug
output.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 13:18:57 +00:00
akr 775d5d8f03 * ext/socket/mkconstants.rb: make common prefix optional.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 06:33:24 +00:00
akr aa0ae0d3b6 * ext/socket/socket.c (optname_arg): defined.
(bsock_setsockopt): use optname_arg.
  (bsock_getsockopt): ditto.

* ext/socket/mkconstants.rb: generate so_optname_to_int,
  ip_optname_to_int, ipv6_optname_to_int, tcp_optname_to_int and
  udp_optname_to_int.
  more constants.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 17:40:41 +00:00
akr 12b443d02f IPv6 test removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 16:22:15 +00:00
akr 59556a0849 * ext/socket/socket.c (level_arg): defined.
(bsock_setsockopt): use level_arg.
  (bsock_getsockopt): ditto.

* ext/socket/mkconstants.rb: generate level_to_int.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 16:16:08 +00:00
akr c6bbf28a9f * ext/socket/socket.c (family_arg): accept symbols as well.
(socktype_arg): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 15:59:10 +00:00
akr f0dd0577b0 * ext/socket/socket.c (family_arg): extracted from
setup_domain_and_type.
  (socktype_arg): ditto.
  (udp_init): use family_arg.
  (sock_s_gethostbyaddr): ditto.
  (sock_s_getaddrinfo): ditto.
  (sock_s_getnameinfo): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 15:15:31 +00:00
akr e924cabede * ext/socket/socket.c (sock_s_getnameinfo): use family_to_int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 12:26:57 +00:00
akr e485a566ed * ext/socket/socket.c (sock_s_getaddrinfo): use family_to_int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 11:47:55 +00:00
akr 0c838b4947 * ext/socket/mkconstants.rb: generate family_to_int().
* ext/socket/socket.c (setup_domain_and_type): use family_to_int.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 07:49:31 +00:00
akr ddedc6f125 * ext/socket/socket.c (sock_s_socketpair): yield if a block is given.
(io_call_close): defined.
  (io_close): defined.
  (pair_yield): defined.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-31 15:05:16 +00:00
akr 021aaa70d6 * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): show openssl error
code in EWOULDBLOCK error.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-31 08:18:12 +00:00
akr 67d66b2652 * io.c (copy_stream_body): don't check to_io because
Zlib::GzipWriter#to_io returns the underlying IO.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-31 07:19:24 +00:00
ryan 70365e5deb Imported minitest 1.3.1 r4506.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-30 09:26:27 +00:00
yugui b3ff7eb3ef * process.c (rb_waitpid): retries waitpid when EINTR.
[ruby-core:19744].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 14:41:22 +00:00
matz 6bbd76a732 * random.c (rb_f_rand): type check simplified. strings are no
longer allowed for argument.  [ruby-dev:37655]

* test/ruby/test_rand.rb (TestRand::o.to_int): need override
  to_int.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 13:29:12 +00:00
yugui af91b42354 * lib/erb.rb (ERB): m17n of ERB. adds rdoc.
fixes #712. c.f. [ruby-dev:37516].

* lib/erb.rb (ERB::Compiler#compile): recognizes magic comments.
  returns a pair of compiled script and its script encoding.

* lib/erb.rb (ERB#set_eoutvar): make generated scripts return a
  string in correct encoding.

* lib/erb.rb (ERB#def_method): use Kernel#eval for encoding-awareness
  of the evaluated string.

* bin/erb.rb (ERB::Main.run): adds -E and -U options.
  String is no longer Enumerable.

* man/erb.1: new manapage.

* test/erb/test_erb_m17n.rb: new test case for m17n features.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 09:26:34 +00:00
yugui 7be399c567 merges r21134 from ruby_1_9_1 into trunk.
* test/rubygems/test_gem_command.rb
  (test_add_option_overlapping_common_and_local_options):
  follows r21066.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 06:18:14 +00:00
ko1 b2ad49565f * thread.c (rb_mutex_trylock): return false if Mutex owned
by current thread.  [ruby-core:20943]
* thread.c (rb_mutex_lock): check dead lock (recursive lock) here.
* test/ruby/test_thread.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 03:03:09 +00:00
akr 8cc42bc701 add a test for OpenSSL::SSL::SSLSocket#read_nonblock.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-28 16:09:59 +00:00
nobu 08b4f9138c * test/ruby/test_sprintf.rb (test_invalid): suppress warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-28 09:51:18 +00:00
naruse faa2987d54 * test/rubygems/test_ext_configure_builder.rb (test_self_build_fail):
Extends pattern for FreeBSD's error message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-28 08:24:35 +00:00
ryan 1cbf898172 Imported minitest 1.3.1 r4505.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27 20:51:23 +00:00
nobu 0c835afac0 * test/rdoc/test_rdoc_info_formatting.rb (setup, teadown): uses
mktmpdir and removes it alfter the test.

* test/cgi/test_cgi_session.rb (setup, teadown): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27 13:41:04 +00:00
ko1 b30b998966 * vm_insnhelper.c (vm_call_method, vm_call_cfunc): use original id instead of
calling id when NODE_CFUNC or NODE_BMETHOD.
  fixes Bug #632 [ruby-core:19282].
* vm_eval.c (vm_call0, vm_call_super): ditto.
* vm_method.c (rb_add_method, rb_alias): store original id
  in nd_file field of NODE_METHOD.
* test/stringio/test_stringio.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27 03:57:21 +00:00
nobu 0a23fe6572 * lib/optparse.rb (OptionParser::List#summarize): gives priority
to latter switches.  [ruby-dev:36692]

* lib/optparse.rb (OptionParser#summarize): do not append
  unnecessary line terminator.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-26 06:50:55 +00:00
naruse 20f5c2a3ba * transcode.c (str_transcode0): set encoding when String#encode was
given explicit but the same destination and source encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-25 11:59:57 +00:00
akr bb4329becd * io.c (pipe_close): removed.
(pipe_yield): defined.
  (rb_io_s_pipe): use pipe_yield.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-25 09:36:40 +00:00
akr db0a659012 * io.c (flush_before_seek): check io_fflush result.
(rb_io_check_readable): ditto.
  (rb_io_flush): ditto.
  (rb_io_fsync): ditto.
  (remain_size): ditto.
  (rb_io_write_nonblock): ditto.
  (finish_writeconv): ditto.
  (fptr_finalize): ditto.
  (io_reopen): ditto.
  (rb_io_reopen): ditto.
  (copy_stream_body): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-25 07:25:06 +00:00
usa c4b30b4449 * test/ruby/test_eval.rb: add new test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-25 05:40:41 +00:00
kouji 823cfeed89 * test/readline/test_readline_history.rb: check the encoding that
is in the Readline::HISTORY.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-24 16:11:01 +00:00
kouji bd877eb7af * test/readline/test_readline_history.rb: did not check the
encoding that is in the Readline::HISTORY. I will fix it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-24 16:03:25 +00:00
akr 6fcaf92943 * strftime.c (rb_strftime): use locale insensitive functions for tr_TR
locale.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23 10:13:11 +00:00
akr fbcc23a8fa * io.c (rb_io_inspect): show fd number if there is no pathname.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23 07:24:13 +00:00
akr 3a7daf882b * io.c (rb_io_s_pipe): IO.pipe can take a block.
(pipe_close): new function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-22 12:27:26 +00:00
kouji 1cf4744a83 * test/readline/test_readline_history.rb: checked encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-21 05:49:18 +00:00
kouji 67cd02b40c * test/readline/test_readline.rb
(TestReadline#test_some_characters_methods): checked encoding.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-21 04:51:43 +00:00
nobu 5ad1f1d3cd * lib/optparse.rb (SPLAT_PROC): fix for regexp. [ruby-dev:37514]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-21 03:23:19 +00:00
xibbar 52d481d8de * lib/cgi/session.rb: fix bug for ignore session_id option.
report from [ruby-core:18635], [Bug #572]

* lib/cgi/core.rb: use Encoding#find when encoding set.

* test/cgi/test_cgi_session.rb: test for session_id specified.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-18 12:20:13 +00:00
kazu 3d923f01bf * test/bigdecimal/test_bigdecimal.rb (TestBigDecimal#test_hash):
shut up warning.  see [ruby-dev:37437]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-17 02:40:53 +00:00
yugui a34a6b3388 * test/ruby/test_metaclass.rb: removed codes for my debugging.
sorry. [ruby-dev:37470]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-17 00:58:10 +00:00
akr e27fbfbc98 * ext/pty/pty.c (getDevice): add nomesg argument.
(get_device_once): add nomesg argument.  chmod slave tty to 0600
  if nomesg.  more error tests.
  (no_mesg): new function.
  (pty_open): make slave tty's mode 0600.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-16 11:39:17 +00:00
akr 56709edc89 * ext/pty/extconf.rb: check posix_openpt.
* ext/pty/pty.c (get_device_once): use posix_openpt if available.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-16 10:49:12 +00:00
ryan c6f32ff88b Removed json/runner.rb with permission from florian frank. it was serving no purpose
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-15 22:13:29 +00:00
akr ca4798c4c3 add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-15 15:36:26 +00:00
akr 005e756537 * ext/pty/pty.c (get_device_once): use DEVICELEN instead of
sizeof SlaveName.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-15 12:25:03 +00:00
yugui 3a5c0bbcb5 * test/ruby/test_metaclass.rb: new test case for metaclass hierarchy.
* class.c (make_metametaclass): new function. extracted from
  rb_make_metaclass.

* class.c (rb_make_metaclass): uses make_metametaclass when called for a
  metaclass.

* class.c (rb_singleton_class): creates a meta^(n+2)-class in
  addition to a meta^(n+1)-class when called for a meta^(n)-class.
  This is because the returned meta^(n+1) class must acts as an instance of 
  Class, metaclass of Class, ..., meta^(n+1)-class of Class,
  Module, metaclass of Module, ..., meta^(n+1)-class of Module,
  Object, metaclass of Object, ..., meta^(n+2)-class of Object,
  BasicObject, metaclass of BasicObject, ..., meta^(n+2)-class of
  and BasicObject even when Class, Module, Object or BasicObject has
  not have its meta^(i)-class yet.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-15 06:23:43 +00:00
mame 19f45f853c * bignum.c (rb_big_mul): faster multiplication by Karatsuba method and
twice faster square than normal multiplication.

* random.c (rb_rand_internal): used by Bignum#*.

* test/ruby/test_bignum.rb: add some tests for above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-14 03:59:02 +00:00
akr 529ad093d4 new file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-14 03:52:13 +00:00
yugui ada58fe013 * test/ruby/enc/test_utf16.rb: feature changed in r20626.
follows it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-13 05:26:37 +00:00
yugui a6c69a7d35 * test/ruby/test_m17n_comb.rb: feature changed in r20626.
follows it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-13 04:45:56 +00:00
yugui dd2a86cf11 * test/ruby/test_m17n.rb: feature changed in r20626.
follows it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-13 03:49:46 +00:00
ryan ac6024f522 Imported minitest 1.3.2 r4503.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-13 00:22:31 +00:00
kouji 8b123714e2 * ext/readline/readline.c
(readline_s_get_completion_append_character): uses locale
  encoding but not ASCII-8BIT.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-12 16:13:11 +00:00
kou 876e1b87e7 * lib/rss/maker.rb, lib/rss/maker/0.9.rb, lib/rss/maker/base.rb:
RSS::Maker.[] returns a maker class corresponds to passed version.

* test/rss/test_maker_*.rb: add tests for RSS::Maker.[].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-11 12:06:26 +00:00
akr 240378856b * test/ruby/test_io.rb (test_dup_many): extracted from test_dup.
test in ruby subprocess.  at asakusa.rb.  [ruby-dev:35648]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-11 10:25:05 +00:00
matz 8249d674fd * test/ruby/test_bignum.rb (TestBignum#test_convert): remove
platform dependent call of Process.wait.  coverage should be
  accomplished by other method.  [ruby-dev:36062]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-11 01:26:59 +00:00
akr 3266ec1658 * lib/open3.rb (Open3.pipeline_start): return an array of threads if a
block is not given.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-10 17:24:42 +00:00
duerst a28fdecda7 * enc/trans/single_byte.trans, cp850-tbl.rb, cp852-tbl.rb,
cp855-tbl.rb, koi8-r-tbl.rb, koi8-u-tbl.rb, tis-620-tbl.rb:
  new single-byte transcodings (from Yoshihiro Kambayashi)

* test/ruby/test_transcode.rb: added tests for the above
  (from Yoshihiro Kambayashi), small cosmetic fixes


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-09 09:39:25 +00:00
nobu 92e0f99d37 * pack.c (pack_pack): fixed length for odd length string.
[ruby-dev:37283]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-08 09:31:44 +00:00
akr c0264efadd * lib/open3.rb (Open3.capture3): renamed from Open3.poutput3.
(Open3.capture2): renamed from Open3.poutput2.
  (lOpen3.capture2e): renamed from Open3.poutput2e.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-07 08:45:31 +00:00
yugui 4b983b90c4 * pack.c (pack_pack): 'u0' is not special differently from 'm0'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-06 08:55:57 +00:00
xibbar 8c07972702 fix for 1.8's
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-05 12:09:49 +00:00
akr 415e2cbd88 * lib/open3.rb (Open3.pipeline_start): new method.
(Open3.pipeline): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-05 10:07:13 +00:00
nobu f6d18c3f2a * iseq.c (rb_iseq_parameters): proc arguments are always optional.
* proc.c (get_proc_iseq, rb_proc_parameters): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-05 04:05:48 +00:00
usa 0b10c32079 * test/ruby/test_process.rb: skip some tests on win32.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 16:39:55 +00:00
akr bca9bf7fef * lib/open3.rb (Open3.poutput3): new method.
(Open3.poutput2): ditto.
  (Open3.poutput2e): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 14:24:54 +00:00
tadf a821725ab0 * test/ruby/test_complex.rb: added some tests.
* test/ruby/test_rational.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 13:14:25 +00:00
akr 87c7905bdc * lib/open3.rb (Open3.popen3): simplified.
(Open3.popen_run): extracted from Open3.popen3.
  (Open3.popen2): new method.
  (Open3.popen2e): new method.
  (Open3.pipeline_rw): new method.
  (Open3.pipeline_r): new method.
  (Open3.pipeline_w): new method.
  (Open3.pipeline_run): new private method.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 10:58:32 +00:00
akr a112ec787a * process.c (check_exec_fds): resolve cascaded child fd reference.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 10:17:34 +00:00
matz 57f7d8c2cd * ext/openssl/ossl_ssl.c (ossl_ssl_read_nonblock):
OpenSSL::SSL::SSLSocket should implement read_nonblock.  a patch
  from Aaron Patterson in [ruby-core:20277].  fix: #814 [ruby-core:20241]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 07:21:10 +00:00
tadf ef38a43c50 * complex.c (nurat_{to_s,inspect}): provides better representation
for in-finite imag part.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-03 16:43:01 +00:00
akr 30b8f1ee2b * process.c (EXEC_OPTION_DUP2_CHILD): defined.
(check_exec_redirect_fd): check :in, :out and :err.
  (check_exec_redirect): check [:child, fd].
  (check_exec_fds): validate EXEC_OPTION_DUP2_CHILD array.
  (run_exec_dup2_child): new function.
  (rb_run_exec_options): call run_exec_dup2_child.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-03 15:02:10 +00:00
akr ca209c80e9 * process.c (check_exec_redirect): accept :in, :out, :err as redirect
target.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-03 12:33:37 +00:00
tadf e98e384be0 revert.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-03 12:19:05 +00:00
mame 7fd3ac4895 * test/ruby/test_rational.rb: add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-02 17:58:17 +00:00
mame 181ffea5e0 * test/ruby/test_range.rb: add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-02 17:53:48 +00:00
mame 0863013b96 * test/ruby/test_string.rb: add some tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-02 17:26:31 +00:00
akr 852b4629c1 * lib/open3.rb (Open3.popen3): merge hash options if given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-02 10:23:48 +00:00
usa a01e1cfb5b * test/socket/test_tcp.rb (test_recvfrom): already can run on mswin32.
* test/socket/test_tcp.rb (test_recvfrom, test_encoding): use IP address instead
  of host name.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-02 06:14:37 +00:00
usa 14c06bd441 * test/socket/test_tcp.rb (test_recvfrom, test_encoding): shouldn't assume
that th is not nil.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-02 06:02:23 +00:00
nobu a918afe05e * cont.c (rb_fiber_start): calls with exact argument number.
[ruby-core:20088]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-01 03:00:48 +00:00
yugui 1fe2fae259 * test/ruby/test_regexp.rb (TestRegexp#test_parse_curly_brace):
now accepts quantifier on anchrs agian by r20391.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-30 09:04:51 +00:00
nobu 46e3b0fe7b * iseq.c (simple_default_value): extracts simplest default
argument value.

* iseq.c (rb_iseq_parameters): returns parameter list.

* proc.c (get_proc_iseq, get_method_iseq): handles ifunc and
  bmethod.

* proc.c (rb_proc_parameters, rb_method_parameters): added
  Proc#parameters and Method#parameters.  [ruby-core:19759]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-28 04:19:37 +00:00
matz 4d3f3af836 * ext/bigdecimal/bigdecimal.c (BigDecimal_DoDivmod): bigdecimal
division (including modulo) should raise ZeroDivisionError as
  integer division. [incompatible]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-27 17:20:08 +00:00
matz 90add5db45 * numeric.c (flodivmod): floating point division should raise
ZeroDivisionError as integer division. [incompatible]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-27 16:01:54 +00:00
matz 0434b0f098 * ext/bigdecimal/bigdecimal.c (VpException): bigdecimal zero
division should raise FloatDomainError if mode
  VP_EXCEPTION_ZERODIVIDE is set.  [ruby-dev:37204]

* ext/bigdecimal/bigdecimal.c (BigDecimal_mode): should handle
  VP_EXCEPTION_ZERODIVIDE.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-26 14:04:58 +00:00
matz a426373520 * ext/bigdecimal/bigdecimal.c (VpAlloc): avoid ALLOCA_N() to avoid
segmentation fault caused by (insanely) long decimal values.
  [ruby-dev:37189] fix #794

* ext/bigdecimal/bigdecimal.c (BigDecimal_dump, BigDecimal_to_i,
  BigDecimal_to_f, BigDecimal_to_s, BigDecimal_split,
  BigDecimal_inspect): ditto.

* ext/bigdecimal/bigdecimal.c (VpToString): small performance
  improvement.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-25 18:02:42 +00:00
tadf 4671724697 * lib/date/format.rb (strftime): ignores '_' flag for %[LN].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24 16:26:00 +00:00
shugo 361a713f96 * strftime.c (rb_strftime): The # flag should work with %a, %A, %b,
%B, and %h.  [ruby-dev:37162]
* test/ruby/test_time.rb (test_strftime): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24 14:29:37 +00:00
shugo bf1d53e2e0 * strftime.c (rb_strftime): A width specifier for %t and %n should
work.  [ruby-dev:37160]
* test/ruby/test_time.rb (test_strftime): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24 14:01:47 +00:00
shugo aa498028b2 * strftime.c (rb_strftime): The precision of %0N should be 9.
[ruby-dev:37156]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24 13:10:07 +00:00
shugo 32aed81046 * strftime.c (rb_strftime): The default precision should be 1, not
0.  [ruby-dev:37155]
* test/ruby/test_time.rb (test_strftime): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24 12:42:45 +00:00
tadf 1537855833 * lib/date.rb (inspect): changed again.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24 10:55:00 +00:00
yugui 31c8291618 * test/ruby/test_method.rb (TestMethod#test_default_accessibility):
fixed a wrong expectation in the test case.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-22 14:41:55 +00:00
yugui b53d7429fc merges r20309 from ruby_1_9_1 to trunk.
* test/cgi/test_cgi_session.rb (setup, teardown): uses a temporary
  directory for testing session stores.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-22 12:36:19 +00:00
yugui ab8114f481 * test/ruby/test_method.rb (test_default_accessiblity): test case for
[ruby-dev:37124].



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-22 12:34:21 +00:00
matz d37f45cef9 * ext/syck/rubyext.c (rb_syck_mktime): return DateTime for a value
out of range of Time.   [ruby-core:19919]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-19 08:49:51 +00:00
seki 9b3e241bfc fixed fails occasionally [ruby-dev:37119]. thanks, shinichiro.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-18 18:05:28 +00:00
nobu b7ac5b1262 * lib/logger.rb (ProgName): fixed for svn, based on a patch from
Nobuhiro IMAI at [ruby-dev:37108].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-18 07:18:29 +00:00
yugui f2077294f1 * lib/rubygems/timer.rb: removed svn:executable.
* lib/rubygems/validator.rb: ditto
* test/cgi/test_cgi_modruby.rb: ditto
* test/cgi/test_cgi_multipart.rb: ditto
* test/cgi/test_cgi_session.rb: ditto: ditto
* test/cgi/testdata/file1.html: ditto
* test/cgi/testdata/small.png: ditto
* test/cgi/testdata/large.png: ditto
* test/cgi/test_cgi_core.rb: ditto
* test/cgi/test_cgi_header.rb: ditto
* test/cgi/test_cgi_cookie.rb: ditto
* test/cgi/test_cgi_tag_helper.rb: ditto



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-11 15:09:21 +00:00
tadf b0e3af4922 * lib/date.rb (inspect): reverted the previous change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-11 11:42:46 +00:00
duerst 0d93d8125e * test/ruby/test_transcode.rb: unnecessary setup method
(setup_really_needed?) removed


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-11 05:42:49 +00:00
duerst 831e804388 * enc/trans/single_byte.trans, macgreek-tbl.rb, macroman-tbl.rb,
macromania-tbl.rb, macturkish-tbl.rb, macukraine-tbl.rb,
  ibm437-tbl.rb, ibm852-tbl.rb, ibm855-tbl.rb, ibm857-tbl.rb,
  ibm860-tbl.rb, ibm861-tbl.rb, ibm862-tbl.rb, ibm863-tbl.rb,
  ibm865-tbl.rb, ibm866-tbl.rb, ibm869-tbl.rb, ibm775-tbl.rb:
  new single-byte transcodings (from Yoshihiro Kambayashi)

* test/ruby/test_transcode.rb: added tests for the above
  (from Yoshihiro Kambayashi)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-11 05:26:20 +00:00
tadf 524c766d19 trivial changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-10 22:59:47 +00:00
tadf e8c67503ea * lib/date.rb (inspect): changed the format.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-10 22:57:01 +00:00
knu fd93c80482 * test/sdbm/test_sdbm.rb (TestSDBM#test_index): Reflect the method
name change from #index to #key and remove a duplicated test
  method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-10 08:38:20 +00:00
xibbar 9b139fe589 fix test for 1.8
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-08 15:38:48 +00:00
xibbar 4b9e885000 fix debug code
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-08 14:56:38 +00:00
xibbar 26862c00e9 * lib/cgi/session.rb (FileStore): use marshalized data.
* test/cgi/session_dir: add a session directory in test.
* test/cgi/test_cgi_session.rb: add a test. 


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-08 14:52:59 +00:00
matz 703fb3d9be * ext/gdbm/gdbm.c (fgdbm_index): make #index warn like Hash.
[ruby-dev:37039]

* ext/sdbm/init.c (Init_sdbm): typo fixed.  [ruby-dev:37039]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-08 03:15:28 +00:00
matz c82769f227 * ext/dbm/dbm.c (fdbm_index): make #index warn like Hash.
* ext/dbm/dbm.c (fdbm_key): new method.

* ext/sdbm/init.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-07 22:07:05 +00:00
matz 1343680398 * lib/yaml/rubytypes.rb: support Rational and Complex as 1.8
does.  a patch from Hiroshi Moriyama in [ruby-dev:36899].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-06 22:36:07 +00:00
shugo a324863b99 * lib/rexml/entity.rb (unnormalized): do not call
document.record_entity_expansion if document is nil.
  see <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502535>.
  Thanks, Naohisa Goto.
* test/rexml/test_document.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-06 17:03:40 +00:00
suke 696e6a9b76 * ext/win32ole/win32ole.c (fole_s_connect, fole_initialize,
folevariant_initialize): check argument type of WIN32OLE.connect,
  WIN32OLE.new, WIN32OLE_VARIANT.new.

* test/win32ole/test_win32ole.rb (test_s_new_exc, test_s_connect_exc):
  ditto.

* test/win32ole/test_win32ole_variant.rb (test_s_new_exc): ditto.

* test/win32ole/test_win32ole_method.rb: add assertion of
  WIN32OLE_METHOD.new.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-06 12:38:49 +00:00
takano32 a3fb952a4f * test/zlib/test_zlib.rb(test_readchar): compare in same type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-03 23:00:40 +00:00
suke 1dead12e7f * test/win32ole/test_win32ole_event.rb: rename test class.
* test/win32ole/test_win32ole_variant_outarg.rb: add in order
  to use ADO instead of Internet Explorer.
  remove test/win32ole/test_win32ole_variant_with_ie.rb.

* test/win32ole/orig_data.csv: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-02 15:41:02 +00:00
suke f35fb72f44 * test/win32ole/test_err_in_callback.rb: add teardown.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-02 14:10:46 +00:00
suke 2d45869c76 * ext/win32ole/win32ole.c (ole_event_free): invoke IConnectionPoint::Unadvise
before invoking IConnectionPoint::Release.

* test/win32ole/test_win32ole_event.rb, test/win32ole/err_in_callback.rb,
  test/win32ole/test_err_in_callback.rb: Use ActiveX Data Object
  Library instead of InternetExplorer.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-02 13:22:42 +00:00
drbrain af0221e728 Don't require rubygems/defaults from gem_prelude.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-31 22:27:35 +00:00
yugui 7ac0beaeea * test/ruby/test_array.rb (test_array_subclass) test for r20076.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-31 09:57:45 +00:00
duerst d37df9fb13 * enc/trans/single_byte.trans, maccroatioan-tbl.rb,
maccyrillic-tbl.rb, maciceland-tbl.rb: new single-byte
  transcodings (from Yoshihiro Kambayashi)

* test/ruby/test_transcode.rb: added tests for the above
  (from Yoshihiro Kambayashi)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-31 09:07:21 +00:00
nobu 04e94c6ec8 * ruby.c (process_options): delays setting safe level.
[ruby-dev:36997]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-30 23:16:16 +00:00
mame e2cb0b9766 * array.c (rb_ary_sort_bang): remove SEGV when replacing array with
embedded one during sort.

* test/ruby/test_array.rb (test_sort!): add tests for above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-29 17:24:44 +00:00
mame 143f059bcd * test/ruby/test_array.rb: add some tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-29 16:46:08 +00:00
matz 86ade65104 * io.c (rb_io_rewind): should reset fptr->readconv if it's
available.

* io.c (more_char): clear readconv at EOF.

* test/ruby/test_file.rb: should not read after EOF.  use rewind
  instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-29 16:40:05 +00:00
mame 85b6c69e82 * test/ruby/test_array (test_permutation): add a test that replaces
array during permutation.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-29 16:16:53 +00:00
mame 224471fd57 * test/webrick/utils.rb (start_server): provide a reference to log of
webrick.

* test/webrick/test_httpproxy.rb, test/webrick/test_httpauth.rb,
  test/webrick/test_cgi.rb, test/webrick/test_httpserver.rb,
  test/webrick/test_server.rb, test/webrick/test_filehandler.rb: use
  webrick log as an assertion message.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-29 11:48:35 +00:00
nobu 3056933cc0 * test/ruby/test_array.rb (test_pack): use utf-8.
* test/ruby/test_pack.rb (test_pack_U): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-29 09:40:38 +00:00
yugui d8c68028fa * test/ruby/test_proc.rb: filled all patterns for testing
vm_yield_setup_args.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 14:18:10 +00:00
usa 45ea81a492 * test/ruby/test_require.rb (test_require_too_long_filename): too long
commandline may be rejected by OS.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 12:03:14 +00:00
usa 7994aaa1f3 * test/ruby/test_io_m17n.rb (test_getc_invalid3): should set binmode if enc is
not compatible with ASCII.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 12:01:46 +00:00
usa 68b9bc4201 * test/ruby/test_io.rb (test_sysopen): should specify the mode of IO::for_fd
if F_GETFL is not available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 11:23:52 +00:00
usa 04e19b5587 * test/ruby/test_io.rb (test_copy_stream, test_copy_stream_socket): skip some
tests if there isn't IO#nonblock=.
* test/ruby/test_io.rb (test_close_on_exec): skip if there isn't
  IO#close_on_exec=.
* test/ruby/test_io.rb (test_bytes, test_readbyte): depend on binmode.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 09:41:30 +00:00
usa fdc4287e87 * test/ruby/test_file.rb (test_*_extended_file): forgot to set mode.
* test/ruby/test_file.rb (test_para_gets_extended_file): output file sould be
  binmode.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 09:34:37 +00:00
yugui e3e645f43a merged r19975 and r19978 from ruby_1_9_1 into trunk.
* gem_prelude.rb: considers --program-suffix and prefix configure
  options.
* lib/rubygems/defaults.rb: ditto.
* test/rubygems/test_gem.rb (@default_dir_re): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 08:21:50 +00:00
usa 993a9404cb * test/ruby/test_file.rb (test_*_extended_file): test in default/text/binary
mode.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 05:20:24 +00:00
usa 6714f687e3 * test/ruby/test_file.rb (test_each_char_extended_file,
test_getbyte_extended_file): add tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 03:52:43 +00:00