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

1699 Коммитов

Автор SHA1 Сообщение Дата
akr db6ec3105e * include/ruby/encoding.h (rb_econv_result_t): enumeration constant:
econv_incomplete_input. 

* io.c (finish_writeconv): check econv_incomplete_input.

* transcode.c (transcode_restartable0): return econv_incomplete_input
  for unexpected end of source buffer.
  (trans_sweep): check econv_incomplete_input.
  (rb_trans_conv): ditto.
  (rb_econv_convert0): ditto.
  (rb_econv_convert): ditto.
  (transcode_loop): ditto.
  (make_econv_exception): change message for econv_incomplete_input.
  (econv_result_to_symbol): return :incomplete_input for
  econv_incomplete_input.
  (ecerr_incomplete_input): new method.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26 16:09:29 +00:00
akr 19ab08653e * transcode.c (rb_econv_open): disable newline conversion for ASCII
incompatible encodings.
  (str_transcode0): don't need disable newline conversion here.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26 12:55:14 +00:00
knu 2e24863549 * test/ruby/test_enum.rb (TestEnumerable#test_each_with_object):
Add a test for Enumerable#each_with_object.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26 10:28:57 +00:00
knu 0924bcf835 * test/ruby/test_enumerator.rb (TestEnumerator#test_with_object):
Add (back) the test for Enumerable#with_object.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26 10:26:45 +00:00
naruse 990ffbb96a * test/cgi/test_cgi_tag_helper.rb: add more tests for html3.
Patch by Takeyuki Fujioka. [ruby-dev:35975]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26 07:18:35 +00:00
knu cb32985d03 * enumerator.c (enumerator_initialize),
test/ruby/test_enumerator.rb: Add an ability to generate an
  enumerator from a block. [experimental] [ruby-dev:35903]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26 05:42:12 +00:00
duerst c5e46ef397 * test/ruby/test_transcode.rb: added test_euc_jp
(contributed by Yoshihiro Kambayashi)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26 04:26:00 +00:00
naruse 8ec7dce8c5 * test/cgi/test_cgi_tag_helper.rb: added by Takeyuki Fujioka.
[ruby-dev:35971]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26 02:55:43 +00:00
akr 86154f63b3 * transcode.c (make_econv_exception): show readagain part for invalid
byte sequence exception.  store the part as an instance variable.
  (ecerr_readagain_bytes): new method to access the readagain part.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25 15:26:54 +00:00
mame bc3c178509 * test/ruby/test_thread.rb (test_status_and_stop_p): reduce the risk
of race condition.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25 13:46:34 +00:00
mame 4da80c7d6b * test/ruby/test_io.rb (test_dup): fix typo. see [ruby-dev:35958]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25 13:32:59 +00:00
akr aeffc67dbb * transcode.c (rb_econv_open_by_transcoder_entries): initialize
last_error.  num_trans may be zero.
  (rb_econv_convert0): num_trans may be zero.
  (rb_econv_putbackable): ditto.
  (rb_econv_putback): ditto.
  (rb_econv_convert): input_ptr and output_ptr may be NULL.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25 13:04:16 +00:00
akr 329729da55 * io.c (rb_io_init_copy): copy encs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 10:40:37 +00:00
akr 071319fde1 * io.c (rb_io_s_pipe): accept optional hash.
(rb_io_set_encoding): ditto.
  (rb_io_extract_modeenc): use rb_econv_opts to initialize
  ecopts.
  (rb_file_open_generic): ditto.
  (rb_file_open_internal): ditto.
  (io_encoding_set): new argument: opt.
  (argf_set_encoding): copy fptr->encs.opts to argf_ecopts.

* transcode.c (rb_econv_opts): accept Qnil for initialization.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 09:40:31 +00:00
akr c6d291b003 * include/ruby/encoding.h (rb_str_transcode): add ecflags argument.
* transcode.c (econv_opts): extracted from str_transcode.
  (str_transcode_enc_args): extracted from str_transcode.
  (str_transcode0): extracted from str_transcode.
  (str_transcode): use econv_opts, str_transcode_enc_args,
  str_transcode0.
  (rb_str_transcode): call str_transcode0.
  (econv_primitive_insert_output): give the additional argument for
  rb_str_transcode.

* io.c (make_writeconv): use invalid/undef flags.
  (io_fwrite): ditto.
  (rb_scan_open_args): give the additional argument for
  rb_str_transcode.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 06:25:24 +00:00
akr 8f9ed3c464 * include/ruby/encoding.h (rb_econv_open_exc): declared.
* transcode.c (rb_eNoConverter): new exception.
  (rb_econv_open_exc): new function.
  (transcode_loop): use rb_econv_open_exc.

* io.c (make_writeconv): use rb_econv_open_exc.
  (make_readconv): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 02:42:37 +00:00
kazu 8aaf39ce80 * test/ruby/test_process.rb (TestProcess#test_rlimit_value): add Errno::EINVAL. [ruby-dev:35900]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 11:04:54 +00:00
akr 2b78afebc7 * include/ruby/io.h (FMODE_INVALID_MASK): defined.
(FMODE_INVALID_IGNORE): defined.
  (FMODE_INVALID_REPLACE): defined.
  (FMODE_UNDEF_MASK): defined.
  (FMODE_UNDEF_IGNORE): defined.
  (FMODE_UNDEF_REPLACE): defined.

* io.c (sym_invalid): defined.
  (sym_undef): defined.
  (sym_ignore): defined.
  (sym_replace): defined.
  (make_readconv): specify ECONV_INVALID_* and ECONV_UNDEF_* if
  FMODE_INVALID_* and FMODE_UNDEF_* is set.
  (rb_io_extract_modeenc): check {:invalid, :undef} => {:replace,
  :ignore} for FMODE_INVALID_* and FMODE_UNDEF_*.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 08:41:02 +00:00
akr d4fabf0e36 * include/ruby/encoding.h (ECONV_INVALID_MASK): defined.
(ECONV_INVALID_IGNORE): defined.
  (ECONV_INVALID_REPLACE): defined.
  (ECONV_UNDEF_MASK): defined.
  (ECONV_UNDEF_IGNORE): defined.
  (ECONV_UNDEF_REPLACE): defined.

* transcode.c (INVALID_IGNORE): removed.
  (INVALID_REPLACE): removed.
  (UNDEF_IGNORE): removed.
  (UNDEF_REPLACE): removed.
  (rb_econv_convert0): renamed from rb_econv_convert.
  (rb_econv_convert): defined to call rb_econv_convert0 with
  replace/ignore behavior moved from transcode_loop.
  (transcode_loop): replace/ignore behavior removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 06:02:58 +00:00
akr 860c233103 * io.c (rb_io_extract_modeenc): check :textmode and :binmode in option
hash.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 02:23:42 +00:00
akr c0d3881e0e * include/ruby/io.h (FMODE_TEXTMODE): defined.
* include/ruby/encoding.h (rb_econv_t): new field: flags.
  (rb_econv_binmode): declared.

* io.c (io_unread): text mode hack removed.
  (NEED_NEWLINE_DECODER): defined.
  (NEED_NEWLINE_ENCODER): defined.
  (NEED_READCONV): defined.
  (NEED_WRITECONV): defined.
  (TEXTMODE_NEWLINE_ENCODER): defined for windows.
  (make_writeconv): setup converter with TEXTMODE_NEWLINE_ENCODER for
  text mode.
  (io_fwrite): use NEED_WRITECONV.  character code conversion is
  disabled if fptr->writeconv_stateless is nil.
  (make_readconv): setup converter with
  ECONV_UNIVERSAL_NEWLINE_DECODER for text mode.
  (read_all): use NEED_READCONV.
  (appendline): use NEED_READCONV.
  (rb_io_getline_1): use NEED_READCONV.
  (io_getc): use NEED_READCONV.
  (rb_io_ungetc): use NEED_READCONV.
  (rb_io_binmode): OS-level text mode test removed.  call
  rb_econv_binmode.
  (rb_io_binmode_m): call rb_io_binmode_m with write_io as well.
  (rb_io_flags_mode): return mode string including "t".
  (rb_io_mode_flags): detect "t" for text mode.
  (rb_sysopen): always specify O_BINARY.

* transcode.c (rb_econv_open_by_transcoder_entries): initialize flags.
  (rb_econv_open): if source and destination encoding is
  both empty string, open newline converter.  last_tc will be NULL in
  this case.
  (rb_econv_encoding_to_insert_output): last_tc may be NULL now.
  (rb_econv_string): ditto.
  (output_replacement_character): ditto.
  (transcode_loop): ditto.
  (econv_init): ditto.
  (econv_inspect): ditto.
  (rb_econv_binmode): new function.




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 16:44:00 +00:00
tadf 8f40b26581 * complex.c (nucomp_div): now behaves as quo.
* complex.c (nucomp_s_generic_p): has been removed.

	* complex.c (nucomp_to_s): adopts new form.

	* complex.c (nucomp_inspect): ditto.

	* complex.c (string_to_c_internal): ditto and supports polar form.

	* complex.c (rb_complex_polar): new.

	* rational.c (nurat_to_s): did not canonicalize.
	
	* rational.c (nurat_inspect): adopts new form.
	
	* rational.c (string_to_r_internal): ditto.

	* include/ruby/intern.h: added a declaration.

	* lib/complex.rb: added an obsolate class method.

	* lib/cmath.rb: use scalar? instead of generic?.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 12:27:54 +00:00
kazu 2d302dfd40 * lib/webrick/server.rb (WEBrick::GenericServer#shutdown):
rescue Errno::ENOTCONN and close. [ruby-dev:35896]

* test/openssl/test_ssl.rb (OpenSSL#start_server): ditto.
  [ruby-dev:35897]

* lib/net/imap.rb (Net::IMAP#disconnect): ditto. [ruby-dev:35898]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 11:12:06 +00:00
nobu ce2b7d3a58 * strftime.c (rb_strftime): supported flags and precision for most
conversions.  [ruby-dev:35906]

* lib/date/format.rb (Date#strftime): left-justifies %L and %N.
  [ruby-dev:35909]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 05:28:08 +00:00
duerst 5dd5311fdf * test/ruby/test_transcode.rb: test_shift_jis:
fixed comment strings (see r18291)



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 05:12:33 +00:00
akr dd7cf02eab * io.c (rb_io_initialize): accept hash argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 17:09:56 +00:00
shugo a0cc5b19b7 * strftime.c (rb_strftime): supported %F and %<precision>N.
reverted config.h to ruby.h for Windows.
* test/ruby/test_time.rb (TestTime::test_strftime): added tests
  for %F and %N.
* time.c: documented %F and %N.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 14:57:35 +00:00
kazu 60bc53a161 * test/ruby/test_m17n_comb.rb (TestM17NComb#test_str_crypt): add key and salt to error message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 11:25:12 +00:00
akr cefd28a84f * file.c (rb_stat_inspect): don't raise if self is not initialized.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 10:20:55 +00:00
akr 61acccefb7 * process.c (pst_pid): use rb_attr_get to avoid warning on
Process::Status.allocate.pid.
  (pst_inspect): don't raise if self is not initialized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 10:18:38 +00:00
akr d34079b17a * io.c (io_extract_encoding_option): if internal encoding is not
specified, enc is external encoding.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 10:07:21 +00:00
akr 3f7bed0b80 test O_NOFOLLOW only on FreeBSD and Linux.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 10:04:23 +00:00
shugo 9b4d4a8a48 * strftime.c (rb_strftime): return "UTC" instead of "GMT".
* test/ruby/test_time.rb (test_strftime): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 00:30:28 +00:00
naruse 0cae739f2d * test/iconv/test_option.rb (test_ignore_option): skip if iconv
doesn't have transliterate.

* test/iconv/test_option.rb (test_translit_option): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 23:00:01 +00:00
nobu b9e3f3c129 * lib/scanf.rb (Scanf::FormatSpecifier#initialize): %i should accept
single digit decimal.  [ruby-core:18355]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 21:12:58 +00:00
akr 4a2cd03fbd * io.c (open_key_args): IO.foreach(path, rs, limit) didn't work.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 16:57:46 +00:00
shugo 1fd1e0ac04 * strftime.c: new file.
* common.mk (COMMONOBJS): added strftime.$(OBJEXT).
* time.c (time_strftime): do not use strftime(3).  supported
  %L(millisecond) and %N(nanosecond).
* test/ruby/test_time.rb: added tests for %L and %N.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 15:30:28 +00:00
akr 65370097cd * io.c (rb_io_open_with_args): use rb_open_file instead of rb_io_open.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 11:33:36 +00:00
akr 297f3249d9 mkcdtmpdir doesn't yield a value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-19 20:27:08 +00:00
akr 02f43f1bd9 * io.c (rb_open_file): encoding in mode string was ignored if perm is
specified.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-18 16:33:46 +00:00
akr 93ad576b05 * re.c (rb_reg_inspect): don't raise for uninitialized Regexp.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-18 15:56:38 +00:00
akr febc4b9923 * io.c (rb_io_check_readable): side effect for STDIN removed.
(rb_io_external_encoding): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-18 15:35:21 +00:00
akr 1b821cb4a3 * io.c (io_ungetbyte): renamed from io_ungetc.
(rb_io_ungetbyte): new method.
  (rb_io_ungetc): push back into character buffer if enc2 is set.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-18 14:28:45 +00:00
akr 035d4816c3 * include/ruby/io.h (rb_io_t): new fields: writeconv,
writeconv_stateless and writeconv_initialized.
  (MakeOpenFile): initialize them.

* include/ruby/encoding.h (rb_econv_stateless_encoding): declared.
  (rb_econv_string): declared.

* io.c (make_writeconv): new function.
  (io_fwrite): use econv.
  (make_readconv): fix error message.
  (finish_writeconv): new function.
  (fptr_finalize): call finish_writeconv.
  (clear_writeconv): new function.
  (clear_codeconv): new function to call both clear_readconv and
  clear_writeconv.
  (rb_io_fptr_finalize): call clear_codeconv instead of
  clear_readconv.
  (mode_enc): ditto.
  (io_set_encoding): ditto.
  (argf_next_argv): ditto.
  (io_encoding_set): ditto.

* gc.c (gc_mark_children): mark writeconv_stateless in T_FILE.

* transcode.c (stateless_encoding_i): new function.
  (rb_econv_stateless_encoding): ditto.
  (rb_econv_string): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-18 12:06:42 +00:00
akr 89b4f06a59 * io.c (clear_readconv): extracted from rb_io_fptr_finalize.
(mode_enc): call clear_readconv.
  (io_set_encoding): ditto.
  (argf_next_argv): ditto.
  (io_encoding_set): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-18 08:24:49 +00:00
akr 6f1fe004f7 * io.c (io_shift_crbuf): add strp argument to append into existing
string.
  (read_all): use econv if enc2 is set.
  (io_getc): follow the io_shift_crbuf change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-18 03:13:53 +00:00
akr 815fd8536b * io.c (io_enc_str_converted): new function.
(make_readconv): extracted from io_getc.
  (more_char): ditto.
  (appendline): use econv via make_readconv and more_char for code
  conversion.
  (prepare_getline_args): don't convert record separator.
  (rb_io_getline_1): don't use rb_io_getline_fast if enc2 is set.
  (io_getc): use make_readconv and more_char.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-18 01:40:01 +00:00
akr f072d0464f add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-18 00:41:54 +00:00
akr f3a42261fb * io.c (appendline): appendline cannot check character boundary.
(rb_io_getline_1): relax limit until character boundary.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-17 19:41:39 +00:00
gotoyuzo d4835a2703 * lib/webrick/cgi.rb (WEBrick::CGI::Socket#eof?): added lacked method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-17 17:33:13 +00:00
akr 0ff4061ef7 * io.c (prepare_getline_args): io.gets(10,nil) should cause TypeError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-17 12:54:26 +00:00
akr 128abaede6 * transcode.c (econv_primitive_putback): new method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-17 04:40:59 +00:00
akr 0051d4a077 * include/ruby/encoding.h (rb_econv_putbackable): declared.
(rb_econv_putback): ditto.

* transcode.c (rb_econv_putbackable): implemented.
  (rb_econv_putback): ditto.

* io.c (io_getc): put back bytes if possible.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-17 04:25:56 +00:00
akr 04bbc1df12 * transcode.c (make_econv_exception): add several instance variables
to exception object.
  (ecerr_source_encoding): new method:
  Encoding::ConversionUndefined#source_encoding and 
  Encoding::InvalidByteSequence#source_encoding.
  (ecerr_destination_encoding): new method:
  Encoding::ConversionUndefined#destination_encoding and 
  Encoding::InvalidByteSequence#destination_encoding.
  (econverr_error_char): new method:
  Encoding::ConversionUndefined#error_char.
  (econverr_error_bytes): new method:
  Encoding::ConversionUndefined#error_bytes.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-17 03:05:40 +00:00
naruse 067f704f64 * test/iconv/test_option.rb (test_ignore_option): skip if iconv
doesn't have transliterate.

* test/iconv/test_option.rb (test_translit_option): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-16 23:40:46 +00:00
akr 63daa7c07d * include/ruby/io.h (rb_io_t): new fields: readconv, crbuf, crbuf_off,
crbuf_len, crbuf_capa.
  (MakeOpenFile): initialize them.

* io.c (io_shift_crbuf): new function.
  (io_getc): use econv.
  (rb_io_fptr_finalize): finalize readconv and crbuf.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-16 17:06:35 +00:00
akr 7a0bea4fd3 * include/ruby/encoding.h (rb_econv_t): add fields: in_buf_start,
in_data_start, in_data_end, in_buf_end and last_trans_index.
  (rb_econv_output): removed.
  (rb_econv_insert_output): declared.
  (rb_econv_encoding_to_insert_output): declared.

* enc/trans/newline.trans (rb_universal_newline): stateful_type
  changed.

* transcode.c (transcode_restartable0): initialize inchar_start,
  tc->recognized_len and next_table at beginning of the loop.
  (rb_econv_open_by_transcoder_entries): initialize new fields.
  (rb_econv_open): setup last_trans_index.
  (trans_sweep): last out_buf_start can be non-NULL now.
  (rb_econv_convert): check last out_buf_start and in_buf_start at
  first.
  (rb_econv_output_with_destination_encoding): removed.
  (econv_just_convert): removed.
  (rb_econv_output): removed.
  (econv_primitive_output): method removed.
  (rb_econv_encoding_to_insert_output): new function.
  (allocate_converted_string): new function.
  (rb_econv_insert_output): new function.
  (econv_primitive_insert_output): new method.
  (output_replacement_character): use rb_econv_insert_output.  unused
  arguments removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-16 05:32:42 +00:00
akr c3d0206e04 add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-15 16:41:16 +00:00
akr 3a427c6199 * transcode.c (econv_just_convert): extracted from rb_econv_output.
(rb_econv_output): use econv_just_convert.
  (econv_primitive_output): new method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-15 14:17:11 +00:00
akr 131e194cec * include/ruby/encoding.h (rb_econv_t): new field: last_error.
* transcode.c (rb_trans_conv): new argument: result_position_ptr.
  (rb_econv_convert): fill last_error.
  (econv_result_to_symbol): extracted from econv_primitive_convert.
  (econv_primitive_errinfo): new method.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-15 09:12:56 +00:00
nobu fa9a533d0b * test/ruby/test_settracefunc.rb (test_call, test_class):
RubyVM::FrozenCore is no longer visible.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-15 08:01:17 +00:00
akr e4e2ef3975 add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-15 02:32:47 +00:00
akr 8b04d998ae add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-15 00:27:03 +00:00
akr b9d5d6a137 add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-15 00:18:42 +00:00
akr 520cd6d186 * transcode.c (econv_init): don't create dummy encoding if
rb_econv_open is failed.
  (make_dummy_encoding): new function extracted from make_encoding.
  (make_encoding): removed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-15 00:05:06 +00:00
akr 8eda80ff2c * transcode.c (econv_primitive_convert): set destination_buffer
encoding.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14 16:06:33 +00:00
akr c82aee31b4 * include/ruby/encoding.h (rb_econv_result_t): moved from
transcode_data.h.
  (rb_econv_elem_t): ditto.
  (rb_econv_t): ditto.  source_encoding and destination_encoding field
  is added.
  (rb_econv_open): declared.
  (rb_econv_convert): ditto.
  (rb_econv_close): ditto.

* transcode.c (rb_econv_open_by_transcoder_entries): initialize
  source_encoding and destination_encoding field as NULL.
  (rb_econv_open): make it external linkage.
  (rb_econv_close): ditto.
  (rb_econv_convert): ditto.  renamed from rb_econv_conv.
  (make_encoding): new function.
  (econv_init): use make_encoding and store rb_encoding* in
  rb_econv_t.
  (econv_source_encoding): new method
  Encoding::Converter#source_encoding.
  (econv_destination_encoding): new method
  Encoding::Converter#destination_encoding.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14 14:28:10 +00:00
akr a6daaf16b0 * transcode.c (econv_init): accept Encoding object as source_encoding
and destination_encoding.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14 12:35:19 +00:00
akr bd9bd52954 * transcode_data.h (transcode_invalid_byte_sequence): renamed from
transcode_invalid_input.
  (transcode_destination_buffer_full): renamed from transcode_obuf_full.
  (transcode_source_buffer_empty): renamed from transcode_ibuf_empty.
  (rb_econv_result_t): renamed from rb_trans_result_t.
  (rb_econv_elem_t): renamed from rb_trans_elem_t.
  (rb_econv_t): renamed from rb_trans_t.

* transcode.c (UNIVERSAL_NEWLINE_DECODER): renamed from
  UNIVERSAL_NEWLINE.
  (CRLF_NEWLINE_ENCODER): renamed from CRLF_NEWLINE.
  (CR_NEWLINE_ENCODER): renamed from CR_NEWLINE.
  (rb_econv_open): renamed from rb_trans_open.
  (rb_econv_close): renamed from rb_trans_close.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14 11:31:27 +00:00
akr 7db5e184c2 add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14 10:38:41 +00:00
akr a99e6c15b8 * transcode.c (rb_econv_conv): new function. it don't consume input
too much, even for multilevel conversion.
  (transcode_loop): use rb_econv_conv.
  (econv_primitive_convert): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14 06:35:33 +00:00
akr bcae240f19 * transcode_data.h (rb_trans_result_t): new enumeration constant:
transcode_output_followed_by_input.

* transcode.c (OUTPUT_FOLLOWED_BY_INPUT): new flag.
  (transcode_restartable0): suspend when output followed by input if
  OUTPUT_FOLLOWED_BY_INPUT is specified.
  (trans_sweep): check OUTPUT_FOLLOWED_BY_INPUT.
  (rb_trans_conv): support OUTPUT_FOLLOWED_BY_INPUT.
  (econv_primitive_convert): return :output_followed_by_input for
  transcode_output_followed_by_input.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14 06:12:27 +00:00
akr 81be10bd85 test updated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14 00:40:25 +00:00
kazu efdcaba210 * test/ruby/test_file_exhaustive.rb (TestFileExhaustive#setup): set group of tmpdir.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13 17:46:47 +00:00
akr fde26b7d7a * transcode.c (econv_primitive_convert): add output_byteoffset
argument.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13 17:24:42 +00:00
shugo 31ad92b2f3 * test/ruby/test_thread.rb (test_list): call Thread.pass to run t1.
fixed [ruby-core:18264].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13 14:22:48 +00:00
knu d4b7cc796c * golf_prelude.rb, lib/set.rb (TC_Set#test_each),
test/readline/test_readline_history.rb (Readline#test_each__enumerator),
  test/ruby/test_array.rb (TestArray#test_collect),
  test/ruby/test_enumerator.rb (TestEnumerator#test_initialize):
  Enumerable::Enumerator is now called Enumerator.

* lib/rinda/tuplespace.rb (Rinda::TupleBag#initialize): Use
  enum_for instead of hardcoding Enumerable::Enumerator.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13 08:03:30 +00:00
ko1 16612b360b * thread.c, vm_core.h: add manual priority support
using time slice.  if you enable USE_NATIVE_THREAD_PRIORITY
  macro, this mechanism is ignored.  [ruby-dev:33124]
* thread_pthread.c, thread_win32.c: ditto.
* test/ruby/test_thread.rb: fix test parameter.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13 07:53:35 +00:00
shugo f433d710d0 * object.c (rb_obj_untrusted): new method Object#untrusted?.
(rb_obj_untrust): new method Object#untrust.
  (rb_obj_trust): new method Object#trust.
* array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c,
  string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c,
  ruby.c, marshal.c: fixes for Object#untrusted?.
* test/ruby/test_module.rb, test/ruby/test_array.rb,
  test/ruby/test_object.rb, test/ruby/test_string.rb,
  test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for
  Object#untrusted?.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13 07:25:05 +00:00
naruse 55c141c624 * test/ruby/test_m17n.rb: follow EncodingCompatibilityError.
* test/ruby/test_mixed_unicode_escapes.rb: ditto.

* test/ruby/enc/test_utf16.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13 07:14:56 +00:00
akr 4aa251999d * transcode.c (econv_init): make flags argument optional.
(econv_primitive_convert): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13 06:08:56 +00:00
akr a14d5eb09b * enc/trans/newline.trans (rb_crlf_newline): new transcoder.
(rb_cr_newline): new transcoder.

* transcode.c (trans_open_i): one more exra room for input newline
  converter.
  (rb_trans_open): crlf newline and cr newline implemented.
  (Init_transcode): Encoding::Converter::CRLF_NEWLINE and
  Encoding::Converter::LF_NEWLINE defined.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13 05:48:57 +00:00
akr 74a2a7bdbf * enc/trans/newline.trans: new file.
* transcode_data.h (rb_trans_t): add last_tc field.

* transcode.c (UNIVERSAL_NEWLINE): defined.
  (CRLF_NEWLINE): defined.
  (CR_NEWLINE): defined.
  (rb_trans_open_by_transcoder_entries): initialize last_tc.
  (trans_open_i): allocate one more room for newline converter.
  (rb_trans_open): universal newline implemented.
  (more_output_buffer): take max_output argument instead ts.
  (output_replacement_character): take tc argument instead of ts.
  (transcode_loop): use last_tc field.
  (econv_init): add flags argument for rb_trans_open.
  (Init_transcode): Encoding::Converter::UNIVERSAL_NEWLINE defined.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13 05:30:42 +00:00
akr 5501d84ceb * transcode.c (econv_primitive_convert): add output_size argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-12 23:03:46 +00:00
akr 9d4bb3b969 * transcode.c (rb_trans_conv): report last transcode_obuf_full.
(econv_max_output): new method Encoding::Converter#max_output.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-12 22:43:17 +00:00
naruse 85c41f4fbc * error.c (rb_eEncCompatError): add Exception.
* include/ruby/ruby.h: ditto.

* encoding.c (rb_enc_check): use rb_eEncCompatError.

* string.c (rb_enc_cr_str_buf_cat): ditto.

* string.c (rb_str_sub_bang): ditto.

* string.c (rb_str_hex): ditto.

* string.c (rb_str_oct): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-12 18:17:05 +00:00
akr edcd02cb5a * transcode.c (rb_cEncodingConverter): new class Encoding::Converter.
(econv_free): new function.
  (econv_s_allocate): ditto.
  (econv_init): ditto.
  (check_econv): ditto.
  (econv_primitive_convert): new method.
  (Init_transcode): define Encoding::Converter.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-12 14:46:18 +00:00
akr 5ade93542f * transcode_data.h (TRANSCODE_ERROR): removed.
* tool/transcode-tblgen.rb: 8bit byte of ASCII-8BIT is a valid
  (but unique to ASCII-8BIT) character.

* transcode.c (rb_eConversionUndefined): new error.
  (rb_eInvalidByteSequence): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-12 07:20:10 +00:00
kouji fa9ef4bf00 * test/readline/test_readline.rb (TestReadline#test_safe_level_4):
tested Readline.vi_editing_mode? and Readline.emacs_editing_mode?.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-12 06:17:48 +00:00
matz c2e85dfa8f * test/win32ole/test_err_in_callback.rb: do not require 'mkmf'
unless WIN32OLE is defined.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-12 04:35:13 +00:00
akr 61f512a357 add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-11 22:49:15 +00:00
akr 94ca2d94de * transcode_data.h (rb_transcoder): add resetstate_func field for
resetting a state of stateful encoding.

* enc/trans/iso2022.trans (rb_EUC_JP_to_ISO_2022_JP): specify
  finish_eucjp_to_iso2022jp for resetstate_func.

* tool/transcode-tblgen.rb: specify NULL for resetstate_func.

* transcode.c (output_replacement_character): call resetstate_func
  before appending the replacement character.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-11 22:44:23 +00:00
akr 425098de96 * transcode.c (rb_trans_conv): find second last error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-11 21:49:38 +00:00
akr a2901a7c75 * transcode_data.h (rb_trans_result_t): new type.
(rb_trans_elem_t): new type.
  (rb_trans_t): new type.

* transcode.c (transcode_dispatch_cb): removed.
  (transcode_dispatch): removed.
  (rb_transcoding_result_t): moved to rb_trans_result_t in
  transcode_data.h.
  (transcode_restartable0): goto follow_info when FUNsi.
  (rb_transcoding_open): use get_transcoder_entry.
  (rb_trans_open): new function.
  (rb_trans_conv): ditto.
  (rb_trans_close): ditto.
  (trans_open_i): ditto.
  (trans_sweep): ditto.
  (more_output_buffer): take rb_trans_t instead of rb_transcoding as
  an argument.
  (transcode_loop): take from_encoding and to_encoding instead of tr
  as arguments.  use rb_trans_open/rb_trans_conv/rb_trans_close.
  (str_transcode): don't use transcode_dispatch.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-11 15:50:42 +00:00
matz 9295fd4b59 * array.c (rb_ary_sample): rename #choice to #sample. in
addition, sample takes optional argument, a la #first.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-11 10:00:47 +00:00
kouji aa2a222f9c * ext/readline/README.ja: added API document for
Readline.vi_editing_mode? and Readline.emacs_editing_mode?.

* ext/readline/extconf.rb: checked rl_editing_mode variable in
  Readline library.

* ext/readline/readline.c (readline_s_emacs_editing_mode_p): added
  Readline.emacs_editing_mode? method.
  (readline_s_vi_editing_mode_p): added Readline.vi_editing_mode?
  method.
  (Init_readline): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-11 08:31:45 +00:00
kouji 5898c07466 * test/readline/test_readline.rb: added test for Readline's class
methods.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-11 07:58:02 +00:00
akr 94342f89f9 add several tests for UTF-32LE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-08 16:12:03 +00:00
akr 2833d9f95d * transcode_data.h (rb_transcoder): from_unit_length field added.
from_utf8 field removed.

* tool/transcode-tblgen.rb: generate offsets range.
  follow rb_transcoder change.

* transcode.c (transcode_loop): don't use from_utf8.
  make invalid region from_unit_length wise.

* enc/trans/iso2022.erb.c: follow rb_transcoder and 
  transcode_generate_node change.

* enc/trans/utf_16_32.erb.c: follow rb_transcoder and
  transcode_generate_node change.
  explicit :invalid map removed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-08 15:48:17 +00:00
akr 1504652373 * transcode_data.h (rb_transcoding): new field "stateful".
(rb_transcoder): preprocessor and postprocessor field removed.
  change arguments of func_ii, func_si, func_io and func_so.
  new field "finish_func".

* tool/transcode-tblgen.rb: make FUNii, FUNsi and FUNio
  generatable.

* transcode.c (transcoder_lib_table): removed.
  (transcoder_table): change structure.
  (transcoder_key): removed because the above structure change.
  (make_transcoder_entry): new function.
  (get_transcoder_entry): ditto.
  (rb_register_transcoder): follow the structure change.
  (declare_transcoder): ditto.
  (transcode_search_path): new function for breadth first search to
  find a list of converters.
  (transcode_search_path_i): new function.
  (transcode_dispatch_cb): ditto.
  (transcode_dispatch): use transcode_search_path.
  (transcode_loop): follow the argument change.
  (str_transcode): preprocessor and postprocessor stuff removed.

* enc/trans/iso2022.erb.c: new file.  ISO-2022-JP conversion
  re-implemented.

* enc/trans/japanese.erb.c: ISO-2022-JP stuff removed.

nute(23:52:53)% head -40 ChangeLog
Thu Aug  7 23:43:11 2008  Tanaka Akira  <akr@fsij.org>

* transcode_data.h (rb_transcoding): new field "stateful".
  (rb_transcoder): preprocessor and postprocessor field removed.
  change arguments of func_ii, func_si, func_io and func_so.
  new field "finish_func".

* tool/transcode-tblgen.rb: make FUNii, FUNsi and FUNio
  generatable.

* transcode.c (transcoder_lib_table): removed.
  (transcoder_table): change structure.
  (transcoder_key): removed because the above structure change.
  (make_transcoder_entry): new function.
  (get_transcoder_entry): ditto.
  (rb_register_transcoder): follow the structure change.
  (declare_transcoder): ditto.
  (transcode_search_path): new function for breadth first search to
  find a list of converters.
  (transcode_search_path_i): new function.
  (transcode_dispatch_cb): ditto.
  (transcode_dispatch): use transcode_search_path.
  (transcode_loop): follow the argument change.
  (str_transcode): preprocessor and postprocessor stuff removed.

* enc/trans/iso2022.erb.c: new file.  ISO-2022-JP conversion
  re-implemented.

* enc/trans/japanese.erb.c: ISO-2022-JP stuff removed.

* enc/trans/utf_16_32.erb.c: follow argument change of FUNso.

[ruby-dev:35798]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-07 14:53:30 +00:00
naruse 99e1e0f208 add comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-06 21:37:41 +00:00
naruse 38751ad9ae * test/ruby/process.rb (test_popen_fork): skip a test which is
freeze in FreeBSD.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-06 21:33:24 +00:00
akr 45428f2257 add tests for [ruby-dev:35726] and [ruby-dev:35709].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-06 11:43:37 +00:00
kazu 81577c26ee * test/io/nonblock/test_flush.rb (TestIONonblock#test_flush):
rescue some exceptions. [ruby-dev:35638]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-05 09:04:13 +00:00
suke e231d67ee1 * ext/win32ole/win32ole.c (hash2named_arg): refactoring.
* ext/win32ole/win32ole.c (ole_invoke, fole_respond_to, ev_on_event,
  fev_off_event): accepts Symbol argument.

* test/win32ole/test_win32ole.rb: ditto.

* test/win32ole/test_win32ole_event.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-03 10:43:44 +00:00
suke 9b47469a25 * test/win32ole/test_err_in_callback.rb: remove temporary files.
some refactoring.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-02 13:59:43 +00:00
kouji 7eb66d1c7b * ext/readline/extconf.rb: checked to have clear_history in
readline library.
* ext/readline/readline.c (hist_get, hist_each, Init_readline): 
  The offset specified for the argument of history_get() might be
  different in GNU Readline and libedit. If use libedit, it was
  corrected that the computational method of the offset specified
  for the argument of history_get() when the Readline module was
  initialized was decided.
  (hist_get, hist_set): If use libedit, accesses first an input
  content in history when specifies the negative offset for the
  argument of history_get() or replace_history_entry(). Then
  checks the offset is negative in ruby.
  (rb_remove_history): When compiling, it corrects it to warning
  when libedit is used.
  (hist_clear, Init_readline): added Readline::HISTORY.clear
  method. [ruby-dev:35551]
* test/readline/test_readline_history.rb: added unit test for
  Readline::HISTORY.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-01 15:04:37 +00:00
mame 8a43d16272 * test/sdbm/test_sdbm.rb: add some tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-01 12:50:17 +00:00
yugui 20486a7f64 * parse.y (parser_yylex): removed an useless conditional, and magic
comment are ignored unless at the first of line.

* test/ruby/test_m17n.rb (test_magic_comment_vim): added.

* test/ruby/test_m17n.rb (test_magic_comment_at_variaous_positions):
  added.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-01 09:38:50 +00:00
naruse 00aef398d0 * transcode.c (output_replacement_character):
rename from _get_replacement_character.

* transcode.c (output_replacement_character):
  fix replacement on UTF-32{BE,LE}. [ruby-dev:35705]

* transcode.c (transcode_loop): ditto.

* test/ruby/test_transcode.rb (test_invalid_replace):
  add for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-31 20:35:35 +00:00
naruse a4077a65de * test/ruby/test_transcode.rb (test_unicode_public_review_issue_121):
fix option1 and 3.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-31 11:08:04 +00:00
naruse 931ba3f3b7 * transcode.c (get_replacement_character): use U+FFFD as replacement
character when convert to Unicode.

* test/ruby/test_transcode.rb (test_unicode_public_review_issue_121):
  rename from test_public_review_issue_121.

* test/ruby/test_transcode.rb (test_unicode_public_review_issue_121):
  enable option2.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-31 10:59:39 +00:00
naruse 31a0672306 * test/rubygems/test_gem_ext_configure_builder.rb
(test_self_build_fail): remove extra newline.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-31 07:39:41 +00:00
duerst 0469c8d95b test/ruby/test_transcode.rb: added test_shift_jis
(contributed by Yoshihiro Kambayashi) and
  test_public_review_issue_121
  (see http://www.unicode.org/review/pr-121.html)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-31 06:12:13 +00:00
nobu 807fcf9d13 * win32/win32.c (rb_w32_select): recalc the rest of timeout for each
iterations.  [ruby-core:18015]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-30 08:48:31 +00:00
mame be9994a03a * io.c (io_ungetc): raise NotImplementedError when ungetc is called
against dummy encoding IO.

* io.c (rb_io_getline_1): ditto when gets with delimiter is called.

* io.c (io_getc): ditto when getc is called.

* test/ruby/test_io_m17n.rb (test_terminator_stateful_conversion,
  test_getc_stateful_conversion, test_ungetc_stateful_conversion):
  these tests should raise NotImplementedError.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-29 14:38:44 +00:00
mame d866ba69a1 * test/ruby/test_io.rb (pipe): run reader thread and writer thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-29 13:56:24 +00:00
mame 8da30b8928 * test/etc/test_etc.rb (test_passwd): age field may be string under
some environments.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-29 12:36:28 +00:00
naruse f783b8d204 * test/etc/test_etc.rb (test_getpwuid): fix for users whose uid is
shared.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-29 04:21:32 +00:00
naruse 78b5fdd5a8 * math.c (math_atanh): raise EDOM on FreeBSD when atanh(1).
* math.c (math_log): ditto.

* math.c (math_log2): ditto.

* math.c (math_log10): ditto.

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-28 17:42:32 +00:00
kou bac3ea1fca * test/rss/: use PNG instead of zlib as binary data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-28 12:33:44 +00:00
mame 517fd61e14 * test/ruby/test_require.rb (test_require_too_long_filename):
Kernel#require does not use dln_find_file_r (at r18242).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-28 12:00:43 +00:00
mame 787cde7f9a * test/openssl/test_ssl.rb (server_loop): rescue Errno::EINVAL and
Errno::ECONNABORTED.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-27 14:33:05 +00:00
seki 0098caf510 merged from 1.8
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-27 00:04:38 +00:00
suke 2e400ad1b8 * ext/win32ole/win32ole.c (Init_win32ole): add
WIN32OLE_EVENT#handler=, WIN32OLE_EVENT#handler

* test/win32ole/test_win32ole_event.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-26 12:27:57 +00:00
nobu 0841c2e67b svn:eol-style LF
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-25 14:49:53 +00:00
mame 65aa393ae7 * test/ruby/enc/test_koi8.rb: move from test/ruby/test_koi8.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-25 12:56:36 +00:00
suke 87f80a7dd7 * test/win32ole/err_in_callback.rb : add test of raising
exception in WIN32OLE_EVENT callback.

* test/win32ole/test_err_in_callback.rb : ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-25 11:59:53 +00:00
suke 4aec73e1ed * ext/win32ole/win32ole.c (Init_win32ole): add
WIN32OLE_EVENT#off_event.

* test/win32ole/test_win32ole_event.rb: ditto.
	
* test/win32ole/test_win32ole_event.rb: some refactoring.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-25 11:49:28 +00:00
duerst 3e53486295 * test/ruby/test_transcode.rb: refactoring/cleanup of
test_iso_2022_jp(_1)



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-25 01:01:38 +00:00
mame a0895f84b0 * test/socket/test_tcp.rb (test_recvfrom): replace an irrelevant test
for old behavior.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-23 14:25:32 +00:00
mame ae7e148256 * test/ruby/test_marshal.rb: suppress warning during test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-23 12:38:49 +00:00
mame ec6c4abdba * test/ruby/test_dir.rb: suppress warning during test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-23 12:36:24 +00:00
kazu 4c3799ec1d * test/zlib/test_zlib.rb (TestZlibDeflate#test_params): suppress a finalizer warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-23 01:09:50 +00:00
mame 08bbb08c5f * test/rdoc/test_rdoc_parser_ruby.rb (teardown): close tempfile.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22 11:34:23 +00:00
duerst ba3fe885d5 * test/ruby/test_transcode.rb: added two comments
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22 10:39:30 +00:00
kazu 784ddb80d2 * test/ruby/test_dir.rb: use realpath of tmpdir. [ruby-dev:35481]
* test/ruby/test_process.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22 02:17:15 +00:00
drbrain cd9e9c6deb Update to RDoc 2.1.0 r112
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-21 18:35:14 +00:00
nobu 16ab763b1f * compile.c (iseq_compile_each): NODE_POSTEXE should set each end
procs only once.  [ruby-dev:35596]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-20 13:50:14 +00:00
drbrain 71b4ecb3d3 Import RDoc r104. Various test fixes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-18 21:10:47 +00:00
drbrain fd25f74d64 Import RDoc r101.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-18 00:46:16 +00:00
mame 0af4a490b4 * test/rdoc/test_rdoc_c_parser.rb (teardown): close tempfile.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-17 14:46:15 +00:00
mame d80a9afb18 * test/ruby/test_process.rb (test_getpriority, test_setpriority): use
PRIO_PROCESS instead of PRIO_USER.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-17 12:09:21 +00:00
nobu c60b57ade0 * test/ruby/enc: moved tests for particular encodings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-16 19:33:15 +00:00
nobu aba40d1a38 * test/ruby/test_signal.rb (test_trap): string commands are allowed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-16 19:12:41 +00:00
mame eafe85f603 * test/ruby/envutil.rb (Test::Unit::Assertions#assert_in_out_err): new
method.

* test/ruby/test_argf.rb: use assert_in_out_err instead of
  EnvUtil.rubyexec.

* test/ruby/test_module.rb: ditto.

* test/ruby/test_require.rb: ditto.

* test/ruby/test_objectspace.rb: ditto.

* test/ruby/test_object.rb: ditto.

* test/ruby/test_string.rb: ditto.

* test/ruby/test_method.rb: ditto.

* test/ruby/test_variable.rb: ditto.

* test/ruby/test_io.rb: ditto.

* test/ruby/test_rubyoptions.rb: ditto.

* test/ruby/test_exception.rb: ditto.

* test/ruby/test_class.rb: ditto.

* test/ruby/test_thread.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-15 15:26:04 +00:00
suke 598fdcb730 * test/win32ole/test_win32ole_event.rb (teardown): fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-14 11:38:09 +00:00
kazu ae87557916 * test/ruby/test_time.rb (TestTime#test_time_interval): add timeout
to avoid stopping tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-14 08:40:17 +00:00
kazu 641d6ece1e * test/ruby/test_variable.rb (TestVariable#test_global_variable_0): add test of $0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-14 06:17:36 +00:00
suke 6e0ed5570e * ext/win32ole/win32ole.c (EVENTSINK_Invoke): using hash
to set value to the reference argument of event.

* test/win32ole/test_win32ole_event.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-13 12:36:26 +00:00
suke 6c62eafc7c * test/win32ole/test_win32ole_event.rb: add test
for WIN32OLE_EVENT#on_event_with_outargs

* test/win32ole/test_win32ole_event.rb(teardown): calling 
  WIN32OLE_EVENT.message_loop


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-12 00:31:32 +00:00
mame dfd0d6a5ca * test/zlib/test_zlib.rb: add a test for Zlib::Deflate#params.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-11 14:06:19 +00:00
suke 4f1b06aabd * test/win32ole/test_win32ole_typelib.rb: add some illegal argument test.
* test/win32ole/test_win32ole_type.rb: ditto.

* test/win32ole/test_win32ole_event.rb: ditto.

* test/win32ole/test_win32ole_param.rb: ditto. 
	
* test/win32ole/test_win32ole_method.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-10 12:22:16 +00:00
wanabe 86714f5b16 * test/ruby/envutil.rb (assert_normal_exit): r17993 revert.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-10 10:45:51 +00:00
wanabe 2026580dc2 * test/ruby/envutil.rb (assert_normal_exit): finish writing script
before spawn("ruby") to avoid blocking in win32.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-10 09:31:03 +00:00
nobu 6e0b5f40cc * string.c (rb_str_succ): alphabets or numerics mutually enclosing
non-alphanumeric characters can carry up.  e.g., "1.999".succ should
  be "2.000".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-08 16:38:40 +00:00
suke 4857543691 * ext/win32ole/win32ole.c (find_default_source): bug fix when
OLE object does not have default source interface.

* test/win32ole/test_win32ole_event.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-08 14:05:38 +00:00
suke 6c32d10c01 * ext/win32ole/win32ole.c (find_default_source): try to
find COCLASS when WIN32OLE object is not COCLASS. 

* test/win32ole/test_win32ole_event.rb: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-08 11:13:09 +00:00
nobu f10c88827e * string.c (rb_str_succ): limit carrying in an alphanumeric region if
exists.  [ruby-dev:35094]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-07 15:23:01 +00:00
suke 6aff4b8eaa * ext/win32ole/win32ole.c(Init_win32ole): add
WIN32OLE_TYPE#source_ole_types, WIN32OLE_TYPE#default_ole_types,
  WIN32OLE_TYPE#default_event_sources.

* test/win32ole/test_win32ole_type.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-07 11:49:14 +00:00
naruse 1d6e2caf10 * test/ruby/test_dir.rb (test_chroot_nodir): add Errno::EPERM.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-07 10:46:13 +00:00
suke 0753c79be2 * test/win32ole/test_win32ole_type.rb (test_initialize): add
more assertions.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-06 09:36:25 +00:00
akr 2ca7298386 test_str_slice! refactored.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-05 12:33:55 +00:00
suke f18120b8a0 * test/win32ole/test_word.rb: check word installed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-05 11:54:06 +00:00
suke 1890ae7aa9 * ext/win32ole/win32ole.c: add WIN32OLE#ole_respond_to?
* test/win32ole/test_win32ole.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-05 01:01:01 +00:00
akr 1a32af4e7a * re.c (unescape_nonascii): add has_property argument not to
raise error by /\p{Hiragana}\u{3042}/ in EUC-JP script.
  (rb_reg_preprocess): use has_property argument to make regexp
  encoding fixed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-04 23:50:33 +00:00
akr 54c984a898 * re.c (unescape_nonascii): make regexp fixed_encoding if \p is used.
fixed [ruby-core:17279].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-04 23:33:04 +00:00
suke 7a05bfaaab * ext/win32ole/win32ole.c (d2time): fix the bug of VT_DATE
to String conversion when negative value.
	  
* test/win32ole/test_win32ole_variant.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-04 14:19:01 +00:00
akr 55b95b0169 new file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-03 12:10:30 +00:00
suke b892e3dd1b * ext/win32ole/win32ole.c: avoid creating Ruby object during
GC. thanks to arton <artonx AT yahoo.co.jp>. [ruby-dev:35313]

* test/win32ole/test_win32ole_event.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-02 15:35:04 +00:00
mame 9e2a51ccb6 * test/ruby/test_settracefunc.rb: fix expected traces for
RubyVM::FrozenCore's event and r17744.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01 18:43:25 +00:00
mame 498324c5d3 * lib/test/unit/ui/console/testrunner.rb: prevent destructive modification to $0.
* test/rubygems/gemutilities.rb (build_rake_in): move from test_gem_ext_rake_builder.rb.

* test/rubygems/test_gem_ext_rake_builder.rb: ditto.

* test/rubygems/test_gem_installer.rb: override Gem.ruby and ENV["rake"].

* test/rubygems/test_gem_uninstaller.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01 12:33:11 +00:00
nobu c274c6fabf * lib/rubygems/ext/builder.rb (Gem::Ext::Builder.make),
(Gem::Ext::Builder.run): EXIT_SUCCESS may be 0 or may not.

* test/rubygems/test_gem_ext_rake_builder.rb (build_rake_in): override
  Gem.ruby and ENV["rake"].

* runruby.rb: bin/rake does not exist in archdir where architecture
  depend script (i.e. rbconfig.rb) exists.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01 06:01:15 +00:00
drbrain 5c8ab4d9c2 RubyGems patches by Yusuke ENDOH [ruby-core:17442], [ruby-core:17444].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-30 18:46:21 +00:00
mame 3ac2c3472a * test/openssl/test_ssl.rb (start_server): shutdown TCPServer before
close.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-30 14:15:48 +00:00
akr 895c7cb3c4 add an assertion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-30 14:05:20 +00:00
mame 32c8d5c411 * test/ruby/test_settracefunc.rb (test_raise): reveal an exception
hided by rescue modifier.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-30 13:58:35 +00:00
mame 4b60da90f9 * test/ruby/test_array.rb (test_aset): access with too big index
raises not ArgumentError but IndexError now.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-30 13:50:18 +00:00
akr cac79cc388 add a test for [ruby-dev:34619].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-30 13:50:13 +00:00
mame 7edda76f15 * test/net/http/test_http.rb (_test_request__file): specify encoding
explicitly.

* test/net/http/utils.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29 18:02:24 +00:00
ko1 9ebf6473eb * vm.c, vm_core.h,vm_core.h, vm_dump.c, iseq.c: rename class name
VM -> RubyVM, and rename rb_cVM -> rb_cRubyVM.
  "VM" is too short name for class.
* test/ruby/test_method.rb, test/ruby/test_settracefunc.rb: ditto.
* include/ruby/ruby.h: rb_cRubyVM, rb_cEnv, rb_cISeq should not be
  exposed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29 17:26:16 +00:00
mame 7fef733b9d * test/ruby/test_parse.rb: remove tests for open_args.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29 16:53:49 +00:00
kou 94031b9628 * lib/rss/maker/base.rb (RSS::Maker::RSSBase#to_feed): raise
exception not return nil if RSS::Maker.make can't get required information.
* test/rss/rss-assertions.rb: follow the above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29 08:42:46 +00:00
kou 7556f66e9c * lib/rss/maker/base.rb (RSS::Maker::RSSBase#make): require block.
* test/rss/test_maker_{0.9,1.0,2.0}.rb: follow the above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29 08:38:11 +00:00
kou b9f895e9c8 * lib/rss/rss.rb, test/rss/test_version.rb (RSS::VERSION): 0.2.4 -> 0.2.5.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29 08:32:10 +00:00
akr ff27b33044 fix test_status_kill for coredump message in Process::Status#inspect.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-28 16:53:56 +00:00
akr 1318dff1a8 add a test for [ruby-dev:34958].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-28 05:15:25 +00:00
akr c8ab5d2dd9 * test/rubygems/test_gem.rb (test_self_path_APPLE_GEM_HOME): don't use
fixed /tmp/apple_gem_home directory.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-28 04:13:08 +00:00
suke dd02419760 * ext/win32ole/win32ole.c : check String encoding when
converting String to VT_BSTR in OLE.

* test/win32ole/test_win32ole.rb : ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-27 23:43:57 +00:00
akr 6e90749f80 * time.c: fix rounding negative float.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-27 16:10:46 +00:00
nobu 4bcf877beb * test/inlinetest.rb (InlineTest.in_progname): workaround for frozen
$0.  [ruby-dev:35261]

* lib/test/unit/ui/console/testrunner.rb (TestRunner#finished): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-27 12:19:11 +00:00
kazu f0bb63782a * lib/erb.rb: adjust line number for magic comment.
* test/erb/test_erb.rb: add tests for def_method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-27 08:48:24 +00:00
drbrain 8b424513fd Upgrade to RubyGems 1.2.0 r1824. Incorporates [ruby-core:17353].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-26 02:06:00 +00:00
usa 5bf133eb50 * test/ruby/test_process.rb (test_exec_wordsplit): on win32, exec'ed process is not child but grandchild.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-24 02:37:51 +00:00
usa b6cab6e8f1 * test_process.rb (test_popen_fork): skip test if fork is not implemented.
* test_process.rb (test_getpriority): skip test if Process::PRIO_USER is not
  defined.

* test_process.rb (test_setpriority): cannot rescue exceptions which raise in
  assert_nothing_raised. check Process:PRIO_USER before test to skip instead.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-24 01:26:54 +00:00
akr 04739ba617 * string.c (rb_memhash): randomize hash to avoid algorithmic
complexity attacks.
  (rb_str_hash): use rb_memhash.

* include/ruby/intern.h (rb_reset_random_seed): declared.

* thread.c (rb_thread_atfork): call rb_reset_random_seed.

* inits.c (rb_call_inits): call Init_RandomSeed at first.

* random.c (seed_initialized): defined.
  (fill_random_seed): extracted from random_seed.
  (make_seed_value): extracted from random_seed.
  (rb_f_rand): initialize random seed at first.
  (initial_seed): defined.
  (Init_RandomSeed): defined.
  (Init_RandomSeed2): defined.
  (rb_reset_random_seed): defined.
  (Init_Random): call Init_RandomSeed2.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-20 02:46:17 +00:00
mame 56dda0e605 * test/testunit/collector/test_dir.rb: r15825 made it unnecessary to change
String to Symbol.

* test/testunit/collector/test_objectspace.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-19 18:20:30 +00:00
drbrain 08837d081d Update to RubyGems 1.1.1 r1784 (pre 1.2)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-19 18:15:26 +00:00
mame 8d4f4e25e5 * test/net/http/test_http.rb: compare encodings of two strings before
comparing themself, which suppress too big error output.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-19 14:49:39 +00:00
ko1 1bc6479a88 * test/ruby/test_enumerator.rb: fix to skip "with_memo" test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-19 02:49:28 +00:00