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

2247 Коммитов

Автор SHA1 Сообщение Дата
naruse e56bf07b16 New API Encoding#ascii_compatible?.
* encoding.c (enc_ascii_compatible_p): added. [ruby-core:24793]
  (Init_Encoding): New API Encoding#ascii_compatible?.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-08 23:25:32 +00:00
nobu ac2557e09f * marshal.c (w_symbol r_symlink, r_symbol, r_object0): fix for
non-ascii symbols.  loading such symbols can cause segfaults in
  older versions.  [ruby-core:24788]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-07 21:18:33 +00:00
nobu f86f669cf3 * test/mkmf/base.rb (TestMkmf): was turned into a class, because
MiniUnit doesn't complain even if a testcase has no tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-06 04:30:15 +00:00
nobu a032b1bdb8 * test/mkmf/base.rb: split from test_sizeof.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-06 04:14:50 +00:00
nobu c6ada1e7e0 * lib/mkmf.rb (check_sizeof): added optional compiler option
argument.  [ruby-core:24785]

* lib/mkmf.rb (create_makefile): suppressed shadowing outer local
  variable warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-06 04:00:38 +00:00
nobu 8bc6c71547 * ruby.c (load_file_internal): assumes -x flag if no "ruby" is in
the shebang line.  [ruby-dev:39015]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-05 10:19:18 +00:00
matz da19797648 * range.c (range_eql, range_eq): fixed equality to work for
subclasses of Range.  a patch from Marc-Andre Lafortune.
   [ruby-core:22190]

* test/ruby/test_range.rb: add assertions for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-05 05:01:12 +00:00
naruse d857a1b0d7 Fix test for previous commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-05 01:40:15 +00:00
mame 528574c2e2 * lib/pp.rb (guard_inspect_key): untrust internal hash to prevent
unexpected SecurityError.

