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

4595 Коммитов

Автор SHA1 Сообщение Дата
drbrain 6c1da63bd7 * lib/rubygems: Update to RubyGems 1.8.22 plus r33517 and r35337 which
were ported to the rubygems git repository.

  See https://github.com/rubygems/rubygems/blob/1.8/History.txt for
  changes since 1.8.11.
* test/rubygems:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-18 00:04:12 +00:00
drbrain 0ebe38eedd Revert r35370 due to bad source branch
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-17 21:17:56 +00:00
drbrain 22d9456b79 * lib/rubygems: Update to RubyGems 1.8.22 plus r33517 and r35337 which
were ported to the rubygems git repository.

  See https://github.com/rubygems/rubygems/blob/1.8/History.txt for
  changes since 1.8.11.
* test/rubygems:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-17 20:50:00 +00:00
nobu 43dbbefbdf * strftime.c (rb_strftime_with_timespec): fix padding of time zone
offset.  [ruby-dev:43287][Bug #4458]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-17 13:18:51 +00:00
naruse 77321aeed9 win32/dln is only for win32.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-17 11:14:24 +00:00
nobu dad31f6e50 * dln.c (rb_w32_check_imported): skip ordinal entries. based on a
patch by phasis68 (Heesob Park) at [ruby-core:44381].
  [ruby-core:44371][Bug #6303]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-17 04:11:17 +00:00
naruse 164ced04de Add debug prints to inspect TC_JSONGenerate#test_gc's timeout issue.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-15 07:37:45 +00:00
naruse 05af801f4c Adds another timeouts.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-14 18:56:12 +00:00
naruse c26ea74ad6 * lib/webrick/server.rb (WEBrick::GenericServer#start):
partially revert r35315.

* test/webrick/test_server.rb (test_start_exception):
  received signal is delivered to the main thread, so it is needed to
  emulate it. patched by Eric Hodel. [ruby-core:44348] [Feature #6236]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-14 02:30:43 +00:00
naruse deb0519aec * lib/webrick/server.rb (WEBrick::GenericServer#stop): fix r35303;
this method is to deny new connections, not shutdown yet.

* lib/webrick/server.rb (WEBrick::GenericServer#start):
  re-raise exception only when the exception is Interrupt (^C).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13 06:21:50 +00:00
nobu 2417bd10d2 * test/ruby/test_autoload.rb: clear autoloaded paths.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-12 07:16:14 +00:00
naruse 1d6d4d2461 r35304 changes the exception.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-12 02:51:02 +00:00
ko1 ee7f8d4805 * compile.c (compile_array, compile_array_):
Divide big array (or hash) literals into several blocks and
  concatetene them.  There was a problem that a big array (hash)
  literal causes SystemStackError exception (stack overflow)
  because VM push all contents of the literal onto VM stack to
  make an array (or hash).  To solve this issue, we make several
  arrays (hashes) and concatenate them to make a big array (hash)
  object.
  ??
* compile.c (iseq_compile_each, setup_args): use modified
  compile_array.
* vm.c (m_core_hash_from_ary, m_core_hash_merge_ary,
  m_core_hash_merge_ptr): added for above change.
* id.c (Init_id), parse.y: add core method ids.
* bootstraptest/test_literal.rb: add simple tests.
* bootstraptest/test_eval.rb: remove rescue clause to catch
  SystemStackError exception.
* test/ruby/test_literal.rb: add tests to check no stack overflow.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-12 01:33:34 +00:00
drbrain 655738577f * lib/uri/generic.rb (module URI): URI now downcases the scheme to
follow RFC 2396 section 3.1.  [ruby-trunk - Feature #4551]
* test/uri/test_generic.rb (class URI):  Test for above


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11 22:11:07 +00:00
drbrain ea9b6997cc * lib/net/protocol.rb (module Net): Added ReadTimeout to match
OpenTimeout.  ReadTimeout is now raised by rbuf_fill instead of
  Timeout::Error to help users distinguish what type of timeout
  occurred.  [ruby-trunk - Feature #6088]
* lib/net/pop.rb (module Net):  Updated documentation for ReadTimeout
  and OpenTimeout.
* lib/net/http.rb (module Net):  ditto
* lib/net/smtp.rb (module Net):  ditto
* lib/net/telnet.rb (module Net):  Net::ReadTimeout is now raised in
  waitfor to match Net::Protocol.
* test/net/http/test_http.rb:  Updated Timeout::Error expectation to
  Net::ReadTimeout.
* test/net/ftp/test_ftp.rb:  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11 21:20:51 +00:00
drbrain 8c5c5a221f * lib/webrick/server.rb (module WEBrick::GenericServer): A server
will now continue only when a StandardError subclass is raised.  For
  other exception types the error will be logged at the fatal level and
  the server will safely stop.  Based on a patch by Alex Young.
  [ruby-trunk - Feature #6236]
* test/webrick/test_server.rb:  Test for new exception handling
  behavior.  Join the server thread instead of busy-waiting for it to
  shut down to remove race conditions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11 20:28:11 +00:00
nobu db5265a82c * parse.y (rb_check_id_cstr): new function to check if ID is
registered with NUL-terminated C string.
* sprintf.c (rb_str_format): avoid inadvertent symbol creation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11 13:31:23 +00:00
nobu a5d1da5d74 * sprintf.c (rb_str_format): fix exception message encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11 13:01:16 +00:00
nobu 51f2207fc9 * test/ruby/test_sprintf.rb (test_named_untyped, test_named_typed):
split and add assertions for exception when named parameter after
  unnumbered.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11 13:01:14 +00:00
nobu 23ba7541e5 * sprintf.c (rb_str_format): fix error message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11 12:43:56 +00:00
shirosaki 2f7290d4b3 * io.c (rb_io_eof): use eof() instead of io_fillbuf(). It's because
io_unread() doesn't work properly when reading CRLF with read(length)
  and mode 'r'.
  [ruby-core:44189][Bug #6271]

* test/ruby/test_io_m17n.rb (TestIO_M17N#test_read_crlf_and_eof):
  test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11 12:05:19 +00:00
naruse 3e13081214 Set $VERBOSE=false in case of ruby -w.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11 01:15:56 +00:00
drbrain 6ba4bd5858 * pack.c (pack_pack): Warn when an invalid character is found in the
format string when $VERBOSE is true.  [ruby-trunk - Feature #5219]
* pack.c (pack_unpack):  ditto
* test/ruby/test_pack.rb (class TestPack):  Test for warnings on
  invalid format characters.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-10 22:33:58 +00:00
naruse 1a7f3d7cb7 It is wrong to expect the last output is "exit".
When lb.join is commented out as [ruby-dev:30653] says,
@keeper is living until the program truely die.
So after it outputs "exit.", it may output "#{i}: cont".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-10 19:34:34 +00:00
naruse a69e190e96 More increae timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-10 11:56:09 +00:00
naruse 66fd3a4eb5 Wait the server until it stops.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-10 10:19:28 +00:00
nobu f45fc7daa0 * error.c (rb_enc_raise): new function to raise an exception with
the message in the given encoding.  patched by now (Nikolai
  Weibull) at [ruby-core:41160].  [Feature #5650]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-10 10:07:07 +00:00
naruse a59dd4b489 Increae timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-10 09:23:14 +00:00
naruse 9a269ab175 start GC before GC.stress.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-10 07:19:08 +00:00
naruse 2eb5d1dea4 Add timeout to TC_JSONGenerate#test_gc.
http://fb.rubyci.org/~chkbuild/ruby-trunk/log/20120409T230301Z.log.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-10 03:41:50 +00:00
nobu 04e3e2de56 * test/ruby/test_file.rb (TestFile#test_long_unc): fix for the case cwd is UNC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-09 14:14:39 +00:00
nobu 3ed259abbc * win32/win32.c (isUNCRoot, winnt_stat): support long UNC.
[ruby-core:30623][Feature #3399]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-09 14:10:32 +00:00
naruse 8c8796333a Wait until the callback is called with timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-09 10:49:46 +00:00
nobu 41c199130a * parse.y (string_content, parser_yylex): count brace nesting to
dispatch embexpr_end.  [ruby-core:43775][Bug #6211]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-09 06:16:07 +00:00
marcandre 6b18a8c2e9 * hash.c (rb_hash_set_default_proc): Accept nil, patch by Run Paint
[Feature #4234]

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-09 04:07:53 +00:00
naruse 228a99a0b2 Add test for r35265.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-08 23:05:08 +00:00
naruse 71d114297f * complex.c (nucomp_expt): the result of f_complex_new2 may be a fixnum
with mathn. [ruby-core:44170] [Bug #6267]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-08 17:53:51 +00:00
naruse 63467e5263 Decrease the default level of try_fdopen.
Because it cause Bus Error:
http://u32.rubyci.org/~chkbuild/ruby-trunk/log/20120407T230202Z.log.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-08 13:46:50 +00:00
naruse 8474c90eac Don't run tests which can't run with editline.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-08 06:26:48 +00:00
naruse 9ec849ee08 * Remove unused variables.
* use Thread.pass instead of true.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-07 23:41:27 +00:00
naruse 56206ab8cd * lib/webrick/httpresponse.rb (WEBrick::HTTPResponse#send_body_io):
use readpartial to get data even if the response is streaming data and
  each data is smaller than @buffer_size.
  patched by yu nobuoka. [ruby-dev:45471] [Bug #6230]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-07 21:50:34 +00:00
shirosaki 42109a02f0 * include/ruby/win32.h (rb_w32_aspawn_flags): add the declaration of
new function.

* process.c (enum): add EXEC_OPTION_PGROUP and move the position
  above for the usage in proc_spawn_n().

* process.c (proc_spawn_n): add an argument to pass new option
  `new_pgroup`. The option specifies CREATE_NEW_PROCESS_GROUP flag to
  CreateProcessW(). This flag is necessary for the usage of
  Process.kill on the subprocess on Windows.

* process.c (rb_exec_arg_addopt): ditto.

* process.c (rb_spawn_process): ditto.

* process.c (documentation for rb_f_spawn): add documentation for new
  option `new_pgroup` of spawn.

* test/ruby/test_process.rb (TestProcess#test_execopts_new_pgroup):
  add tests for option `new_pgroup`.

* test/ruby/test_thread.rb
  (TestThreadGroup#test_thread_timer_and_interrupt):
  add option `new_pgroup: true` to spawn on Windows. It's needed for
  Process.kill on a subprocess.

* win32/win32.c (CreateChild): add an argument to pass
  dwCreationFlags of CreateProcessW().

* win32/win32.c (rb_w32_spawn): ditto.

* win32/win32.c (rb_w32_aspawn_flags): add new function to pass
  dwCreationFlags.

* win32/win32.c (rb_w32_aspawn): refactor to move the content to
  rb_w32_aspawn_flags().
  [ruby-core:43245][Bug #6131]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-07 14:10:30 +00:00
shirosaki fc83ebb037 * test/ruby/test_thread.rb
(TestThreadGroup#test_thread_timer_and_interrupt): skip on Windows.
  Process.kill cannot kill a subprocess if CREATE_NEW_PROCESS_GROUP
  flag is not specified in a call to CreateProcessW().

* win32/win32.c (CreateChild): revert the usage of
  CREATE_NEW_PROCESS_GROUP flag for compatibility.
  [ruby-core:43245][Bug #6131]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-07 14:10:25 +00:00
tenderlove 85e4c89675 * ext/psych/parser.c: fall back to any encoding if the external
encoding is wrong.  [ruby-core:44163]
* test/psych/test_encoding.rb: fix test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-06 17:09:03 +00:00
naruse 3f443e6115 Use mount_proc to avoid the delay of writing data to files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-04 12:49:12 +00:00
naruse 223e0212e9 Sleep 0.5sec to wait the file is written on server.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-04 07:58:19 +00:00
naruse 7865005fa1 * lib/ftp/ftp.rb (Net::FTP#close): restore original read_timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-04 04:10:58 +00:00
naruse 58a9bf0c4c Don't call f.close if f is nil or already closed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-03 19:30:10 +00:00
naruse bc2ece6cf8 * lib/ftp/ftp.rb (Net::FTP#close): close socket more gracefully.
* lib/ftp/ftp.rb (Net::BufferedSocket#shutdown): added.

* test/net/ftp/test_ftp.rb (FTPTest#create_ftp_server): wait socket
  with shutdown and read.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-03 19:24:30 +00:00
nobu d7655cc292 * test/mkmf/base.rb (TestMkmf#setup): remove uninitialized global variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-03 14:30:08 +00:00
nobu 5c67392c95 * test/mkmf/base.rb (TestMkmf#teardown): remove meaningless assertion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-03 14:30:05 +00:00
usa 995d212a64 * test/net/ftp/test_ftp.rb (FTPTest#create_ftp_server): should wait
a little before closing socket because if the client call
  Net::FTP#getmultiline the socket is suddenly closed by the server in
  the getline loop.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-03 10:03:30 +00:00
nobu 9102ee7be2 * test/mkmf: remove generated files and ensure nothing left.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-03 09:41:14 +00:00
naruse 31bd33a662 Revert r35180; the fix break the test. see [ruby-dev:30653]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-03 04:27:30 +00:00
nobu 63e8110bfc * enumerator.c (inspect_enumerator): suppress uninitialized
instance variable warnings.  [ruby-dev:45449][Bug #6214]
  patched by no6v (Nobuhiro IMAI).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-03 01:18:31 +00:00
nobu a59bfa76e5 * lib/optparse/ac.rb: autoconf-like options.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-02 04:25:14 +00:00
nobu 38b8afcf5a * string.c (rb_str_start_with, rb_str_end_with): raise an error if
an argument is not convertible to a String.
  [ruby-core:40623][Bug #5536]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-02 01:34:11 +00:00
naruse 8630041945 Refix of 35206; 0.3 is too small for Ruby's timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-01 21:06:13 +00:00
naruse 61fcda16fd ReRefix the test for r35205.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-01 21:00:54 +00:00
naruse 9d8ca7e15e Refix the test for r35205.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-01 20:59:02 +00:00
naruse 8520505e44 Fix the test for r35205.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-01 18:42:22 +00:00
naruse 4179e0b5c6 Client waits only the first line.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-01 14:06:42 +00:00
naruse ae79409db4 * lib/net/ftp.rb (Net::BufferedSocket): should delegate send() to @io
for Net::FTP#abort and Net::FTP#status..

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-01 14:06:38 +00:00
nobu bfdccf09c7 use super in h.default
* test/ruby/test_hash.rb (TestHash#test_shift_none): super in
  singleton default method doesn't cause SystemStackError now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-31 08:13:58 +00:00
nobu 160d02d830 * hash.c (hash_default_value): extract from rb_hash_aref(), to be
shared with rb_hash_shift(), so that overriding Hash#default
  will be respected.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-31 05:23:01 +00:00
shugo 5f81a53fd2 * lib/net/ftp.rb (read_timeout=, open_timeout=): supported timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-31 04:44:36 +00:00
nobu d481e34e3c misplaced rescue
* test/ruby/test_thread.rb (test_condvar_wait_deadlock_2): fix cleanup
  code which is never executed because of misplaced rescue.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-31 00:48:56 +00:00
nobu becc3000ca descriptive assertions
* test/ruby/test_hash.rb: use more descriptive assertions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-30 22:18:52 +00:00
nobu fc4e79e301 join LocalBarrier
* test/ruby/lbtest.rb: needs to join the local barrier.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-30 22:18:50 +00:00
nobu efd6f6b856 * test/ruby/lbtest.rb: print at once including newlines.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-29 15:03:05 +00:00
nobu 30cea65767 * st.c (st_update): add existing parameter to the callback function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-29 07:36:12 +00:00
emboss aad347f5ec * ext/openssl/ossl_pkcs7.c: fix crash when parsing garbage data.
* test/openssl/test_pkcs7.rb: assert correct behavior for it.
  Thanks to Matt Venables for reporting the issue.
  [ruby-core:43250][Bug #6134]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-29 01:27:17 +00:00
emboss 836af4e5dc * test/openssl/test_x509cert.rb: Exclude test that fails when issuing
a certificate with RSA signature and DSS1 digest for earlier
  OpenSSL versions when used in conjunction with OpenSSL 1.0.1.
  Thanks, Vit Ondruch, for reporting the issue.
  [ruby-core:42949][Bug #6089]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-29 00:32:09 +00:00
emboss 5bef1c9223 * ext/openssl/ossl_asn1.c: raise TypeError when trying to encode nil
values for Primitive instances. 
* test/openssl/test_asn1.rb: Assert consistent behavior when
  encoding nil values: Primitives raise TypeError, Constructives
  raise NoMethodError.
  Fixes [ruby-core:43009][Bug #6102]
-This line, and those below, will be ignored--

M    test/openssl/test_asn1.rb
M    ext/openssl/ossl_asn1.c
M    ChangeLog


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-28 22:53:18 +00:00
nobu 9bf9b3ef95 * process.c (obj2uid, obj2gid): allow strings as input user/group id.
[ruby-core:40923][Feature #5610]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-28 07:40:02 +00:00
nobu 1521f9331e * marshal.c (r_symreal): default to ASCII-8BIT for non-ascii symbols,
otherwise it should be converted to US-ASCII in rb_intern_str() if
  possible.  [ruby-core:43762][Bug #6209]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-28 06:06:20 +00:00
nobu ab9c982cc0 * string.c (str_new_empty): should copy also the encoding as an
empty substring.  [ruby-dev:45441][Bug #6206]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-27 04:13:54 +00:00
shugo 422c8baeb9 * lib/net/ftp.rb (parse_pasv_port): refactored.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-26 14:39:16 +00:00
shugo cae1d532f5 * test/net/ftp/test_ftp.rb: add the test, which was forgotten in the
previous commit.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-26 10:52:06 +00:00
shugo b9f67c4149 * enumerator.c (inspect_enumerator): show method arguments of
lazy enumerators correctly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-26 10:52:02 +00:00
nobu 764d54788a * ruby.c (load_file_internal): bail out if the script is a directory.
[Feature #2408][ruby-core:26925]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-26 02:46:04 +00:00
naruse 73a184cc3a * string.c (tr_setup_table): fix multiple non latin argument for
non latin (over 256 characters) tr-like methods.
  [ruby-core:43371] [Bug #6167]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-25 09:20:04 +00:00
shugo 0c9f66eb40 * enumerator (lazy_initialize): set the instance variable "receiver"
to include the receiver to the return value of inspect on a lazy
  enumerator directly created by Enumerator::Lazy.new.

* enumerator (RETURN_LAZY): don't set the instance variable "receiver".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-24 15:53:38 +00:00
shugo 6b885f6e74 * enumerator (enumerator_inspect): include the original receiver and
method name of Enumerator::Lazy in the result of inspect.
  [ruby-core:43345] [Bug #6159]

* enumerator (InitVM_Enumerator): don't use rb_define_alias for
  some methods such as collect in order to make rb_frame_this_func()
  return the correct method names.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-24 15:17:31 +00:00
nobu 28e48d3fd8 * time.c (time_init_1): Time.new will accept seconds as string or
int.  [ruby-core:43569][Bug #6193]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-24 13:22:22 +00:00
nobu 163ab0a4da * bignum.c (rb_str_to_inum): must be ASCII compatible encoding as
well as String#hex and String#oct.  [ruby-core:43566][Bug #6192]
* string.c (rb_must_asciicompat): check if ASCII compatible.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-23 04:19:24 +00:00
nobu a13486997a * test/ruby/test_io.rb (try_fdopen): more GCable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-23 03:14:49 +00:00
nobu 2b84626193 * transcode.c (str_encode_bang, encoded_dup): if nothing was
transcoded, just set encoding but leave coderange unchanged as
  forcee_encoding.  [ruby-core:43557][Bug #6190]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-22 14:14:39 +00:00
shirosaki 7cbff3b9dd * io.c (static int io_fflush): add the definition.
Use it in set_binary_mode_with_seek_cur().

* io.c (set_binary_mode_with_seek_cur): refactoring to split the
  content into io_unread(). Fix the possibility of buffer overflow.

* io.c (io_unread): add new implementation for Windows. Previous one
  caused invalid cursor position using IO#pos with OS text mode. New
  one fixes the bug.

* test/ruby/test_io_m17n.rb
  (TestIO_M17N#test_pos_dont_move_cursor_position): add a test for
  above bug.
  [ruby-core:43497] [Bug #6179]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-22 14:05:31 +00:00
nobu 0b83d3b27b * test/ruby/test_m17n.rb (test_env): show failed values.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-22 09:37:47 +00:00
usa caf627afce * test/ruby/test_io.rb (TestIO#test_pos_with_getc): updated.
see [ruby-core:43550]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-22 02:14:42 +00:00
usa af86dba25a * test/ruby/test_io.rb (TestIO#test_pos_with_getc): added.
see [Bug #6179][ruby-core:43518]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-21 08:03:08 +00:00
nobu 1e42030f2a test_thread: test_condvar_wait_not_owner duplicates test_condvar_nolock
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-20 13:54:59 +00:00
shugo ded27bf5dc * enumerator.c (lazy_flat_map_func): convert the block value to
Array if it doesn't respond to each.  [ruby-core:43334]
  [Bug #6155]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-19 08:22:29 +00:00
shyouhei d4f0f28430 * test/test_pty.rb: same as r29280, skip tests when PTY allocation
failed (that's not our fault).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-19 06:08:44 +00:00
nobu f4aff7feb1 num2ll and num2ull
* ext/-test-/num2int/num2int.c (print_num2ll, print_num2ull): define
  only if long long is available, and use long long printf modifier
  checked by configure.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-18 15:21:04 +00:00
nobu ed4c5f38ba * bignum.c (rb_big_pow): estimate result bit size more precisely.
[ruby-core:30735][Feature #3429]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-18 08:17:50 +00:00
nobu 2555f3f5bf * gc.c (free_method_entry_i): method entry may be in
unlinked_method_entry_list.  [ruby-core:43383][Bug #6171]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-18 08:17:39 +00:00
kazu ea6511c63a * string.c (trnext): fix bug with string ending with '\\'.
[ruby-dev:45374][Bug #6160]

* test/ruby/test_string.rb (TestString#test_delete): test for
  above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 16:49:44 +00:00
nobu ba20fe6289 * string.c (trnext): should advance char-wise.
[ruby-core:43335][Bug #6156]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 11:06:27 +00:00
nobu 7af3e9f08b fix unreachable warning line number
* parse.y (block_append_gen): fix unreachable warning line number.
  should warn at the code, not jump.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 08:42:16 +00:00
nobu be2dc4434a fix typo
* test/ruby/test_module.rb (test_method_redefinition): fix typo.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 08:38:27 +00:00
nobu 2b906bf226 verbose_warning
* test/ruby/envutil.rb (verbose_warning): should not hide execptions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 08:38:24 +00:00
nobu d19e5328d8 suppress warning.
* test/ruby/envutil.rb: suppress warnings.

* test/ruby/test_exception.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 08:38:22 +00:00
nobu 36ada1b318 fix indent
* test/ruby/test_exception.rb (test_exception): fix indent.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 08:38:20 +00:00
nobu 9faa910961 Tempfile#open
* test/ruby/test_exception.rb (test_systemexit_new,
  test_exception_in_exception_equal): use Tempfile#open.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 08:38:18 +00:00
nobu 62cdd6e64a fix argument order
* test/ruby/test_parse.rb (test_void_expr_stmts_value): expected value
  comes first.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 08:38:16 +00:00
nobu a87f0aa071 bug number
* test/ruby/test_syntax.rb (test_keyword_rest): give the bug number to assertions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 08:38:13 +00:00
shugo 6853b44a92 * lib/net/imap.rb (initialize): raise Net::IMAP::Error when the
connection is closed without a greeting response.
  [ruby-core:40938] [Bug #5616]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 05:12:39 +00:00
shugo ed07df5ab5 * lib/net/imap.rb (rfc822_text): ignore [] after RFC822.
[ruby-core:40945] [Bug #5620]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 04:56:18 +00:00
nobu 817eb7d17d * vm_insnhelper.c (argument_error): use line number at the beginning
of lambda, not the first code ob its body.
  [ruby-core:43314][Bug #6151]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 03:00:44 +00:00
shugo 29f73009ca * enumerator.c (lazy_take): don't enumerate an extra value.
[ruby-dev:45370] [Bug #6152]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 02:22:20 +00:00
shugo 2baeb78294 * enum.c (rb_enum_values_pack): rename from enum_values_pack, and
remove static.

* enumerator.c (lazy_init_iterator, lazy_init_yielder,
  lazy_select_func, lazy_reject_func, lazy_grep_func): handle
  multiple values correctly.

* enumerator.c (lazy_grep): change the behavior when a block is
  given, to be consistent with Enumerable#grep.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 14:20:27 +00:00
shugo d135138f9b * enumerator.c (lazy_zip): rescue StopIteration returned by
Enumerator#next.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 10:14:22 +00:00
shugo 032861ade7 * enumerator.c (lazy_zip, lazy_cycle): Enumerator::Lazy#{zip,cycle}
should be eager when a block is given, to be consistent with
  Enumerable#{zip,cycle}.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 09:25:03 +00:00
shugo ff1f6107f9 * enumerator.c (InitVM_Enumerator): renamed Enumerable::Lazy to
Enumerator::Lazy.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 08:47:09 +00:00
nobu bf87ec4eb9 * parse.y (parser_yylex): fix warning line number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 06:37:46 +00:00
nobu b30c4aa8d7 * test/ruby/test_m17n.rb (assert_warning): use common method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 06:24:10 +00:00
nobu 375aedbfb4 * parse.y (sym_check_asciionly): check ascii compatibility before
scanning for code range.
* parse.y (intern_str): set to us-ascii if ascii only.
  [ruby-dev:45363][Bug #6146]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 06:04:44 +00:00
shugo d18dc74698 * enumerator.c (lazy_cycle): add Enumerable::Lazy#cycle.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 02:00:30 +00:00
nobu 9f9201b85d * test/ruby/test_arity.rb (TestArity#err_mess): use assert_raise.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 01:31:43 +00:00
drbrain 724e683e86 * vm_eval.c (check_funcall): Raise ArgumentError if respond_to?
requires more than three arguments. [Bug #6000]
	* test/ruby/test_object.rb (class TestObject):  Test for respond_to?
	  requiring more than three arguments.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 22:12:53 +00:00
marcandre 7316302483 * include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]
* array.c: Use rb_check_arity / rb_error_arity

* class.c: ditto

* enumerator.c: ditto

* eval.c: ditto

* file.c: ditto

* hash.c: ditto

* numeric.c: ditto

* proc.c: ditto

* process.c: ditto

* random.c: ditto

* re.c: ditto

* signal.c: ditto

* string.c: ditto

* struct.c: ditto

* transcode.c: ditto

* vm_eval.c: ditto

* vm_insnhelper.c: ditto & implementation of rb_error_arity

* test/ruby/test_arity.rb: tests for above

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 21:10:34 +00:00
marcandre 35c356ea72 * vm_insnhelper.c: improve number of arguments error in case of
optional parameters (issue #6085)

* include/ruby/intern.h: define UNLIMITED_ARGUMENTS

* test/ruby/test_arity.rb:  test for above

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 21:10:16 +00:00
shugo c8860b504e * enumerator.c (lazy_init_iterator): break when Qundef is returned
to make obj.drop(3).take(2) work properly.

* enumerator.c (lazy_take_while): add Enumerable::Lazy#take_while.

* enumerator.c (lazy_drop): add Enumerable::Lazy#drop.

* enumerator.c (lazy_drop_while): add Enumerable::Lazy#drop_while.

* enumerator.c (InitVM_Enumerator): add Enumerable::Lazy#force as an
  alias of to_a.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 13:04:18 +00:00
shugo 0b35e9e5dd * enumerator.c (lazy_take): add Enumerable::Lazy#take.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 10:29:25 +00:00
usa 005953a17b * test/test_tmpdir.rb (TestTmpdir#test_world_writable): skip on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 07:42:30 +00:00
marcandre 4c2e2d8bde * numeric.c: fix flodivmod for cornercases [Bug #6044]
add ruby_float_mod

* insns.def (opt_mod): use ruby_float_mod

* internal.h: declare ruby_float_mod

* test/ruby/test_float.rb: tests for above

* test/ruby/envutil.rb: create helper assert_is_minus_zero

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 06:10:01 +00:00
nobu 4bce9fc7bd more GCable
* test/test_weakref.rb (make_weakref): more GCable, probably.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 02:29:48 +00:00
nobu cb1d290886 * enumerator.c (lazy_grep_func): should use === instead of =~, as
well as Enumerable#grep

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 01:44:37 +00:00
nobu 8cdfe403d3 Init_Enumerator
* enumerator.c (Init_Enumerator): initialize method IDs first.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 01:35:09 +00:00
shugo 6b4525912b * enumerator.c (lazy_zip_func): use each for non-Array objects.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13 23:16:37 +00:00
shugo 22434473c7 * enumerator.c (lazy_zip): add Enumerable::Lazy#flat_map.
* enumerator.c (lazy_lazy): just returns self.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13 23:08:15 +00:00
nobu 8fe3fb4c0f * compile.c (iseq_set_arguments): keyword rest arg without keyword args.
* node.c (dump_node): dump kw_rest_arg too.
* parse.y (block_param, f_arg): more kwrest patterns.
  [ruby-core:42455][Bug #5989]
* parse.y (new_args_gen): no extra kw_rest_arg if no keyword rest arg.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13 13:00:17 +00:00
nobu d6a977f667 * parse.y (block_param, f_args): add rules for the case arguments
begin with kwrest.  [ruby-core:42455][Bug #5989]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13 06:17:08 +00:00
naruse db83618d2c * io.c (io_encoding_set): always warn if external encoding and internal
encoding are identical. [ruby-core:40727] [Bug #5568]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13 04:03:06 +00:00
naruse 272d72efc0 Fix error and show given message and match message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13 04:03:03 +00:00
nobu df058ea0e3 Bug #5350
* gc.c: add ObjectSpace::WeakMap.  [ruby-dev:44565][Bug #5350]
* lib/weakref.rb: use WeakMap instead of _id2ref.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13 03:37:06 +00:00
nobu 826cdd67a0 assert_warn, assert_warning
* test/ruby/envutil.rb (assert_warn): add optional message argument.

* test/ruby/envutil.rb (assert_warning): moved from test_io_m17n.rb

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13 03:34:11 +00:00
naruse 7f199d12e0 Add missing assert_warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12 15:17:27 +00:00
nobu 33ceea5cdb * encoding.c (rb_find_encoding): new function find encoding from
arbitrary object as a pointer to rb_encoding, and return NULL if
  not found.
* io.c (io_encoding_set): just warn unsupported encodings, but not
  exception.  [ruby-core:40726] [Bug #5567]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12 10:23:17 +00:00
nobu a2229db3e8 * vm_method.c (Init_eval_method): copy basic methods to Exception.
[ruby-core:40287][Bug #5473]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12 03:44:40 +00:00
nobu b19f3a8a15 * eval_jump.c (rb_exec_end_proc): remember the latest exit status.
[ruby-core:43173][Bug #5218]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12 01:13:40 +00:00
naruse 90b7ddb89f Exclude json/add/complex.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12 00:32:16 +00:00
nobu bcb9e567c4 * lib/tmpdir.rb (Dir.tmpdir): should not use world-writable but
non-sticky directory.
* lib/tmpdir.rb (Dir.mktmpdir): check the parent directory.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-11 22:19:06 +00:00
nobu b87f2fe1e4 * random.c (random_s_rand): ensure default PRNG is re-initialized
after fork.  patched by Eric Wong.  [ruby-core:41209][Bug #5661]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-11 22:03:36 +00:00
naruse b7df3e9f4e * pack.c (pack_unpack): when unpack('M') occurs an illegal byte
sequence, output the "=" character and the following character in
  the decoded data without any transformation.
  [ruby-dev:44875] [Bug #5635]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-11 14:59:42 +00:00
naruse 4d8d3184d1 * ext/json: Merge 164a75c8bd2007d32c4d7665d53140d8fc126dcd.
[ruby-core:41917] [Bug #5846]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-11 13:36:06 +00:00
nobu a73d958c33 * st.c: add st_foreach_check for fixing iteration over packed table
and st_delete_safe.  patched by Sokolov Yura at
  https://github.com/ruby/ruby/pull/84


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-10 14:52:19 +00:00
nobu efae619458 * st.c: fix packed num_entries on delete_safe. patched by Sokolov
Yura at https://github.com/ruby/ruby/pull/84


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-10 14:52:06 +00:00