yugui
294f45b0fc
* lib/prime.rb (Prime::prime?): used to return a wrong answer.
...
[ruby-core:22646].
* test/test_prime.rb (test_prime?): test case for [ruby-core:22646].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-03 15:57:15 +00:00
nobu
f9ca2119e4
* test/dl: moved from ext/dl/test.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-03 06:03:23 +00:00
akr
fb5d4ecfb5
* ext/socket/ancdata.c (rsock_discard_cmsg_resource): defined
...
unconditionally.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-02 12:14:35 +00:00
nobu
faabbf230a
* test/ruby/test_path.rb (test_extname): test for r19596.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-01 05:16:14 +00:00
nobu
d988d09458
* test/ruby/test_path.rb (test_basename): test for r19595.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-01 05:10:36 +00:00
akr
2ba6eec1fa
* ext/socket/ancdata.c (ancillary_unix_rights): check message type.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-28 09:29:26 +00:00
akr
d8c66c4333
* ext/socket/ancdata.c (bsock_recvmsg_internal): close FDs passed by
...
SCM_RIGHTS unless :scm_rights=>true is given.
(discard_cmsg): extracted from rsock_discard_cmsg_resource.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-27 14:23:54 +00:00
akr
7f247b9d0c
add a test.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-27 13:10:25 +00:00
nobu
1942710d42
* lib/ostruct.rb (modifiable): check if really frozen.
...
[ruby-core:22559]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-27 05:23:10 +00:00
akr
ecb22ce2c5
* ext/socket/lib/socket.rb (BasicSocket#connect_address): new method.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-26 14:15:39 +00:00
akr
e6f0b1de89
* ext/socket/option.c (sockopt_level): extracted from sockopt_level_m.
...
(sockopt_optname): extracted from sockopt_optname_m.
(sockopt_data): apply StringValue.
(sockopt_s_linger): new method.
(sockopt_linger): new method.
(inspect_linger): show onoff value if it is neither 0 nor 1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-25 15:26:25 +00:00
akr
56c52c1da8
* ext/socket/ancdata.c (ancillary_s_unix_rights): new method.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-25 14:19:24 +00:00
nobu
43b9684962
* string.c (rb_str_force_encoding): should clear coderange at changing
...
encoding. [ruby-core:22437]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-25 03:28:00 +00:00
nobu
ac9d09ba3c
* io.c (rb_io_getline_1): enables limit even if rs is given.
...
[ruby-core:22434]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-25 03:06:12 +00:00
nobu
6dd9388545
* string.c (rb_str_chomp_bang): coderange may change.
...
[ruby-core:22414]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24 17:28:56 +00:00
nobu
42eeb2c1b1
* string.c (rb_str_delete_bang): should recalculate coderange.
...
[ruby-talk:329267]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24 17:17:35 +00:00
akr
e137e939b7
* ext/socket/ancdata.c (ancillary_timestamp): support SCM_BINTIME.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24 10:56:57 +00:00
akr
b404c651d2
* ext/socket/ancdata.c (ancillary_timestamp): new method.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24 10:45:46 +00:00
akr
605cd65904
* ext/socket/ancdata.c (inspect_timespec_as_abstime): new function to
...
show struct timespec.
(ancillary_inspect): use it for SCM_TIMESTAMPNS on GNU/Linux.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-23 11:41:38 +00:00
akr
23e286f3fb
* ext/socket/ancdata.c (inspect_bintime_as_abstime): new function to
...
show struct bintime.
(ancillary_inspect): use it for SCM_BINTIME on FreeBSD.
* ext/socket/mkconstants.rb: define SCM_BINTIME.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-23 11:32:43 +00:00
akr
a0e3e8e4d1
* ext/socket/ancdata.c (inspect_timeval_as_abstime): use time_t
...
variable to avoid a warning on environments which use long as
tv_sec as NetBSD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-23 11:21:45 +00:00
akr
decee68028
add a test.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 18:14:01 +00:00
nobu
624d07b0e4
* string.c (tr_trans): should recalculate coderange.
...
[ruby-core:22326] (reopened at [ruby-core:22328])
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 13:42:22 +00:00
nobu
7b1bbd59e1
* test/ruby/test_string.rb (test_tr): test for [ruby-core:22328].
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 13:38:24 +00:00
nobu
bc59123dc0
* string.c (tr_trans): should not be affected by the encoding of
...
replacement unless actually modified. [ruby-talk:328967]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 05:33:07 +00:00
akr
9cfe35ad50
* io.c (io_getpartial): error message describes what should be
...
waited after nonblocking error.
(rb_io_write_nonblock): ditto.
* ext/socket/init.c (s_recvfrom_nonblock): ditto.
(s_accept_nonblock): ditto.
* ext/socket/socket.c (sock_connect_nonblock): ditto.
* ext/socket/ancdata.c (bsock_sendmsg_internal): ditto.
(bsock_recvmsg_internal): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-21 15:57:52 +00:00
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