* test/ruby/test_object.rb: add a test for [ruby-dev:38982].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-04 16:44:05 +00:00
nobu a194550e5c * random.c (rb_random_int): arguments have to be converted to
integer.  [ruby-core:24679]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-02 15:32:04 +00:00
mame dfd3d1fb29 * test/ruby/test_rand.rb: add tests for Random#float's rejection
against Infinity and NaN.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-02 08:40:52 +00:00
nobu e626e0bdec * random.c (rand_int): prevent from GC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-02 05:20:51 +00:00
mame 22acf29509 * test/ruby/test_module.rb (test_ancestors, test_included_modules):
ignore rake mixins.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-30 15:57:06 +00:00
mame 045136d475 * test/ruby/test_rand.rb: add tests for Random class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-30 12:57:02 +00:00
duerst 5e85648b77 * transcode.c: added check for frozen string for encode! (see Bug #1836)
* test/ruby/test_transcode.rb: added tests for the above


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-30 09:40:06 +00:00
nobu b8b083dbd5 * insns.def (defineclass): preserve encoding of class/module
names.  [ruby-core:24600]

* variable.c (rb_set_class_path_string): set class path with a
  string value.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-30 07:45:42 +00:00
xibbar 8bc2fb5ba4 add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-30 07:39:09 +00:00
xibbar 1976ef38a7 * lib/cgi/util.rb (CGI::unescape): support encoding option.
* lib/cgi/cookie.rb (CGI::Cookie.parse): fix for the encoded value.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-30 05:34:02 +00:00
ko1 9050b61dcb * proc.c (rb_method_entry_arity): support optimized method (send).
* test/ruby/test_method.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-28 10:41:11 +00:00
nobu 1ac307dddc * lib/rdoc/parser.rb (RDoc::Parser.binary?): fix for empty files.
[ruby-dev:38848]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-27 01:25:01 +00:00
nobu b7f26835da * io.c (argf_eof): go to the next file if called after ARGF.close
or ARGF.skip.  [ruby-core:24561]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-26 10:17:39 +00:00
nobu 00d61f1fe5 * vm_insnhelper.c (vm_call_method): __send__ can call protected
methods.  [ruby-core:24500]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-26 09:30:08 +00:00
nobu c689ee1a89 * io.c (argf_eof): should not have reached EOF before trying to
read.  based on a patch by Heesob Park <phasis AT gmail.com> at
  [ruby-core:24559].  [ruby-core:24557]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-25 08:49:08 +00:00
nobu d6ab828369 * complex.c (nucomp_hash), rational.c (nurat_hash): not to use
hash value of class so that equality against subclasses can
  work.  [ruby-dev:38850]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-25 04:44:36 +00:00
duerst 2886207584 * enc/trans/big5.trans, big5-hkscs-tbl.rb:
new Chinese BIG5-HKSCS transcoding (with Tatsuya Mizuno)

* test/ruby/test_transcode.rb: added tests for the above
  (with Tatsuya Mizuno)

* enc/big5.c: Added BIG5-HKSCS as a replicate encoding of BIG5
  (short term solution, needs more work; with Tatsuya Mizuno)

* tool/transcode-tblgen.rb: made 'pat' directly accessible in
  class StrSet


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-24 10:26:18 +00:00
shugo 9914a16ca9 * lib/net/imap.rb (idle): leaves IDLE in a ensure clause. a patch
from Eric Hodel.
* test/net/imap/test_imap.rb (setup, teardown): turn on
  Socket.do_not_reverse_lookup in tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-24 09:09:04 +00:00
shugo 4676ede3d1 * lib/net/imap.rb (resp_text_code): accepts response codes without
text.  [ruby-core:24194]
* lib/net/imap.rb (idle, idle_done): new methods for the IMAP4 IDLE
  command (RFC 2177).  Thanks, Eric Hodel.
* lib/net/imap.rb (format_date, format_datetime): new method to
  format IMAP-style date/datetime. Thanks, Eric Hodel.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-23 15:20:47 +00:00
matz 7a5d48f6ab * test/ruby/test_module.rb (TestModule#test_alias): warning
message updated.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-22 18:21:32 +00:00
matz 9ce6eb65bb * test/ruby/test_enum.rb (TestEnumerable#each): recursive join now
raises ArgumentError.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-22 17:53:56 +00:00
mame 31c561f66a * vm_core.h (struct rb_iseq_t): add a new field line_no. This field
represents line number from which the original code of the iseq
  starts.  [ruby-dev:38698]

* iseq.c, compile.c: ditto.

* parse.y: line number hack (for Proc#source_location) is no longer
  needed.

* test/ruby/test_settracefunc.rb: line number of set_trace_func is now
  compatible with 1.8's.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-22 13:37:26 +00:00
nobu 2e4ad56fc2 * test/ruby/test_rand.rb (test_big_seed): tests also instance methods.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-21 23:38:23 +00:00
mame 4516f623b8 * random.c (rand_init): array length of random seed was broken, which
causes memory error with srand(2**1000000-1).

* test/ruby/test_rand.c: test for above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-21 14:51:17 +00:00
suke 904abb1d9b * ext/win32ole/win32ole.c (vtdate2rbtime): VT_DATE variant object
is converted to Time object now. 

* test/win32ole/test_win32ole_variant.rb (test_s_new_with_nil,
  test_conversion_time2date, test_conversion_str2date,
  test_conversion_vt_date, test_set_value): ditto.

* ext/win32ole/win32ole.c (rbtime2vtdate): refactoring. 


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-21 07:27:08 +00:00
nobu 5a392c71db * compile.c (compile_dstr_fragments): reduced needless literal.
* parse.y (xstring, regexp, dsym, literal_concat, evstr2dstr):
  literal at the top of dstr is no longer needed if it is empty,
  since concatstrings and toregexp always create new strings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-20 10:01:05 +00:00
akr 666049981f Use UDP for sendmsg/recvmsg tests.
sendmsg/recvmsg doesn't work with SOCK_STREAM on Windows.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-19 08:53:11 +00:00
nobu 2737b90e36 * io.c (io_read): should taint the result. [ruby-dev:38826]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-19 08:32:44 +00:00
nobu 33fc55acef * vm_method.c (me_opts): fixed optimized method aliasing.
[ruby-dev:38824]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-19 02:00:27 +00:00
usa 828d7a368a * test_socket.rb (test_udp_server): cannot check the existance of sendmsg by
respond_to?.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-19 00:48:40 +00:00
akr bdfe1c7f8e fix skip condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-17 22:28:28 +00:00
usa 229b4e4c37 * ext/socket/socket.c (socket_s_ip_address_list): drop inactive
adapters.

	* test/socket/test_{nonblock,addrinfo,socket}.rb: skip some tests on
	  Windows.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-17 13:40:59 +00:00
akr 0101958745 * array.c (recursive_hash): reject recursive key.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-17 07:49:06 +00:00
matz ae487eda6e * array.c (recursive_join): raise ArgumentError for joining
recursive array.

* array.c (ary_join_1): ditto.

* test/ruby/test_array.rb (TestArray#test_join2): test updated for
  recursive join.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-17 02:04:37 +00:00
akr 6dc1fea552 remove test for recursive hash key. [ruby-core:22921]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-17 00:18:34 +00:00
suke 6d7ddc3b29 * test/win32ole/test_win32ole.rb (test_s_codepage_changed,
test_s_locale_set, test_s_locale_change): skip test if Japanese
  locale is not installed. [ruby-core:23806]
	
* test/win32ole/test_win32ole_variant.rb (test_conversion_str2cy):
  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-16 12:06:23 +00:00
nobu 415d5ebc2f * id.c (Init_id), vm.c (vm_exec): @#__ThrowState__ is no longer
used.  [ruby-dev:38760]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-16 09:28:12 +00:00
ko1 b5dd85f049 * vm_method.c (rb_alias): fix a case which try non-existing method alias.
* test/ruby/test_alias.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-16 08:44:23 +00:00
nobu 53163f8138 * io.c (io_reopen): discards read buffer. [ruby-core:24240]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-16 07:00:23 +00:00
nobu eb9bc2d265 * random.c (rb_random_t): objectified. [EXPERIMENTAL]
[ruby-dev:30954]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-16 06:00:35 +00:00
naruse ed55083246 Set tempfile name with literal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-14 19:26:59 +00:00
nobu 9681409e36 * io.c (rb_io_initialize): check if the descriptor can be accessed
in the specified open mode.  [ruby-dev:38571]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-14 07:13:11 +00:00