summaryrefslogtreecommitdiff
path: root/spec/ruby/core/integer/shared/abs.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/integer/shared/abs.rb')
-rw-r--r--spec/ruby/core/integer/shared/abs.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/ruby/core/integer/shared/abs.rb b/spec/ruby/core/integer/shared/abs.rb
new file mode 100644
index 0000000000..43844c9065
--- /dev/null
+++ b/spec/ruby/core/integer/shared/abs.rb
@@ -0,0 +1,18 @@
+describe :integer_abs, shared: true do
+ context "fixnum" do
+ it "returns self's absolute fixnum value" do
+ { 0 => [0, -0, +0], 2 => [2, -2, +2], 100 => [100, -100, +100] }.each do |key, values|
+ values.each do |value|
+ value.send(@method).should == key
+ end
+ end
+ end
+ end
+
+ context "bignum" do
+ it "returns the absolute bignum value" do
+ bignum_value(39).send(@method).should == 18446744073709551655
+ (-bignum_value(18)).send(@method).should == 18446744073709551634
+ end
+ end
+end
class='graph'>
-rw-r--r--COPYING4
-rw-r--r--COPYING.ja72
-rw-r--r--ChangeLog26373
-rw-r--r--GPL39
-rw-r--r--KNOWNBUGS.rb5
-rw-r--r--LEGAL335
-rw-r--r--LGPL504
-rw-r--r--Makefile.in398
-rw-r--r--NEWS454
-rw-r--r--README123
-rw-r--r--README.EXT1381
-rw-r--r--README.EXT.ja1969
-rw-r--r--README.ja224
-rw-r--r--ToDo126
-rw-r--r--addr2line.c649
-rw-r--r--addr2line.h21
-rw-r--r--array.c5507
-rw-r--r--bcc32/Makefile.sub229
-rw-r--r--bcc32/README.bcc3237
-rwxr-xr-xbcc32/configure.bat101
-rwxr-xr-x[-rw-r--r--]bcc32/mkexports.rb39
-rw-r--r--bcc32/setup.mak98
-rw-r--r--benchmark/bm_app_answer.rb15
-rw-r--r--benchmark/bm_app_erb.rb26
-rw-r--r--benchmark/bm_app_factorial.rb11
-rw-r--r--benchmark/bm_app_fib.rb10
-rw-r--r--benchmark/bm_app_mandelbrot.rb23
-rw-r--r--benchmark/bm_app_pentomino.rb259
-rw-r--r--benchmark/bm_app_raise.rb8
-rw-r--r--benchmark/bm_app_strconcat.rb5
-rw-r--r--benchmark/bm_app_tak.rb13
-rw-r--r--benchmark/bm_app_tarai.rb10
-rw-r--r--benchmark/bm_app_uri.rb8
-rw-r--r--benchmark/bm_io_file_create.rb13
-rw-r--r--benchmark/bm_io_file_read.rb15
-rw-r--r--benchmark/bm_io_file_write.rb14
-rw-r--r--benchmark/bm_io_select.rb9
-rw-r--r--benchmark/bm_io_select2.rb22
-rw-r--r--benchmark/bm_io_select3.rb21
-rw-r--r--benchmark/bm_loop_for.rb3
-rw-r--r--benchmark/bm_loop_generator.rb14
-rw-r--r--benchmark/bm_loop_times.rb1
-rw-r--r--benchmark/bm_loop_whileloop.rb4
-rw-r--r--benchmark/bm_loop_whileloop2.rb4
-rw-r--r--benchmark/bm_so_ackermann.rb19
-rw-r--r--benchmark/bm_so_array.rb23
-rw-r--r--benchmark/bm_so_binary_trees.rb57
-rw-r--r--benchmark/bm_so_concatenate.rb18
-rw-r--r--benchmark/bm_so_count_words.rb19
-rw-r--r--benchmark/bm_so_exception.rb61
-rw-r--r--benchmark/bm_so_fannkuch.rb45
-rw-r--r--benchmark/bm_so_fasta.rb81
-rw-r--r--benchmark/bm_so_k_nucleotide.rb48
-rw-r--r--benchmark/bm_so_lists.rb47
-rw-r--r--benchmark/bm_so_mandelbrot.rb57
-rw-r--r--benchmark/bm_so_matrix.rb48
-rw-r--r--benchmark/bm_so_meteor_contest.rb564
-rw-r--r--benchmark/bm_so_nbody.rb148
-rw-r--r--benchmark/bm_so_nested_loop.rb24
-rw-r--r--benchmark/bm_so_nsieve.rb35
-rw-r--r--benchmark/bm_so_nsieve_bits.rb43
-rw-r--r--benchmark/bm_so_object.rb56
-rw-r--r--benchmark/bm_so_partial_sums.rb31
-rw-r--r--benchmark/bm_so_pidigits.rb92
-rw-r--r--benchmark/bm_so_random.rb20
-rw-r--r--benchmark/bm_so_reverse_complement.rb30
-rw-r--r--benchmark/bm_so_sieve.rb24
-rw-r--r--benchmark/bm_so_spectralnorm.rb50
-rw-r--r--benchmark/bm_vm1_attr_ivar.rb14
-rw-r--r--benchmark/bm_vm1_attr_ivar_set.rb14
-rw-r--r--benchmark/bm_vm1_block.rb10
-rw-r--r--benchmark/bm_vm1_const.rb8
-rw-r--r--benchmark/bm_vm1_ensure.rb11
-rw-r--r--benchmark/bm_vm1_float_simple.rb7
-rw-r--r--benchmark/bm_vm1_ivar.rb8
-rw-r--r--benchmark/bm_vm1_ivar_set.rb6
-rw-r--r--benchmark/bm_vm1_length.rb9
-rw-r--r--benchmark/bm_vm1_lvar_init.rb18
-rw-r--r--benchmark/bm_vm1_lvar_set.rb5
-rw-r--r--benchmark/bm_vm1_neq.rb8
-rw-r--r--benchmark/bm_vm1_not.rb7
-rw-r--r--benchmark/bm_vm1_rescue.rb7
-rw-r--r--benchmark/bm_vm1_simplereturn.rb9
-rw-r--r--benchmark/bm_vm1_swap.rb8
-rw-r--r--benchmark/bm_vm1_yield.rb10
-rw-r--r--benchmark/bm_vm2_array.rb5
-rw-r--r--benchmark/bm_vm2_bigarray.rb106
-rw-r--r--benchmark/bm_vm2_bighash.rb5
-rw-r--r--benchmark/bm_vm2_case.rb14
-rw-r--r--benchmark/bm_vm2_defined_method.rb9
-rw-r--r--benchmark/bm_vm2_dstr.rb6
-rw-r--r--benchmark/bm_vm2_eval.rb6
-rw-r--r--benchmark/bm_vm2_method.rb9
-rw-r--r--benchmark/bm_vm2_method_missing.rb12
-rw-r--r--benchmark/bm_vm2_method_with_block.rb9
-rw-r--r--benchmark/bm_vm2_mutex.rb9
-rw-r--r--benchmark/bm_vm2_poly_method.rb20
-rw-r--r--benchmark/bm_vm2_poly_method_ov.rb20
-rw-r--r--benchmark/bm_vm2_proc.rb14
-rw-r--r--benchmark/bm_vm2_raise1.rb18
-rw-r--r--benchmark/bm_vm2_raise2.rb18
-rw-r--r--benchmark/bm_vm2_regexp.rb6
-rw-r--r--benchmark/bm_vm2_send.rb12
-rw-r--r--benchmark/bm_vm2_super.rb20
-rw-r--r--benchmark/bm_vm2_unif1.rb8
-rw-r--r--benchmark/bm_vm2_zsuper.rb20
-rw-r--r--benchmark/bm_vm3_backtrace.rb22
-rw-r--r--benchmark/bm_vm3_clearmethodcache.rb8
-rwxr-xr-xbenchmark/bm_vm3_gc.rb7
-rw-r--r--benchmark/bm_vm_thread_alive_check1.rb6
-rw-r--r--benchmark/bm_vm_thread_create_join.rb6
-rw-r--r--benchmark/bm_vm_thread_mutex1.rb21
-rw-r--r--benchmark/bm_vm_thread_mutex2.rb21
-rw-r--r--benchmark/bm_vm_thread_mutex3.rb20
-rw-r--r--benchmark/bm_vm_thread_pass.rb15
-rw-r--r--benchmark/bm_vm_thread_pass_flood.rb8
-rw-r--r--benchmark/bm_vm_thread_pipe.rb17
-rw-r--r--benchmark/driver.rb301
-rw-r--r--benchmark/make_fasta_output.rb19
-rw-r--r--benchmark/other-lang/ack.pl11
-rw-r--r--benchmark/other-lang/ack.py16
-rw-r--r--benchmark/other-lang/ack.rb12
-rw-r--r--benchmark/other-lang/ack.scm7
-rw-r--r--benchmark/other-lang/eval.rb66
-rw-r--r--benchmark/other-lang/fact.pl13
-rw-r--r--benchmark/other-lang/fact.py18
-rw-r--r--benchmark/other-lang/fact.rb13
-rw-r--r--benchmark/other-lang/fact.scm8
-rw-r--r--benchmark/other-lang/fib.pl11
-rw-r--r--benchmark/other-lang/fib.py7
-rw-r--r--benchmark/other-lang/fib.rb9
-rw-r--r--benchmark/other-lang/fib.scm7
-rw-r--r--benchmark/other-lang/loop.pl3
-rw-r--r--benchmark/other-lang/loop.py2
-rw-r--r--benchmark/other-lang/loop.rb4
-rw-r--r--benchmark/other-lang/loop.scm1
-rw-r--r--benchmark/other-lang/loop2.rb1
-rw-r--r--benchmark/other-lang/tak.pl11
-rw-r--r--benchmark/other-lang/tak.py8
-rw-r--r--benchmark/other-lang/tak.rb13
-rw-r--r--benchmark/other-lang/tak.scm10
-rw-r--r--benchmark/prepare_so_count_words.rb15
-rw-r--r--benchmark/prepare_so_k_nucleotide.rb2
-rw-r--r--benchmark/prepare_so_reverse_complement.rb2
-rw-r--r--benchmark/report.rb79
-rw-r--r--benchmark/run.rb127
-rw-r--r--benchmark/runc.rb27
-rw-r--r--benchmark/wc.input.base25
-rw-r--r--bignum.c3189
-rwxr-xr-xbin/erb72
-rwxr-xr-xbin/gem25
-rwxr-xr-x[-rw-r--r--]bin/irb7
-rwxr-xr-xbin/rake37
-rwxr-xr-x[-rw-r--r--]bin/rdoc81
-rwxr-xr-xbin/ri53
-rwxr-xr-xbin/testrb4
-rw-r--r--bootstraptest/pending.rb39
-rwxr-xr-xbootstraptest/runner.rb480
-rw-r--r--bootstraptest/test_attr.rb36
-rw-r--r--bootstraptest/test_autoload.rb110
-rw-r--r--bootstraptest/test_block.rb599
-rw-r--r--bootstraptest/test_class.rb159
-rw-r--r--bootstraptest/test_eval.rb324
-rw-r--r--bootstraptest/test_exception.rb432
-rw-r--r--bootstraptest/test_finalizer.rb8
-rw-r--r--bootstraptest/test_flip.rb1
-rw-r--r--bootstraptest/test_flow.rb591
-rw-r--r--bootstraptest/test_fork.rb69
-rw-r--r--bootstraptest/test_gc.rb34
-rw-r--r--bootstraptest/test_io.rb112
-rw-r--r--bootstraptest/test_jump.rb308
-rw-r--r--bootstraptest/test_literal.rb226
-rw-r--r--bootstraptest/test_load.rb27
-rw-r--r--bootstraptest/test_marshal.rb5
-rw-r--r--bootstraptest/test_massign.rb183
-rw-r--r--bootstraptest/test_method.rb1264
-rw-r--r--bootstraptest/test_objectspace.rb46
-rw-r--r--bootstraptest/test_proc.rb483
-rw-r--r--bootstraptest/test_struct.rb5
-rw-r--r--bootstraptest/test_syntax.rb902
-rw-r--r--bootstraptest/test_thread.rb456
-rw-r--r--class.c1494
-rw-r--r--common.mk1132
-rw-r--r--compar.c106
-rw-r--r--compile.c5851
-rw-r--r--complex.c2252
-rw-r--r--config.guess1459
-rw-r--r--config.sub1537
-rw-r--r--configure.in3681
-rw-r--r--constant.h36
-rw-r--r--cont.c1566
-rw-r--r--cygwin/GNUmakefile.in67
-rw-r--r--debug.c162
-rw-r--r--defines.h261
-rw-r--r--defs/default_gems5
-rw-r--r--defs/id.def89
-rw-r--r--defs/keywords53
-rw-r--r--defs/known_errors.def145
-rw-r--r--defs/lex.c.src53
-rw-r--r--defs/opt_insn_unif.def29
-rw-r--r--defs/opt_operand.def22
-rw-r--r--dir.c2010
-rw-r--r--distruby.rb59
-rw-r--r--djgpp/GNUmakefile.in2
-rw-r--r--djgpp/README.djgpp21
-rw-r--r--djgpp/config.hin114
-rw-r--r--djgpp/config.sed128
-rwxr-xr-xdjgpp/configure.bat20
-rw-r--r--djgpp/mkver.sed1
-rw-r--r--dln.c854
-rw-r--r--dln.h22
-rw-r--r--dln_find.c312
-rw-r--r--dmydln.c11
-rw-r--r--dmyencoding.c2
-rw-r--r--dmyext.c7
-rw-r--r--dmyversion.c2
-rw-r--r--doc/.document4
-rw-r--r--doc/ChangeLog-1.8.05
-rw-r--r--doc/ChangeLog-1.9.392772
-rw-r--r--doc/ChangeLog-YARV6917
-rw-r--r--doc/NEWS837
-rw-r--r--doc/NEWS-1.8.7650
-rw-r--r--doc/NEWS-1.9.1424
-rw-r--r--doc/NEWS-1.9.2500
-rw-r--r--doc/NEWS-1.9.3305
-rw-r--r--doc/etc.rd.ja75
-rw-r--r--doc/forwardable.rd84
-rw-r--r--doc/forwardable.rd.ja47
-rw-r--r--doc/globals.rdoc61
-rw-r--r--doc/images/boottime-classes.pngbin0 -> 28677 bytes-rw-r--r--doc/irb/irb-tools.rd.ja113
-rw-r--r--doc/irb/irb.rd392
-rw-r--r--doc/irb/irb.rd.ja355
-rw-r--r--doc/pty/README84
-rw-r--r--doc/pty/README.expect (renamed from ext/pty/README.expect)0
-rw-r--r--doc/pty/README.expect.ja21
-rw-r--r--doc/pty/README.ja76
-rw-r--r--doc/rake/CHANGES440
-rw-r--r--doc/rake/README196
-rw-r--r--doc/rake/command_line_usage.rdoc169
-rw-r--r--doc/rake/example/Rakefile138
-rw-r--r--doc/rake/example/Rakefile235
-rw-r--r--doc/rake/example/a.c6
-rw-r--r--doc/rake/example/b.c6
-rw-r--r--doc/rake/example/main.c11
-rw-r--r--doc/rake/glossary.rdoc51
-rw-r--r--doc/rake/jamis.rb591
-rw-r--r--doc/rake/proto_rake.rdoc127
-rw-r--r--doc/rake/rakefile.rdoc557
-rw-r--r--doc/rake/rational.rdoc151
-rw-r--r--doc/rake/release_notes/rake-0.8.7.rdoc55
-rw-r--r--doc/rake/release_notes/rake-0.9.0.rdoc112
-rw-r--r--doc/rake/release_notes/rake-0.9.1.rdoc52
-rw-r--r--doc/rake/release_notes/rake-0.9.2.2.rdoc55
-rw-r--r--doc/rake/release_notes/rake-0.9.2.rdoc49
-rw-r--r--doc/rake/release_notes/rake-0.9.3.rdoc102
-rw-r--r--doc/rake/release_notes/rake-0.9.4.rdoc110
-rw-r--r--doc/rake/release_notes/rake-0.9.5.rdoc114
-rw-r--r--doc/rake/release_notes/rake-0.9.6.rdoc127
-rw-r--r--doc/re.rdoc653
-rw-r--r--doc/rubygems/ChangeLog5689
-rw-r--r--doc/rubygems/History.txt852
-rw-r--r--doc/rubygems/LICENSE.txt53
-rw-r--r--doc/rubygems/README41
-rw-r--r--doc/shell.rd348
-rw-r--r--doc/shell.rd.ja153
-rw-r--r--doc/syntax.rdoc13
-rw-r--r--doc/syntax/exceptions.rdoc79
-rw-r--r--doc/syntax/literals.rdoc295
-rw-r--r--doc/syntax/methods.rdoc223
-rw-r--r--doc/syntax/modules_and_classes.rdoc338
-rw-r--r--enc/Makefile.in81
-rw-r--r--enc/ascii.c96
-rw-r--r--enc/big5.c373
-rw-r--r--enc/cp949.c221
-rw-r--r--enc/depend157
-rw-r--r--enc/emacs_mule.c341
-rw-r--r--enc/encdb.c29
-rw-r--r--enc/encinit.c.erb26
-rw-r--r--enc/euc_jp.c644
-rw-r--r--enc/euc_kr.c194
-rw-r--r--enc/euc_tw.c227
-rw-r--r--enc/gb18030.c603
-rw-r--r--enc/gb2312.c13
-rw-r--r--enc/gbk.c224
-rw-r--r--enc/iso_2022_jp.h47
-rw-r--r--enc/iso_8859_1.c289
-rw-r--r--enc/iso_8859_10.c246
-rw-r--r--enc/iso_8859_11.c113
-rw-r--r--enc/iso_8859_13.c245
-rw-r--r--enc/iso_8859_14.c248
-rw-r--r--enc/iso_8859_15.c242
-rw-r--r--enc/iso_8859_16.c244
-rw-r--r--enc/iso_8859_2.c254
-rw-r--r--enc/iso_8859_3.c242
-rw-r--r--enc/iso_8859_4.c244
-rw-r--r--enc/iso_8859_5.c232
-rw-r--r--enc/iso_8859_6.c109
-rw-r--r--enc/iso_8859_7.c239
-rw-r--r--enc/iso_8859_8.c109
-rw-r--r--enc/iso_8859_9.c245
-rw-r--r--enc/koi8_r.c221
-rw-r--r--enc/koi8_u.c223
-rwxr-xr-xenc/make_encmake.rb136
-rw-r--r--enc/mktable.c1162
-rw-r--r--enc/prelude.rb6
-rw-r--r--enc/shift_jis.c614
-rw-r--r--enc/trans/CP/CP932UDA%UCS.src1912
-rw-r--r--enc/trans/CP/CP932VDC@IBM%UCS.src420
-rw-r--r--enc/trans/CP/CP932VDC@NEC_IBM%UCS.src406
-rw-r--r--enc/trans/CP/UCS%CP932UDA.src1912
-rw-r--r--enc/trans/CP/UCS%CP932VDC@IBM.src420
-rw-r--r--enc/trans/CP/UCS%CP932VDC@NEC_IBM.src406
-rw-r--r--enc/trans/EMOJI/EMOJI_ISO-2022-JP-KDDI%UCS.src658
-rw-r--r--enc/trans/EMOJI/EMOJI_SHIFT_JIS-DOCOMO%UCS.src293
-rw-r--r--enc/trans/EMOJI/EMOJI_SHIFT_JIS-KDDI%UCS.src658
-rw-r--r--enc/trans/EMOJI/EMOJI_SHIFT_JIS-KDDI-UNDOC%UCS.src658
-rw-r--r--enc/trans/EMOJI/EMOJI_SHIFT_JIS-SOFTBANK%UCS.src496
-rw-r--r--enc/trans/EMOJI/UCS%EMOJI_ISO-2022-JP-KDDI-UNDOC.src658
-rw-r--r--enc/trans/EMOJI/UCS%EMOJI_ISO-2022-JP-KDDI.src658
-rw-r--r--enc/trans/EMOJI/UCS%EMOJI_SHIFT_JIS-DOCOMO.src293
-rw-r--r--enc/trans/EMOJI/UCS%EMOJI_SHIFT_JIS-KDDI-UNDOC.src658
-rw-r--r--enc/trans/EMOJI/UCS%EMOJI_SHIFT_JIS-KDDI.src658
-rw-r--r--enc/trans/EMOJI/UCS%EMOJI_SHIFT_JIS-SOFTBANK.src496
-rw-r--r--enc/trans/GB/GB12345%UCS.src7618
-rw-r--r--enc/trans/GB/GB2312%UCS.src7535
-rw-r--r--enc/trans/GB/UCS%GB12345.src7620
-rw-r--r--enc/trans/GB/UCS%GB2312.src7531
-rw-r--r--enc/trans/JIS/JISX0201-KANA%UCS.src127
-rw-r--r--enc/trans/JIS/JISX0208@1990%UCS.src6972
-rw-r--r--enc/trans/JIS/JISX0208@MS%UCS.src6893
-rw-r--r--enc/trans/JIS/JISX0208UDC%UCS.src954
-rw-r--r--enc/trans/JIS/JISX0208VDC@NEC%UCS.src97
-rw-r--r--enc/trans/JIS/JISX0212%UCS.src6167
-rw-r--r--enc/trans/JIS/JISX0212@MS%UCS.src6081
-rw-r--r--enc/trans/JIS/JISX0212UDC%UCS.src954
-rw-r--r--enc/trans/JIS/JISX0212VDC@IBM%UCS.src120
-rw-r--r--enc/trans/JIS/JISX0213-1%UCS@BMP.src1926
-rw-r--r--enc/trans/JIS/JISX0213-1%UCS@SIP.src60
-rw-r--r--enc/trans/JIS/JISX0213-2%UCS@BMP.src2193
-rw-r--r--enc/trans/JIS/JISX0213-2%UCS@SIP.src311
-rw-r--r--enc/trans/JIS/UCS%JISX0201-KANA.src127
-rw-r--r--enc/trans/JIS/UCS%JISX0208@1990.src6974
-rw-r--r--enc/trans/JIS/UCS%JISX0208@MS.src6894
-rw-r--r--enc/trans/JIS/UCS%JISX0208UDC.src955
-rw-r--r--enc/trans/JIS/UCS%JISX0208VDC@NEC.src98
-rw-r--r--enc/trans/JIS/UCS%JISX0212.src6170
-rw-r--r--enc/trans/JIS/UCS%JISX0212@MS.src6082
-rw-r--r--enc/trans/JIS/UCS%JISX0212UDC.src955
-rw-r--r--enc/trans/JIS/UCS%JISX0212VDC@IBM.src121
-rw-r--r--enc/trans/JIS/UCS@BMP%JISX0213-1.src1922
-rw-r--r--enc/trans/JIS/UCS@BMP%JISX0213-2.src2189
-rw-r--r--enc/trans/JIS/UCS@SIP%JISX0213-1.src56
-rw-r--r--enc/trans/JIS/UCS@SIP%JISX0213-2.src307
-rw-r--r--enc/trans/big5-hkscs-tbl.rb37302
-rw-r--r--enc/trans/big5-uao-tbl.rb19784
-rw-r--r--enc/trans/big5.trans32
-rw-r--r--enc/trans/chinese.trans31
-rw-r--r--enc/trans/cp850-tbl.rb130
-rw-r--r--enc/trans/cp852-tbl.rb130
-rw-r--r--enc/trans/cp855-tbl.rb130
-rw-r--r--enc/trans/cp949-tbl.rb8831
-rw-r--r--enc/trans/emoji-exchange-tbl.rb8407
-rw-r--r--enc/trans/emoji.trans36
-rw-r--r--enc/trans/emoji_iso2022_kddi.trans216
-rw-r--r--enc/trans/emoji_sjis_docomo.trans32
-rw-r--r--enc/trans/emoji_sjis_kddi.trans33
-rw-r--r--enc/trans/emoji_sjis_softbank.trans32
-rw-r--r--enc/trans/escape.trans93
-rw-r--r--enc/trans/euckr-tbl.rb8228
-rw-r--r--enc/trans/gb18030-tbl.rb63362
-rw-r--r--enc/trans/gb18030.trans183
-rw-r--r--enc/trans/gbk-tbl.rb21794
-rw-r--r--enc/trans/gbk.trans15
-rw-r--r--enc/trans/ibm437-tbl.rb130
-rw-r--r--enc/trans/ibm737-tbl.rb130
-rw-r--r--enc/trans/ibm775-tbl.rb130
-rw-r--r--enc/trans/ibm852-tbl.rb130
-rw-r--r--enc/trans/ibm855-tbl.rb130
-rw-r--r--enc/trans/ibm857-tbl.rb127
-rw-r--r--enc/trans/ibm860-tbl.rb130
-rw-r--r--enc/trans/ibm861-tbl.rb130
-rw-r--r--enc/trans/ibm862-tbl.rb130
-rw-r--r--enc/trans/ibm863-tbl.rb130
-rw-r--r--enc/trans/ibm865-tbl.rb130
-rw-r--r--enc/trans/ibm866-tbl.rb130
-rw-r--r--enc/trans/ibm869-tbl.rb121
-rw-r--r--enc/trans/iso-8859-1-tbl.rb98
-rw-r--r--enc/trans/iso-8859-10-tbl.rb98
-rw-r--r--enc/trans/iso-8859-11-tbl.rb90
-rw-r--r--enc/trans/iso-8859-13-tbl.rb98
-rw-r--r--enc/trans/iso-8859-14-tbl.rb98
-rw-r--r--enc/trans/iso-8859-15-tbl.rb98
-rw-r--r--enc/trans/iso-8859-16-tbl.rb98
-rw-r--r--enc/trans/iso-8859-2-tbl.rb98
-rw-r--r--enc/trans/iso-8859-3-tbl.rb91
-rw-r--r--enc/trans/iso-8859-4-tbl.rb98
-rw-r--r--enc/trans/iso-8859-5-tbl.rb98
-rw-r--r--enc/trans/iso-8859-6-tbl.rb53
-rw-r--r--enc/trans/iso-8859-7-tbl.rb95
-rw-r--r--enc/trans/iso-8859-8-tbl.rb62
-rw-r--r--enc/trans/iso-8859-9-tbl.rb98
-rw-r--r--enc/trans/iso2022.trans567
-rw-r--r--enc/trans/japanese.trans97
-rw-r--r--enc/trans/japanese_euc.trans57
-rw-r--r--enc/trans/japanese_sjis.trans33
-rw-r--r--enc/trans/koi8-r-tbl.rb130
-rw-r--r--enc/trans/koi8-u-tbl.rb130
-rw-r--r--enc/trans/korean.trans18
-rw-r--r--enc/trans/maccroatian-tbl.rb129
-rw-r--r--enc/trans/maccyrillic-tbl.rb130
-rw-r--r--enc/trans/macgreek-tbl.rb129
-rw-r--r--enc/trans/maciceland-tbl.rb129
-rw-r--r--enc/trans/macroman-tbl.rb129
-rw-r--r--enc/trans/macromania-tbl.rb129
-rw-r--r--enc/trans/macturkish-tbl.rb128
-rw-r--r--enc/trans/macukraine-tbl.rb130
-rw-r--r--enc/trans/newline.trans135
-rw-r--r--enc/trans/single_byte.trans91
-rw-r--r--enc/trans/tis-620-tbl.rb89
-rw-r--r--enc/trans/transdb.c18
-rw-r--r--enc/trans/ucm/glibc-BIG5-2.3.3.ucm14087
-rw-r--r--enc/trans/ucm/glibc-BIG5HKSCS-2.3.3.ucm18332
-rw-r--r--enc/trans/ucm/windows-950-2000.ucm20379
-rw-r--r--enc/trans/ucm/windows-950_hkscs-2001.ucm23446
-rw-r--r--enc/trans/utf8_mac-tbl.rb945
-rw-r--r--enc/trans/utf8_mac.trans241
-rw-r--r--enc/trans/utf_16_32.trans556
-rw-r--r--enc/trans/windows-1250-tbl.rb125
-rw-r--r--enc/trans/windows-1251-tbl.rb129
-rw-r--r--enc/trans/windows-1252-tbl.rb125
-rw-r--r--enc/trans/windows-1253-tbl.rb113
-rw-r--r--enc/trans/windows-1254-tbl.rb123
-rw-r--r--enc/trans/windows-1255-tbl.rb141
-rw-r--r--enc/trans/windows-1256-tbl.rb130
-rw-r--r--enc/trans/windows-1257-tbl.rb118
-rw-r--r--enc/trans/windows-874-tbl.rb99
-rw-r--r--enc/unicode.c680
-rw-r--r--enc/unicode/casefold.h2238
-rw-r--r--enc/unicode/name2ctype.h28722
-rw-r--r--enc/unicode/name2ctype.h.blt28722
-rw-r--r--enc/unicode/name2ctype.kwd26550
-rw-r--r--enc/unicode/name2ctype.src26550
-rw-r--r--enc/us_ascii.c33
-rw-r--r--enc/utf_16_32.h5
-rw-r--r--enc/utf_16be.c256
-rw-r--r--enc/utf_16le.c248
-rw-r--r--enc/utf_32be.c193
-rw-r--r--enc/utf_32le.c192
-rw-r--r--enc/utf_7.h5
-rw-r--r--enc/utf_8.c457
-rw-r--r--enc/windows_1251.c210
-rw-r--r--enc/windows_31j.c80
-rw-r--r--enc/x_emoji.h26
-rw-r--r--encoding.c1906
-rw-r--r--enum.c2774
-rw-r--r--enumerator.c1937
-rw-r--r--env.h60
-rw-r--r--error.c2147
-rw-r--r--eval.c13283
-rw-r--r--eval_error.c298
-rw-r--r--eval_intern.h213
-rw-r--r--eval_jump.c146
-rw-r--r--ext/-test-/array/resize/extconf.rb1
-rw-r--r--ext/-test-/array/resize/resize.c14
-rw-r--r--ext/-test-/bug-3571/bug.c23
-rw-r--r--ext/-test-/bug-3571/extconf.rb1
-rw-r--r--ext/-test-/bug-3662/bug.c16
-rw-r--r--ext/-test-/bug-3662/extconf.rb1
-rw-r--r--ext/-test-/bug-5832/bug.c14
-rw-r--r--ext/-test-/bug-5832/extconf.rb1
-rw-r--r--ext/-test-/exception/enc_raise.c15
-rw-r--r--ext/-test-/exception/extconf.rb6
-rw-r--r--ext/-test-/exception/init.c11
-rw-r--r--ext/-test-/fatal/extconf.rb1
-rw-r--r--ext/-test-/fatal/rb_fatal.c19
-rw-r--r--ext/-test-/funcall/extconf.rb2
-rw-r--r--ext/-test-/funcall/passing_block.c30
-rw-r--r--ext/-test-/iter/break.c16
-rw-r--r--ext/-test-/iter/extconf.rb1
-rw-r--r--ext/-test-/load/dot.dot/dot.dot.c1
-rw-r--r--ext/-test-/load/dot.dot/extconf.rb1
-rw-r--r--ext/-test-/marshal/compat/extconf.rb1
-rw-r--r--ext/-test-/marshal/compat/usrcompat.c32
-rw-r--r--ext/-test-/marshal/usr/extconf.rb1
-rw-r--r--ext/-test-/marshal/usr/usrmarshal.c35
-rw-r--r--ext/-test-/num2int/depend1
-rw-r--r--ext/-test-/num2int/extconf.rb1
-rw-r--r--ext/-test-/num2int/num2int.c120
-rw-r--r--ext/-test-/old_thread_select/depend2
-rw-r--r--ext/-test-/old_thread_select/extconf.rb4
-rw-r--r--ext/-test-/old_thread_select/old_thread_select.c75
-rw-r--r--ext/-test-/path_to_class/extconf.rb6
-rw-r--r--ext/-test-/path_to_class/path_to_class.c15
-rw-r--r--ext/-test-/printf/extconf.rb1
-rw-r--r--ext/-test-/printf/printf.c31
-rw-r--r--ext/-test-/st/numhash/extconf.rb1
-rw-r--r--ext/-test-/st/numhash/numhash.c120
-rw-r--r--ext/-test-/st/update/extconf.rb1
-rw-r--r--ext/-test-/st/update/update.c34
-rw-r--r--ext/-test-/string/coderange.c30
-rw-r--r--ext/-test-/string/cstr.c20
-rw-r--r--ext/-test-/string/ellipsize.c13
-rw-r--r--ext/-test-/string/enc_associate.c14
-rw-r--r--ext/-test-/string/enc_str_buf_cat.c14
-rw-r--r--ext/-test-/string/extconf.rb6
-rw-r--r--ext/-test-/string/init.c11
-rw-r--r--ext/-test-/string/modify.c22
-rw-r--r--ext/-test-/string/qsort.c61
-rw-r--r--ext/-test-/string/set_len.c14
-rw-r--r--ext/-test-/symbol/extconf.rb6
-rw-r--r--ext/-test-/symbol/init.c11
-rw-r--r--ext/-test-/symbol/intern.c14
-rw-r--r--ext/-test-/typeddata/extconf.rb1
-rw-r--r--ext/-test-/typeddata/typeddata.c20
-rw-r--r--ext/-test-/wait_for_single_fd/depend2
-rw-r--r--ext/-test-/wait_for_single_fd/extconf.rb1
-rw-r--r--ext/-test-/wait_for_single_fd/wait_for_single_fd.c30
-rw-r--r--ext/-test-/win32/dln/dlntest.c17
-rw-r--r--ext/-test-/win32/dln/extconf.rb36
-rw-r--r--ext/-test-/win32/dln/libdlntest.c4
-rw-r--r--ext/-test-/win32/dln/libdlntest.def2
-rw-r--r--ext/-test-/win32/fd_setsize/depend2
-rw-r--r--ext/-test-/win32/fd_setsize/extconf.rb3
-rw-r--r--ext/-test-/win32/fd_setsize/fd_setsize.c55
-rw-r--r--ext/.cvsignore2
-rw-r--r--ext/.document100
-rw-r--r--ext/Setup7
-rw-r--r--ext/Setup.atheos6
-rw-r--r--ext/Setup.dj33
-rw-r--r--ext/Setup.emx6
-rw-r--r--ext/Setup.nacl49
-rw-r--r--ext/Setup.nt6
-rw-r--r--ext/Setup.x6833
-rw-r--r--ext/Win32API/.cvsignore3
-rw-r--r--ext/Win32API/Win32API.c215
-rw-r--r--ext/Win32API/depend1
-rw-r--r--ext/Win32API/extconf.rb6
-rw-r--r--ext/Win32API/getch.rb5
-rw-r--r--ext/Win32API/lib/win32/registry.rb831
-rw-r--r--ext/Win32API/lib/win32/resolv.rb366
-rw-r--r--ext/Win32API/point.rb18
-rw-r--r--ext/bigdecimal/.cvsignore3
-rw-r--r--ext/bigdecimal/README6
-rw-r--r--ext/bigdecimal/bigdecimal.c3764
-rw-r--r--ext/bigdecimal/bigdecimal.def2
-rw-r--r--ext/bigdecimal/bigdecimal.gemspec30
-rw-r--r--ext/bigdecimal/bigdecimal.h189
-rw-r--r--ext/bigdecimal/bigdecimal_en.html797
-rw-r--r--ext/bigdecimal/bigdecimal_ja.html798
-rw-r--r--ext/bigdecimal/extconf.rb4
-rw-r--r--ext/bigdecimal/lib/bigdecimal/jacobian.rb33
-rw-r--r--ext/bigdecimal/lib/bigdecimal/ludcmp.rb44
-rw-r--r--ext/bigdecimal/lib/bigdecimal/math.rb96
-rw-r--r--ext/bigdecimal/lib/bigdecimal/newton.rb13
-rw-r--r--ext/bigdecimal/lib/bigdecimal/util.rb126
-rw-r--r--ext/continuation/continuation.c8
-rw-r--r--ext/continuation/extconf.rb3
-rw-r--r--ext/coverage/coverage.c109
-rw-r--r--ext/coverage/extconf.rb3
-rw-r--r--ext/curses/.cvsignore3
-rw-r--r--ext/curses/curses.c3219
-rw-r--r--ext/curses/depend2
-rw-r--r--ext/curses/extconf.rb115
-rw-r--r--ext/curses/rain.rb2
-rw-r--r--ext/curses/view.rb12
-rw-r--r--ext/curses/view2.rb228
-rw-r--r--ext/date/date_core.c9655
-rw-r--r--ext/date/date_parse.c3126
-rw-r--r--ext/date/date_strftime.c629
-rw-r--r--ext/date/date_strptime.c699
-rw-r--r--ext/date/date_tmx.h56
-rw-r--r--ext/date/depend3
-rw-r--r--ext/date/extconf.rb2
-rw-r--r--ext/date/lib/date.rb61
-rw-r--r--ext/date/lib/date/format.rb1
-rw-r--r--ext/dbm/.cvsignore3
-rw-r--r--ext/dbm/dbm.c715
-rw-r--r--ext/dbm/extconf.rb265
-rw-r--r--ext/digest/.cvsignore3
-rw-r--r--ext/digest/bubblebabble/bubblebabble.c142
-rw-r--r--ext/digest/bubblebabble/depend3
-rw-r--r--ext/digest/bubblebabble/extconf.rb6
-rw-r--r--ext/digest/defs.h20
-rw-r--r--ext/digest/digest.c762
-rw-r--r--ext/digest/digest.h30
-rw-r--r--ext/digest/digest.txt113
-rw-r--r--ext/digest/digest.txt.ja111
-rw-r--r--ext/digest/extconf.rb6
-rw-r--r--ext/digest/lib/digest.rb88
-rw-r--r--ext/digest/lib/digest/hmac.rb302
-rw-r--r--ext/digest/lib/md5.rb14
-rw-r--r--ext/digest/lib/sha1.rb14
-rw-r--r--ext/digest/md5/.cvsignore3
-rw-r--r--ext/digest/md5/extconf.rb11
-rw-r--r--ext/digest/md5/md5.c30
-rw-r--r--ext/digest/md5/md5.h11
-rw-r--r--ext/digest/md5/md5init.c28
-rw-r--r--ext/digest/md5/md5ossl.c25
-rw-r--r--ext/digest/md5/md5ossl.h7
-rw-r--r--ext/digest/rmd160/.cvsignore3
-rw-r--r--ext/digest/rmd160/depend2
-rw-r--r--ext/digest/rmd160/extconf.rb13
-rw-r--r--ext/digest/rmd160/rmd160.c21
-rw-r--r--ext/digest/rmd160/rmd160.h20
-rw-r--r--ext/digest/rmd160/rmd160hl.c96
-rw-r--r--ext/digest/rmd160/rmd160init.c31
-rw-r--r--ext/digest/rmd160/rmd160ossl.c43
-rw-r--r--ext/digest/rmd160/rmd160ossl.h6
-rw-r--r--ext/digest/sha1/.cvsignore3
-rw-r--r--ext/digest/sha1/depend2
-rw-r--r--ext/digest/sha1/extconf.rb13
-rw-r--r--ext/digest/sha1/sha1.c24
-rw-r--r--ext/digest/sha1/sha1.h23
-rw-r--r--ext/digest/sha1/sha1hl.c102
-rw-r--r--ext/digest/sha1/sha1init.c31
-rw-r--r--ext/digest/sha1/sha1ossl.c43
-rw-r--r--ext/digest/sha1/sha1ossl.h9
-rw-r--r--ext/digest/sha2/.cvsignore3
-rw-r--r--ext/digest/sha2/depend3
-rw-r--r--ext/digest/sha2/extconf.rb28
-rw-r--r--ext/digest/sha2/lib/sha2.rb107
-rw-r--r--ext/digest/sha2/sha2.c285
-rw-r--r--ext/digest/sha2/sha2.h194
-rw-r--r--ext/digest/sha2/sha2hl.c252
-rw-r--r--ext/digest/sha2/sha2init.c29
-rw-r--r--ext/digest/sha2/sha2ossl.c13
-rw-r--r--ext/digest/sha2/sha2ossl.h17
-rw-r--r--ext/digest/test.sh7
-rw-r--r--ext/dl/.cvsignore8
-rw-r--r--ext/dl/callback/depend15
-rw-r--r--ext/dl/callback/extconf.rb14
-rw-r--r--ext/dl/callback/mkcallback.rb242
-rw-r--r--ext/dl/cfunc.c675
-rw-r--r--ext/dl/cptr.c673
-rw-r--r--ext/dl/depend47
-rw-r--r--ext/dl/dl.c1217
-rw-r--r--ext/dl/dl.def59
-rw-r--r--ext/dl/dl.h418
-rw-r--r--ext/dl/doc/dl.txt266
-rw-r--r--ext/dl/extconf.rb218
-rw-r--r--ext/dl/h2rb500
-rw-r--r--ext/dl/handle.c505
-rw-r--r--ext/dl/install.rb49
-rw-r--r--ext/dl/lib/dl.rb15
-rw-r--r--ext/dl/lib/dl/callback.rb112
-rw-r--r--ext/dl/lib/dl/cparser.rb156
-rw-r--r--ext/dl/lib/dl/func.rb248
-rw-r--r--ext/dl/lib/dl/import.rb439
-rw-r--r--ext/dl/lib/dl/pack.rb128
-rw-r--r--ext/dl/lib/dl/stack.rb116
-rw-r--r--ext/dl/lib/dl/struct.rb369
-rw-r--r--ext/dl/lib/dl/types.rb302
-rw-r--r--ext/dl/lib/dl/value.rb114
-rw-r--r--ext/dl/lib/dl/win32.rb25
-rw-r--r--ext/dl/mkcall.rb62
-rw-r--r--ext/dl/mkcallback.rb56
-rw-r--r--ext/dl/mkcbtable.rb18
-rw-r--r--ext/dl/ptr.c1068
-rw-r--r--ext/dl/sample/c++sample.C35
-rw-r--r--ext/dl/sample/c++sample.rb60
-rw-r--r--ext/dl/sample/drives.rb70
-rw-r--r--ext/dl/sample/getch.rb5
-rw-r--r--ext/dl/sample/libc.rb69
-rw-r--r--ext/dl/sample/msgbox.rb19
-rw-r--r--ext/dl/sample/msgbox2.rb18
-rw-r--r--ext/dl/sample/stream.rb87
-rw-r--r--ext/dl/sym.c992
-rw-r--r--ext/dl/test/libtest.def28
-rw-r--r--ext/dl/test/test.c247
-rw-r--r--ext/dl/test/test.rb306
-rw-r--r--ext/dl/type.rb115
-rw-r--r--ext/dl/win32/extconf.rb3
-rw-r--r--ext/dl/win32/lib/Win32API.rb31
-rw-r--r--ext/dl/win32/lib/win32/registry.rb845
-rw-r--r--ext/dl/win32/lib/win32/resolv.rb379
-rw-r--r--ext/dl/win32/lib/win32/sspi.rb330
-rw-r--r--ext/enumerator/.cvsignore2
-rw-r--r--ext/enumerator/enumerator.c298
-rw-r--r--ext/enumerator/enumerator.txt102
-rw-r--r--ext/enumerator/extconf.rb2
-rw-r--r--ext/etc/.cvsignore3
-rw-r--r--ext/etc/depend2
-rw-r--r--ext/etc/etc.c528
-rw-r--r--ext/etc/etc.txt72
-rw-r--r--ext/etc/etc.txt.ja72
-rw-r--r--ext/etc/extconf.rb19
-rwxr-xr-x[-rw-r--r--]ext/extmk.rb431
-rw-r--r--ext/fcntl/.cvsignore3
-rw-r--r--ext/fcntl/fcntl.c10
-rw-r--r--ext/fiber/extconf.rb3
-rw-r--r--ext/fiber/fiber.c8
-rw-r--r--ext/fiddle/closure.c307
-rw-r--r--ext/fiddle/closure.h8
-rw-r--r--ext/fiddle/conversions.c141
-rw-r--r--ext/fiddle/conversions.h44
-rw-r--r--ext/fiddle/extconf.rb54
-rw-r--r--ext/fiddle/fiddle.c458
-rw-r--r--ext/fiddle/fiddle.h143
-rw-r--r--ext/fiddle/function.c245
-rw-r--r--ext/fiddle/function.h8
-rw-r--r--ext/fiddle/handle.c469
-rw-r--r--ext/fiddle/lib/fiddle.rb46
-rw-r--r--ext/fiddle/lib/fiddle/closure.rb48
-rw-r--r--ext/fiddle/lib/fiddle/cparser.rb176
-rw-r--r--ext/fiddle/lib/fiddle/function.rb17
-rw-r--r--ext/fiddle/lib/fiddle/import.rb314
-rw-r--r--ext/fiddle/lib/fiddle/pack.rb128
-rw-r--r--ext/fiddle/lib/fiddle/struct.rb243
-rw-r--r--ext/fiddle/lib/fiddle/types.rb71
-rw-r--r--ext/fiddle/lib/fiddle/value.rb112
-rw-r--r--ext/fiddle/pointer.c716
-rw-r--r--ext/fiddle/win32/extconf.rb3
-rw-r--r--ext/fiddle/win32/lib/win32/registry.rb845
-rw-r--r--ext/fiddle/win32/lib/win32/resolv.rb379
-rw-r--r--ext/gdbm/.cvsignore3
-rw-r--r--ext/gdbm/gdbm.c861
-rw-r--r--ext/iconv/.cvsignore5
-rw-r--r--ext/iconv/charset_alias.rb103
-rw-r--r--ext/iconv/depend2
-rw-r--r--ext/iconv/extconf.rb51
-rw-r--r--ext/iconv/iconv.c910
-rw-r--r--ext/io/console/console.c762
-rw-r--r--ext/io/console/extconf.rb20
-rw-r--r--ext/io/console/io-console.gemspec16
-rw-r--r--ext/io/console/lib/console/size.rb20
-rw-r--r--ext/io/nonblock/extconf.rb8
-rw-r--r--ext/io/nonblock/nonblock.c114
-rw-r--r--ext/io/wait/.cvsignore2
-rw-r--r--ext/io/wait/extconf.rb5
-rw-r--r--ext/io/wait/lib/nonblock.rb23
-rw-r--r--ext/io/wait/wait.c165
-rw-r--r--ext/json/extconf.rb3
-rw-r--r--ext/json/fbuffer/fbuffer.h185
-rw-r--r--ext/json/generator/depend1
-rw-r--r--ext/json/generator/extconf.rb4
-rw-r--r--ext/json/generator/generator.c1393
-rw-r--r--ext/json/generator/generator.h141
-rw-r--r--ext/json/lib/json.rb62
-rw-r--r--ext/json/lib/json/add/bigdecimal.rb21
-rw-r--r--ext/json/lib/json/add/complex.rb22
-rw-r--r--ext/json/lib/json/add/core.rb11
-rw-r--r--ext/json/lib/json/add/date.rb34
-rw-r--r--ext/json/lib/json/add/date_time.rb50
-rw-r--r--ext/json/lib/json/add/exception.rb31
-rw-r--r--ext/json/lib/json/add/ostruct.rb31
-rw-r--r--ext/json/lib/json/add/range.rb29
-rw-r--r--ext/json/lib/json/add/rational.rb22
-rw-r--r--ext/json/lib/json/add/regexp.rb30
-rw-r--r--ext/json/lib/json/add/struct.rb30
-rw-r--r--ext/json/lib/json/add/symbol.rb25
-rw-r--r--ext/json/lib/json/add/time.rb38
-rw-r--r--ext/json/lib/json/common.rb480
-rw-r--r--ext/json/lib/json/ext.rb21
-rw-r--r--ext/json/lib/json/generic_object.rb39
-rw-r--r--ext/json/lib/json/version.rb8
-rw-r--r--ext/json/parser/depend1
-rw-r--r--ext/json/parser/extconf.rb3
-rw-r--r--ext/json/parser/parser.c2204
-rw-r--r--ext/json/parser/parser.h77
-rw-r--r--ext/json/parser/parser.rl927
-rw-r--r--ext/json/parser/prereq.mk9
-rw-r--r--ext/mathn/complex/complex.c7
-rw-r--r--ext/mathn/complex/extconf.rb3
-rw-r--r--ext/mathn/rational/extconf.rb3
-rw-r--r--ext/mathn/rational/rational.c7
-rw-r--r--ext/nkf/.cvsignore3
-rw-r--r--ext/nkf/depend5
-rw-r--r--ext/nkf/lib/kconv.rb287
-rw-r--r--ext/nkf/nkf-utf8/config.h77
-rw-r--r--ext/nkf/nkf-utf8/nkf.c9724
-rw-r--r--ext/nkf/nkf-utf8/nkf.h189
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.c7349
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.h39
-rw-r--r--ext/nkf/nkf.c407
-rw-r--r--ext/objspace/depend3
-rw-r--r--ext/objspace/extconf.rb2
-rw-r--r--ext/objspace/objspace.c807
-rw-r--r--ext/openssl/.cvsignore5
-rw-r--r--ext/openssl/deprecation.rb21
-rw-r--r--ext/openssl/extconf.rb98
-rw-r--r--ext/openssl/lib/net/ftptls.rb53
-rw-r--r--ext/openssl/lib/net/telnets.rb251
-rw-r--r--ext/openssl/lib/openssl.rb8
-rw-r--r--ext/openssl/lib/openssl/bn.rb40
-rw-r--r--ext/openssl/lib/openssl/buffering.rb236
-rw-r--r--ext/openssl/lib/openssl/cipher.rb69
-rw-r--r--ext/openssl/lib/openssl/config.rb313
-rw-r--r--ext/openssl/lib/openssl/digest.rb82
-rw-r--r--ext/openssl/lib/openssl/ssl.rb108
-rw-r--r--ext/openssl/lib/openssl/x509.rb58
-rw-r--r--ext/openssl/openssl_missing.c39
-rw-r--r--ext/openssl/openssl_missing.h110
-rw-r--r--ext/openssl/ossl.c720
-rw-r--r--ext/openssl/ossl.h81
-rw-r--r--ext/openssl/ossl_asn1.c1219
-rw-r--r--ext/openssl/ossl_asn1.h6
-rw-r--r--ext/openssl/ossl_bio.c28
-rw-r--r--ext/openssl/ossl_bio.h2
-rw-r--r--ext/openssl/ossl_bn.c273
-rw-r--r--ext/openssl/ossl_bn.h7
-rw-r--r--ext/openssl/ossl_cipher.c714
-rw-r--r--ext/openssl/ossl_cipher.h3
-rw-r--r--ext/openssl/ossl_config.c424
-rw-r--r--ext/openssl/ossl_config.h2
-rw-r--r--ext/openssl/ossl_digest.c406
-rw-r--r--ext/openssl/ossl_digest.h3
-rw-r--r--ext/openssl/ossl_engine.c96
-rw-r--r--ext/openssl/ossl_engine.h2
-rw-r--r--ext/openssl/ossl_hmac.c134
-rw-r--r--ext/openssl/ossl_hmac.h2
-rw-r--r--ext/openssl/ossl_ns_spki.c193
-rw-r--r--ext/openssl/ossl_ns_spki.h2
-rw-r--r--ext/openssl/ossl_ocsp.c123
-rw-r--r--ext/openssl/ossl_ocsp.h2
-rw-r--r--ext/openssl/ossl_pkcs12.c98
-rw-r--r--ext/openssl/ossl_pkcs12.h3
-rw-r--r--ext/openssl/ossl_pkcs5.c189
-rw-r--r--ext/openssl/ossl_pkcs7.c183
-rw-r--r--ext/openssl/ossl_pkcs7.h3
-rw-r--r--ext/openssl/ossl_pkey.c240
-rw-r--r--ext/openssl/ossl_pkey.h49
-rw-r--r--ext/openssl/ossl_pkey_dh.c289
-rw-r--r--ext/openssl/ossl_pkey_dsa.c292
-rw-r--r--ext/openssl/ossl_pkey_ec.c1677
-rw-r--r--ext/openssl/ossl_pkey_rsa.c333
-rw-r--r--ext/openssl/ossl_rand.c108
-rw-r--r--ext/openssl/ossl_rand.h2
-rw-r--r--ext/openssl/ossl_ssl.c1652
-rw-r--r--ext/openssl/ossl_ssl.h17
-rw-r--r--ext/openssl/ossl_ssl_session.c323
-rw-r--r--ext/openssl/ossl_version.h4
-rw-r--r--ext/openssl/ossl_x509.c2
-rw-r--r--ext/openssl/ossl_x509.h2
-rw-r--r--ext/openssl/ossl_x509attr.c72
-rw-r--r--ext/openssl/ossl_x509cert.c345
-rw-r--r--ext/openssl/ossl_x509crl.c100
-rw-r--r--ext/openssl/ossl_x509ext.c109
-rw-r--r--ext/openssl/ossl_x509name.c223
-rw-r--r--ext/openssl/ossl_x509req.c90
-rw-r--r--ext/openssl/ossl_x509revoked.c48
-rw-r--r--ext/openssl/ossl_x509store.c164
-rw-r--r--ext/openssl/ruby_missing.h18
-rw-r--r--ext/pathname/extconf.rb2
-rw-r--r--ext/pathname/lib/pathname.rb571
-rw-r--r--ext/pathname/pathname.c1385
-rw-r--r--ext/psych/.gitignore11
-rw-r--r--ext/psych/extconf.rb38
-rw-r--r--ext/psych/lib/psych.rb333
-rw-r--r--ext/psych/lib/psych/coder.rb94
-rw-r--r--ext/psych/lib/psych/core_ext.rb35
-rw-r--r--ext/psych/lib/psych/deprecated.rb84
-rw-r--r--ext/psych/lib/psych/handler.rb249
-rw-r--r--ext/psych/lib/psych/handlers/document_stream.rb22
-rw-r--r--ext/psych/lib/psych/handlers/recorder.rb39
-rw-r--r--ext/psych/lib/psych/json/ruby_events.rb19
-rw-r--r--ext/psych/lib/psych/json/stream.rb15
-rw-r--r--ext/psych/lib/psych/json/tree_builder.rb12
-rw-r--r--ext/psych/lib/psych/json/yaml_events.rb29
-rw-r--r--ext/psych/lib/psych/nodes.rb77
-rw-r--r--ext/psych/lib/psych/nodes/alias.rb18
-rw-r--r--ext/psych/lib/psych/nodes/document.rb60
-rw-r--r--ext/psych/lib/psych/nodes/mapping.rb56
-rw-r--r--ext/psych/lib/psych/nodes/node.rb53
-rw-r--r--ext/psych/lib/psych/nodes/scalar.rb67
-rw-r--r--ext/psych/lib/psych/nodes/sequence.rb81
-rw-r--r--ext/psych/lib/psych/nodes/stream.rb37
-rw-r--r--ext/psych/lib/psych/omap.rb4
-rw-r--r--ext/psych/lib/psych/parser.rb51
-rw-r--r--ext/psych/lib/psych/scalar_scanner.rb144
-rw-r--r--ext/psych/lib/psych/set.rb4
-rw-r--r--ext/psych/lib/psych/stream.rb36
-rw-r--r--ext/psych/lib/psych/streaming.rb22
-rw-r--r--ext/psych/lib/psych/syntax_error.rb22
-rw-r--r--ext/psych/lib/psych/tree_builder.rb96
-rw-r--r--ext/psych/lib/psych/visitors.rb6
-rw-r--r--ext/psych/lib/psych/visitors/depth_first.rb26
-rw-r--r--ext/psych/lib/psych/visitors/emitter.rb51
-rw-r--r--ext/psych/lib/psych/visitors/json_tree.rb21
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb332
-rw-r--r--ext/psych/lib/psych/visitors/visitor.rb19
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb461
-rw-r--r--ext/psych/lib/psych/y.rb7
-rw-r--r--ext/psych/psych.c34
-rw-r--r--ext/psych/psych.gemspec24
-rw-r--r--ext/psych/psych.h20
-rw-r--r--ext/psych/psych_emitter.c538
-rw-r--r--ext/psych/psych_emitter.h8
-rw-r--r--ext/psych/psych_parser.c579
-rw-r--r--ext/psych/psych_parser.h6
-rw-r--r--ext/psych/psych_to_ruby.c41
-rw-r--r--ext/psych/psych_to_ruby.h8
-rw-r--r--ext/psych/psych_yaml_tree.c24
-rw-r--r--ext/psych/psych_yaml_tree.h8
-rw-r--r--ext/psych/yaml/LICENSE19
-rw-r--r--ext/psych/yaml/api.c1392
-rw-r--r--ext/psych/yaml/config.h11
-rw-r--r--ext/psych/yaml/dumper.c394
-rw-r--r--ext/psych/yaml/emitter.c2329
-rw-r--r--ext/psych/yaml/loader.c432
-rw-r--r--ext/psych/yaml/parser.c1374
-rw-r--r--ext/psych/yaml/reader.c465
-rw-r--r--ext/psych/yaml/scanner.c3570
-rw-r--r--ext/psych/yaml/writer.c141
-rw-r--r--ext/psych/yaml/yaml.h1971
-rw-r--r--ext/psych/yaml/yaml_private.h643
-rw-r--r--ext/pty/.cvsignore3
-rw-r--r--ext/pty/README65
-rw-r--r--ext/pty/README.expect.ja21
-rw-r--r--ext/pty/README.ja89
-rw-r--r--ext/pty/depend2
-rw-r--r--ext/pty/expect_sample.rb55
-rw-r--r--ext/pty/extconf.rb8
-rw-r--r--ext/pty/lib/expect.rb19
-rw-r--r--ext/pty/pty.c817
-rw-r--r--ext/pty/script.rb37
-rw-r--r--ext/racc/cparse/.cvsignore3
-rw-r--r--ext/racc/cparse/README10
-rw-r--r--ext/racc/cparse/cparse.c103
-rw-r--r--ext/racc/cparse/extconf.rb3
-rw-r--r--ext/readline/.cvsignore3
-rw-r--r--ext/readline/README68
-rw-r--r--ext/readline/README.ja444
-rw-r--r--ext/readline/extconf.rb103
-rw-r--r--ext/readline/readline.c1624
-rw-r--r--ext/ripper/README30
-rw-r--r--ext/ripper/depend49
-rw-r--r--ext/ripper/eventids2.c287
-rw-r--r--ext/ripper/extconf.rb21
-rw-r--r--ext/ripper/lib/ripper.rb73
-rw-r--r--ext/ripper/lib/ripper/core.rb70
-rw-r--r--ext/ripper/lib/ripper/filter.rb77
-rw-r--r--ext/ripper/lib/ripper/lexer.rb186
-rw-r--r--ext/ripper/lib/ripper/sexp.rb114
-rwxr-xr-xext/ripper/tools/generate-param-macros.rb14
-rwxr-xr-xext/ripper/tools/generate.rb154
-rwxr-xr-xext/ripper/tools/preproc.rb91
-rwxr-xr-xext/ripper/tools/strip.rb12
-rw-r--r--ext/sdbm/.cvsignore3
-rw-r--r--ext/sdbm/_sdbm.c246
-rw-r--r--ext/sdbm/depend4
-rw-r--r--ext/sdbm/extconf.rb1
-rw-r--r--ext/sdbm/init.c718
-rw-r--r--ext/sdbm/sdbm.h10
-rw-r--r--ext/socket/.cvsignore3
-rw-r--r--ext/socket/.document16
-rw-r--r--ext/socket/addrinfo.h49
-rw-r--r--ext/socket/ancdata.c1828
-rw-r--r--ext/socket/basicsocket.c773
-rw-r--r--ext/socket/constants.c145
-rw-r--r--ext/socket/depend28
-rw-r--r--ext/socket/extconf.rb299
-rw-r--r--ext/socket/getaddrinfo.c102
-rw-r--r--ext/socket/getnameinfo.c38
-rw-r--r--ext/socket/init.c616
-rw-r--r--ext/socket/ipsocket.c308
-rw-r--r--ext/socket/lib/socket.rb845
-rw-r--r--ext/socket/mkconstants.rb705
-rw-r--r--ext/socket/option.c924
-rw-r--r--ext/socket/raddrinfo.c2245
-rw-r--r--ext/socket/rubysocket.h314
-rw-r--r--ext/socket/socket.c4805
-rw-r--r--ext/socket/sockport.h20
-rw-r--r--ext/socket/sockssocket.c71
-rw-r--r--ext/socket/tcpserver.c171
-rw-r--r--ext/socket/tcpsocket.c82
-rw-r--r--ext/socket/udpsocket.c265
-rw-r--r--ext/socket/unixserver.c155
-rw-r--r--ext/socket/unixsocket.c516
-rw-r--r--ext/stringio/.cvsignore3
-rw-r--r--ext/stringio/README5
-rw-r--r--ext/stringio/depend5
-rw-r--r--ext/stringio/stringio.c1006
-rw-r--r--ext/strscan/.cvsignore3
-rw-r--r--ext/strscan/depend3
-rw-r--r--ext/strscan/extconf.rb1
-rw-r--r--ext/strscan/strscan.c283
-rw-r--r--ext/syck/.cvsignore3
-rw-r--r--ext/syck/bytecode.c1166
-rw-r--r--ext/syck/depend12
-rw-r--r--ext/syck/emitter.c1242
-rw-r--r--ext/syck/extconf.rb5
-rw-r--r--ext/syck/gram.c1894
-rw-r--r--ext/syck/gram.h79
-rw-r--r--ext/syck/handler.c174
-rw-r--r--ext/syck/implicit.c2990
-rw-r--r--ext/syck/node.c408
-rw-r--r--ext/syck/rubyext.c2367
-rw-r--r--ext/syck/syck.c504
-rw-r--r--ext/syck/syck.h458
-rw-r--r--ext/syck/token.c2725
-rw-r--r--ext/syck/yaml2byte.c257
-rw-r--r--ext/syck/yamlbyte.h170
-rw-r--r--ext/syslog/.cvsignore3
-rw-r--r--ext/syslog/extconf.rb2
-rw-r--r--ext/syslog/lib/syslog/logger.rb194
-rw-r--r--ext/syslog/syslog.c389
-rw-r--r--ext/syslog/syslog.txt11
-rw-r--r--ext/syslog/test.rb164
-rw-r--r--ext/tk/.cvsignore3
-rw-r--r--ext/tk/ChangeLog.tkextlib109
-rw-r--r--ext/tk/MANUAL_tcltklib.eng320
-rw-r--r--ext/tk/MANUAL_tcltklib.eucj815
-rw-r--r--ext/tk/README.1st29
-rw-r--r--ext/tk/README.ActiveTcl35
-rw-r--r--ext/tk/README.fork14
-rw-r--r--ext/tk/README.macosx-aqua20
-rw-r--r--ext/tk/README.tcltklib134
-rw-r--r--ext/tk/config_list.in41
-rw-r--r--ext/tk/depend4
-rw-r--r--ext/tk/extconf.rb2008
-rw-r--r--ext/tk/lib/README4
-rw-r--r--ext/tk/lib/multi-tk.rb969
-rw-r--r--ext/tk/lib/remote-tk.rb38
-rw-r--r--ext/tk/lib/tcltk.rb24
-rw-r--r--ext/tk/lib/tk.rb1882
-rw-r--r--ext/tk/lib/tk/after.rb2
-rw-r--r--ext/tk/lib/tk/autoload.rb704
-rw-r--r--ext/tk/lib/tk/bindtag.rb83
-rw-r--r--ext/tk/lib/tk/busy.rb118
-rw-r--r--ext/tk/lib/tk/button.rb8
-rw-r--r--ext/tk/lib/tk/canvas.rb170
-rw-r--r--ext/tk/lib/tk/canvastag.rb144
-rw-r--r--ext/tk/lib/tk/checkbutton.rb13
-rw-r--r--ext/tk/lib/tk/composite.rb118
-rw-r--r--ext/tk/lib/tk/console.rb6
-rw-r--r--ext/tk/lib/tk/dialog.rb30
-rw-r--r--ext/tk/lib/tk/encodedstr.rb90
-rw-r--r--ext/tk/lib/tk/entry.rb9
-rw-r--r--ext/tk/lib/tk/event.rb276
-rw-r--r--ext/tk/lib/tk/font.rb835
-rw-r--r--ext/tk/lib/tk/fontchooser.rb176
-rw-r--r--ext/tk/lib/tk/frame.rb8
-rw-r--r--ext/tk/lib/tk/grid.rb79
-rw-r--r--ext/tk/lib/tk/image.rb194
-rw-r--r--ext/tk/lib/tk/itemconfig.rb328
-rw-r--r--ext/tk/lib/tk/itemfont.rb69
-rw-r--r--ext/tk/lib/tk/kinput.rb6
-rw-r--r--ext/tk/lib/tk/label.rb8
-rw-r--r--ext/tk/lib/tk/labelframe.rb12
-rw-r--r--ext/tk/lib/tk/listbox.rb41
-rw-r--r--ext/tk/lib/tk/macpkg.rb11
-rw-r--r--ext/tk/lib/tk/menu.rb186
-rw-r--r--ext/tk/lib/tk/menubar.rb46
-rw-r--r--ext/tk/lib/tk/menuspec.rb259
-rw-r--r--ext/tk/lib/tk/message.rb9
-rw-r--r--ext/tk/lib/tk/mngfocus.rb4
-rw-r--r--ext/tk/lib/tk/msgcat.rb64
-rw-r--r--ext/tk/lib/tk/namespace.rb171
-rw-r--r--ext/tk/lib/tk/optiondb.rb62
-rw-r--r--ext/tk/lib/tk/optionobj.rb18
-rw-r--r--ext/tk/lib/tk/pack.rb17
-rw-r--r--ext/tk/lib/tk/package.rb4
-rw-r--r--ext/tk/lib/tk/palette.rb6
-rw-r--r--ext/tk/lib/tk/panedwindow.rb72
-rw-r--r--ext/tk/lib/tk/place.rb12
-rw-r--r--ext/tk/lib/tk/radiobutton.rb13
-rw-r--r--ext/tk/lib/tk/root.rb47
-rw-r--r--ext/tk/lib/tk/scale.rb38
-rw-r--r--ext/tk/lib/tk/scrollable.rb11
-rw-r--r--ext/tk/lib/tk/scrollbar.rb75
-rw-r--r--ext/tk/lib/tk/scrollbox.rb7
-rw-r--r--ext/tk/lib/tk/selection.rb6
-rw-r--r--ext/tk/lib/tk/spinbox.rb67
-rw-r--r--ext/tk/lib/tk/text.rb336
-rw-r--r--ext/tk/lib/tk/textimage.rb24
-rw-r--r--ext/tk/lib/tk/textmark.rb108
-rw-r--r--ext/tk/lib/tk/texttag.rb136
-rw-r--r--ext/tk/lib/tk/textwindow.rb33
-rw-r--r--ext/tk/lib/tk/timer.rb91
-rw-r--r--ext/tk/lib/tk/toplevel.rb33
-rw-r--r--ext/tk/lib/tk/ttk_selector.rb98
-rw-r--r--ext/tk/lib/tk/txtwin_abst.rb2
-rw-r--r--ext/tk/lib/tk/validation.rb53
-rw-r--r--ext/tk/lib/tk/variable.rb630
-rw-r--r--ext/tk/lib/tk/virtevent.rb85
-rw-r--r--ext/tk/lib/tk/winfo.rb10
-rw-r--r--ext/tk/lib/tk/winpkg.rb25
-rw-r--r--ext/tk/lib/tk/wm.rb476
-rw-r--r--ext/tk/lib/tk/xim.rb4
-rw-r--r--ext/tk/lib/tkclass.rb2
-rw-r--r--ext/tk/lib/tkextlib/ICONS/icons.rb8
-rw-r--r--ext/tk/lib/tkextlib/ICONS/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/SUPPORT_STATUS106
-rw-r--r--ext/tk/lib/tkextlib/blt.rb10
-rw-r--r--ext/tk/lib/tkextlib/blt/barchart.rb6
-rw-r--r--ext/tk/lib/tkextlib/blt/bitmap.rb21
-rw-r--r--ext/tk/lib/tkextlib/blt/busy.rb3
-rw-r--r--ext/tk/lib/tkextlib/blt/component.rb625
-rw-r--r--ext/tk/lib/tkextlib/blt/container.rb22
-rw-r--r--ext/tk/lib/tkextlib/blt/dragdrop.rb77
-rw-r--r--ext/tk/lib/tkextlib/blt/eps.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/graph.rb4
-rw-r--r--ext/tk/lib/tkextlib/blt/htext.rb4
-rw-r--r--ext/tk/lib/tkextlib/blt/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/blt/stripchart.rb6
-rw-r--r--ext/tk/lib/tkextlib/blt/table.rb132
-rw-r--r--ext/tk/lib/tkextlib/blt/tabnotebook.rb93
-rw-r--r--ext/tk/lib/tkextlib/blt/tabset.rb185
-rw-r--r--ext/tk/lib/tkextlib/blt/ted.rb12
-rw-r--r--ext/tk/lib/tkextlib/blt/tile.rb4
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/button.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/checkbutton.rb4
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/frame.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/label.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/radiobutton.rb4
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/scrollbar.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/toplevel.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/tree.rb385
-rw-r--r--ext/tk/lib/tkextlib/blt/treeview.rb283
-rw-r--r--ext/tk/lib/tkextlib/blt/unix_dnd.rb22
-rw-r--r--ext/tk/lib/tkextlib/blt/vector.rb49
-rw-r--r--ext/tk/lib/tkextlib/blt/watch.rb47
-rw-r--r--ext/tk/lib/tkextlib/blt/winop.rb12
-rw-r--r--ext/tk/lib/tkextlib/bwidget.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/arrowbutton.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/button.rb4
-rw-r--r--ext/tk/lib/tkextlib/bwidget/buttonbox.rb22
-rw-r--r--ext/tk/lib/tkextlib/bwidget/combobox.rb21
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dialog.rb51
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dynamichelp.rb7
-rw-r--r--ext/tk/lib/tkextlib/bwidget/entry.rb4
-rw-r--r--ext/tk/lib/tkextlib/bwidget/label.rb4
-rw-r--r--ext/tk/lib/tkextlib/bwidget/labelentry.rb4
-rw-r--r--ext/tk/lib/tkextlib/bwidget/labelframe.rb10
-rw-r--r--ext/tk/lib/tkextlib/bwidget/listbox.rb62
-rw-r--r--ext/tk/lib/tkextlib/bwidget/mainframe.rb54
-rw-r--r--ext/tk/lib/tkextlib/bwidget/messagedlg.rb18
-rw-r--r--ext/tk/lib/tkextlib/bwidget/notebook.rb32
-rw-r--r--ext/tk/lib/tkextlib/bwidget/pagesmanager.rb18
-rw-r--r--ext/tk/lib/tkextlib/bwidget/panedwindow.rb15
-rw-r--r--ext/tk/lib/tkextlib/bwidget/panelframe.rb22
-rw-r--r--ext/tk/lib/tkextlib/bwidget/passwddlg.rb8
-rw-r--r--ext/tk/lib/tkextlib/bwidget/progressbar.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/progressdlg.rb6
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrollableframe.rb10
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb20
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrollview.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/selectcolor.rb30
-rw-r--r--ext/tk/lib/tkextlib/bwidget/selectfont.rb14
-rw-r--r--ext/tk/lib/tkextlib/bwidget/separator.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/bwidget/spinbox.rb4
-rw-r--r--ext/tk/lib/tkextlib/bwidget/statusbar.rb26
-rw-r--r--ext/tk/lib/tkextlib/bwidget/titleframe.rb10
-rw-r--r--ext/tk/lib/tkextlib/bwidget/tree.rb116
-rw-r--r--ext/tk/lib/tkextlib/bwidget/widget.rb20
-rw-r--r--ext/tk/lib/tkextlib/itcl/incr_tcl.rb14
-rw-r--r--ext/tk/lib/tkextlib/itcl/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/itk/incr_tk.rb50
-rw-r--r--ext/tk/lib/tkextlib/itk/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/buttonbox.rb8
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/calendar.rb23
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/checkbox.rb26
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/combobox.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dateentry.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/datefield.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dialogshell.rb8
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/entryfield.rb37
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extbutton.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/feedback.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/finddialog.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/hierarchy.rb80
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/labeledframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/mainwindow.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/menubar.rb8
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/messagebox.rb8
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/messagedialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/notebook.rb19
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/optionmenu.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/panedwindow.rb8
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/promptdialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/pushbutton.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/radiobox.rb19
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scopedobject.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb24
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb6
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb94
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/selectionbox.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/shell.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spindate.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spinint.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spinner.rb37
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spintime.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb24
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/tabset.rb52
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/timeentry.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/timefield.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/toolbar.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/watch.rb4
-rwxr-xr-xext/tk/lib/tkextlib/pkg_checker.rb4
-rw-r--r--ext/tk/lib/tkextlib/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/tcllib.rb29
-rw-r--r--ext/tk/lib/tkextlib/tcllib/README14
-rw-r--r--ext/tk/lib/tkextlib/tcllib/autoscroll.rb26
-rw-r--r--ext/tk/lib/tkextlib/tcllib/calendar.rb55
-rw-r--r--ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb36
-rw-r--r--ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb21
-rw-r--r--ext/tk/lib/tkextlib/tcllib/chatwidget.rb151
-rw-r--r--ext/tk/lib/tkextlib/tcllib/crosshair.rb117
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ctext.rb14
-rw-r--r--ext/tk/lib/tkextlib/tcllib/cursor.rb14
-rw-r--r--ext/tk/lib/tkextlib/tcllib/dateentry.rb62
-rw-r--r--ext/tk/lib/tkextlib/tcllib/datefield.rb14
-rw-r--r--ext/tk/lib/tkextlib/tcllib/diagrams.rb224
-rw-r--r--ext/tk/lib/tkextlib/tcllib/dialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/getstring.rb9
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ico.rb52
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ip_entry.rb17
-rw-r--r--ext/tk/lib/tkextlib/tcllib/khim.rb68
-rw-r--r--ext/tk/lib/tkextlib/tcllib/menuentry.rb47
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ntext.rb146
-rw-r--r--ext/tk/lib/tkextlib/tcllib/panelframe.rb10
-rw-r--r--ext/tk/lib/tkextlib/tcllib/plotchart.rb785
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ruler.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/screenruler.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb57
-rw-r--r--ext/tk/lib/tkextlib/tcllib/scrollwin.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tcllib/statusbar.rb79
-rw-r--r--ext/tk/lib/tkextlib/tcllib/superframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/swaplist.rb15
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist.rb9
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist_core.rb342
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb20
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tkpiechart.rb36
-rw-r--r--ext/tk/lib/tkextlib/tcllib/toolbar.rb175
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tooltip.rb13
-rw-r--r--ext/tk/lib/tkextlib/tcllib/widget.rb34
-rw-r--r--ext/tk/lib/tkextlib/tclx/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tile.rb288
-rw-r--r--ext/tk/lib/tkextlib/tile/dialog.rb22
-rw-r--r--ext/tk/lib/tkextlib/tile/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tile/sizegrip.rb32
-rw-r--r--ext/tk/lib/tkextlib/tile/style.rb261
-rw-r--r--ext/tk/lib/tkextlib/tile/tbutton.rb10
-rw-r--r--ext/tk/lib/tkextlib/tile/tcheckbutton.rb12
-rw-r--r--ext/tk/lib/tkextlib/tile/tcombobox.rb12
-rw-r--r--ext/tk/lib/tkextlib/tile/tentry.rb15
-rw-r--r--ext/tk/lib/tkextlib/tile/tframe.rb10
-rw-r--r--ext/tk/lib/tkextlib/tile/tlabel.rb10
-rw-r--r--ext/tk/lib/tkextlib/tile/tlabelframe.rb12
-rw-r--r--ext/tk/lib/tkextlib/tile/tmenubutton.rb16
-rw-r--r--ext/tk/lib/tkextlib/tile/tnotebook.rb55
-rw-r--r--ext/tk/lib/tkextlib/tile/tpaned.rb93
-rw-r--r--ext/tk/lib/tkextlib/tile/tprogressbar.rb6
-rw-r--r--ext/tk/lib/tkextlib/tile/tradiobutton.rb12
-rw-r--r--ext/tk/lib/tkextlib/tile/treeview.rb1284
-rw-r--r--ext/tk/lib/tkextlib/tile/tscale.rb14
-rw-r--r--ext/tk/lib/tkextlib/tile/tscrollbar.rb39
-rw-r--r--ext/tk/lib/tkextlib/tile/tseparator.rb6
-rw-r--r--ext/tk/lib/tkextlib/tile/tspinbox.rb107
-rw-r--r--ext/tk/lib/tkextlib/tile/tsquare.rb2
-rw-r--r--ext/tk/lib/tkextlib/tkDND/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tkDND/shape.rb32
-rw-r--r--ext/tk/lib/tkextlib/tkDND/tkdnd.rb70
-rw-r--r--ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb25
-rw-r--r--ext/tk/lib/tkextlib/tkHTML/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tkimg/README2
-rw-r--r--ext/tk/lib/tkextlib/tkimg/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tktable/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tktable/tktable.rb305
-rw-r--r--ext/tk/lib/tkextlib/tktrans/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tktrans/tktrans.rb4
-rw-r--r--ext/tk/lib/tkextlib/treectrl/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/treectrl/tktreectrl.rb519
-rw-r--r--ext/tk/lib/tkextlib/trofs/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/version.rb6
-rw-r--r--ext/tk/lib/tkextlib/vu/bargraph.rb10
-rw-r--r--ext/tk/lib/tkextlib/vu/charts.rb2
-rw-r--r--ext/tk/lib/tkextlib/vu/dial.rb6
-rw-r--r--ext/tk/lib/tkextlib/vu/pie.rb83
-rw-r--r--ext/tk/lib/tkextlib/vu/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/vu/spinbox.rb4
-rw-r--r--ext/tk/lib/tkextlib/winico/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/winico/winico.rb89
-rw-r--r--ext/tk/old-README.tcltklib.eucj206
-rw-r--r--ext/tk/old-extconf.rb440
-rw-r--r--ext/tk/sample/24hr_clock.rb130
-rw-r--r--ext/tk/sample/binding_sample.rb8
-rw-r--r--ext/tk/sample/bindtag_sample.rb38
-rw-r--r--ext/tk/sample/binstr_usage.rb14
-rw-r--r--ext/tk/sample/cd_timer.rb16
-rw-r--r--ext/tk/sample/cmd_res_test.rb2
-rw-r--r--ext/tk/sample/demos-en/ChangeLog.prev2
-rw-r--r--ext/tk/sample/demos-en/README130
-rw-r--r--ext/tk/sample/demos-en/README.1st8
-rw-r--r--ext/tk/sample/demos-en/README.tkencoding22
-rw-r--r--ext/tk/sample/demos-en/anilabel.rb24
-rw-r--r--ext/tk/sample/demos-en/aniwave.rb19
-rw-r--r--ext/tk/sample/demos-en/arrow.rb80
-rw-r--r--ext/tk/sample/demos-en/bind.rb67
-rw-r--r--ext/tk/sample/demos-en/bitmap.rb16
-rw-r--r--ext/tk/sample/demos-en/browse122
-rw-r--r--ext/tk/sample/demos-en/browse222
-rw-r--r--ext/tk/sample/demos-en/button.rb12
-rw-r--r--ext/tk/sample/demos-en/check.rb22
-rw-r--r--ext/tk/sample/demos-en/check2.rb46
-rw-r--r--ext/tk/sample/demos-en/clrpick.rb30
-rw-r--r--ext/tk/sample/demos-en/colors.rb20
-rw-r--r--ext/tk/sample/demos-en/combo.rb96
-rw-r--r--ext/tk/sample/demos-en/cscroll.rb34
-rw-r--r--ext/tk/sample/demos-en/ctext.rb81
-rw-r--r--ext/tk/sample/demos-en/doc.org/license.terms2
-rw-r--r--ext/tk/sample/demos-en/doc.org/license.terms.tk802
-rw-r--r--ext/tk/sample/demos-en/entry1.rb18
-rw-r--r--ext/tk/sample/demos-en/entry2.rb12
-rw-r--r--ext/tk/sample/demos-en/entry3.rb70
-rw-r--r--ext/tk/sample/demos-en/filebox.rb47
-rw-r--r--ext/tk/sample/demos-en/floor.rb560
-rw-r--r--ext/tk/sample/demos-en/floor2.rb560
-rw-r--r--ext/tk/sample/demos-en/form.rb14
-rw-r--r--ext/tk/sample/demos-en/goldberg.rb419
-rw-r--r--ext/tk/sample/demos-en/hello6
-rw-r--r--ext/tk/sample/demos-en/hscale.rb29
-rw-r--r--ext/tk/sample/demos-en/icon.rb24
-rw-r--r--ext/tk/sample/demos-en/image1.rb15
-rw-r--r--ext/tk/sample/demos-en/image2.rb28
-rw-r--r--ext/tk/sample/demos-en/image3.rb43
-rw-r--r--ext/tk/sample/demos-en/items.rb103
-rw-r--r--ext/tk/sample/demos-en/ixset28
-rw-r--r--ext/tk/sample/demos-en/ixset254
-rw-r--r--ext/tk/sample/demos-en/knightstour.rb271
-rw-r--r--ext/tk/sample/demos-en/label.rb29
-rw-r--r--ext/tk/sample/demos-en/labelframe.rb18
-rw-r--r--ext/tk/sample/demos-en/mclist.rb117
-rw-r--r--ext/tk/sample/demos-en/menu.rb60
-rw-r--r--ext/tk/sample/demos-en/menu84.rb68
-rw-r--r--ext/tk/sample/demos-en/menubu.rb14
-rw-r--r--ext/tk/sample/demos-en/msgbox.rb34
-rw-r--r--ext/tk/sample/demos-en/msgbox2.rb91
-rw-r--r--ext/tk/sample/demos-en/paned1.rb18
-rw-r--r--ext/tk/sample/demos-en/paned2.rb52
-rw-r--r--ext/tk/sample/demos-en/patch_1.1c193
-rw-r--r--ext/tk/sample/demos-en/pendulum.rb75
-rw-r--r--ext/tk/sample/demos-en/plot.rb36
-rw-r--r--ext/tk/sample/demos-en/puzzle.rb38
-rw-r--r--ext/tk/sample/demos-en/radio.rb24
-rw-r--r--ext/tk/sample/demos-en/radio2.rb33
-rw-r--r--ext/tk/sample/demos-en/radio3.rb55
-rw-r--r--ext/tk/sample/demos-en/rmt68
-rw-r--r--ext/tk/sample/demos-en/rolodex6
-rw-r--r--ext/tk/sample/demos-en/rolodex-j323
-rw-r--r--ext/tk/sample/demos-en/ruler.rb42
-rw-r--r--ext/tk/sample/demos-en/sayings.rb16
-rw-r--r--ext/tk/sample/demos-en/search.rb51
-rw-r--r--ext/tk/sample/demos-en/spin.rb22
-rw-r--r--ext/tk/sample/demos-en/square12
-rw-r--r--ext/tk/sample/demos-en/states.rb30
-rw-r--r--ext/tk/sample/demos-en/style.rb80
-rw-r--r--ext/tk/sample/demos-en/tcolor18
-rw-r--r--ext/tk/sample/demos-en/text.rb14
-rw-r--r--ext/tk/sample/demos-en/textpeer.rb76
-rw-r--r--ext/tk/sample/demos-en/timer2
-rw-r--r--ext/tk/sample/demos-en/toolbar.rb130
-rw-r--r--ext/tk/sample/demos-en/tree.rb119
-rw-r--r--ext/tk/sample/demos-en/ttkbut.rb139
-rw-r--r--ext/tk/sample/demos-en/ttkmenu.rb85
-rw-r--r--ext/tk/sample/demos-en/ttknote.rb89
-rw-r--r--ext/tk/sample/demos-en/ttkpane.rb213
-rw-r--r--ext/tk/sample/demos-en/ttkprogress.rb66
-rw-r--r--ext/tk/sample/demos-en/twind.rb72
-rw-r--r--ext/tk/sample/demos-en/twind2.rb134
-rw-r--r--ext/tk/sample/demos-en/unicodeout.rb50
-rw-r--r--ext/tk/sample/demos-en/vscale.rb29
-rw-r--r--ext/tk/sample/demos-en/widget353
-rw-r--r--ext/tk/sample/demos-jp/README104
-rw-r--r--ext/tk/sample/demos-jp/README.1st28
-rw-r--r--ext/tk/sample/demos-jp/anilabel.rb45
-rw-r--r--ext/tk/sample/demos-jp/aniwave.rb28
-rw-r--r--ext/tk/sample/demos-jp/arrow.rb97
-rw-r--r--ext/tk/sample/demos-jp/bind.rb88
-rw-r--r--ext/tk/sample/demos-jp/bitmap.rb33
-rw-r--r--ext/tk/sample/demos-jp/browse122
-rw-r--r--ext/tk/sample/demos-jp/browse222
-rw-r--r--ext/tk/sample/demos-jp/button.rb24
-rw-r--r--ext/tk/sample/demos-jp/check.rb39
-rw-r--r--ext/tk/sample/demos-jp/check2.rb61
-rw-r--r--ext/tk/sample/demos-jp/clrpick.rb45
-rw-r--r--ext/tk/sample/demos-jp/colors.rb39
-rw-r--r--ext/tk/sample/demos-jp/combo.rb98
-rw-r--r--ext/tk/sample/demos-jp/cscroll.rb53
-rw-r--r--ext/tk/sample/demos-jp/ctext.rb108
-rw-r--r--ext/tk/sample/demos-jp/dialog1.rb11
-rw-r--r--ext/tk/sample/demos-jp/dialog2.rb11
-rw-r--r--ext/tk/sample/demos-jp/doc.org/license.terms2
-rw-r--r--ext/tk/sample/demos-jp/doc.org/license.terms.tk802
-rw-r--r--ext/tk/sample/demos-jp/entry1.rb45
-rw-r--r--ext/tk/sample/demos-jp/entry2.rb41
-rw-r--r--ext/tk/sample/demos-jp/entry3.rb105
-rw-r--r--ext/tk/sample/demos-jp/filebox.rb72
-rw-r--r--ext/tk/sample/demos-jp/floor.rb579
-rw-r--r--ext/tk/sample/demos-jp/floor2.rb579
-rw-r--r--ext/tk/sample/demos-jp/form.rb37
-rw-r--r--ext/tk/sample/demos-jp/goldberg.rb440
-rw-r--r--ext/tk/sample/demos-jp/hello5
-rw-r--r--ext/tk/sample/demos-jp/hscale.rb41
-rw-r--r--ext/tk/sample/demos-jp/icon.rb45
-rw-r--r--ext/tk/sample/demos-jp/image1.rb36
-rw-r--r--ext/tk/sample/demos-jp/image2.rb52
-rw-r--r--ext/tk/sample/demos-jp/image3.rb40
-rw-r--r--ext/tk/sample/demos-jp/items.rb156
-rw-r--r--ext/tk/sample/demos-jp/ixset30
-rw-r--r--ext/tk/sample/demos-jp/ixset277
-rw-r--r--ext/tk/sample/demos-jp/knightstour.rb273
-rw-r--r--ext/tk/sample/demos-jp/label.rb46
-rw-r--r--ext/tk/sample/demos-jp/labelframe.rb48
-rw-r--r--ext/tk/sample/demos-jp/mclist.rb121
-rw-r--r--ext/tk/sample/demos-jp/menu.rb141
-rw-r--r--ext/tk/sample/demos-jp/menu84.rb107
-rw-r--r--ext/tk/sample/demos-jp/menu8x.rb159
-rw-r--r--ext/tk/sample/demos-jp/menubu.rb41
-rw-r--r--ext/tk/sample/demos-jp/msgbox.rb63
-rw-r--r--ext/tk/sample/demos-jp/msgbox2.rb90
-rw-r--r--ext/tk/sample/demos-jp/paned1.rb34
-rw-r--r--ext/tk/sample/demos-jp/paned2.rb74
-rw-r--r--ext/tk/sample/demos-jp/pendulum.rb84
-rw-r--r--ext/tk/sample/demos-jp/plot.rb61
-rw-r--r--ext/tk/sample/demos-jp/puzzle.rb67
-rw-r--r--ext/tk/sample/demos-jp/radio.rb43
-rw-r--r--ext/tk/sample/demos-jp/radio2.rb49
-rw-r--r--ext/tk/sample/demos-jp/radio3.rb61
-rw-r--r--ext/tk/sample/demos-jp/rmt68
-rw-r--r--ext/tk/sample/demos-jp/rolodex6
-rw-r--r--ext/tk/sample/demos-jp/rolodex-j135
-rw-r--r--ext/tk/sample/demos-jp/ruler.rb59
-rw-r--r--ext/tk/sample/demos-jp/sayings.rb35
-rw-r--r--ext/tk/sample/demos-jp/search.rb80
-rw-r--r--ext/tk/sample/demos-jp/spin.rb64
-rw-r--r--ext/tk/sample/demos-jp/square12
-rw-r--r--ext/tk/sample/demos-jp/states.rb43
-rw-r--r--ext/tk/sample/demos-jp/style.rb258
-rw-r--r--ext/tk/sample/demos-jp/tcolor51
-rw-r--r--ext/tk/sample/demos-jp/text.rb111
-rw-r--r--ext/tk/sample/demos-jp/textpeer.rb82
-rw-r--r--ext/tk/sample/demos-jp/timer2
-rw-r--r--ext/tk/sample/demos-jp/toolbar.rb136
-rw-r--r--ext/tk/sample/demos-jp/tree.rb120
-rw-r--r--ext/tk/sample/demos-jp/ttkbut.rb145
-rw-r--r--ext/tk/sample/demos-jp/ttkmenu.rb91
-rw-r--r--ext/tk/sample/demos-jp/ttknote.rb97
-rw-r--r--ext/tk/sample/demos-jp/ttkpane.rb216
-rw-r--r--ext/tk/sample/demos-jp/ttkprogress.rb71
-rw-r--r--ext/tk/sample/demos-jp/twind.rb143
-rw-r--r--ext/tk/sample/demos-jp/twind2.rb223
-rw-r--r--ext/tk/sample/demos-jp/unicodeout.rb86
-rw-r--r--ext/tk/sample/demos-jp/vscale.rb44
-rw-r--r--ext/tk/sample/demos-jp/widget613
-rw-r--r--ext/tk/sample/editable_listbox.rb148
-rw-r--r--ext/tk/sample/encstr_usage.rb9
-rw-r--r--ext/tk/sample/figmemo_sample.rb456
-rw-r--r--ext/tk/sample/images/teapot.ppm49
-rw-r--r--ext/tk/sample/irbtk.rb4
-rw-r--r--ext/tk/sample/irbtkw.rbw156
-rw-r--r--ext/tk/sample/menubar1.rb20
-rw-r--r--ext/tk/sample/menubar2.rb24
-rw-r--r--ext/tk/sample/menubar3.rb72
-rw-r--r--ext/tk/sample/msgs_rb/README4
-rw-r--r--ext/tk/sample/msgs_rb/es.msg2
-rw-r--r--ext/tk/sample/msgs_rb/ru.msg4
-rw-r--r--ext/tk/sample/msgs_rb2/README2
-rw-r--r--ext/tk/sample/msgs_rb2/ja.msg154
-rw-r--r--ext/tk/sample/msgs_tk/README2
-rw-r--r--ext/tk/sample/msgs_tk/el.msg2
-rw-r--r--ext/tk/sample/msgs_tk/es.msg2
-rw-r--r--ext/tk/sample/msgs_tk/license.terms2
-rw-r--r--ext/tk/sample/msgs_tk/ru.msg4
-rw-r--r--ext/tk/sample/multi-ip_sample.rb7
-rw-r--r--ext/tk/sample/multi-ip_sample2.rb2
-rw-r--r--ext/tk/sample/optobj_sample.rb30
-rw-r--r--ext/tk/sample/propagate.rb2
-rw-r--r--ext/tk/sample/remote-ip_sample.rb10
-rw-r--r--ext/tk/sample/remote-ip_sample2.rb20
-rw-r--r--ext/tk/sample/safe-tk.rb57
-rw-r--r--ext/tk/sample/scrollframe.rb28
-rw-r--r--ext/tk/sample/tcltklib/sample0.rb12
-rw-r--r--ext/tk/sample/tcltklib/sample1.rb304
-rw-r--r--ext/tk/sample/tcltklib/sample2.rb120
-rw-r--r--ext/tk/sample/tkalignbox.rb102
-rw-r--r--ext/tk/sample/tkballoonhelp.rb118
-rw-r--r--ext/tk/sample/tkbiff.rb6
-rw-r--r--ext/tk/sample/tkbrowse.rb2
-rw-r--r--ext/tk/sample/tkcombobox.rb133
-rw-r--r--ext/tk/sample/tkdialog.rb2
-rw-r--r--ext/tk/sample/tkextlib/ICONS/viewIcons.rb38
-rw-r--r--ext/tk/sample/tkextlib/blt/barchart5.rb22
-rw-r--r--ext/tk/sample/tkextlib/blt/calendar.rb54
-rw-r--r--ext/tk/sample/tkextlib/blt/graph6.rb4056
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7.rb8
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7a.rb10
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7b.rb8
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7c.rb8
-rw-r--r--ext/tk/sample/tkextlib/blt/pareto.rb34
-rw-r--r--ext/tk/sample/tkextlib/blt/plot1b.rb2
-rw-r--r--ext/tk/sample/tkextlib/blt/readme.txt2
-rw-r--r--ext/tk/sample/tkextlib/blt/winop1.rb8
-rw-r--r--ext/tk/sample/tkextlib/blt/winop2.rb2
-rw-r--r--ext/tk/sample/tkextlib/bwidget/basic.rb96
-rw-r--r--ext/tk/sample/tkextlib/bwidget/demo.rb84
-rw-r--r--ext/tk/sample/tkextlib/bwidget/dnd.rb16
-rw-r--r--ext/tk/sample/tkextlib/bwidget/manager.rb28
-rw-r--r--ext/tk/sample/tkextlib/bwidget/select.rb56
-rw-r--r--ext/tk/sample/tkextlib/bwidget/tmpldlg.rb162
-rw-r--r--ext/tk/sample/tkextlib/bwidget/tree.rb96
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb12
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb16
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb10
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb12
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb16
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb4
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb36
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb66
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb12
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb6
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb6
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb4
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb6
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb4
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/shell.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb32
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/watch.rb2
-rw-r--r--ext/tk/sample/tkextlib/tcllib/datefield.rb4
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos1.rb22
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos2.rb8
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos3.rb20
-rw-r--r--ext/tk/sample/tkextlib/tcllib/xyplot.rb2
-rw-r--r--ext/tk/sample/tkextlib/tile/demo.rb213
-rw-r--r--ext/tk/sample/tkextlib/tile/readme.txt4
-rw-r--r--ext/tk/sample/tkextlib/tile/repeater.tcl12
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue.tcl8
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/pkgIndex.tcl2
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik.tcl30
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/pkgIndex.tcl4
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc.rb122
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/kroc.tcl38
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/pkgIndex.tcl4
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/pkgIndex.tcl4
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik.tcl2
-rw-r--r--ext/tk/sample/tkextlib/tile/toolbutton.tcl36
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/README6
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/hv.rb48
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/index.html2
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/index.html48
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/index.html40
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/ss.rb82
-rw-r--r--ext/tk/sample/tkextlib/tkimg/demo.rb10
-rw-r--r--ext/tk/sample/tkextlib/tkimg/license_terms_of_Img_extension4
-rw-r--r--ext/tk/sample/tkextlib/tkimg/readme.txt2
-rw-r--r--ext/tk/sample/tkextlib/tktable/basic.rb14
-rw-r--r--ext/tk/sample/tkextlib/tktable/buttons.rb12
-rw-r--r--ext/tk/sample/tkextlib/tktable/command.rb22
-rw-r--r--ext/tk/sample/tkextlib/tktable/debug.rb16
-rw-r--r--ext/tk/sample/tkextlib/tktable/dynarows.rb14
-rw-r--r--ext/tk/sample/tkextlib/tktable/maxsize.rb14
-rw-r--r--ext/tk/sample/tkextlib/tktable/spreadsheet.rb16
-rw-r--r--[-rwxr-xr-x]ext/tk/sample/tkextlib/tktable/tcllogo.gifbin2341 -> 2341 bytes-rw-r--r--ext/tk/sample/tkextlib/tktable/valid.rb12
-rw-r--r--ext/tk/sample/tkextlib/treectrl/bitmaps.rb32
-rw-r--r--ext/tk/sample/tkextlib/treectrl/demo.rb349
-rw-r--r--ext/tk/sample/tkextlib/treectrl/explorer.rb126
-rw-r--r--ext/tk/sample/tkextlib/treectrl/help.rb106
-rw-r--r--ext/tk/sample/tkextlib/treectrl/imovie.rb30
-rw-r--r--ext/tk/sample/tkextlib/treectrl/layout.rb26
-rw-r--r--ext/tk/sample/tkextlib/treectrl/mailwasher.rb100
-rw-r--r--ext/tk/sample/tkextlib/treectrl/outlook-folders.rb52
-rw-r--r--ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb102
-rw-r--r--ext/tk/sample/tkextlib/treectrl/random.rb68
-rw-r--r--ext/tk/sample/tkextlib/treectrl/readme.txt2
-rw-r--r--ext/tk/sample/tkextlib/treectrl/www-options.rb72
-rw-r--r--ext/tk/sample/tkextlib/vu/canvItems.rb68
-rw-r--r--ext/tk/sample/tkextlib/vu/canvSticker.rb4
-rw-r--r--ext/tk/sample/tkextlib/vu/canvSticker2.rb16
-rw-r--r--ext/tk/sample/tkextlib/vu/dial_demo.rb62
-rw-r--r--ext/tk/sample/tkextlib/vu/oscilloscope.rb16
-rw-r--r--ext/tk/sample/tkextlib/vu/pie.rb10
-rw-r--r--ext/tk/sample/tkextlib/vu/vu_demo.rb14
-rw-r--r--ext/tk/sample/tkfrom.rb2
-rw-r--r--ext/tk/sample/tkhello.rb2
-rw-r--r--ext/tk/sample/tkmenubutton.rb56
-rw-r--r--ext/tk/sample/tkmsgcat-load_rb.rb16
-rw-r--r--ext/tk/sample/tkmsgcat-load_rb2.rb16
-rw-r--r--ext/tk/sample/tkmsgcat-load_tk.rb22
-rw-r--r--ext/tk/sample/tkmulticolumnlist.rb114
-rw-r--r--ext/tk/sample/tkmultilistbox.rb96
-rw-r--r--ext/tk/sample/tkmultilistframe.rb168
-rw-r--r--ext/tk/sample/tkoptdb-safeTk.rb30
-rw-r--r--ext/tk/sample/tkoptdb.rb34
-rw-r--r--ext/tk/sample/tkrttimer.rb17
-rw-r--r--ext/tk/sample/tksleep_sample.rb29
-rw-r--r--ext/tk/sample/tktextframe.rb267
-rw-r--r--ext/tk/sample/tktextio.rb579
-rw-r--r--ext/tk/sample/tktimer2.rb8
-rw-r--r--ext/tk/sample/tktimer3.rb8
-rw-r--r--ext/tk/sample/tktree.rb26
-rw-r--r--ext/tk/sample/ttk_wrapper.rb154
-rw-r--r--ext/tk/stubs.c134
-rw-r--r--ext/tk/tcltklib.c4518
-rw-r--r--ext/tk/tkutil/.cvsignore3
-rw-r--r--ext/tk/tkutil/extconf.rb16
-rw-r--r--ext/tk/tkutil/tkutil.c881
-rw-r--r--ext/win32ole/.cvsignore4
-rw-r--r--ext/win32ole/depend2
-rw-r--r--ext/win32ole/doc/win32ole.rd294
-rw-r--r--ext/win32ole/extconf.rb32
-rw-r--r--ext/win32ole/lib/win32ole.rb22
-rw-r--r--ext/win32ole/sample/excel1.rb15
-rw-r--r--ext/win32ole/sample/excel2.rb10
-rw-r--r--ext/win32ole/sample/ieconst.rb2
-rw-r--r--ext/win32ole/sample/ienavi.rb2
-rw-r--r--ext/win32ole/sample/ienavi2.rb40
-rw-r--r--ext/win32ole/sample/oledirs.rb2
-rw-r--r--ext/win32ole/sample/olegen.rb27
-rw-r--r--ext/win32ole/sample/xml.rb36
-rw-r--r--ext/win32ole/tests/oleserver.rb10
-rw-r--r--ext/win32ole/tests/testNIL2VTEMPTY.rb28
-rw-r--r--ext/win32ole/tests/testOLEEVENT.rb91
-rw-r--r--ext/win32ole/tests/testOLEMETHOD.rb92
-rw-r--r--ext/win32ole/tests/testOLEPARAM.rb65
-rw-r--r--ext/win32ole/tests/testOLETYPE.rb96
-rw-r--r--ext/win32ole/tests/testOLEVARIABLE.rb49
-rw-r--r--ext/win32ole/tests/testVARIANT.rb32
-rw-r--r--ext/win32ole/tests/testWIN32OLE.rb372
-rw-r--r--ext/win32ole/tests/test_ole_methods.rb36
-rw-r--r--ext/win32ole/tests/test_propertyputref.rb19
-rw-r--r--ext/win32ole/tests/test_word.rb37
-rw-r--r--ext/win32ole/tests/testall.rb15
-rw-r--r--ext/win32ole/win32ole.c6095
-rw-r--r--ext/zlib/.cvsignore3
-rw-r--r--ext/zlib/doc/zlib.rd911
-rw-r--r--ext/zlib/extconf.rb17
-rw-r--r--ext/zlib/zlib.c2846
-rw-r--r--file.c4083
-rw-r--r--gc.c5179
-rw-r--r--gc.h104
-rw-r--r--gem_prelude.rb1
-rw-r--r--golf_prelude.rb122
-rw-r--r--goruby.c58
-rw-r--r--hash.c2875
-rw-r--r--ia64.s42
-rw-r--r--include/ruby.h35
-rw-r--r--include/ruby/backward/classext.h18
-rw-r--r--include/ruby/backward/rubyio.h6
-rw-r--r--include/ruby/backward/rubysig.h56
-rw-r--r--include/ruby/backward/st.h6
-rw-r--r--include/ruby/backward/util.h6
-rw-r--r--include/ruby/debug.h92
-rw-r--r--include/ruby/defines.h264
-rw-r--r--include/ruby/encoding.h354
-rw-r--r--include/ruby/intern.h919
-rw-r--r--include/ruby/io.h203
-rw-r--r--include/ruby/missing.h245
-rw-r--r--include/ruby/oniguruma.h839
-rw-r--r--include/ruby/re.h75
-rw-r--r--include/ruby/regex.h50
-rw-r--r--include/ruby/ruby.h1728
-rw-r--r--include/ruby/st.h157
-rw-r--r--include/ruby/subst.h19
-rw-r--r--include/ruby/thread.h49
-rw-r--r--include/ruby/util.h99
-rw-r--r--include/ruby/version.h78
-rw-r--r--include/ruby/vm.h68
-rw-r--r--include/ruby/win32.h799
-rw-r--r--inits.c121
-rw-r--r--insns.def2148
-rw-r--r--instruby.rb244
-rw-r--r--intern.h500
-rw-r--r--internal.h378
-rw-r--r--io.c11760
-rw-r--r--iseq.c2272
-rw-r--r--iseq.h140
-rw-r--r--keywords42
-rw-r--r--lex.c136
-rw-r--r--lex.c.blt219
-rw-r--r--lib/.document103
-rw-r--r--lib/English.rb10
-rw-r--r--lib/Env.rb18
-rw-r--r--lib/README189
-rwxr-xr-x[-rw-r--r--]lib/abbrev.rb109
-rw-r--r--lib/base64.rb142
-rw-r--r--lib/benchmark.rb379
-rw-r--r--lib/cgi-lib.rb272
-rw-r--r--lib/cgi.rb2189
-rw-r--r--lib/cgi/.document2
-rw-r--r--lib/cgi/cookie.rb164
-rw-r--r--lib/cgi/core.rb864
-rw-r--r--lib/cgi/html.rb1077
-rw-r--r--lib/cgi/session.rb275
-rw-r--r--lib/cgi/session/pstore.rb60
-rw-r--r--lib/cgi/util.rb198
-rw-r--r--lib/cmath.rb402
-rw-r--r--lib/complex.rb633
-rw-r--r--lib/csv.rb3138
-rw-r--r--lib/date.rb1328
-rw-r--r--lib/date/format.rb603
-rw-r--r--lib/date2.rb5
-rw-r--r--lib/debug.rb1692
-rw-r--r--lib/delegate.rb473
-rw-r--r--lib/drb/acl.rb154
-rw-r--r--lib/drb/drb.rb583
-rw-r--r--lib/drb/eq.rb2
-rw-r--r--lib/drb/extserv.rb21
-rw-r--r--lib/drb/extservm.rb71
-rw-r--r--lib/drb/invokemethod.rb12
-rw-r--r--lib/drb/observer.rb20
-rw-r--r--lib/drb/ssl.rb182
-rw-r--r--lib/drb/timeridconv.rb80
-rw-r--r--lib/drb/unix.rb52
-rw-r--r--lib/e2mmap.rb107
-rw-r--r--lib/erb.rb870
-rw-r--r--lib/eregex.rb37
-rw-r--r--lib/fileutils.rb902
-rw-r--r--lib/finalize.rb193
-rw-r--r--lib/find.rb48
-rw-r--r--lib/forwardable.rb293
-rw-r--r--lib/ftools.rb261
-rw-r--r--lib/generator.rb380
-rw-r--r--lib/getoptlong.rb295
-rw-r--r--lib/getopts.rb127
-rw-r--r--lib/gserver.rb94
-rw-r--r--lib/importenv.rb33
-rw-r--r--lib/ipaddr.rb522
-rw-r--r--lib/irb.rb669
-rw-r--r--lib/irb/cmd/chws.rb12
-rw-r--r--lib/irb/cmd/fork.rb20
-rw-r--r--lib/irb/cmd/help.rb27
-rw-r--r--lib/irb/cmd/load.rb15
-rw-r--r--lib/irb/cmd/nop.rb16
-rw-r--r--lib/irb/cmd/pushws.rb11
-rw-r--r--lib/irb/cmd/subirb.rb13
-rw-r--r--lib/irb/completion.rb148
-rw-r--r--lib/irb/context.rb213
-rw-r--r--lib/irb/ext/change-ws.rb27
-rw-r--r--lib/irb/ext/history.rb30
-rw-r--r--lib/irb/ext/loader.rb34
-rw-r--r--lib/irb/ext/math-mode.rb22
-rw-r--r--lib/irb/ext/multi-irb.rb93
-rw-r--r--lib/irb/ext/save-history.rb81
-rw-r--r--lib/irb/ext/tracer.rb24
-rw-r--r--lib/irb/ext/use-loader.rb20
-rw-r--r--lib/irb/ext/workspaces.rb22
-rw-r--r--lib/irb/extend-command.rb126
-rw-r--r--lib/irb/frame.rb23
-rw-r--r--lib/irb/help.rb37
-rw-r--r--lib/irb/init.rb103
-rw-r--r--lib/irb/input-method.rb119
-rw-r--r--lib/irb/inspector.rb145
-rw-r--r--lib/irb/lc/error.rb15
-rw-r--r--lib/irb/lc/help-message23
-rw-r--r--lib/irb/lc/ja/encoding_aliases.rb10
-rw-r--r--lib/irb/lc/ja/error.rb35
-rw-r--r--lib/irb/lc/ja/help-message61
-rw-r--r--lib/irb/locale.rb170
-rw-r--r--lib/irb/magic-file.rb37
-rw-r--r--lib/irb/notifier.rb116
-rw-r--r--lib/irb/output-method.rb70
-rw-r--r--lib/irb/ruby-lex.rb222
-rw-r--r--lib/irb/ruby-token.rb32
-rw-r--r--lib/irb/slex.rb53
-rw-r--r--lib/irb/src_encoding.rb4
-rw-r--r--lib/irb/version.rb13
-rw-r--r--lib/irb/workspace.rb37
-rw-r--r--lib/irb/ws-for-case-2.rb11
-rw-r--r--lib/irb/xmp.rb95
-rw-r--r--lib/jcode.rb220
-rw-r--r--lib/logger.rb344
-rw-r--r--lib/mailread.rb62
-rw-r--r--lib/mathn.rb432
-rw-r--r--lib/matrix.rb1765
-rw-r--r--lib/matrix/eigenvalue_decomposition.rb886
-rw-r--r--lib/matrix/lup_decomposition.rb218
-rw-r--r--lib/minitest/README.txt394
-rw-r--r--lib/minitest/autorun.rb19
-rw-r--r--lib/minitest/benchmark.rb380
-rw-r--r--lib/minitest/hell.rb16
-rw-r--r--lib/minitest/mock.rb200
-rw-r--r--lib/minitest/parallel_each.rb36
-rw-r--r--lib/minitest/pride.rb119
-rw-r--r--lib/minitest/spec.rb541
-rw-r--r--lib/minitest/unit.rb1477
-rw-r--r--lib/mkmf.rb3355
-rw-r--r--lib/monitor.rb362
-rw-r--r--lib/mutex_m.rb121
-rw-r--r--lib/net/ftp.rb898
-rw-r--r--lib/net/http.rb2642
-rw-r--r--lib/net/http/backward.rb25
-rw-r--r--lib/net/http/exceptions.rb25
-rw-r--r--lib/net/http/generic_request.rb309
-rw-r--r--lib/net/http/header.rb452
-rw-r--r--lib/net/http/proxy_delta.rb16
-rw-r--r--lib/net/http/request.rb20
-rw-r--r--lib/net/http/requests.rb122
-rw-r--r--lib/net/http/response.rb399
-rw-r--r--lib/net/http/responses.rb268
-rw-r--r--lib/net/https.rb163
-rw-r--r--lib/net/imap.rb1191
-rw-r--r--lib/net/pop.rb360
-rw-r--r--lib/net/protocol.rb68
-rw-r--r--lib/net/smtp.rb810
-rw-r--r--lib/net/telnet.rb273
-rw-r--r--lib/observer.rb96
-rw-r--r--lib/open-uri.rb395
-rw-r--r--lib/open3.rb758
-rw-r--r--lib/optparse.rb504
-rw-r--r--lib/optparse/ac.rb50
-rw-r--r--lib/optparse/version.rb10
-rw-r--r--lib/ostruct.rb242
-rw-r--r--lib/parsearg.rb87
-rw-r--r--lib/parsedate.rb15
-rw-r--r--lib/pathname.rb1062
-rw-r--r--lib/ping.rb53
-rw-r--r--lib/pp.rb373
-rw-r--r--lib/prettyprint.rb553
-rw-r--r--lib/prime.rb509
-rw-r--r--lib/profile.rb4
-rw-r--r--lib/profiler.rb134
-rw-r--r--lib/pstore.rb376
-rw-r--r--lib/racc/parser.rb53
-rw-r--r--lib/rake.rb71
-rw-r--r--lib/rake/alt_system.rb109
-rw-r--r--lib/rake/application.rb702
-rw-r--r--lib/rake/backtrace.rb18
-rw-r--r--lib/rake/classic_namespace.rb11
-rw-r--r--lib/rake/clean.rb32
-rw-r--r--lib/rake/cloneable.rb16
-rw-r--r--lib/rake/contrib/compositepublisher.rb21
-rw-r--r--lib/rake/contrib/ftptools.rb151
-rw-r--r--lib/rake/contrib/publisher.rb73
-rw-r--r--lib/rake/contrib/rubyforgepublisher.rb16
-rw-r--r--lib/rake/contrib/sshpublisher.rb50
-rw-r--r--lib/rake/contrib/sys.rb192
-rw-r--r--lib/rake/default_loader.rb10
-rw-r--r--lib/rake/dsl_definition.rb182
-rw-r--r--lib/rake/early_time.rb18
-rw-r--r--lib/rake/ext/core.rb27
-rw-r--r--lib/rake/ext/module.rb39
-rw-r--r--lib/rake/ext/string.rb168
-rw-r--r--lib/rake/ext/time.rb15
-rw-r--r--lib/rake/file_creation_task.rb24
-rw-r--r--lib/rake/file_list.rb410
-rw-r--r--lib/rake/file_task.rb47
-rw-r--r--lib/rake/file_utils.rb114
-rw-r--r--lib/rake/file_utils_ext.rb146
-rw-r--r--lib/rake/gempackagetask.rb15
-rw-r--r--lib/rake/invocation_chain.rb51
-rw-r--r--lib/rake/invocation_exception_mixin.rb16
-rw-r--r--lib/rake/lib/project.rake21
-rw-r--r--lib/rake/loaders/makefile.rb40
-rw-r--r--lib/rake/multi_task.rb13
-rw-r--r--lib/rake/name_space.rb25
-rw-r--r--lib/rake/packagetask.rb185
-rw-r--r--lib/rake/pathmap.rb1
-rw-r--r--lib/rake/phony.rb15
-rw-r--r--lib/rake/private_reader.rb20
-rw-r--r--lib/rake/promise.rb99
-rw-r--r--lib/rake/pseudo_status.rb24
-rw-r--r--lib/rake/rake_module.rb37
-rw-r--r--lib/rake/rake_test_loader.rb22
-rw-r--r--lib/rake/rdoctask.rb234
-rw-r--r--lib/rake/ruby182_test_unit_fix.rb25
-rw-r--r--lib/rake/rule_recursion_overflow_error.rb20
-rw-r--r--lib/rake/runtest.rb22
-rw-r--r--lib/rake/task.rb350
-rw-r--r--lib/rake/task_argument_error.rb7
-rw-r--r--lib/rake/task_arguments.rb78
-rw-r--r--lib/rake/task_manager.rb307
-rw-r--r--lib/rake/tasklib.rb22
-rw-r--r--lib/rake/testtask.rb198
-rw-r--r--lib/rake/thread_history_display.rb48
-rw-r--r--lib/rake/thread_pool.rb155
-rw-r--r--lib/rake/trace_output.rb19
-rw-r--r--lib/rake/version.rb13
-rw-r--r--lib/rake/win32.rb55
-rw-r--r--lib/rational.rb525
-rw-r--r--lib/rbconfig/.document1
-rw-r--r--lib/rbconfig/datadir.rb13
-rw-r--r--lib/rbconfig/obsolete.rb38
-rw-r--r--lib/rdoc.rb182
-rw-r--r--lib/rdoc/README489
-rw-r--r--lib/rdoc/alias.rb111
-rw-r--r--lib/rdoc/anon_class.rb10
-rw-r--r--lib/rdoc/any_method.rb262
-rw-r--r--lib/rdoc/attr.rb173
-rw-r--r--lib/rdoc/class_module.rb780
-rw-r--r--lib/rdoc/code_object.rb347
-rw-r--r--lib/rdoc/code_objects.rb766
-rw-r--r--lib/rdoc/comment.rb232
-rw-r--r--lib/rdoc/constant.rb178
-rw-r--r--lib/rdoc/context.rb1190
-rw-r--r--lib/rdoc/context/section.rb238
-rw-r--r--lib/rdoc/cross_reference.rb183
-rw-r--r--lib/rdoc/diagram.rb335
-rw-r--r--lib/rdoc/dot/dot.rb255
-rw-r--r--lib/rdoc/encoding.rb97
-rw-r--r--lib/rdoc/erb_partial.rb18
-rw-r--r--lib/rdoc/erbio.rb37
-rw-r--r--lib/rdoc/extend.rb117
-rw-r--r--lib/rdoc/generator.rb50
-rw-r--r--lib/rdoc/generator/darkfish.rb720
-rw-r--r--lib/rdoc/generator/json_index.rb248
-rw-r--r--lib/rdoc/generator/markup.rb169
-rw-r--r--lib/rdoc/generator/ri.rb30
-rw-r--r--lib/rdoc/generator/template/darkfish/.document (renamed from install-sh)0
-rw-r--r--lib/rdoc/generator/template/darkfish/_footer.rhtml5
-rw-r--r--lib/rdoc/generator/template/darkfish/_head.rhtml16
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml18
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml9
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml16
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml8
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml16
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml14
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml12
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml7
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml12
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml10
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml10
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml10
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml19
-rw-r--r--lib/rdoc/generator/template/darkfish/class.rhtml179
-rwxr-xr-xlib/rdoc/generator/template/darkfish/images/add.pngbin0 -> 733 bytes-rwxr-xr-xlib/rdoc/generator/template/darkfish/images/arrow_up.pngbin0 -> 372 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/brick.pngbin0 -> 452 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/brick_link.pngbin0 -> 764 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/bug.pngbin0 -> 774 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/bullet_black.pngbin0 -> 211 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.pngbin0 -> 207 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.pngbin0 -> 209 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/date.pngbin0 -> 626 bytes-rwxr-xr-xlib/rdoc/generator/template/darkfish/images/delete.pngbin0 -> 715 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/find.pngbin0 -> 659 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/loadingAnimation.gifbin0 -> 5886 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/macFFBgHack.pngbin0 -> 207 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/package.pngbin0 -> 853 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/page_green.pngbin0 -> 621 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/page_white_text.pngbin0 -> 342 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/page_white_width.pngbin0 -> 309 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/plugin.pngbin0 -> 591 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/ruby.pngbin0 -> 592 bytes-rwxr-xr-xlib/rdoc/generator/template/darkfish/images/tag_blue.pngbin0 -> 1880 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/tag_green.pngbin0 -> 613 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/transparent.pngbin0 -> 97 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/wrench.pngbin0 -> 610 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/wrench_orange.pngbin0 -> 584 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/zoom.pngbin0 -> 692 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/index.rhtml19
-rw-r--r--lib/rdoc/generator/template/darkfish/js/darkfish.js153
-rw-r--r--lib/rdoc/generator/template/darkfish/js/jquery.js18
-rw-r--r--lib/rdoc/generator/template/darkfish/js/search.js94
-rw-r--r--lib/rdoc/generator/template/darkfish/page.rhtml18
-rw-r--r--lib/rdoc/generator/template/darkfish/rdoc.css595
-rw-r--r--lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml18
-rw-r--r--lib/rdoc/generator/template/darkfish/servlet_root.rhtml37
-rw-r--r--lib/rdoc/generator/template/darkfish/table_of_contents.rhtml55
-rw-r--r--lib/rdoc/generator/template/json_index/js/navigation.js142
-rw-r--r--lib/rdoc/generator/template/json_index/js/searcher.js228
-rw-r--r--lib/rdoc/generators/chm_generator.rb112
-rw-r--r--lib/rdoc/generators/html_generator.rb1509
-rw-r--r--lib/rdoc/generators/ri_generator.rb268
-rw-r--r--lib/rdoc/generators/template/chm/chm.rb87
-rw-r--r--lib/rdoc/generators/template/html/hefss.rb418
-rw-r--r--lib/rdoc/generators/template/html/html.rb711
-rw-r--r--lib/rdoc/generators/template/html/kilmer.rb435
-rw-r--r--lib/rdoc/generators/template/html/old_html.rb728
-rw-r--r--lib/rdoc/generators/template/html/one_page_html.rb122
-rw-r--r--lib/rdoc/generators/template/xml/rdf.rb112
-rw-r--r--lib/rdoc/generators/template/xml/xml.rb112
-rw-r--r--lib/rdoc/generators/xml_generator.rb130
-rw-r--r--lib/rdoc/ghost_method.rb6
-rw-r--r--lib/rdoc/include.rb119
-rw-r--r--lib/rdoc/known_classes.rb72
-rw-r--r--lib/rdoc/markdown.rb16336
-rw-r--r--lib/rdoc/markdown/entities.rb2131
-rw-r--r--lib/rdoc/markdown/literals_1_9.rb417
-rw-r--r--lib/rdoc/markup.rb872
-rw-r--r--lib/rdoc/markup/.document2
-rw-r--r--lib/rdoc/markup/attr_changer.rb22
-rw-r--r--lib/rdoc/markup/attr_span.rb29
-rw-r--r--lib/rdoc/markup/attribute_manager.rb342
-rw-r--r--lib/rdoc/markup/attributes.rb70
-rw-r--r--lib/rdoc/markup/blank_line.rb27
-rw-r--r--lib/rdoc/markup/block_quote.rb14
-rw-r--r--lib/rdoc/markup/document.rb164
-rw-r--r--lib/rdoc/markup/formatter.rb264
-rw-r--r--lib/rdoc/markup/formatter_test_case.rb767
-rw-r--r--lib/rdoc/markup/hard_break.rb31
-rw-r--r--lib/rdoc/markup/heading.rb65
-rw-r--r--lib/rdoc/markup/include.rb42
-rw-r--r--lib/rdoc/markup/indented_paragraph.rb47
-rw-r--r--lib/rdoc/markup/inline.rb1
-rw-r--r--lib/rdoc/markup/list.rb101
-rw-r--r--lib/rdoc/markup/list_item.rb99
-rw-r--r--lib/rdoc/markup/paragraph.rb28
-rw-r--r--lib/rdoc/markup/parser.rb551
-rw-r--r--lib/rdoc/markup/pre_process.rb293
-rw-r--r--lib/rdoc/markup/raw.rb69
-rw-r--r--lib/rdoc/markup/rule.rb20
-rw-r--r--lib/rdoc/markup/sample/rdoc2latex.rb16
-rw-r--r--lib/rdoc/markup/sample/sample.rb42
-rw-r--r--lib/rdoc/markup/simple_markup.rb476
-rw-r--r--lib/rdoc/markup/simple_markup/fragments.rb328
-rw-r--r--lib/rdoc/markup/simple_markup/inline.rb340
-rw-r--r--lib/rdoc/markup/simple_markup/lines.rb151
-rw-r--r--lib/rdoc/markup/simple_markup/preprocess.rb73
-rw-r--r--lib/rdoc/markup/simple_markup/to_flow.rb188
-rw-r--r--lib/rdoc/markup/simple_markup/to_html.rb289
-rw-r--r--lib/rdoc/markup/simple_markup/to_latex.rb333
-rw-r--r--lib/rdoc/markup/special.rb40
-rw-r--r--lib/rdoc/markup/test/AllTests.rb2
-rw-r--r--lib/rdoc/markup/test/TestInline.rb154
-rw-r--r--lib/rdoc/markup/test/TestParse.rb503
-rw-r--r--lib/rdoc/markup/text_formatter_test_case.rb114
-rw-r--r--lib/rdoc/markup/to_ansi.rb93
-rw-r--r--lib/rdoc/markup/to_bs.rb78
-rw-r--r--lib/rdoc/markup/to_html.rb374
-rw-r--r--lib/rdoc/markup/to_html_crossref.rb157
-rw-r--r--lib/rdoc/markup/to_html_snippet.rb284
-rw-r--r--lib/rdoc/markup/to_joined_paragraph.rb71
-rw-r--r--lib/rdoc/markup/to_label.rb74
-rw-r--r--lib/rdoc/markup/to_markdown.rb189
-rw-r--r--lib/rdoc/markup/to_rdoc.rb333
-rw-r--r--lib/rdoc/markup/to_table_of_contents.rb87
-rw-r--r--lib/rdoc/markup/to_test.rb69
-rw-r--r--lib/rdoc/markup/to_tt_only.rb120
-rw-r--r--lib/rdoc/markup/verbatim.rb83
-rw-r--r--lib/rdoc/meta_method.rb6
-rw-r--r--lib/rdoc/method_attr.rb398
-rw-r--r--lib/rdoc/normal_class.rb88
-rw-r--r--lib/rdoc/normal_module.rb69
-rw-r--r--lib/rdoc/options.rb1550
-rw-r--r--lib/rdoc/parser.rb299
-rw-r--r--lib/rdoc/parser/c.rb1181
-rw-r--r--lib/rdoc/parser/changelog.rb194
-rw-r--r--lib/rdoc/parser/markdown.rb23
-rw-r--r--lib/rdoc/parser/rd.rb22
-rw-r--r--lib/rdoc/parser/ruby.rb1957
-rw-r--r--lib/rdoc/parser/ruby_tools.rb167
-rw-r--r--lib/rdoc/parser/simple.rb61
-rw-r--r--lib/rdoc/parser/text.rb11
-rw-r--r--lib/rdoc/parsers/parse_c.rb697
-rw-r--r--lib/rdoc/parsers/parse_f95.rb1841
-rw-r--r--lib/rdoc/parsers/parse_rb.rb2605
-rw-r--r--lib/rdoc/parsers/parse_simple.rb41
-rw-r--r--lib/rdoc/parsers/parserfactory.rb99
-rw-r--r--lib/rdoc/rd.rb99
-rw-r--r--lib/rdoc/rd/block_parser.rb1055
-rw-r--r--lib/rdoc/rd/inline.rb71
-rw-r--r--lib/rdoc/rd/inline_parser.rb1207
-rw-r--r--lib/rdoc/rdoc.rb717
-rw-r--r--lib/rdoc/require.rb51
-rw-r--r--lib/rdoc/ri.rb20
-rw-r--r--lib/rdoc/ri/driver.rb1424
-rw-r--r--lib/rdoc/ri/formatter.rb5
-rw-r--r--lib/rdoc/ri/paths.rb187
-rw-r--r--lib/rdoc/ri/ri_cache.rb187
-rw-r--r--lib/rdoc/ri/ri_descriptions.rb154
-rw-r--r--lib/rdoc/ri/ri_display.rb255
-rw-r--r--lib/rdoc/ri/ri_driver.rb143
-rw-r--r--lib/rdoc/ri/ri_formatter.rb674
-rw-r--r--lib/rdoc/ri/ri_options.rb313
-rw-r--r--lib/rdoc/ri/ri_paths.rb80
-rw-r--r--lib/rdoc/ri/ri_reader.rb100
-rw-r--r--lib/rdoc/ri/ri_util.rb75
-rw-r--r--lib/rdoc/ri/ri_writer.rb62
-rw-r--r--lib/rdoc/ri/store.rb6
-rw-r--r--lib/rdoc/ruby_lex.rb1352
-rw-r--r--lib/rdoc/ruby_token.rb459
-rw-r--r--lib/rdoc/rubygems_hook.rb238
-rw-r--r--lib/rdoc/servlet.rb407
-rw-r--r--lib/rdoc/single_class.rb21
-rw-r--r--lib/rdoc/stats.rb444
-rw-r--r--lib/rdoc/stats/normal.rb48
-rw-r--r--lib/rdoc/stats/quiet.rb59
-rw-r--r--lib/rdoc/stats/verbose.rb45
-rw-r--r--lib/rdoc/store.rb975
-rw-r--r--lib/rdoc/task.rb330
-rw-r--r--lib/rdoc/template.rb234
-rw-r--r--lib/rdoc/test_case.rb178
-rw-r--r--lib/rdoc/text.rb315
-rw-r--r--lib/rdoc/token_stream.rb95
-rw-r--r--lib/rdoc/tokenstream.rb25
-rw-r--r--lib/rdoc/tom_doc.rb233
-rw-r--r--lib/rdoc/top_level.rb281
-rw-r--r--lib/rdoc/usage.rb210
-rw-r--r--lib/readbytes.rb41
-rw-r--r--lib/resolv-replace.rb22
-rw-r--r--lib/resolv.rb1457
-rw-r--r--lib/rexml/attlistdecl.rb112
-rw-r--r--lib/rexml/attribute.rb307
-rw-r--r--lib/rexml/cdata.rb115
-rw-r--r--lib/rexml/child.rb164
-rw-r--r--lib/rexml/comment.rb134
-rw-r--r--lib/rexml/doctype.rb73
-rw-r--r--lib/rexml/document.rb371
-rw-r--r--lib/rexml/dtd/attlistdecl.rb14
-rw-r--r--lib/rexml/dtd/dtd.rb82
-rw-r--r--lib/rexml/dtd/elementdecl.rb26
-rw-r--r--lib/rexml/dtd/entitydecl.rb98
-rw-r--r--lib/rexml/dtd/notationdecl.rb64
-rw-r--r--lib/rexml/element.rb2290
-rw-r--r--lib/rexml/encoding.rb92
-rw-r--r--lib/rexml/encodings/CP-1252.rb98
-rw-r--r--lib/rexml/encodings/EUC-JP.rb35
-rw-r--r--lib/rexml/encodings/ICONV.rb22
-rw-r--r--lib/rexml/encodings/ISO-8859-1.rb7
-rw-r--r--lib/rexml/encodings/ISO-8859-15.rb69
-rw-r--r--lib/rexml/encodings/SHIFT-JIS.rb37
-rw-r--r--lib/rexml/encodings/SHIFT_JIS.rb1
-rw-r--r--lib/rexml/encodings/UNILE.rb34
-rw-r--r--lib/rexml/encodings/US-ASCII.rb30
-rw-r--r--lib/rexml/encodings/UTF-16.rb34
-rw-r--r--lib/rexml/encodings/UTF-8.rb18
-rw-r--r--lib/rexml/entity.rb293
-rw-r--r--lib/rexml/formatters/default.rb111
-rw-r--r--lib/rexml/formatters/pretty.rb141
-rw-r--r--lib/rexml/formatters/transitive.rb57
-rw-r--r--lib/rexml/functions.rb83
-rw-r--r--lib/rexml/instruction.rb102
-rw-r--r--lib/rexml/light/node.rb381
-rw-r--r--lib/rexml/namespace.rb78
-rw-r--r--lib/rexml/node.rb99
-rw-r--r--lib/rexml/output.rb29
-rw-r--r--lib/rexml/parent.rb51
-rw-r--r--lib/rexml/parseexception.rb8
-rw-r--r--lib/rexml/parsers/baseparser.rb186
-rw-r--r--lib/rexml/parsers/lightparser.rb84
-rw-r--r--lib/rexml/parsers/pullparser.rb2
-rw-r--r--lib/rexml/parsers/sax2parser.rb409
-rw-r--r--lib/rexml/parsers/streamparser.rb4
-rw-r--r--lib/rexml/parsers/treeparser.rb16
-rw-r--r--lib/rexml/parsers/ultralightparser.rb80
-rw-r--r--lib/rexml/parsers/xpathparser.rb109
-rw-r--r--lib/rexml/quickpath.rb495
-rw-r--r--lib/rexml/rexml.rb20
-rw-r--r--lib/rexml/sax2listener.rb184
-rw-r--r--lib/rexml/source.rb457
-rw-r--r--lib/rexml/streamlistener.rb180
-rw-r--r--lib/rexml/syncenumerator.rb7
-rw-r--r--lib/rexml/text.rb270
-rw-r--r--lib/rexml/undefinednamespaceexception.rb8
-rw-r--r--lib/rexml/validation/relaxng.rb36
-rw-r--r--lib/rexml/validation/validation.rb10
-rw-r--r--lib/rexml/xmldecl.rb131
-rw-r--r--lib/rexml/xmltokens.rb28
-rw-r--r--lib/rexml/xpath.rb130
-rw-r--r--lib/rexml/xpath_parser.rb186
-rw-r--r--lib/rinda/rinda.rb18
-rw-r--r--lib/rinda/ring.rb94
-rw-r--r--lib/rinda/tuplespace.rb112
-rw-r--r--lib/rss.rb85
-rw-r--r--lib/rss/0.9.rb63
-rw-r--r--lib/rss/1.0.rb61
-rw-r--r--lib/rss/2.0.rb8
-rw-r--r--lib/rss/atom.rb756
-rw-r--r--lib/rss/content.rb25
-rw-r--r--lib/rss/content/1.0.rb9
-rw-r--r--lib/rss/content/2.0.rb11
-rw-r--r--lib/rss/converter.rb44
-rw-r--r--lib/rss/dublincore.rb55
-rw-r--r--lib/rss/dublincore/1.0.rb12
-rw-r--r--lib/rss/dublincore/2.0.rb12
-rw-r--r--lib/rss/dublincore/atom.rb16
-rw-r--r--lib/rss/image.rb28
-rw-r--r--lib/rss/itunes.rb410
-rw-r--r--lib/rss/maker.rb39
-rw-r--r--lib/rss/maker/0.9.rb450
-rw-r--r--lib/rss/maker/1.0.rb343
-rw-r--r--lib/rss/maker/2.0.rb169
-rw-r--r--lib/rss/maker/atom.rb172
-rw-r--r--lib/rss/maker/base.rb968
-rw-r--r--lib/rss/maker/content.rb14
-rw-r--r--lib/rss/maker/dublincore.rb150
-rw-r--r--lib/rss/maker/entry.rb163
-rw-r--r--lib/rss/maker/feed.rb426
-rw-r--r--lib/rss/maker/image.rb118
-rw-r--r--lib/rss/maker/itunes.rb242
-rw-r--r--lib/rss/maker/slash.rb33
-rw-r--r--lib/rss/maker/syndication.rb13
-rw-r--r--lib/rss/maker/taxonomy.rb126
-rw-r--r--lib/rss/maker/trackback.rb117
-rw-r--r--lib/rss/parser.rb224
-rw-r--r--lib/rss/rexmlparser.rb10
-rw-r--r--lib/rss/rss.rb801
-rw-r--r--lib/rss/slash.rb49
-rw-r--r--lib/rss/syndication.rb15
-rw-r--r--lib/rss/taxonomy.rb20
-rw-r--r--lib/rss/trackback.rb36
-rw-r--r--lib/rss/utils.rb82
-rw-r--r--lib/rss/xml-stylesheet.rb8
-rw-r--r--lib/rss/xml.rb71
-rw-r--r--lib/rss/xmlparser.rb14
-rw-r--r--lib/rss/xmlscanner.rb10
-rw-r--r--lib/rubygems.rb1110
-rw-r--r--lib/rubygems/available_set.rb95
-rw-r--r--lib/rubygems/command.rb579
-rw-r--r--lib/rubygems/command_manager.rb220
-rw-r--r--lib/rubygems/commands/build_command.rb41
-rw-r--r--lib/rubygems/commands/cert_command.rb228
-rw-r--r--lib/rubygems/commands/check_command.rb86
-rw-r--r--lib/rubygems/commands/cleanup_command.rb165
-rw-r--r--lib/rubygems/commands/contents_command.rb119
-rw-r--r--lib/rubygems/commands/dependency_command.rb155
-rw-r--r--lib/rubygems/commands/environment_command.rb135
-rw-r--r--lib/rubygems/commands/fetch_command.rb65
-rw-r--r--lib/rubygems/commands/generate_index_command.rb84
-rw-r--r--lib/rubygems/commands/help_command.rb167
-rw-r--r--lib/rubygems/commands/install_command.rb198
-rw-r--r--lib/rubygems/commands/list_command.rb37
-rw-r--r--lib/rubygems/commands/lock_command.rb110
-rw-r--r--lib/rubygems/commands/mirror_command.rb17
-rw-r--r--lib/rubygems/commands/outdated_command.rb33
-rw-r--r--lib/rubygems/commands/owner_command.rb84
-rw-r--r--lib/rubygems/commands/pristine_command.rb125
-rw-r--r--lib/rubygems/commands/push_command.rb79
-rw-r--r--lib/rubygems/commands/query_command.rb313
-rw-r--r--lib/rubygems/commands/rdoc_command.rb92
-rw-r--r--lib/rubygems/commands/search_command.rb17
-rw-r--r--lib/rubygems/commands/server_command.rb86
-rw-r--r--lib/rubygems/commands/setup_command.rb449
-rw-r--r--lib/rubygems/commands/sources_command.rb136
-rw-r--r--lib/rubygems/commands/specification_command.rb129
-rw-r--r--lib/rubygems/commands/stale_command.rb28
-rw-r--r--lib/rubygems/commands/uninstall_command.rb111
-rw-r--r--lib/rubygems/commands/unpack_command.rb164
-rw-r--r--lib/rubygems/commands/update_command.rb218
-rw-r--r--lib/rubygems/commands/which_command.rb82
-rw-r--r--lib/rubygems/commands/yank_command.rb98
-rw-r--r--lib/rubygems/compatibility.rb51
-rw-r--r--lib/rubygems/config_file.rb403
-rw-r--r--lib/rubygems/core_ext/kernel_gem.rb53
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb119
-rw-r--r--lib/rubygems/defaults.rb113
-rw-r--r--lib/rubygems/dependency.rb311
-rw-r--r--lib/rubygems/dependency_installer.rb396
-rw-r--r--lib/rubygems/dependency_list.rb244
-rw-r--r--lib/rubygems/dependency_resolver.rb562
-rw-r--r--lib/rubygems/deprecate.rb70
-rw-r--r--lib/rubygems/doctor.rb125
-rw-r--r--lib/rubygems/errors.rb88
-rw-r--r--lib/rubygems/exceptions.rb109
-rw-r--r--lib/rubygems/ext.rb19
-rw-r--r--lib/rubygems/ext/builder.rb60
-rw-r--r--lib/rubygems/ext/cmake_builder.rb14
-rw-r--r--lib/rubygems/ext/configure_builder.rb25
-rw-r--r--lib/rubygems/ext/ext_conf_builder.rb24
-rw-r--r--lib/rubygems/ext/rake_builder.rb39
-rw-r--r--lib/rubygems/gem_runner.rb73
-rw-r--r--lib/rubygems/gemcutter_utilities.rb97
-rw-r--r--lib/rubygems/indexer.rb494
-rw-r--r--lib/rubygems/install_message.rb12
-rw-r--r--lib/rubygems/install_update_options.rb166
-rw-r--r--lib/rubygems/installer.rb786
-rw-r--r--lib/rubygems/installer_test_case.rb196
-rw-r--r--lib/rubygems/local_remote_options.rb148
-rw-r--r--lib/rubygems/mock_gem_ui.rb88
-rw-r--r--lib/rubygems/name_tuple.rb110
-rw-r--r--lib/rubygems/package.rb556
-rw-r--r--lib/rubygems/package/digest_io.rb64
-rw-r--r--lib/rubygems/package/old.rb147
-rw-r--r--lib/rubygems/package/tar_header.rb229
-rw-r--r--lib/rubygems/package/tar_reader.rb123
-rw-r--r--lib/rubygems/package/tar_reader/entry.rb145
-rw-r--r--lib/rubygems/package/tar_test_case.rb137
-rw-r--r--lib/rubygems/package/tar_writer.rb297
-rw-r--r--lib/rubygems/package_task.rb125
-rw-r--r--lib/rubygems/path_support.rb77
-rw-r--r--lib/rubygems/platform.rb187
-rw-r--r--lib/rubygems/psych_additions.rb9
-rw-r--r--lib/rubygems/psych_tree.rb27
-rw-r--r--lib/rubygems/rdoc.rb327
-rw-r--r--lib/rubygems/remote_fetcher.rb581
-rw-r--r--lib/rubygems/request_set.rb182
-rw-r--r--lib/rubygems/requirement.rb242
-rw-r--r--lib/rubygems/security.rb566
-rw-r--r--lib/rubygems/security/policies.rb115
-rw-r--r--lib/rubygems/security/policy.rb227
-rw-r--r--lib/rubygems/security/signer.rb136
-rw-r--r--lib/rubygems/security/trust_dir.rb104
-rw-r--r--lib/rubygems/server.rb825
-rw-r--r--lib/rubygems/source.rb144
-rw-r--r--lib/rubygems/source_list.rb87
-rw-r--r--lib/rubygems/source_local.rb92
-rw-r--r--lib/rubygems/source_specific_file.rb28
-rw-r--r--lib/rubygems/spec_fetcher.rb229
-rw-r--r--lib/rubygems/specification.rb2576
-rw-r--r--lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem90
-rw-r--r--lib/rubygems/ssl_certs/Entrust_net-Secure-Server-Certification-Authority.pem90
-rw-r--r--lib/rubygems/ssl_certs/VerisignClass3PublicPrimaryCertificationAuthority-G2.pem57
-rw-r--r--lib/rubygems/ssl_certs/ca-bundle.pem3366
-rw-r--r--lib/rubygems/syck_hack.rb76
-rw-r--r--lib/rubygems/test_case.rb1038
-rw-r--r--lib/rubygems/test_utilities.rb180
-rw-r--r--lib/rubygems/text.rb65
-rw-r--r--lib/rubygems/uninstaller.rb325
-rw-r--r--lib/rubygems/user_interaction.rb572
-rw-r--r--lib/rubygems/validator.rb161
-rw-r--r--lib/rubygems/version.rb340
-rw-r--r--lib/rubygems/version_option.rb65
-rw-r--r--lib/rubyunit.rb6
-rw-r--r--lib/runit/assert.rb73
-rw-r--r--lib/runit/cui/testrunner.rb51
-rw-r--r--lib/runit/error.rb9
-rw-r--r--lib/runit/testcase.rb45
-rw-r--r--lib/runit/testresult.rb44
-rw-r--r--lib/runit/testsuite.rb26
-rw-r--r--lib/runit/topublic.rb8
-rw-r--r--lib/scanf.rb781
-rw-r--r--lib/securerandom.rb266
-rw-r--r--lib/set.rb1098
-rw-r--r--lib/shell.rb292
-rw-r--r--lib/shell/builtin-command.rb68
-rw-r--r--lib/shell/command-processor.rb715
-rw-r--r--lib/shell/error.rb11
-rw-r--r--lib/shell/filter.rb91
-rw-r--r--lib/shell/process-controller.rb353
-rw-r--r--lib/shell/system-command.rb147
-rw-r--r--lib/shell/version.rb15
-rw-r--r--lib/shellwords.rb235
-rw-r--r--lib/singleton.rb420
-rw-r--r--lib/soap/attachment.rb107
-rw-r--r--lib/soap/baseData.rb942
-rw-r--r--lib/soap/element.rb258
-rw-r--r--lib/soap/encodingstyle/aspDotNetHandler.rb213
-rw-r--r--lib/soap/encodingstyle/handler.rb100
-rw-r--r--lib/soap/encodingstyle/literalHandler.rb226
-rw-r--r--lib/soap/encodingstyle/soapHandler.rb582
-rw-r--r--lib/soap/generator.rb268
-rw-r--r--lib/soap/header/handler.rb57
-rw-r--r--lib/soap/header/handlerset.rb70
-rw-r--r--lib/soap/header/simplehandler.rb44
-rw-r--r--lib/soap/httpconfigloader.rb119
-rw-r--r--lib/soap/mapping.rb10
-rw-r--r--lib/soap/mapping/factory.rb355
-rw-r--r--lib/soap/mapping/mapping.rb381
-rw-r--r--lib/soap/mapping/registry.rb541
-rw-r--r--lib/soap/mapping/rubytypeFactory.rb475
-rw-r--r--lib/soap/mapping/typeMap.rb50
-rw-r--r--lib/soap/mapping/wsdlencodedregistry.rb280
-rw-r--r--lib/soap/mapping/wsdlliteralregistry.rb418
-rw-r--r--lib/soap/marshal.rb59
-rw-r--r--lib/soap/mimemessage.rb240
-rw-r--r--lib/soap/netHttpClient.rb190
-rw-r--r--lib/soap/parser.rb251
-rw-r--r--lib/soap/processor.rb66
-rw-r--r--lib/soap/property.rb333
-rw-r--r--lib/soap/rpc/cgistub.rb206
-rw-r--r--lib/soap/rpc/driver.rb254
-rw-r--r--lib/soap/rpc/element.rb325
-rw-r--r--lib/soap/rpc/httpserver.rb129
-rw-r--r--lib/soap/rpc/proxy.rb497
-rw-r--r--lib/soap/rpc/router.rb594
-rw-r--r--lib/soap/rpc/rpc.rb25
-rw-r--r--lib/soap/rpc/soaplet.rb162
-rw-r--r--lib/soap/rpc/standaloneServer.rb43
-rw-r--r--lib/soap/soap.rb140
-rw-r--r--lib/soap/streamHandler.rb229
-rw-r--r--lib/soap/wsdlDriver.rb575
-rw-r--r--lib/sync.rb343
-rw-r--r--lib/tempfile.rb350
-rw-r--r--lib/test/unit.rb1117
-rw-r--r--lib/test/unit/assertionfailederror.rb14
-rw-r--r--lib/test/unit/assertions.rb780
-rw-r--r--lib/test/unit/autorunner.rb204
-rw-r--r--lib/test/unit/collector.rb43
-rw-r--r--lib/test/unit/collector/dir.rb92
-rw-r--r--lib/test/unit/collector/objectspace.rb34
-rw-r--r--lib/test/unit/error.rb56
-rw-r--r--lib/test/unit/failure.rb51
-rw-r--r--lib/test/unit/parallel.rb182
-rw-r--r--lib/test/unit/test-unit.gemspec14
-rw-r--r--lib/test/unit/testcase.rb152
-rw-r--r--lib/test/unit/testresult.rb80
-rw-r--r--lib/test/unit/testsuite.rb76
-rw-r--r--lib/test/unit/ui/console/testrunner.rb127
-rw-r--r--lib/test/unit/ui/fox/testrunner.rb268
-rw-r--r--lib/test/unit/ui/gtk/testrunner.rb416
-rw-r--r--lib/test/unit/ui/gtk2/testrunner.rb465
-rw-r--r--lib/test/unit/ui/testrunnermediator.rb68
-rw-r--r--lib/test/unit/ui/testrunnerutilities.rb46
-rw-r--r--lib/test/unit/ui/tk/testrunner.rb260
-rw-r--r--lib/test/unit/util/backtracefilter.rb40
-rw-r--r--lib/test/unit/util/observable.rb90
-rw-r--r--lib/test/unit/util/procwrapper.rb48
-rw-r--r--lib/thread.rb351
-rw-r--r--lib/thwait.rb95
-rw-r--r--lib/time.rb725
-rw-r--r--lib/timeout.rb148
-rw-r--r--lib/tmpdir.rb159
-rw-r--r--lib/tracer.rb247
-rw-r--r--lib/tsort.rb68
-rw-r--r--lib/ubygems.rb10
-rw-r--r--lib/un.rb204
-rw-r--r--lib/uri.rb95
-rw-r--r--lib/uri/common.rb858
-rw-r--r--lib/uri/ftp.rb170
-rw-r--r--lib/uri/generic.rb898
-rw-r--r--lib/uri/http.rb69
-rw-r--r--lib/uri/https.rb10
-rw-r--r--lib/uri/ldap.rb80
-rw-r--r--lib/uri/ldaps.rb20
-rw-r--r--lib/uri/mailto.rb91
-rw-r--r--lib/weakref.rb163
-rw-r--r--lib/webrick.rb201
-rw-r--r--lib/webrick/accesslog.rb94
-rw-r--r--lib/webrick/cgi.rb57
-rw-r--r--lib/webrick/compat.rb20
-rw-r--r--lib/webrick/config.rb32
-rw-r--r--lib/webrick/cookie.rb6
-rw-r--r--lib/webrick/htmlutils.rb5
-rw-r--r--lib/webrick/httpauth.rb56
-rw-r--r--lib/webrick/httpauth/authenticator.rb49
-rw-r--r--lib/webrick/httpauth/basicauth.rb45
-rw-r--r--lib/webrick/httpauth/digestauth.rb75
-rw-r--r--lib/webrick/httpauth/htdigest.rb39
-rw-r--r--lib/webrick/httpauth/htgroup.rb32
-rw-r--r--lib/webrick/httpauth/htpasswd.rb42
-rw-r--r--lib/webrick/httpauth/userdb.rb31
-rw-r--r--lib/webrick/httpproxy.rb297
-rw-r--r--lib/webrick/httprequest.rb178
-rw-r--r--lib/webrick/httpresponse.rb135
-rw-r--r--lib/webrick/https.rb5
-rw-r--r--lib/webrick/httpserver.rb66
-rw-r--r--lib/webrick/httpservlet/abstract.rb92
-rw-r--r--lib/webrick/httpservlet/cgi_runner.rb5
-rw-r--r--lib/webrick/httpservlet/cgihandler.rb40
-rw-r--r--lib/webrick/httpservlet/erbhandler.rb47
-rw-r--r--lib/webrick/httpservlet/filehandler.rb59
-rw-r--r--lib/webrick/httpservlet/prochandler.rb8
-rw-r--r--lib/webrick/httpstatus.rb182
-rw-r--r--lib/webrick/httputils.rb43
-rw-r--r--lib/webrick/httpversion.rb2
-rw-r--r--lib/webrick/log.rb56
-rw-r--r--lib/webrick/server.rb117
-rw-r--r--lib/webrick/ssl.rb15
-rw-r--r--lib/webrick/utils.rb153
-rw-r--r--lib/webrick/version.rb2
-rw-r--r--lib/wsdl/binding.rb65
-rw-r--r--lib/wsdl/data.rb64
-rw-r--r--lib/wsdl/definitions.rb250
-rw-r--r--lib/wsdl/documentation.rb32
-rw-r--r--lib/wsdl/import.rb80
-rw-r--r--lib/wsdl/importer.rb38
-rw-r--r--lib/wsdl/info.rb39
-rw-r--r--lib/wsdl/message.rb54
-rw-r--r--lib/wsdl/operation.rb130
-rw-r--r--lib/wsdl/operationBinding.rb108
-rw-r--r--lib/wsdl/param.rb85
-rw-r--r--lib/wsdl/parser.rb163
-rw-r--r--lib/wsdl/part.rb52
-rw-r--r--lib/wsdl/port.rb84
-rw-r--r--lib/wsdl/portType.rb73
-rw-r--r--lib/wsdl/service.rb61
-rw-r--r--lib/wsdl/soap/address.rb40
-rw-r--r--lib/wsdl/soap/binding.rb49
-rw-r--r--lib/wsdl/soap/body.rb56
-rw-r--r--lib/wsdl/soap/cgiStubCreator.rb76
-rw-r--r--lib/wsdl/soap/classDefCreator.rb314
-rw-r--r--lib/wsdl/soap/classDefCreatorSupport.rb126
-rw-r--r--lib/wsdl/soap/clientSkeltonCreator.rb78
-rw-r--r--lib/wsdl/soap/complexType.rb161
-rw-r--r--lib/wsdl/soap/data.rb42
-rw-r--r--lib/wsdl/soap/definitions.rb149
-rw-r--r--lib/wsdl/soap/driverCreator.rb95
-rw-r--r--lib/wsdl/soap/element.rb28
-rw-r--r--lib/wsdl/soap/fault.rb56
-rw-r--r--lib/wsdl/soap/header.rb86
-rw-r--r--lib/wsdl/soap/headerfault.rb56
-rw-r--r--lib/wsdl/soap/mappingRegistryCreator.rb92
-rw-r--r--lib/wsdl/soap/methodDefCreator.rb228
-rw-r--r--lib/wsdl/soap/operation.rb122
-rw-r--r--lib/wsdl/soap/servantSkeltonCreator.rb67
-rw-r--r--lib/wsdl/soap/standaloneServerStubCreator.rb85
-rw-r--r--lib/wsdl/soap/wsdl2ruby.rb176
-rw-r--r--lib/wsdl/types.rb43
-rw-r--r--lib/wsdl/wsdl.rb23
-rw-r--r--lib/wsdl/xmlSchema/all.rb69
-rw-r--r--lib/wsdl/xmlSchema/annotation.rb34
-rw-r--r--lib/wsdl/xmlSchema/any.rb56
-rw-r--r--lib/wsdl/xmlSchema/attribute.rb127
-rw-r--r--lib/wsdl/xmlSchema/choice.rb69
-rw-r--r--lib/wsdl/xmlSchema/complexContent.rb92
-rw-r--r--lib/wsdl/xmlSchema/complexType.rb139
-rw-r--r--lib/wsdl/xmlSchema/content.rb96
-rw-r--r--lib/wsdl/xmlSchema/data.rb80
-rw-r--r--lib/wsdl/xmlSchema/element.rb154
-rw-r--r--lib/wsdl/xmlSchema/enumeration.rb36
-rw-r--r--lib/wsdl/xmlSchema/import.rb65
-rw-r--r--lib/wsdl/xmlSchema/importer.rb87
-rw-r--r--lib/wsdl/xmlSchema/include.rb54
-rw-r--r--lib/wsdl/xmlSchema/length.rb35
-rw-r--r--lib/wsdl/xmlSchema/parser.rb166
-rw-r--r--lib/wsdl/xmlSchema/pattern.rb36
-rw-r--r--lib/wsdl/xmlSchema/schema.rb143
-rw-r--r--lib/wsdl/xmlSchema/sequence.rb69
-rw-r--r--lib/wsdl/xmlSchema/simpleContent.rb65
-rw-r--r--lib/wsdl/xmlSchema/simpleExtension.rb54
-rw-r--r--lib/wsdl/xmlSchema/simpleRestriction.rb73
-rw-r--r--lib/wsdl/xmlSchema/simpleType.rb73
-rw-r--r--lib/wsdl/xmlSchema/unique.rb34
-rw-r--r--lib/wsdl/xmlSchema/xsd2ruby.rb107
-rw-r--r--lib/xmlrpc.rb301
-rw-r--r--lib/xmlrpc/.document1
-rw-r--r--lib/xmlrpc/README.txt31
-rw-r--r--lib/xmlrpc/base64.rb73
-rw-r--r--lib/xmlrpc/client.rb673
-rw-r--r--lib/xmlrpc/config.rb34
-rw-r--r--lib/xmlrpc/create.rb220
-rw-r--r--lib/xmlrpc/datetime.rb131
-rw-r--r--lib/xmlrpc/httpserver.rb81
-rw-r--r--lib/xmlrpc/marshal.rb22
-rw-r--r--lib/xmlrpc/parser.rb509
-rw-r--r--lib/xmlrpc/server.rb673
-rw-r--r--lib/xmlrpc/utils.rb74
-rw-r--r--lib/xsd/charset.rb187
-rw-r--r--lib/xsd/codegen.rb12
-rw-r--r--lib/xsd/codegen/classdef.rb203
-rw-r--r--lib/xsd/codegen/commentdef.rb34
-rw-r--r--lib/xsd/codegen/gensupport.rb166
-rw-r--r--lib/xsd/codegen/methoddef.rb63
-rw-r--r--lib/xsd/codegen/moduledef.rb191
-rw-r--r--lib/xsd/datatypes.rb1269
-rw-r--r--lib/xsd/datatypes1999.rb20
-rw-r--r--lib/xsd/iconvcharset.rb33
-rw-r--r--lib/xsd/mapping.rb42
-rw-r--r--lib/xsd/namedelements.rb95
-rw-r--r--lib/xsd/ns.rb140
-rw-r--r--lib/xsd/qname.rb78
-rw-r--r--lib/xsd/xmlparser.rb61
-rw-r--r--lib/xsd/xmlparser/parser.rb96
-rw-r--r--lib/xsd/xmlparser/rexmlparser.rb54
-rw-r--r--lib/xsd/xmlparser/xmlparser.rb50
-rw-r--r--lib/xsd/xmlparser/xmlscanner.rb147
-rw-r--r--lib/yaml.rb456
-rw-r--r--lib/yaml/baseemitter.rb247
-rw-r--r--lib/yaml/basenode.rb216
-rw-r--r--lib/yaml/constants.rb45
-rw-r--r--lib/yaml/dbm.rb143
-rw-r--r--lib/yaml/encoding.rb33
-rw-r--r--lib/yaml/error.rb34
-rw-r--r--lib/yaml/loader.rb14
-rw-r--r--lib/yaml/rubytypes.rb408
-rw-r--r--lib/yaml/store.rb76
-rw-r--r--lib/yaml/stream.rb40
-rw-r--r--lib/yaml/stringio.rb83
-rw-r--r--lib/yaml/syck.rb19
-rw-r--r--lib/yaml/tag.rb91
-rw-r--r--lib/yaml/types.rb194
-rw-r--r--lib/yaml/yamlnode.rb54
-rw-r--r--lib/yaml/ypath.rb52
-rw-r--r--load.c1101
-rw-r--r--main.c48
-rw-r--r--man/erb.1157
-rw-r--r--man/goruby.139
-rw-r--r--man/irb.1173
-rw-r--r--man/rake.1169
-rw-r--r--man/ri.1180
-rw-r--r--man/ruby.1512
-rw-r--r--marshal.c1653
-rw-r--r--math.c664
-rwxr-xr-xmdoc2man.rb465
-rw-r--r--method.h134
-rw-r--r--misc/README7
-rw-r--r--misc/inf-ruby.el249
-rw-r--r--misc/rb_optparse.bash20
-rwxr-xr-xmisc/rb_optparse.zsh38
-rw-r--r--misc/rdebug.el136
-rw-r--r--misc/rdoc-mode.el130
-rw-r--r--misc/ruby-additional.el100
-rw-r--r--misc/ruby-electric.el98
-rw-r--r--misc/ruby-mode.el1845
-rw-r--r--misc/ruby-style.el78
-rw-r--r--misc/rubydb3x.el42
-rw-r--r--missing.h142
-rw-r--r--missing/acosh.c21
-rw-r--r--missing/alloca.c13
-rw-r--r--missing/cbrt.c11
-rw-r--r--missing/close.c72
-rw-r--r--missing/crt_externs.h8
-rw-r--r--missing/crypt.c123
-rw-r--r--missing/dup2.c5
-rw-r--r--missing/erf.c13
-rw-r--r--missing/ffs.c49
-rw-r--r--missing/finite.c5
-rw-r--r--missing/flock.c24
-rw-r--r--missing/hypot.c4
-rw-r--r--missing/isinf.c19
-rw-r--r--missing/isnan.c10
-rw-r--r--missing/langinfo.c148
-rw-r--r--missing/lgamma_r.c80
-rw-r--r--missing/memcmp.c10
-rw-r--r--missing/memmove.c18
-rw-r--r--missing/os2.c29
-rw-r--r--missing/setproctitle.c170
-rw-r--r--missing/signbit.c19
-rw-r--r--missing/strcasecmp.c16
-rw-r--r--missing/strchr.c22
-rw-r--r--missing/strerror.c5
-rw-r--r--missing/strftime.c907
-rw-r--r--missing/strlcat.c74
-rw-r--r--missing/strlcpy.c70
-rw-r--r--missing/strncasecmp.c21
-rw-r--r--missing/strstr.c15
-rw-r--r--missing/strtod.c271
-rw-r--r--missing/strtol.c10
-rw-r--r--missing/strtoul.c184
-rw-r--r--missing/tgamma.c92
-rw-r--r--missing/vsnprintf.c1135
-rw-r--r--missing/x68.c40
-rw-r--r--missing/x86_64-chkstk.s10
-rw-r--r--mkconfig.rb164
-rw-r--r--nacl/GNUmakefile.in87
-rw-r--r--nacl/README.nacl34
-rw-r--r--nacl/create_nmf.rb70
-rw-r--r--nacl/dirent.h15
-rw-r--r--nacl/example.html150
-rw-r--r--nacl/ioctl.h7
-rw-r--r--nacl/nacl-config.rb61
-rw-r--r--nacl/package.rb109
-rw-r--r--nacl/pepper_main.c870
-rw-r--r--nacl/resource.h8
-rw-r--r--nacl/select.h7
-rw-r--r--nacl/signal.h6
-rw-r--r--nacl/stat.h10
-rw-r--r--nacl/unistd.h9
-rw-r--r--nacl/utime.h11
-rw-r--r--node.c899
-rw-r--r--node.h321
-rw-r--r--numeric.c2880
-rw-r--r--object.c2698
-rw-r--r--pack.c1937
-rw-r--r--parse.y9859
-rw-r--r--prec.c141
-rw-r--r--prelude.rb15
-rw-r--r--probes.d44
-rw-r--r--probes_helper.h67
-rw-r--r--proc.c2340
-rw-r--r--process.c5678
-rw-r--r--random.c1462
-rw-r--r--range.c1387
-rw-r--r--rational.c2485
-rw-r--r--re.c3637
-rw-r--r--re.h42
-rw-r--r--regcomp.c6686
-rw-r--r--regenc.c955
-rw-r--r--regenc.h227
-rw-r--r--regerror.c402
-rw-r--r--regex.c4657
-rw-r--r--regex.h221
-rw-r--r--regexec.c4341
-rw-r--r--regint.h914
-rw-r--r--regparse.c6319
-rw-r--r--regparse.h367
-rw-r--r--regsyntax.c387
-rw-r--r--ruby.1351
-rw-r--r--ruby.c1989
-rw-r--r--ruby.h734
-rw-r--r--ruby_atomic.h121
-rw-r--r--rubyio.h88
-rw-r--r--rubysig.h105
-rw-r--r--rubytest.rb49
-rwxr-xr-xrunruby.rb59
-rw-r--r--safe.c135
-rw-r--r--sample/README15
-rw-r--r--sample/biorhythm.rb136
-rw-r--r--sample/cal.rb84
-rw-r--r--sample/cbreak.rb4
-rw-r--r--sample/coverage.rb62
-rw-r--r--sample/dbmtest.rb14
-rw-r--r--sample/drb/README.rd.ja48
-rw-r--r--sample/drb/darray.rb2
-rw-r--r--sample/drb/darrayc.rb16
-rw-r--r--sample/drb/dbiff.rb4
-rw-r--r--sample/drb/dchatc.rb4
-rw-r--r--sample/drb/dchats.rb2
-rw-r--r--sample/drb/dhasen.rb4
-rw-r--r--sample/drb/dhasenc.rb7
-rw-r--r--sample/drb/dlogc.rb2
-rw-r--r--sample/drb/dlogd.rb2
-rw-r--r--sample/drb/dqin.rb2
-rw-r--r--sample/drb/dqout.rb2
-rw-r--r--sample/drb/dqueue.rb2
-rw-r--r--sample/drb/drbc.rb2
-rw-r--r--sample/drb/drbch.rb2
-rw-r--r--sample/drb/drbm.rb6
-rw-r--r--sample/drb/drbmc.rb2
-rw-r--r--sample/drb/drbs-acl.rb6
-rw-r--r--sample/drb/drbs.rb4
-rw-r--r--sample/drb/extserv_test.rb12
-rw-r--r--sample/drb/holderc.rb2
-rw-r--r--sample/drb/holders.rb6
-rw-r--r--sample/drb/http0.rb6
-rw-r--r--sample/drb/http0serv.rb12
-rw-r--r--sample/drb/name.rb16
-rw-r--r--sample/drb/namec.rb2
-rw-r--r--sample/drb/old_tuplespace.rb6
-rw-r--r--sample/drb/ring_echo.rb2
-rw-r--r--sample/drb/simpletuple.rb6
-rw-r--r--sample/drb/speedc.rb2
-rw-r--r--sample/drb/speeds.rb4
-rw-r--r--sample/dualstack-httpd.rb4
-rw-r--r--sample/eval.rb2
-rw-r--r--sample/exyacc.rb32
-rw-r--r--sample/from.rb161
-rw-r--r--sample/fullpath.rb2
-rw-r--r--sample/getopts.test36
-rw-r--r--sample/goodfriday.rb48
-rw-r--r--sample/list.rb1
-rw-r--r--sample/list2.rb2
-rw-r--r--sample/list3.rb2
-rwxr-xr-x[-rw-r--r--]sample/mine.rb39
-rw-r--r--sample/mkproto.rb6
-rw-r--r--sample/mrshtest.rb13
-rw-r--r--sample/occur.rb4
-rw-r--r--sample/occur2.rb11
-rw-r--r--sample/openssl/c_rehash.rb4
-rw-r--r--sample/openssl/cert_store_view.rb911
-rw-r--r--sample/openssl/certstore.rb2
-rw-r--r--sample/openssl/cipher.rb73
-rw-r--r--sample/openssl/echo_cli.rb21
-rw-r--r--sample/openssl/echo_svr.rb15
-rw-r--r--sample/openssl/gen_csr.rb13
-rw-r--r--sample/openssl/smime_read.rb10
-rw-r--r--sample/openssl/smime_write.rb12
-rw-r--r--sample/openssl/wget.rb17
-rwxr-xr-x[-rw-r--r--]sample/optparse/opttest.rb30
-rw-r--r--sample/philos.rb2
-rw-r--r--sample/pty/expect_sample.rb48
-rw-r--r--sample/pty/script.rb37
-rw-r--r--sample/pty/shl.rb (renamed from ext/pty/shl.rb)0
-rw-r--r--sample/rdoc/markup/rdoc2latex.rb15
-rw-r--r--sample/rdoc/markup/sample.rb40
-rw-r--r--sample/regx.rb23
-rw-r--r--sample/ripper/ruby2html.rb112
-rw-r--r--sample/ripper/strip-comment.rb19
-rwxr-xr-xsample/rss/blend.rb6
-rwxr-xr-xsample/rss/convert.rb2
-rwxr-xr-x[-rw-r--r--]sample/rss/list_description.rb17
-rwxr-xr-xsample/rss/re_read.rb14
-rwxr-xr-x[-rw-r--r--]sample/rss/rss_recent.rb24
-rw-r--r--sample/svr.rb4
-rwxr-xr-x[-rw-r--r--]sample/test.rb919
-rw-r--r--sample/time.rb16
-rw-r--r--sample/timeout.rb42
-rw-r--r--sample/trojan.rb2
-rw-r--r--sample/tsvr.rb2
-rw-r--r--sample/webrick/httpproxy.rb7
-rw-r--r--signal.c1132
-rw-r--r--siphash.c483
-rw-r--r--siphash.h48
-rw-r--r--sparc.c31
-rw-r--r--spec/README31
-rw-r--r--spec/default.mspec21
-rw-r--r--sprintf.c1056
-rw-r--r--st.c1497
-rw-r--r--st.h72
-rw-r--r--strftime.c1162
-rw-r--r--string.c7879
-rw-r--r--struct.c797
-rw-r--r--symbian/README.SYMBIAN93
-rw-r--r--symbian/configure.bat123
-rw-r--r--symbian/missing-aeabi.c18
-rw-r--r--symbian/missing-pips.c65
-rw-r--r--symbian/pre-build83
-rw-r--r--symbian/setup440
-rw-r--r--template/Doxyfile.tmpl265
-rw-r--r--template/encdb.h.tmpl83
-rw-r--r--template/fake.rb.in47
-rw-r--r--template/id.c.tmpl27
-rw-r--r--template/id.h.tmpl98
-rw-r--r--template/insns.inc.tmpl20
-rw-r--r--template/insns_info.inc.tmpl83
-rw-r--r--template/known_errors.inc.tmpl14
-rw-r--r--template/minsns.inc.tmpl14
-rw-r--r--template/opt_sc.inc.tmpl32
-rw-r--r--template/optinsn.inc.tmpl30
-rw-r--r--template/optunifs.inc.tmpl35
-rw-r--r--template/ruby.pc.in44
-rw-r--r--template/transdb.h.tmpl59
-rw-r--r--template/vm.inc.tmpl29
-rw-r--r--template/vmtc.inc.tmpl18
-rw-r--r--template/yarvarch.en7
-rw-r--r--template/yarvarch.ja454
-rw-r--r--template/yasmdata.rb.tmpl20
-rw-r--r--test/-ext-/array/test_resize.rb29
-rw-r--r--test/-ext-/exception/test_enc_raise.rb15
-rw-r--r--test/-ext-/funcall/test_passing_block.rb22
-rw-r--r--test/-ext-/iter/test_iter_break.rb9
-rw-r--r--test/-ext-/load/test_dot_dot.rb10
-rw-r--r--test/-ext-/marshal/test_usrmarshal.rb34
-rw-r--r--test/-ext-/num2int/test_num2int.rb227
-rw-r--r--test/-ext-/old_thread_select/test_old_thread_select.rb100
-rw-r--r--test/-ext-/path_to_class/test_path_to_class.rb12
-rw-r--r--test/-ext-/st/test_numhash.rb49
-rw-r--r--test/-ext-/st/test_update.rb50
-rw-r--r--test/-ext-/string/test_cstr.rb17
-rw-r--r--test/-ext-/string/test_ellipsize.rb46
-rw-r--r--test/-ext-/string/test_enc_associate.rb12
-rw-r--r--test/-ext-/string/test_enc_str_buf_cat.rb15
-rw-r--r--test/-ext-/string/test_modify_expand.rb15
-rw-r--r--test/-ext-/string/test_qsort.rb19
-rw-r--r--test/-ext-/string/test_set_len.rb25
-rw-r--r--test/-ext-/symbol/test_inadvertent_creation.rb163
-rw-r--r--test/-ext-/test_bug-3571.rb21
-rw-r--r--test/-ext-/test_bug-3662.rb10
-rw-r--r--test/-ext-/test_bug-5832.rb21
-rw-r--r--test/-ext-/test_printf.rb49
-rw-r--r--test/-ext-/typeddata/test_typeddata.rb21
-rw-r--r--test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb45
-rw-r--r--test/-ext-/win32/test_dln.rb13
-rw-r--r--test/-ext-/win32/test_fd_setsize.rb25
-rw-r--r--test/base64/test_base64.rb100
-rw-r--r--test/benchmark/test_benchmark.rb169
-rw-r--r--test/bigdecimal/test_bigdecimal.rb1379
-rw-r--r--test/bigdecimal/test_bigdecimal_util.rb43
-rw-r--r--test/bigdecimal/test_bigmath.rb63
-rw-r--r--test/bigdecimal/testbase.rb27
-rw-r--r--test/cgi/test_cgi_cookie.rb110
-rw-r--r--test/cgi/test_cgi_core.rb373
-rw-r--r--test/cgi/test_cgi_header.rb185
-rw-r--r--test/cgi/test_cgi_modruby.rb146
-rw-r--r--test/cgi/test_cgi_multipart.rb370
-rw-r--r--test/cgi/test_cgi_session.rb172
-rw-r--r--test/cgi/test_cgi_tag_helper.rb354
-rw-r--r--test/cgi/test_cgi_util.rb64
-rw-r--r--test/cgi/testdata/file1.html10
-rw-r--r--test/cgi/testdata/large.pngbin0 -> 156414 bytes-rw-r--r--test/cgi/testdata/small.pngbin0 -> 82 bytes-rw-r--r--test/coverage/test_coverage.rb64
-rw-r--r--test/csv/base.rb8
-rw-r--r--test/csv/line_endings.gzbin0 -> 59 bytes-rw-r--r--test/csv/test_csv.rb1753
-rwxr-xr-xtest/csv/test_csv_parsing.rb221
-rwxr-xr-xtest/csv/test_csv_writing.rb97
-rwxr-xr-xtest/csv/test_data_converters.rb263
-rwxr-xr-xtest/csv/test_encodings.rb339
-rwxr-xr-xtest/csv/test_features.rb310
-rwxr-xr-xtest/csv/test_headers.rb289
-rwxr-xr-xtest/csv/test_interface.rb337
-rwxr-xr-xtest/csv/test_row.rb344
-rwxr-xr-xtest/csv/test_serialization.rb158
-rwxr-xr-xtest/csv/test_table.rb420
-rw-r--r--test/csv/ts_all.rb21
-rw-r--r--test/date/test_date.rb144
-rw-r--r--test/date/test_date_arith.rb286
-rw-r--r--test/date/test_date_attr.rb112
-rw-r--r--test/date/test_date_base.rb442
-rw-r--r--test/date/test_date_compat.rb21
-rw-r--r--test/date/test_date_conv.rb137
-rw-r--r--test/date/test_date_marshal.rb41
-rw-r--r--test/date/test_date_new.rb271
-rw-r--r--test/date/test_date_parse.rb1122
-rw-r--r--test/date/test_date_strftime.rb422
-rw-r--r--test/date/test_date_strptime.rb492
-rw-r--r--test/date/test_switch_hitter.rb609
-rw-r--r--test/dbm/test_dbm.rb195
-rwxr-xr-x[-rw-r--r--]test/digest/test_digest.rb76
-rw-r--r--test/digest/test_digest_extend.rb158
-rw-r--r--test/digest/test_digest_hmac.rb2
-rw-r--r--test/dl/test_base.rb131
-rw-r--r--test/dl/test_c_struct_entry.rb55
-rw-r--r--test/dl/test_c_union_entity.rb31
-rw-r--r--test/dl/test_callback.rb72
-rw-r--r--test/dl/test_cfunc.rb80
-rw-r--r--test/dl/test_cparser.rb33
-rw-r--r--test/dl/test_cptr.rb222
-rw-r--r--test/dl/test_dl2.rb167
-rw-r--r--test/dl/test_func.rb184
-rw-r--r--test/dl/test_handle.rb187
-rw-r--r--test/dl/test_import.rb165
-rw-r--r--test/dl/test_win32.rb54
-rw-r--r--test/drb/drbtest.rb100
-rw-r--r--test/drb/test_acl.rb2
-rw-r--r--test/drb/test_drb.rb59
-rw-r--r--test/drb/test_drbssl.rb8
-rw-r--r--test/drb/test_drbunix.rb8
-rw-r--r--test/drb/ut_array_drbssl.rb11
-rw-r--r--test/drb/ut_drb.rb3
-rw-r--r--test/drb/ut_drb_drbssl.rb13
-rw-r--r--test/drb/ut_eq.rb30
-rw-r--r--test/drb/ut_large.rb2
-rw-r--r--test/drb/ut_safe1.rb2
-rw-r--r--test/drb/ut_timerholder.rb2
-rw-r--r--test/dtrace/dummy.rb1
-rw-r--r--test/dtrace/helper.rb40
-rw-r--r--test/dtrace/test_array_create.rb35
-rw-r--r--test/dtrace/test_cmethod.rb49
-rw-r--r--test/dtrace/test_function_entry.rb87
-rw-r--r--test/dtrace/test_gc.rb26
-rw-r--r--test/dtrace/test_hash_create.rb52
-rw-r--r--test/dtrace/test_load.rb52
-rw-r--r--test/dtrace/test_object_create_start.rb35
-rw-r--r--test/dtrace/test_raise.rb29
-rw-r--r--test/dtrace/test_require.rb34
-rw-r--r--test/dtrace/test_singleton_function.rb55
-rw-r--r--test/dtrace/test_string.rb27
-rw-r--r--test/erb/hello.erb4
-rw-r--r--test/erb/test_erb.rb458
-rw-r--r--test/erb/test_erb_m17n.rb123
-rw-r--r--test/etc/test_etc.rb115
-rw-r--r--test/fiddle/helper.rb110
-rw-r--r--test/fiddle/test_c_struct_entry.rb74
-rw-r--r--test/fiddle/test_c_union_entity.rb31
-rw-r--r--test/fiddle/test_closure.rb84
-rw-r--r--test/fiddle/test_cparser.rb33
-rw-r--r--test/fiddle/test_fiddle.rb16
-rw-r--r--test/fiddle/test_func.rb79
-rw-r--r--test/fiddle/test_function.rb74
-rw-r--r--test/fiddle/test_handle.rb186
-rw-r--r--test/fiddle/test_import.rb137
-rw-r--r--test/fiddle/test_pointer.rb231
-rw-r--r--test/fileutils/clobber.rb91
-rw-r--r--test/fileutils/fileasserts.rb91
-rw-r--r--test/fileutils/test_dryrun.rb15
-rw-r--r--test/fileutils/test_fileutils.rb317
-rw-r--r--test/fileutils/test_nowrite.rb85
-rw-r--r--test/fileutils/test_verbose.rb13
-rw-r--r--test/gdbm/test_gdbm.rb168
-rw-r--r--test/inlinetest.rb55
-rw-r--r--test/io/console/test_io_console.rb246
-rw-r--r--test/io/nonblock/test_flush.rb42
-rw-r--r--test/io/wait/test_io_wait.rb108
-rw-r--r--test/irb/test_completion.rb22
-rw-r--r--test/irb/test_option.rb12
-rw-r--r--test/json/fixtures/fail1.json1
-rw-r--r--test/json/fixtures/fail10.json1
-rw-r--r--test/json/fixtures/fail11.json1
-rw-r--r--test/json/fixtures/fail12.json1
-rw-r--r--test/json/fixtures/fail13.json1
-rw-r--r--test/json/fixtures/fail14.json1
-rw-r--r--test/json/fixtures/fail18.json1
-rw-r--r--test/json/fixtures/fail19.json1
-rw-r--r--test/json/fixtures/fail2.json1
-rw-r--r--test/json/fixtures/fail20.json1
-rw-r--r--test/json/fixtures/fail21.json1
-rw-r--r--test/json/fixtures/fail22.json1
-rw-r--r--test/json/fixtures/fail23.json1
-rw-r--r--test/json/fixtures/fail24.json1
-rw-r--r--test/json/fixtures/fail25.json1
-rw-r--r--test/json/fixtures/fail27.json2
-rw-r--r--test/json/fixtures/fail28.json2
-rw-r--r--test/json/fixtures/fail3.json1
-rw-r--r--test/json/fixtures/fail4.json1
-rw-r--r--test/json/fixtures/fail5.json1
-rw-r--r--test/json/fixtures/fail6.json1
-rw-r--r--test/json/fixtures/fail7.json1
-rw-r--r--test/json/fixtures/fail8.json1
-rw-r--r--test/json/fixtures/fail9.json1
-rw-r--r--test/json/fixtures/pass1.json56
-rw-r--r--test/json/fixtures/pass15.json1
-rw-r--r--test/json/fixtures/pass16.json1
-rw-r--r--test/json/fixtures/pass17.json1
-rw-r--r--test/json/fixtures/pass2.json1
-rw-r--r--test/json/fixtures/pass26.json1
-rw-r--r--test/json/fixtures/pass3.json6
-rw-r--r--test/json/setup_variant.rb11
-rwxr-xr-xtest/json/test_json.rb539
-rwxr-xr-xtest/json/test_json_addition.rb188
-rw-r--r--test/json/test_json_encoding.rb65
-rwxr-xr-xtest/json/test_json_fixtures.rb35
-rwxr-xr-xtest/json/test_json_generate.rb252
-rw-r--r--test/json/test_json_generic_object.rb35
-rw-r--r--test/json/test_json_string_matching.rb40
-rwxr-xr-xtest/json/test_json_unicode.rb72
-rw-r--r--test/logger/test_logger.rb163
-rw-r--r--test/matrix/test_matrix.rb426
-rw-r--r--test/matrix/test_vector.rb149
-rw-r--r--test/minitest/metametameta.rb74
-rw-r--r--test/minitest/test_minitest_benchmark.rb119
-rw-r--r--test/minitest/test_minitest_mock.rb377
-rw-r--r--test/minitest/test_minitest_spec.rb738
-rw-r--r--test/minitest/test_minitest_unit.rb1705
-rw-r--r--test/misc/test_ruby_mode.rb181
-rw-r--r--test/mkmf/base.rb134
-rw-r--r--test/mkmf/test_convertible.rb34
-rw-r--r--test/mkmf/test_find_executable.rb50
-rw-r--r--test/mkmf/test_flags.rb35
-rw-r--r--test/mkmf/test_framework.rb14
-rw-r--r--test/mkmf/test_have_func.rb14
-rw-r--r--test/mkmf/test_have_library.rb53
-rw-r--r--test/mkmf/test_have_macro.rb35
-rw-r--r--test/mkmf/test_signedness.rb29
-rw-r--r--test/mkmf/test_sizeof.rb47
-rw-r--r--test/monitor/test_monitor.rb31
-rw-r--r--test/net/ftp/test_ftp.rb813
-rw-r--r--test/net/http/test_buffered_io.rb17
-rw-r--r--test/net/http/test_http.rb902
-rw-r--r--test/net/http/test_http_request.rb57
-rw-r--r--test/net/http/test_httpheader.rb29
-rw-r--r--test/net/http/test_httpresponse.rb228
-rw-r--r--test/net/http/test_httpresponses.rb24
-rw-r--r--test/net/http/test_https.rb154
-rw-r--r--test/net/http/test_https_proxy.rb17
-rw-r--r--test/net/http/utils.rb117
-rw-r--r--test/net/imap/cacert.pem60
-rw-r--r--test/net/imap/server.crt61
-rw-r--r--test/net/imap/server.key15
-rw-r--r--test/net/imap/test_imap.rb536
-rw-r--r--test/net/imap/test_imap_response_parser.rb183
-rw-r--r--test/net/pop/test_pop.rb132
-rw-r--r--test/net/protocol/test_protocol.rb19
-rw-r--r--test/net/smtp/test_response.rb99
-rw-r--r--test/net/smtp/test_smtp.rb16
-rw-r--r--test/net/smtp/test_ssl_socket.rb91
-rw-r--r--test/nkf/test_kconv.rb104
-rw-r--r--test/nkf/test_nkf.rb6
-rw-r--r--test/objspace/test_objspace.rb109
-rw-r--r--test/open-uri/test_open-uri.rb701
-rw-r--r--test/open-uri/test_ssl.rb325
-rw-r--r--test/openssl/ssl_server.rb2
-rw-r--r--test/openssl/test_asn1.rb418
-rw-r--r--test/openssl/test_bn.rb23
-rw-r--r--test/openssl/test_buffering.rb87
-rw-r--r--test/openssl/test_cipher.rb171
-rw-r--r--test/openssl/test_config.rb299
-rw-r--r--test/openssl/test_digest.rb50
-rw-r--r--test/openssl/test_engine.rb75
-rw-r--r--test/openssl/test_fips.rb14
-rw-r--r--test/openssl/test_hmac.rb28
-rw-r--r--test/openssl/test_ns_spki.rb12
-rw-r--r--test/openssl/test_ocsp.rb47
-rw-r--r--test/openssl/test_pair.rb123
-rw-r--r--test/openssl/test_pkcs12.rb209
-rw-r--r--test/openssl/test_pkcs5.rb97
-rw-r--r--test/openssl/test_pkcs7.rb38
-rw-r--r--test/openssl/test_pkey_dh.rb82
-rw-r--r--test/openssl/test_pkey_dsa.rb240
-rw-r--r--test/openssl/test_pkey_ec.rb207
-rw-r--r--test/openssl/test_pkey_rsa.rb246
-rw-r--r--test/openssl/test_ssl.rb679
-rw-r--r--test/openssl/test_ssl_session.rb367
-rw-r--r--test/openssl/test_x509cert.rb118
-rw-r--r--test/openssl/test_x509crl.rb33
-rw-r--r--test/openssl/test_x509ext.rb7
-rw-r--r--test/openssl/test_x509name.rb115
-rw-r--r--test/openssl/test_x509req.rb46
-rw-r--r--test/openssl/test_x509store.rb49
-rw-r--r--test/openssl/utils.rb206
-rw-r--r--test/optparse/test_autoconf.rb63
-rw-r--r--test/optparse/test_bash_completion.rb42
-rw-r--r--test/optparse/test_getopts.rb34
-rw-r--r--test/optparse/test_noarg.rb14
-rw-r--r--test/optparse/test_optarg.rb4
-rw-r--r--test/optparse/test_optparse.rb19
-rw-r--r--test/optparse/test_placearg.rb13
-rw-r--r--test/optparse/test_reqarg.rb22
-rw-r--r--test/optparse/test_summary.rb46
-rw-r--r--test/optparse/test_zsh_completion.rb22
-rw-r--r--test/ostruct/test_ostruct.rb94
-rw-r--r--test/pathname/test_pathname.rb885
-rw-r--r--test/profile_test_all.rb52
-rw-r--r--test/psych/handlers/test_recorder.rb25
-rw-r--r--test/psych/helper.rb56
-rw-r--r--test/psych/json/test_stream.rb109
-rw-r--r--test/psych/nodes/test_enumerable.rb43
-rw-r--r--test/psych/test_alias_and_anchor.rb96
-rw-r--r--test/psych/test_array.rb57
-rw-r--r--test/psych/test_boolean.rb36
-rw-r--r--test/psych/test_class.rb36
-rw-r--r--test/psych/test_coder.rb184
-rw-r--r--test/psych/test_date_time.rb17
-rw-r--r--test/psych/test_deprecated.rb210
-rw-r--r--test/psych/test_document.rb46
-rw-r--r--test/psych/test_emitter.rb94
-rw-r--r--test/psych/test_encoding.rb268
-rw-r--r--test/psych/test_engine_manager.rb47
-rw-r--r--test/psych/test_exception.rb151
-rw-r--r--test/psych/test_hash.rb44
-rw-r--r--test/psych/test_json_tree.rb65
-rw-r--r--test/psych/test_merge_keys.rb81
-rw-r--r--test/psych/test_nil.rb18
-rw-r--r--test/psych/test_null.rb19
-rw-r--r--test/psych/test_numeric.rb41
-rw-r--r--test/psych/test_object.rb44
-rw-r--r--test/psych/test_object_references.rb67
-rw-r--r--test/psych/test_omap.rb75
-rw-r--r--test/psych/test_parser.rb339
-rw-r--r--test/psych/test_psych.rb168
-rw-r--r--test/psych/test_scalar.rb11
-rw-r--r--test/psych/test_scalar_scanner.rb106
-rw-r--r--test/psych/test_serialize_subclasses.rb38
-rw-r--r--test/psych/test_set.rb49
-rw-r--r--test/psych/test_stream.rb93
-rw-r--r--test/psych/test_string.rb95
-rw-r--r--test/psych/test_struct.rb49
-rw-r--r--test/psych/test_symbol.rb17
-rw-r--r--test/psych/test_tainted.rb130
-rw-r--r--test/psych/test_to_yaml_properties.rb63
-rw-r--r--test/psych/test_tree_builder.rb79
-rw-r--r--test/psych/test_yaml.rb1280
-rw-r--r--test/psych/test_yamldbm.rb197
-rw-r--r--test/psych/test_yamlstore.rb87
-rw-r--r--test/psych/visitors/test_depth_first.rb49
-rw-r--r--test/psych/visitors/test_emitter.rb144
-rw-r--r--test/psych/visitors/test_to_ruby.rb326
-rw-r--r--test/psych/visitors/test_yaml_tree.rb173
-rw-r--r--test/rake/file_creation.rb34
-rw-r--r--test/rake/helper.rb562
-rw-r--r--test/rake/test_private_reader.rb42
-rw-r--r--test/rake/test_rake.rb40
-rw-r--r--test/rake/test_rake_application.rb531
-rw-r--r--test/rake/test_rake_application_options.rb460
-rw-r--r--test/rake/test_rake_backtrace.rb89
-rw-r--r--test/rake/test_rake_clean.rb14
-rw-r--r--test/rake/test_rake_definitions.rb80
-rw-r--r--test/rake/test_rake_directory_task.rb57
-rw-r--r--test/rake/test_rake_dsl.rb77
-rw-r--r--test/rake/test_rake_early_time.rb31
-rw-r--r--test/rake/test_rake_extension.rb59
-rw-r--r--test/rake/test_rake_file_creation_task.rb56
-rw-r--r--test/rake/test_rake_file_list.rb628
-rw-r--r--test/rake/test_rake_file_list_path_map.rb8
-rw-r--r--test/rake/test_rake_file_task.rb122
-rw-r--r--test/rake/test_rake_file_utils.rb305
-rw-r--r--test/rake/test_rake_ftp_file.rb59
-rw-r--r--test/rake/test_rake_functional.rb496
-rw-r--r--test/rake/test_rake_invocation_chain.rb52
-rw-r--r--test/rake/test_rake_makefile_loader.rb44
-rw-r--r--test/rake/test_rake_multi_task.rb59
-rw-r--r--test/rake/test_rake_name_space.rb43
-rw-r--r--test/rake/test_rake_package_task.rb79
-rw-r--r--test/rake/test_rake_path_map.rb157
-rw-r--r--test/rake/test_rake_path_map_explode.rb34
-rw-r--r--test/rake/test_rake_path_map_partial.rb18
-rw-r--r--test/rake/test_rake_pseudo_status.rb21
-rw-r--r--test/rake/test_rake_rake_test_loader.rb21
-rw-r--r--test/rake/test_rake_rdoc_task.rb83
-rw-r--r--test/rake/test_rake_reduce_compat.rb65
-rw-r--r--test/rake/test_rake_require.rb40
-rw-r--r--test/rake/test_rake_rules.rb327
-rw-r--r--test/rake/test_rake_task.rb316
-rw-r--r--test/rake/test_rake_task_argument_parsing.rb103
-rw-r--r--test/rake/test_rake_task_arguments.rb88
-rw-r--r--test/rake/test_rake_task_lib.rb9
-rw-r--r--test/rake/test_rake_task_manager.rb157
-rw-r--r--test/rake/test_rake_task_manager_argument_resolution.rb36
-rw-r--r--test/rake/test_rake_task_with_arguments.rb181
-rw-r--r--test/rake/test_rake_test_task.rb120
-rw-r--r--test/rake/test_rake_thread_pool.rb123
-rw-r--r--test/rake/test_rake_top_level_functions.rb111
-rw-r--r--test/rake/test_rake_win32.rb72
-rw-r--r--test/rake/test_sys.rb20
-rw-r--r--test/rake/test_thread_history_display.rb91
-rw-r--r--test/rake/test_trace_output.rb43
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Amps and angle encoding.text21
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Auto links.text13
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Backslash escapes.text120
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Blockquotes with code blocks.text11
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Code Blocks.text14
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Code Spans.text6
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Hard-wrapped paragraphs with list-like lines.text8
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Horizontal rules.text67
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Inline HTML (Advanced).text15
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Inline HTML (Simple).text69
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Inline HTML comments.text13
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Links, inline style.text12
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Links, reference style.text71
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Links, shortcut references.text20
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Literal quotes in titles.text7
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Basics.text306
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text888
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Nested blockquotes.text5
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Ordered and unordered lists.text131
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Strong and em together.text7
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Tabs.text21
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Tidyness.text5
-rw-r--r--test/rdoc/README1
-rw-r--r--test/rdoc/binary.datbin0 -> 1024 bytes-rw-r--r--test/rdoc/hidden.zip.txt1
-rw-r--r--test/rdoc/test.ja.large.rdoc3
-rw-r--r--test/rdoc/test.ja.largedoc3
-rw-r--r--test/rdoc/test.ja.rdoc10
-rw-r--r--test/rdoc/test.ja.txt8
-rw-r--r--test/rdoc/test.txt1
-rw-r--r--test/rdoc/test_attribute_manager.rb120
-rw-r--r--test/rdoc/test_rdoc_alias.rb13
-rw-r--r--test/rdoc/test_rdoc_any_method.rb319
-rw-r--r--test/rdoc/test_rdoc_attr.rb186
-rw-r--r--test/rdoc/test_rdoc_class_module.rb1443
-rw-r--r--test/rdoc/test_rdoc_code_object.rb317
-rw-r--r--test/rdoc/test_rdoc_comment.rb504
-rw-r--r--test/rdoc/test_rdoc_constant.rb147
-rw-r--r--test/rdoc/test_rdoc_context.rb882
-rw-r--r--test/rdoc/test_rdoc_context_section.rb137
-rw-r--r--test/rdoc/test_rdoc_cross_reference.rb191
-rw-r--r--test/rdoc/test_rdoc_encoding.rb204
-rw-r--r--test/rdoc/test_rdoc_extend.rb94
-rw-r--r--test/rdoc/test_rdoc_generator_darkfish.rb177
-rw-r--r--test/rdoc/test_rdoc_generator_json_index.rb275
-rw-r--r--test/rdoc/test_rdoc_generator_markup.rb59
-rw-r--r--test/rdoc/test_rdoc_generator_ri.rb86
-rw-r--r--test/rdoc/test_rdoc_include.rb108
-rw-r--r--test/rdoc/test_rdoc_markdown.rb977
-rw-r--r--test/rdoc/test_rdoc_markdown_test.rb1891
-rw-r--r--test/rdoc/test_rdoc_markup.rb95
-rw-r--r--test/rdoc/test_rdoc_markup_attribute_manager.rb237
-rw-r--r--test/rdoc/test_rdoc_markup_attributes.rb39
-rw-r--r--test/rdoc/test_rdoc_markup_document.rb214
-rw-r--r--test/rdoc/test_rdoc_markup_formatter.rb149
-rw-r--r--test/rdoc/test_rdoc_markup_hard_break.rb31
-rw-r--r--test/rdoc/test_rdoc_markup_heading.rb20
-rw-r--r--test/rdoc/test_rdoc_markup_include.rb19
-rw-r--r--test/rdoc/test_rdoc_markup_indented_paragraph.rb53
-rw-r--r--test/rdoc/test_rdoc_markup_paragraph.rb32
-rw-r--r--test/rdoc/test_rdoc_markup_parser.rb1687
-rw-r--r--test/rdoc/test_rdoc_markup_pre_process.rb461
-rw-r--r--test/rdoc/test_rdoc_markup_raw.rb29
-rw-r--r--test/rdoc/test_rdoc_markup_to_ansi.rb369
-rw-r--r--test/rdoc/test_rdoc_markup_to_bs.rb366
-rw-r--r--test/rdoc/test_rdoc_markup_to_html.rb575
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_crossref.rb218
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_snippet.rb710
-rw-r--r--test/rdoc/test_rdoc_markup_to_joined_paragraph.rb32
-rw-r--r--test/rdoc/test_rdoc_markup_to_label.rb112
-rw-r--r--test/rdoc/test_rdoc_markup_to_markdown.rb383
-rw-r--r--test/rdoc/test_rdoc_markup_to_rdoc.rb377
-rw-r--r--test/rdoc/test_rdoc_markup_to_table_of_contents.rb126
-rw-r--r--test/rdoc/test_rdoc_markup_to_tt_only.rb246
-rw-r--r--test/rdoc/test_rdoc_markup_verbatim.rb29
-rw-r--r--test/rdoc/test_rdoc_method_attr.rb155
-rw-r--r--test/rdoc/test_rdoc_normal_class.rb42
-rw-r--r--test/rdoc/test_rdoc_normal_module.rb37
-rw-r--r--test/rdoc/test_rdoc_options.rb643
-rw-r--r--test/rdoc/test_rdoc_parser.rb287
-rw-r--r--test/rdoc/test_rdoc_parser_c.rb1709
-rw-r--r--test/rdoc/test_rdoc_parser_changelog.rb322
-rw-r--r--test/rdoc/test_rdoc_parser_markdown.rb61
-rw-r--r--test/rdoc/test_rdoc_parser_rd.rb62
-rw-r--r--test/rdoc/test_rdoc_parser_ruby.rb3009
-rw-r--r--test/rdoc/test_rdoc_parser_simple.rb115
-rw-r--r--test/rdoc/test_rdoc_rd.rb30
-rw-r--r--test/rdoc/test_rdoc_rd_block_parser.rb541
-rw-r--r--test/rdoc/test_rdoc_rd_inline.rb63
-rw-r--r--test/rdoc/test_rdoc_rd_inline_parser.rb178
-rw-r--r--test/rdoc/test_rdoc_rdoc.rb391
-rw-r--r--test/rdoc/test_rdoc_require.rb25
-rw-r--r--test/rdoc/test_rdoc_ri_driver.rb1421
-rw-r--r--test/rdoc/test_rdoc_ri_paths.rb155
-rw-r--r--test/rdoc/test_rdoc_ruby_lex.rb291
-rw-r--r--test/rdoc/test_rdoc_ruby_token.rb19
-rw-r--r--test/rdoc/test_rdoc_rubygems_hook.rb254
-rw-r--r--test/rdoc/test_rdoc_servlet.rb429
-rw-r--r--test/rdoc/test_rdoc_single_class.rb12
-rw-r--r--test/rdoc/test_rdoc_stats.rb647
-rw-r--r--test/rdoc/test_rdoc_store.rb962
-rw-r--r--test/rdoc/test_rdoc_task.rb120
-rw-r--r--test/rdoc/test_rdoc_text.rb568
-rw-r--r--test/rdoc/test_rdoc_token_stream.rb42
-rw-r--r--test/rdoc/test_rdoc_tom_doc.rb492
-rw-r--r--test/rdoc/test_rdoc_top_level.rb271
-rw-r--r--test/rdoc/xref_data.rb76
-rw-r--r--test/rdoc/xref_test_case.rb65
-rw-r--r--test/readline/test_readline.rb495
-rw-r--r--test/readline/test_readline_history.rb327
-rw-r--r--test/resolv/test_addr.rb16
-rw-r--r--test/resolv/test_dns.rb153
-rw-r--r--test/rexml/data/LostineRiver.kml.gzbin0 -> 50154 bytes-rw-r--r--test/rexml/data/ProductionSupport.xml29
-rw-r--r--test/rexml/data/axis.xml25
-rw-r--r--test/rexml/data/bad.xml5
-rw-r--r--test/rexml/data/basic.xml11
-rw-r--r--test/rexml/data/basicupdate.xml47
-rw-r--r--test/rexml/data/broken.rss20
-rw-r--r--test/rexml/data/contents.xml70
-rw-r--r--test/rexml/data/dash.xml12
-rw-r--r--test/rexml/data/defaultNamespace.xml6
-rw-r--r--test/rexml/data/doctype_test.xml34
-rw-r--r--test/rexml/data/documentation.xml542
-rw-r--r--test/rexml/data/euc.xml296
-rw-r--r--test/rexml/data/evaluate.xml28
-rw-r--r--test/rexml/data/fibo.xml29
-rw-r--r--test/rexml/data/foo.xml10
-rw-r--r--test/rexml/data/google.2.xml156
-rw-r--r--test/rexml/data/id.xml21
-rw-r--r--test/rexml/data/iso8859-1.xml4
-rw-r--r--test/rexml/data/jaxen24.xml2
-rw-r--r--test/rexml/data/jaxen3.xml15
-rw-r--r--test/rexml/data/lang.xml11
-rw-r--r--test/rexml/data/lang0.xml18
-rw-r--r--test/rexml/data/message.xml27
-rw-r--r--test/rexml/data/moreover.xml244
-rw-r--r--test/rexml/data/much_ado.xml6850
-rw-r--r--test/rexml/data/namespaces.xml18
-rw-r--r--test/rexml/data/nitf.xml67
-rw-r--r--test/rexml/data/numbers.xml18
-rw-r--r--test/rexml/data/ofbiz-issues-full-177.xml13971
-rw-r--r--test/rexml/data/pi.xml13
-rw-r--r--test/rexml/data/pi2.xml6
-rw-r--r--test/rexml/data/project.xml1
-rw-r--r--test/rexml/data/simple.xml2
-rw-r--r--test/rexml/data/stream_accents.xml4
-rw-r--r--test/rexml/data/t63-1.xmlbin0 -> 161690 bytes-rw-r--r--test/rexml/data/t63-2.svg2828
-rw-r--r--test/rexml/data/t75.xml31
-rw-r--r--test/rexml/data/test/tests.xml683
-rw-r--r--test/rexml/data/test/tests.xsl369
-rw-r--r--test/rexml/data/testNamespaces.xml22
-rw-r--r--test/rexml/data/testsrc.xml64
-rw-r--r--test/rexml/data/text.xml10
-rw-r--r--test/rexml/data/ticket_110_utf16.xmlbin0 -> 207464 bytes-rw-r--r--test/rexml/data/ticket_61.xml4
-rw-r--r--test/rexml/data/ticket_68.xml590
-rw-r--r--test/rexml/data/tutorial.xml678
-rw-r--r--test/rexml/data/underscore.xml6
-rw-r--r--test/rexml/data/web.xml42
-rw-r--r--test/rexml/data/web2.xml7
-rw-r--r--test/rexml/data/working.rss202
-rw-r--r--test/rexml/data/xmlfile-bug.xml15
-rw-r--r--test/rexml/data/xp.tst27
-rw-r--r--test/rexml/data/yahoo.xml80
-rw-r--r--test/rexml/listener.rb50
-rw-r--r--test/rexml/rexml_test_utils.rb5
-rw-r--r--test/rexml/test_attributes.rb198
-rw-r--r--test/rexml/test_attributes_mixin.rb32
-rw-r--r--test/rexml/test_changing_encoding.rb44
-rw-r--r--test/rexml/test_comment.rb25
-rw-r--r--test/rexml/test_contrib.rb581
-rw-r--r--test/rexml/test_core.rb1462
-rw-r--r--test/rexml/test_doctype.rb107
-rw-r--r--test/rexml/test_document.rb319
-rw-r--r--test/rexml/test_elements.rb116
-rw-r--r--test/rexml/test_encoding.rb94
-rw-r--r--test/rexml/test_encoding_2.rb59
-rw-r--r--test/rexml/test_entity.rb149
-rw-r--r--test/rexml/test_functions.rb223
-rw-r--r--test/rexml/test_functions_number.rb32
-rw-r--r--test/rexml/test_jaxen.rb126
-rw-r--r--test/rexml/test_light.rb104
-rw-r--r--test/rexml/test_lightparser.rb12
-rw-r--r--test/rexml/test_listener.rb129
-rw-r--r--test/rexml/test_martin_fowler.rb37
-rw-r--r--test/rexml/test_namespace.rb38
-rw-r--r--test/rexml/test_notationdecl_mixin.rb58
-rw-r--r--test/rexml/test_notationdecl_parsetest.rb23
-rw-r--r--test/rexml/test_order.rb105
-rw-r--r--test/rexml/test_preceding_sibling.rb38
-rw-r--r--test/rexml/test_pullparser.rb100
-rw-r--r--test/rexml/test_rexml_issuezilla.rb14
-rw-r--r--test/rexml/test_sax.rb279
-rw-r--r--test/rexml/test_stream.rb104
-rw-r--r--test/rexml/test_ticket_80.rb56
-rw-r--r--test/rexml/test_validation_rng.rb790
-rw-r--r--test/rexml/test_xml_declaration.rb34
-rw-r--r--test/rexml/test_xpath.rb1079
-rw-r--r--test/rexml/test_xpath_attribute_query.rb89
-rw-r--r--test/rexml/test_xpath_msw.rb38
-rw-r--r--test/rexml/test_xpath_pred.rb80
-rw-r--r--test/rexml/test_xpathtext.rb72
-rw-r--r--test/rinda/test_rinda.rb277
-rw-r--r--test/rinda/test_tuplebag.rb172
-rw-r--r--test/ripper/dummyparser.rb216
-rw-r--r--test/ripper/test_files.rb46
-rw-r--r--test/ripper/test_filter.rb83
-rw-r--r--test/ripper/test_parser_events.rb1174
-rw-r--r--test/ripper/test_ripper.rb49
-rw-r--r--test/ripper/test_scanner_events.rb863
-rw-r--r--test/rss/dot.pngbin0 -> 111 bytes-rw-r--r--test/rss/rss-assertions.rb1944
-rw-r--r--test/rss/rss-testcase.rb216
-rw-r--r--test/rss/test_1.0.rb210
-rw-r--r--test/rss/test_2.0.rb145
-rw-r--r--test/rss/test_accessor.rb32
-rw-r--r--test/rss/test_atom.rb683
-rw-r--r--test/rss/test_content.rb76
-rw-r--r--test/rss/test_dublincore.rb318
-rw-r--r--test/rss/test_image.rb49
-rw-r--r--test/rss/test_inherit.rb5
-rw-r--r--test/rss/test_itunes.rb347
-rw-r--r--test/rss/test_maker_0.9.rb215
-rw-r--r--test/rss/test_maker_1.0.rb281
-rw-r--r--test/rss/test_maker_2.0.rb198
-rw-r--r--test/rss/test_maker_atom_entry.rb393
-rw-r--r--test/rss/test_maker_atom_feed.rb454
-rw-r--r--test/rss/test_maker_content.rb15
-rw-r--r--test/rss/test_maker_dc.rb22
-rw-r--r--test/rss/test_maker_image.rb4
-rw-r--r--test/rss/test_maker_itunes.rb471
-rw-r--r--test/rss/test_maker_slash.rb37
-rw-r--r--test/rss/test_maker_sy.rb5
-rw-r--r--test/rss/test_maker_taxo.rb6
-rw-r--r--test/rss/test_maker_trackback.rb2
-rw-r--r--test/rss/test_maker_xml-stylesheet.rb14
-rw-r--r--test/rss/test_parser.rb26
-rw-r--r--test/rss/test_parser_1.0.rb27
-rw-r--r--test/rss/test_parser_atom_entry.rb163
-rw-r--r--test/rss/test_parser_atom_feed.rb276
-rw-r--r--test/rss/test_setup_maker_0.9.rb49
-rw-r--r--test/rss/test_setup_maker_1.0.rb110
-rw-r--r--test/rss/test_setup_maker_2.0.rb42
-rw-r--r--test/rss/test_setup_maker_atom_entry.rb409
-rw-r--r--test/rss/test_setup_maker_atom_feed.rb445
-rw-r--r--test/rss/test_setup_maker_itunes.rb144
-rw-r--r--test/rss/test_setup_maker_slash.rb38
-rw-r--r--test/rss/test_slash.rb64
-rw-r--r--test/rss/test_syndication.rb40
-rw-r--r--test/rss/test_taxonomy.rb30
-rw-r--r--test/rss/test_to_s.rb262
-rw-r--r--test/rss/test_trackback.rb28
-rw-r--r--test/rss/test_version.rb2
-rw-r--r--test/rss/test_xml-stylesheet.rb22
-rw-r--r--test/ruby/allpairs.rb103
-rw-r--r--test/ruby/beginmainend.rb2
-rw-r--r--test/ruby/enc/test_big5.rb28
-rw-r--r--test/ruby/enc/test_cp949.rb28
-rw-r--r--test/ruby/enc/test_emoji.rb442
-rw-r--r--test/ruby/enc/test_euc_jp.rb24
-rw-r--r--test/ruby/enc/test_euc_kr.rb28
-rw-r--r--test/ruby/enc/test_euc_tw.rb28
-rw-r--r--test/ruby/enc/test_gb18030.rb126
-rw-r--r--test/ruby/enc/test_gbk.rb28
-rw-r--r--test/ruby/enc/test_iso_8859.rb163
-rw-r--r--test/ruby/enc/test_koi8.rb22
-rw-r--r--test/ruby/enc/test_shift_jis.rb27
-rw-r--r--test/ruby/enc/test_utf16.rb384
-rw-r--r--test/ruby/enc/test_utf32.rb93
-rw-r--r--test/ruby/enc/test_windows_1251.rb16
-rw-r--r--test/ruby/endblockwarn_rb (renamed from test/ruby/endblockwarn.rb)0
-rw-r--r--test/ruby/envutil.rb342
-rw-r--r--test/ruby/lbtest.rb49
-rw-r--r--test/ruby/marshaltestlib.rb90
-rw-r--r--test/ruby/memory_status.rb114
-rw-r--r--test/ruby/sentence.rb668
-rw-r--r--test/ruby/test_alias.rb124
-rw-r--r--test/ruby/test_argf.rb815
-rw-r--r--test/ruby/test_arity.rb71
-rw-r--r--test/ruby/test_array.rb2167
-rw-r--r--test/ruby/test_assignment.rb710
-rw-r--r--test/ruby/test_autoload.rb182
-rw-r--r--test/ruby/test_backtrace.rb144
-rw-r--r--test/ruby/test_basicinstructions.rb687
-rw-r--r--test/ruby/test_beginendblock.rb135
-rw-r--r--test/ruby/test_bignum.rb610
-rw-r--r--test/ruby/test_call.rb4
-rw-r--r--test/ruby/test_case.rb57
-rw-r--r--test/ruby/test_class.rb353
-rw-r--r--test/ruby/test_clone.rb2
-rw-r--r--test/ruby/test_comparable.rb72
-rw-r--r--test/ruby/test_complex.rb1163
-rw-r--r--test/ruby/test_complex2.rb735
-rw-r--r--test/ruby/test_complexrational.rb407
-rw-r--r--test/ruby/test_const.rb35
-rw-r--r--test/ruby/test_continuation.rb135
-rw-r--r--test/ruby/test_defined.rb145
-rw-r--r--test/ruby/test_dir.rb203
-rw-r--r--test/ruby/test_dir_m17n.rb272
-rw-r--r--test/ruby/test_econv.rb931
-rw-r--r--test/ruby/test_encoding.rb116
-rw-r--r--test/ruby/test_enum.rb423
-rw-r--r--test/ruby/test_enumerator.rb560
-rw-r--r--test/ruby/test_env.rb362
-rw-r--r--test/ruby/test_eval.rb427
-rw-r--r--test/ruby/test_exception.rb392
-rw-r--r--test/ruby/test_fiber.rb324
-rw-r--r--test/ruby/test_file.rb360
-rw-r--r--test/ruby/test_file_exhaustive.rb1117
-rw-r--r--test/ruby/test_fixnum.rb282
-rw-r--r--test/ruby/test_flip.rb13
-rw-r--r--test/ruby/test_float.rb507
-rw-r--r--test/ruby/test_fnmatch.rb112
-rw-r--r--test/ruby/test_gc.rb113
-rw-r--r--test/ruby/test_hash.rb479
-rw-r--r--test/ruby/test_ifunless.rb14
-rw-r--r--test/ruby/test_integer.rb244
-rw-r--r--test/ruby/test_integer_comb.rb622
-rw-r--r--test/ruby/test_io.rb2625
-rw-r--r--test/ruby/test_io_m17n.rb2467
-rw-r--r--test/ruby/test_iseq.rb83
-rw-r--r--test/ruby/test_iterator.rb162
-rw-r--r--test/ruby/test_keyword.rb277
-rw-r--r--test/ruby/test_lambda.rb92
-rw-r--r--test/ruby/test_lazy_enumerator.rb366
-rw-r--r--test/ruby/test_literal.rb437
-rw-r--r--test/ruby/test_m17n.rb1484
-rw-r--r--test/ruby/test_m17n_comb.rb1590
-rw-r--r--test/ruby/test_marshal.rb490
-rw-r--r--test/ruby/test_math.rb281
-rw-r--r--test/ruby/test_metaclass.rb167
-rw-r--r--test/ruby/test_method.rb488
-rw-r--r--test/ruby/test_mixed_unicode_escapes.rb25
-rw-r--r--test/ruby/test_module.rb1618
-rw-r--r--test/ruby/test_not.rb12
-rw-r--r--test/ruby/test_notimp.rb64
-rw-r--r--test/ruby/test_numeric.rb235
-rw-r--r--test/ruby/test_object.rb888
-rw-r--r--test/ruby/test_objectspace.rb51
-rw-r--r--test/ruby/test_optimization.rb202
-rw-r--r--test/ruby/test_pack.rb658
-rw-r--r--test/ruby/test_parse.rb845
-rw-r--r--test/ruby/test_path.rb57
-rw-r--r--test/ruby/test_pipe.rb4
-rw-r--r--test/ruby/test_primitive.rb423
-rw-r--r--test/ruby/test_proc.rb1088
-rw-r--r--test/ruby/test_process.rb1563
-rw-r--r--test/ruby/test_rand.rb546
-rw-r--r--test/ruby/test_range.rb422
-rw-r--r--test/ruby/test_rational.rb1149
-rw-r--r--test/ruby/test_rational2.rb1386
-rw-r--r--test/ruby/test_readpartial.rb14
-rw-r--r--test/ruby/test_refinement.rb809
-rw-r--r--test/ruby/test_regexp.rb927
-rw-r--r--test/ruby/test_require.rb607
-rw-r--r--test/ruby/test_rubyoptions.rb636
-rw-r--r--test/ruby/test_settracefunc.rb996
-rw-r--r--test/ruby/test_signal.rb256
-rw-r--r--test/ruby/test_sleep.rb15
-rw-r--r--test/ruby/test_sprintf.rb394
-rw-r--r--test/ruby/test_sprintf_comb.rb553
-rw-r--r--test/ruby/test_string.rb2174
-rw-r--r--test/ruby/test_stringchar.rb57
-rw-r--r--test/ruby/test_struct.rb260
-rw-r--r--test/ruby/test_super.rb256
-rw-r--r--test/ruby/test_symbol.rb114
-rw-r--r--test/ruby/test_syntax.rb365
-rw-r--r--test/ruby/test_system.rb166
-rw-r--r--test/ruby/test_thread.rb918
-rw-r--r--test/ruby/test_threadgroup.rb55
-rw-r--r--test/ruby/test_time.rb925
-rw-r--r--test/ruby/test_time_tz.rb353
-rw-r--r--test/ruby/test_trace.rb46
-rw-r--r--test/ruby/test_transcode.rb2063
-rw-r--r--test/ruby/test_undef.rb37
-rw-r--r--test/ruby/test_unicode_escape.rb271
-rw-r--r--test/ruby/test_variable.rb52
-rw-r--r--test/ruby/test_whileuntil.rb112
-rw-r--r--test/ruby/test_yield.rb382
-rw-r--r--test/ruby/ut_eof.rb12
-rw-r--r--test/rubygems/alternate_cert.pem18
-rw-r--r--test/rubygems/alternate_cert_32.pem18
-rw-r--r--test/rubygems/alternate_key.pem27
-rw-r--r--test/rubygems/bad_rake.rb1
-rw-r--r--test/rubygems/bogussources.rb8
-rw-r--r--test/rubygems/ca_cert.pem45
-rw-r--r--test/rubygems/child_cert.pem18
-rw-r--r--test/rubygems/child_cert_32.pem18
-rw-r--r--test/rubygems/child_key.pem27
-rw-r--r--test/rubygems/data/gem-private_key.pem27
-rw-r--r--test/rubygems/data/gem-public_cert.pem20
-rw-r--r--test/rubygems/data/null-type.gemspec.rzbin0 -> 554 bytes-rw-r--r--test/rubygems/expired_cert.pem18
-rw-r--r--test/rubygems/fake_certlib/openssl.rb7
-rw-r--r--test/rubygems/fix_openssl_warnings.rb12
-rw-r--r--test/rubygems/foo/discover.rb (renamed from test/wsdl/datetime/datetime.rb)0
-rw-r--r--test/rubygems/future_cert.pem18
-rw-r--r--test/rubygems/future_cert_32.pem18
-rw-r--r--test/rubygems/good_rake.rb1
-rw-r--r--test/rubygems/grandchild_cert.pem18
-rw-r--r--test/rubygems/grandchild_cert_32.pem18
-rw-r--r--test/rubygems/grandchild_key.pem27
-rw-r--r--test/rubygems/insure_session.rb43
-rw-r--r--test/rubygems/invalid_issuer_cert.pem18
-rw-r--r--test/rubygems/invalid_issuer_cert_32.pem18
-rw-r--r--test/rubygems/invalid_key.pem27
-rw-r--r--test/rubygems/invalid_signer_cert.pem18
-rw-r--r--test/rubygems/invalid_signer_cert_32.pem18
-rw-r--r--test/rubygems/invalidchild_cert.pem18
-rw-r--r--test/rubygems/invalidchild_cert_32.pem18
-rw-r--r--test/rubygems/invalidchild_key.pem27
-rw-r--r--test/rubygems/plugin/exception/rubygems_plugin.rb2
-rw-r--r--test/rubygems/plugin/load/rubygems_plugin.rb3
-rw-r--r--test/rubygems/plugin/standarderror/rubygems_plugin.rb2
-rw-r--r--test/rubygems/private_key.pem27
-rw-r--r--test/rubygems/public_cert.pem18
-rw-r--r--test/rubygems/public_cert_32.pem18
-rw-r--r--test/rubygems/public_key.pem9
-rw-r--r--test/rubygems/rubygems/commands/crash_command.rb5
-rw-r--r--test/rubygems/rubygems_plugin.rb21
-rw-r--r--test/rubygems/sff/discover.rb (renamed from test/wsdl/qualified/lp.rb)0
-rw-r--r--test/rubygems/simple_gem.rb66
-rw-r--r--test/rubygems/ssl_cert.pem (renamed from test/soap/ssl/server.cert)0
-rw-r--r--test/rubygems/ssl_key.pem (renamed from test/soap/ssl/server.key)0
-rw-r--r--test/rubygems/test_config.rb14
-rw-r--r--test/rubygems/test_deprecate.rb76
-rw-r--r--test/rubygems/test_gem.rb1555
-rw-r--r--test/rubygems/test_gem_available_set.rb106
-rw-r--r--test/rubygems/test_gem_command.rb188
-rw-r--r--test/rubygems/test_gem_command_manager.rb261
-rw-r--r--test/rubygems/test_gem_commands_build_command.rb110
-rw-r--r--test/rubygems/test_gem_commands_cert_command.rb523
-rw-r--r--test/rubygems/test_gem_commands_check_command.rb68
-rw-r--r--test/rubygems/test_gem_commands_cleanup_command.rb152
-rw-r--r--test/rubygems/test_gem_commands_contents_command.rb168
-rw-r--r--test/rubygems/test_gem_commands_dependency_command.rb231
-rw-r--r--test/rubygems/test_gem_commands_environment_command.rb144
-rw-r--r--test/rubygems/test_gem_commands_fetch_command.rb101
-rw-r--r--test/rubygems/test_gem_commands_generate_index_command.rb50
-rw-r--r--test/rubygems/test_gem_commands_help_command.rb59
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb953
-rw-r--r--test/rubygems/test_gem_commands_list_command.rb33
-rw-r--r--test/rubygems/test_gem_commands_lock_command.rb68
-rw-r--r--test/rubygems/test_gem_commands_mirror.rb32
-rw-r--r--test/rubygems/test_gem_commands_outdated_command.rb38
-rw-r--r--test/rubygems/test_gem_commands_owner_command.rb143
-rw-r--r--test/rubygems/test_gem_commands_pristine_command.rb294
-rw-r--r--test/rubygems/test_gem_commands_push_command.rb170
-rw-r--r--test/rubygems/test_gem_commands_query_command.rb434
-rw-r--r--test/rubygems/test_gem_commands_search_command.rb25
-rw-r--r--test/rubygems/test_gem_commands_server_command.rb59
-rw-r--r--test/rubygems/test_gem_commands_setup_command.rb45
-rw-r--r--test/rubygems/test_gem_commands_sources_command.rb225
-rw-r--r--test/rubygems/test_gem_commands_specification_command.rb273
-rw-r--r--test/rubygems/test_gem_commands_stale_command.rb40
-rw-r--r--test/rubygems/test_gem_commands_uninstall_command.rb179
-rw-r--r--test/rubygems/test_gem_commands_unpack_command.rb224
-rw-r--r--test/rubygems/test_gem_commands_update_command.rb390
-rw-r--r--test/rubygems/test_gem_commands_which_command.rb83
-rw-r--r--test/rubygems/test_gem_commands_yank_command.rb97
-rw-r--r--test/rubygems/test_gem_config_file.rb364
-rw-r--r--test/rubygems/test_gem_dependency.rb223
-rw-r--r--test/rubygems/test_gem_dependency_installer.rb1093
-rw-r--r--test/rubygems/test_gem_dependency_list.rb259
-rw-r--r--test/rubygems/test_gem_dependency_resolver.rb327
-rw-r--r--test/rubygems/test_gem_doctor.rb168
-rw-r--r--test/rubygems/test_gem_ext_cmake_builder.rb90
-rw-r--r--test/rubygems/test_gem_ext_configure_builder.rb84
-rw-r--r--test/rubygems/test_gem_ext_ext_conf_builder.rb162
-rw-r--r--test/rubygems/test_gem_ext_rake_builder.rb66
-rw-r--r--test/rubygems/test_gem_gem_runner.rb64
-rw-r--r--test/rubygems/test_gem_gemcutter_utilities.rb170
-rw-r--r--test/rubygems/test_gem_indexer.rb363
-rw-r--r--test/rubygems/test_gem_install_update_options.rb147
-rw-r--r--test/rubygems/test_gem_installer.rb1312
-rw-r--r--test/rubygems/test_gem_local_remote_options.rb120
-rw-r--r--test/rubygems/test_gem_name_tuple.rb15
-rw-r--r--test/rubygems/test_gem_package.rb549
-rw-r--r--test/rubygems/test_gem_package_old.rb37
-rw-r--r--test/rubygems/test_gem_package_tar_header.rb130
-rw-r--r--test/rubygems/test_gem_package_tar_reader.rb78
-rw-r--r--test/rubygems/test_gem_package_tar_reader_entry.rb119
-rw-r--r--test/rubygems/test_gem_package_tar_writer.rb227
-rw-r--r--test/rubygems/test_gem_package_task.rb59
-rw-r--r--test/rubygems/test_gem_path_support.rb67
-rw-r--r--test/rubygems/test_gem_platform.rb274
-rw-r--r--test/rubygems/test_gem_rdoc.rb269
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb1038
-rw-r--r--test/rubygems/test_gem_request_set.rb70
-rw-r--r--test/rubygems/test_gem_requirement.rb340
-rw-r--r--test/rubygems/test_gem_security.rb250
-rw-r--r--test/rubygems/test_gem_security_policy.rb376
-rw-r--r--test/rubygems/test_gem_security_signer.rb188
-rw-r--r--test/rubygems/test_gem_security_trust_dir.rb94
-rw-r--r--test/rubygems/test_gem_server.rb235
-rw-r--r--test/rubygems/test_gem_silent_ui.rb111
-rw-r--r--test/rubygems/test_gem_source.rb188
-rw-r--r--test/rubygems/test_gem_source_list.rb87
-rw-r--r--test/rubygems/test_gem_source_local.rb83
-rw-r--r--test/rubygems/test_gem_source_specific_file.rb33
-rw-r--r--test/rubygems/test_gem_spec_fetcher.rb244
-rw-r--r--test/rubygems/test_gem_specification.rb2003
-rw-r--r--test/rubygems/test_gem_stream_ui.rb238
-rw-r--r--test/rubygems/test_gem_text.rb58
-rw-r--r--test/rubygems/test_gem_uninstaller.rb403
-rw-r--r--test/rubygems/test_gem_validator.rb36
-rw-r--r--test/rubygems/test_gem_version.rb184
-rw-r--r--test/rubygems/test_gem_version_option.rb89
-rw-r--r--test/rubygems/test_kernel.rb55
-rw-r--r--test/rubygems/test_require.rb192
-rw-r--r--test/rubygems/wrong_key_cert.pem18
-rw-r--r--test/rubygems/wrong_key_cert_32.pem18
-rw-r--r--test/runner.rb18
-rw-r--r--test/scanf/data.txt6
-rw-r--r--test/scanf/test_scanf.rb325
-rw-r--r--test/scanf/test_scanfblocks.rb81
-rw-r--r--test/scanf/test_scanfio.rb20
-rw-r--r--test/sdbm/test_sdbm.rb93
-rw-r--r--test/soap/asp.net/hello.wsdl96
-rw-r--r--test/soap/asp.net/test_aspdotnet.rb111
-rw-r--r--test/soap/calc/calc.rb17
-rw-r--r--test/soap/calc/calc2.rb29
-rw-r--r--test/soap/calc/server.cgi13
-rw-r--r--test/soap/calc/server.rb17
-rw-r--r--test/soap/calc/server2.rb20
-rw-r--r--test/soap/calc/test_calc.rb49
-rw-r--r--test/soap/calc/test_calc2.rb53
-rw-r--r--test/soap/calc/test_calc_cgi.rb69
-rw-r--r--test/soap/fault/test_customfault.rb58
-rw-r--r--test/soap/header/server.cgi119
-rw-r--r--test/soap/header/test_authheader.rb240
-rw-r--r--test/soap/header/test_authheader_cgi.rb121
-rw-r--r--test/soap/header/test_simplehandler.rb116
-rw-r--r--test/soap/helloworld/hw_s.rb16
-rw-r--r--test/soap/helloworld/test_helloworld.rb40
-rw-r--r--test/soap/marshal/test_digraph.rb56
-rw-r--r--test/soap/marshal/test_marshal.rb26
-rw-r--r--test/soap/marshal/test_struct.rb47
-rw-r--r--test/soap/ssl/README1
-rw-r--r--test/soap/ssl/ca.cert23
-rw-r--r--test/soap/ssl/client.cert19
-rw-r--r--test/soap/ssl/client.key15
-rw-r--r--test/soap/ssl/sslsvr.rb57
-rw-r--r--test/soap/ssl/subca.cert21
-rw-r--r--test/soap/ssl/test_ssl.rb204
-rw-r--r--test/soap/struct/test_struct.rb77
-rw-r--r--test/soap/swa/test_file.rb73
-rw-r--r--test/soap/test_basetype.rb970
-rw-r--r--test/soap/test_envelopenamespace.rb92
-rw-r--r--test/soap/test_httpconfigloader.rb39
-rw-r--r--test/soap/test_mapping.rb59
-rw-r--r--test/soap/test_no_indent.rb86
-rw-r--r--test/soap/test_property.rb424
-rw-r--r--test/soap/test_soapelement.rb122
-rw-r--r--test/soap/test_streamhandler.rb209
-rw-r--r--test/soap/test_styleuse.rb333
-rw-r--r--test/soap/wsdlDriver/README.txt2
-rw-r--r--test/soap/wsdlDriver/calc.wsdl126
-rw-r--r--test/soap/wsdlDriver/document.wsdl54
-rw-r--r--test/soap/wsdlDriver/echo_version.rb20
-rw-r--r--test/soap/wsdlDriver/simpletype.wsdl63
-rw-r--r--test/soap/wsdlDriver/test_calc.rb100
-rw-r--r--test/soap/wsdlDriver/test_document.rb78
-rw-r--r--test/soap/wsdlDriver/test_simpletype.rb87
-rw-r--r--test/socket/test_addrinfo.rb640
-rw-r--r--test/socket/test_ancdata.rb66
-rw-r--r--test/socket/test_basicsocket.rb88
-rw-r--r--test/socket/test_nonblock.rb149
-rw-r--r--test/socket/test_socket.rb574
-rw-r--r--test/socket/test_sockopt.rb33
-rw-r--r--test/socket/test_tcp.rb42
-rw-r--r--test/socket/test_udp.rb39
-rw-r--r--test/socket/test_unix.rb405
-rw-r--r--test/stringio/test_stringio.rb500
-rw-r--r--test/strscan/test_stringscanner.rb213
-rw-r--r--test/syslog/test_syslog_logger.rb522
-rw-r--r--test/test_abbrev.rb54
-rw-r--r--test/test_cmath.rb16
-rw-r--r--test/test_curses.rb12
-rw-r--r--test/test_delegate.rb136
-rw-r--r--test/test_find.rb226
-rw-r--r--test/test_ipaddr.rb3
-rw-r--r--test/test_mathn.rb12
-rw-r--r--test/test_mutex_m.rb26
-rw-r--r--test/test_open3.rb242
-rw-r--r--test/test_pp.rb187
-rw-r--r--test/test_prettyprint.rb519
-rw-r--r--test/test_prime.rb174
-rw-r--r--test/test_pstore.rb137
-rw-r--r--test/test_pty.rb219
-rw-r--r--test/test_securerandom.rb185
-rw-r--r--test/test_set.rb638
-rw-r--r--test/test_shellwords.rb61
-rw-r--r--test/test_singleton.rb103
-rw-r--r--test/test_syslog.rb185
-rw-r--r--test/test_tempfile.rb308
-rw-r--r--test/test_time.rb414
-rw-r--r--test/test_timeout.rb32
-rw-r--r--test/test_tmpdir.rb33
-rw-r--r--test/test_tracer.rb63
-rw-r--r--test/test_tsort.rb44
-rw-r--r--test/test_weakref.rb56
-rw-r--r--test/testunit/collector/test_dir.rb389
-rw-r--r--test/testunit/collector/test_objectspace.rb98
-rw-r--r--test/testunit/runit/test_assert.rb402
-rw-r--r--test/testunit/runit/test_testcase.rb91
-rw-r--r--test/testunit/runit/test_testresult.rb144
-rw-r--r--test/testunit/runit/test_testsuite.rb49
-rw-r--r--test/testunit/test4test_hideskip.rb7
-rw-r--r--test/testunit/test4test_redefinition.rb11
-rw-r--r--test/testunit/test4test_sorting.rb15
-rw-r--r--test/testunit/test_assertion.rb8
-rw-r--r--test/testunit/test_assertions.rb528
-rw-r--r--test/testunit/test_error.rb26
-rw-r--r--test/testunit/test_failure.rb33
-rw-r--r--test/testunit/test_hideskip.rb27
-rw-r--r--test/testunit/test_parallel.rb189
-rw-r--r--test/testunit/test_rake_integration.rb35
-rw-r--r--test/testunit/test_redefinition.rb13
-rw-r--r--test/testunit/test_sorting.rb17
-rw-r--r--test/testunit/test_testcase.rb275
-rw-r--r--test/testunit/test_testresult.rb104
-rw-r--r--test/testunit/test_testsuite.rb129
-rw-r--r--test/testunit/tests_for_parallel/ptest_first.rb7
-rw-r--r--test/testunit/tests_for_parallel/ptest_forth.rb21
-rw-r--r--test/testunit/tests_for_parallel/ptest_second.rb11
-rw-r--r--test/testunit/tests_for_parallel/ptest_third.rb10
-rw-r--r--test/testunit/tests_for_parallel/runner.rb10
-rw-r--r--test/testunit/util/test_backtracefilter.rb41
-rw-r--r--test/testunit/util/test_observable.rb102
-rw-r--r--test/testunit/util/test_procwrapper.rb36
-rw-r--r--test/thread/test_cv.rb188
-rw-r--r--test/thread/test_queue.rb110
-rw-r--r--test/thread/test_sync.rb57
-rw-r--r--test/uri/test_common.rb88
-rw-r--r--test/uri/test_ftp.rb30
-rw-r--r--test/uri/test_generic.rb237
-rw-r--r--test/uri/test_http.rb5
-rw-r--r--test/uri/test_ldap.rb32
-rw-r--r--test/uri/test_mailto.rb36
-rw-r--r--test/uri/test_parser.rb41
-rw-r--r--test/webrick/test_cgi.rb109
-rw-r--r--test/webrick/test_cookie.rb58
-rw-r--r--test/webrick/test_filehandler.rb159
-rw-r--r--test/webrick/test_httpauth.rb111
-rw-r--r--test/webrick/test_httpproxy.rb282
-rw-r--r--test/webrick/test_httprequest.rb145
-rw-r--r--test/webrick/test_httpresponse.rb49
-rw-r--r--test/webrick/test_httpserver.rb143
-rw-r--r--test/webrick/test_httputils.rb36
-rw-r--r--test/webrick/test_server.rb56
-rw-r--r--test/webrick/test_utils.rb64
-rw-r--r--test/webrick/utils.rb31
-rw-r--r--[-rwxr-xr-x]test/webrick/webrick_long_filename.cgi0
-rw-r--r--test/win32ole/err_in_callback.rb9
-rw-r--r--test/win32ole/orig_data.csv5
-rw-r--r--test/win32ole/test_err_in_callback.rb52
-rw-r--r--test/win32ole/test_folderitem2_invokeverb.rb65
-rw-r--r--test/win32ole/test_nil2vtempty.rb36
-rw-r--r--test/win32ole/test_ole_methods.rb36
-rw-r--r--test/win32ole/test_propertyputref.rb30
-rw-r--r--test/win32ole/test_thread.rb20
-rw-r--r--test/win32ole/test_win32ole.rb517
-rw-r--r--test/win32ole/test_win32ole_event.rb334
-rw-r--r--test/win32ole/test_win32ole_method.rb146
-rw-r--r--test/win32ole/test_win32ole_param.rb106
-rw-r--r--test/win32ole/test_win32ole_type.rb249
-rw-r--r--test/win32ole/test_win32ole_typelib.rb116
-rw-r--r--test/win32ole/test_win32ole_variable.rb61
-rw-r--r--test/win32ole/test_win32ole_variant.rb660
-rw-r--r--test/win32ole/test_win32ole_variant_m.rb35
-rw-r--r--test/win32ole/test_win32ole_variant_outarg.rb68
-rw-r--r--test/win32ole/test_word.rb72
-rw-r--r--test/with_different_ofs.rb17
-rw-r--r--test/wsdl/any/any.wsdl50
-rw-r--r--test/wsdl/any/expectedDriver.rb54
-rw-r--r--test/wsdl/any/expectedEcho.rb14
-rw-r--r--test/wsdl/any/expectedService.rb52
-rw-r--r--test/wsdl/any/test_any.rb58
-rw-r--r--test/wsdl/axisArray/axisArray.wsdl60
-rw-r--r--test/wsdl/axisArray/itemList.rb27
-rw-r--r--test/wsdl/axisArray/test_axisarray.rb69
-rw-r--r--test/wsdl/datetime/DatetimeService.rb44
-rw-r--r--test/wsdl/datetime/datetime.wsdl45
-rw-r--r--test/wsdl/datetime/datetimeServant.rb21
-rw-r--r--test/wsdl/datetime/test_datetime.rb82
-rw-r--r--test/wsdl/document/document.wsdl74
-rw-r--r--test/wsdl/document/echo.rb92
-rw-r--r--test/wsdl/document/number.wsdl54
-rw-r--r--test/wsdl/document/ping_nosoapaction.wsdl66
-rw-r--r--test/wsdl/document/test_nosoapaction.rb109
-rw-r--r--test/wsdl/document/test_number.rb99
-rw-r--r--test/wsdl/document/test_rpc.rb177
-rw-r--r--test/wsdl/emptycomplextype.wsdl31
-rw-r--r--test/wsdl/map/map.wsdl92
-rw-r--r--test/wsdl/map/map.xml43
-rw-r--r--test/wsdl/map/test_map.rb99
-rw-r--r--test/wsdl/marshal/person.wsdl21
-rw-r--r--test/wsdl/marshal/person_org.rb22
-rw-r--r--test/wsdl/marshal/test_wsdlmarshal.rb80
-rw-r--r--test/wsdl/multiplefault.wsdl68
-rw-r--r--test/wsdl/qualified/lp.wsdl47
-rw-r--r--test/wsdl/qualified/lp.xsd26
-rw-r--r--test/wsdl/qualified/np.wsdl50
-rw-r--r--test/wsdl/qualified/test_qualified.rb154
-rw-r--r--test/wsdl/qualified/test_unqualified.rb143
-rw-r--r--test/wsdl/raa/RAA.rb243
-rw-r--r--test/wsdl/raa/RAAServant.rb99
-rw-r--r--test/wsdl/raa/RAAService.rb100
-rw-r--r--test/wsdl/raa/README.txt8
-rw-r--r--test/wsdl/raa/raa.wsdl264
-rw-r--r--test/wsdl/raa/server.rb103
-rw-r--r--test/wsdl/raa/test_raa.rb71
-rw-r--r--test/wsdl/ref/expectedProduct.rb90
-rw-r--r--test/wsdl/ref/product.wsdl86
-rw-r--r--test/wsdl/ref/test_ref.rb54
-rw-r--r--test/wsdl/rpc/echoDriver.rb55
-rw-r--r--test/wsdl/rpc/echo_serviceClient.rb23
-rw-r--r--test/wsdl/rpc/rpc.wsdl75
-rw-r--r--test/wsdl/rpc/test-rpc-lit.wsdl364
-rw-r--r--test/wsdl/rpc/test-rpc-lit12.wsdl455
-rw-r--r--test/wsdl/rpc/test_rpc.rb118
-rw-r--r--test/wsdl/rpc/test_rpc_lit.rb399
-rw-r--r--test/wsdl/simpletype/rpc/expectedClient.rb34
-rw-r--r--test/wsdl/simpletype/rpc/expectedDriver.rb62
-rw-r--r--test/wsdl/simpletype/rpc/expectedEchoVersion.rb23
-rw-r--r--test/wsdl/simpletype/rpc/expectedServant.rb32
-rw-r--r--test/wsdl/simpletype/rpc/expectedService.rb60
-rw-r--r--test/wsdl/simpletype/rpc/rpc.wsdl80
-rw-r--r--test/wsdl/simpletype/rpc/test_rpc.rb62
-rw-r--r--test/wsdl/simpletype/simpletype.wsdl95
-rw-r--r--test/wsdl/simpletype/test_simpletype.rb99
-rw-r--r--test/wsdl/soap/soapbodyparts.wsdl103
-rw-r--r--test/wsdl/soap/test_soapbodyparts.rb79
-rw-r--r--test/wsdl/test_emptycomplextype.rb21
-rw-r--r--test/wsdl/test_fault.rb51
-rw-r--r--test/wsdl/test_multiplefault.rb39
-rw-r--r--test/xmlrpc/data/blog.xml18
-rw-r--r--test/xmlrpc/htpasswd2
-rw-r--r--test/xmlrpc/test_client.rb293
-rw-r--r--test/xmlrpc/test_cookie.rb96
-rw-r--r--test/xmlrpc/test_datetime.rb64
-rw-r--r--test/xmlrpc/test_features.rb6
-rw-r--r--test/xmlrpc/test_marshal.rb23
-rw-r--r--test/xmlrpc/test_parser.rb18
-rw-r--r--test/xmlrpc/test_webrick_server.rb60
-rw-r--r--test/xmlrpc/webrick_testing.rb25
-rw-r--r--test/xsd/codegen/test_classdef.rb214
-rw-r--r--test/xsd/noencoding.xml4
-rw-r--r--test/xsd/test_noencoding.rb32
-rw-r--r--test/xsd/test_xmlschemaparser.rb22
-rw-r--r--test/xsd/test_xsd.rb1511
-rw-r--r--test/xsd/xmlschema.xml12
-rw-r--r--test/yaml/test_yaml.rb1284
-rw-r--r--test/zlib/test_zlib.rb1020
-rw-r--r--thread.c5091
-rw-r--r--thread_pthread.c1461
-rw-r--r--thread_pthread.h56
-rw-r--r--thread_win32.c787
-rw-r--r--thread_win32.h45
-rw-r--r--time.c5403
-rw-r--r--timev.h21
-rw-r--r--tool/asm_parse.rb51
-rwxr-xr-xtool/build-transcode16
-rwxr-xr-xtool/change_maker.rb32
-rw-r--r--tool/compile_prelude.rb198
-rwxr-xr-xtool/config.guess1522
-rwxr-xr-xtool/config.sub1771
-rw-r--r--tool/enc-emoji-citrus-gen.rb131
-rw-r--r--tool/enc-emoji4unicode.rb133
-rwxr-xr-xtool/enc-unicode.rb358
-rw-r--r--tool/eval.rb159
-rwxr-xr-xtool/file2lastrev.rb160
-rwxr-xr-xtool/gen_dummy_probes.rb27
-rw-r--r--tool/generic_erb.rb40
-rwxr-xr-xtool/id2token.rb24
-rwxr-xr-xtool/ifchange48
-rwxr-xr-xtool/insns2vm.rb15
-rw-r--r--tool/install-sh17
-rwxr-xr-xtool/instruction.rb1343
-rw-r--r--tool/jisx0208.rb84
-rwxr-xr-xtool/make-snapshot272
-rwxr-xr-xtool/mdoc2man.rb465
-rwxr-xr-xtool/merger.rb234
-rwxr-xr-xtool/mkconfig.rb273
-rwxr-xr-xtool/mkrunnable.rb85
-rwxr-xr-xtool/node_name.rb6
-rw-r--r--tool/parse.rb13
-rwxr-xr-xtool/rbinstall.rb764
-rwxr-xr-xtool/rmdirs11
-rwxr-xr-xtool/rubytest.rb29
-rwxr-xr-xtool/runruby.rb99
-rwxr-xr-xtool/strip-rdoc.rb22
-rw-r--r--tool/test/test_jisx0208.rb40
-rw-r--r--tool/transcode-tblgen.rb1074
-rwxr-xr-xtool/update-deps139
-rw-r--r--tool/vpath.rb79
-rw-r--r--tool/vtlh.rb15
-rwxr-xr-xtool/ytab.sed37
-rw-r--r--transcode.c4462
-rw-r--r--transcode_data.h127
-rw-r--r--util.c4193
-rw-r--r--util.h67
-rw-r--r--variable.c2272
-rw-r--r--version.c144
-rw-r--r--version.h66
-rw-r--r--vm.c2637
-rw-r--r--vm_backtrace.c1128
-rw-r--r--vm_core.h1006
-rw-r--r--vm_debug.h41
-rw-r--r--vm_dump.c719
-rw-r--r--vm_eval.c1940
-rw-r--r--vm_exec.c147
-rw-r--r--vm_exec.h173
-rw-r--r--vm_insnhelper.c2258
-rw-r--r--vm_insnhelper.h274
-rw-r--r--vm_method.c1636
-rw-r--r--vm_opts.h56
-rw-r--r--vm_trace.c1330
-rw-r--r--vms/config.h102
-rw-r--r--vms/vms.h10
-rw-r--r--vms/vmsruby_private.c52
-rw-r--r--vms/vmsruby_private.h7
-rw-r--r--vsnprintf.c1322
-rw-r--r--win32/Makefile.sub852
-rw-r--r--win32/README.win3275
-rwxr-xr-xwin32/configure.bat162
-rw-r--r--win32/dir.h30
-rw-r--r--win32/enc-setup.mak10
-rw-r--r--win32/file.c666
-rwxr-xr-xwin32/ifchange.bat59
-rwxr-xr-xwin32/makedirs.bat3
-rwxr-xr-x[-rw-r--r--]win32/mkexports.rb195
-rwxr-xr-x[-rw-r--r--]win32/resource.rb44
-rwxr-xr-xwin32/rm.bat12
-rwxr-xr-xwin32/rmall.bat6
-rwxr-xr-xwin32/rmdirs.bat29
-rw-r--r--win32/setup.mak146
-rw-r--r--win32/stub.c42
-rw-r--r--win32/win32.c5710
-rw-r--r--win32/win32.h558
-rw-r--r--win32/winmain.c4
-rw-r--r--wince/Makefile.sub505
-rw-r--r--wince/README.wince121
-rw-r--r--wince/assert.c11
-rw-r--r--wince/assert.h6
-rwxr-xr-xwince/configure.bat102
-rw-r--r--wince/direct.c54
-rw-r--r--wince/direct.h22
-rw-r--r--wince/errno.c11
-rw-r--r--wince/errno.h55
-rw-r--r--wince/fcntl.h42
-rw-r--r--wince/io.h76
-rw-r--r--wince/io_wce.c230
-rw-r--r--wince/mkconfig_wce.rb7
-rw-r--r--wince/mkexports.rb35
-rw-r--r--wince/process.h46
-rw-r--r--wince/process_wce.c47
-rw-r--r--wince/resource.rb96
-rw-r--r--wince/setup.mak245
-rw-r--r--wince/signal.h71
-rw-r--r--wince/signal_wce.c26
-rw-r--r--wince/stddef.h5
-rw-r--r--wince/stdio.c36
-rw-r--r--wince/stdlib.c57
-rw-r--r--wince/string_wce.c89
-rw-r--r--wince/sys/stat.c102
-rw-r--r--wince/sys/stat.h68
-rw-r--r--wince/sys/timeb.c25
-rw-r--r--wince/sys/timeb.h26
-rw-r--r--wince/sys/types.h60
-rw-r--r--wince/sys/utime.c44
-rw-r--r--wince/sys/utime.h27
-rw-r--r--wince/time.h63
-rw-r--r--wince/time_wce.c301
-rw-r--r--wince/varargs.h34
-rw-r--r--wince/wince.c583
-rw-r--r--wince/wince.h191
-rw-r--r--wince/wincemain.c19
-rw-r--r--wince/wincon.h7
-rw-r--r--wince/winsock2.c338
-rw-r--r--x68/_dtos18.c250
-rw-r--r--x68/_round.c45
-rw-r--r--x68/fconvert.c81
-rw-r--r--x68/select.c167
4072 files changed, 1300687 insertions, 241530 deletions
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index 9fd96ca149..0000000000
--- a/.cvsignore
+++ /dev/null
@@ -1,58 +0,0 @@
-*.bak
-*.orig
-*.rej
-*.sav
-*~
-.ccmalloc
-.ppack
-.ext
-.git
-.svn
-.rbconfig.time
-COPYING.LIB
-ChangeLog.pre-alpha
-ChangeLog.pre1_1
-Makefile
-README.fat-patch
-README.v6
-README.atheos
-archive
-autom4te*.cache
-automake
-beos
-config.cache
-config.h
-config.h.in
-config.log
-config.status
-configure
-foo.rb
-libruby.so.*
-miniruby
-miniruby.elhash
-miniruby.elhash2
-miniruby.orig2
-miniruby.plhash
-miniruby.plhash2
-modex.rb
-newdate.rb
-newver.rb
-parse.c
-parse.y.try
-pitest.rb
-ppack
-preview
-rbconfig.rb
-rename2.h
-repack
-riscos
-rubicon
-ruby
-ruby-man.rd.gz
-rubyunit
-st.c.power
-this that
-tmp
-web
-y.output
-y.tab.c
diff --git a/.document b/.document
index 230c50e387..f955928c89 100644
--- a/.document
+++ b/.document
@@ -6,6 +6,9 @@
# Process all the C source files
*.c
+# prelude
+prelude.rb
+
# the lib/ directory (which has its own .document file)
lib
@@ -14,3 +17,15 @@ lib
# and some of the ext/ directory (which has its own .document file)
ext
+
+# rdoc files
+ChangeLog
+
+NEWS
+
+README
+README.EXT
+README.EXT.ja
+README.ja
+
+doc
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..67abf4b978
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,16 @@
+root = true
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+tab_width = 8
+indent_style = tab
+indent_size = 4
+
+[**.bat]
+end_of_line = crlf
+
+[**.rb]
+indent_style = space
+indent_size = 2
diff --git a/.gdbinit b/.gdbinit
new file mode 100644
index 0000000000..b67115b6a2
--- /dev/null
+++ b/.gdbinit
@@ -0,0 +1,802 @@
+define rp
+ if ruby_dummy_gdb_enums.special_consts
+ end
+ if (VALUE)($arg0) & RUBY_FIXNUM_FLAG
+ printf "FIXNUM: %ld\n", (long)($arg0) >> 1
+ else
+ if ((VALUE)($arg0) & ~(~(VALUE)0<<RUBY_SPECIAL_SHIFT)) == RUBY_SYMBOL_FLAG
+ set $id = (($arg0) >> RUBY_SPECIAL_SHIFT)
+ if $id == '!' || $id == '+' || $id == '-' || $id == '*' || $id == '/' || $id == '%' || $id == '<' || $id == '>' || $id == '`'
+ printf "SYMBOL(:%c)\n", $id
+ else
+ if $id == idDot2
+ echo SYMBOL(:..)\n
+ else
+ if $id == idDot3
+ echo SYMBOL(:...)\n
+ else
+ if $id == idUPlus
+ echo SYMBOL(:+@)\n
+ else
+ if $id == idUMinus
+ echo SYMBOL(:-@)\n
+ else
+ if $id == idPow
+ echo SYMBOL(:**)\n
+ else
+ if $id == idCmp
+ echo SYMBOL(:<=>)\n
+ else
+ if $id == idLTLT
+ echo SYMBOL(:<<)\n
+ else
+ if $id == idLE
+ echo SYMBOL(:<=)\n
+ else
+ if $id == idGE
+ echo SYMBOL(:>=)\n
+ else
+ if $id == idEq
+ echo SYMBOL(:==)\n
+ else
+ if $id == idEqq
+ echo SYMBOL(:===)\n
+ else
+ if $id == idNeq
+ echo SYMBOL(:!=)\n
+ else
+ if $id == idEqTilde
+ echo SYMBOL(:=~)\n
+ else
+ if $id == idNeqTilde
+ echo SYMBOL(:!~)\n
+ else
+ if $id == idAREF
+ echo SYMBOL(:[])\n
+ else
+ if $id == idASET
+ echo SYMBOL(:[]=)\n
+ else
+ printf "SYMBOL(%ld)\n", $id
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ else
+ if ($arg0) == RUBY_Qfalse
+ echo false\n
+ else
+ if ($arg0) == RUBY_Qtrue
+ echo true\n
+ else
+ if ($arg0) == RUBY_Qnil
+ echo nil\n
+ else
+ if ($arg0) == RUBY_Qundef
+ echo undef\n
+ else
+ if (VALUE)($arg0) & RUBY_IMMEDIATE_MASK
+ if ((VALUE)($arg0) & RUBY_FLONUM_MASK) == RUBY_FLONUM_FLAG
+ printf "FLONUM: %g\n", (double)rb_float_value($arg0)
+ else
+ echo immediate\n
+ end
+ else
+ set $flags = ((struct RBasic*)($arg0))->flags
+ if ($flags & RUBY_T_MASK) == RUBY_T_NONE
+ printf "T_NONE: "
+ print (struct RBasic *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_NIL
+ printf "T_NIL: "
+ print (struct RBasic *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_OBJECT
+ printf "T_OBJECT: "
+ print (struct RObject *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_CLASS
+ printf "T_CLASS%s: ", ($flags & RUBY_FL_SINGLETON) ? "*" : ""
+ rp_class $arg0
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_ICLASS
+ printf "T_ICLASS: "
+ rp_class $arg0
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_MODULE
+ printf "T_MODULE: "
+ rp_class $arg0
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_FLOAT
+ printf "T_FLOAT: %.16g ", (((struct RFloat*)($arg0))->float_value)
+ print (struct RFloat *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_STRING
+ printf "T_STRING: "
+ set print address off
+ output (char *)(($flags & RUBY_FL_USER1) ? \
+ ((struct RString*)($arg0))->as.heap.ptr : \
+ ((struct RString*)($arg0))->as.ary)
+ set print address on
+ printf " bytesize:%ld ", ($flags & RUBY_FL_USER1) ? \
+ ((struct RString*)($arg0))->as.heap.len : \
+ (($flags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
+ if !($flags & RUBY_FL_USER1)
+ printf "(embed) "
+ else
+ if ($flags & RUBY_FL_USER2)
+ printf "(shared) "
+ end
+ if ($flags & RUBY_FL_USER3)
+ printf "(assoc) "
+ end
+ end
+ printf "encoding:%d ", ($flags & RUBY_ENCODING_MASK) >> RUBY_ENCODING_SHIFT
+ if ($flags & RUBY_ENC_CODERANGE_MASK) == 0
+ printf "coderange:unknown "
+ else
+ if ($flags & RUBY_ENC_CODERANGE_MASK) == RUBY_ENC_CODERANGE_7BIT
+ printf "coderange:7bit "
+ else
+ if ($flags & RUBY_ENC_CODERANGE_MASK) == RUBY_ENC_CODERANGE_VALID
+ printf "coderange:valid "
+ else
+ printf "coderange:broken "
+ end
+ end
+ end
+ print (struct RString *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_REGEXP
+ set $regsrc = ((struct RRegexp*)($arg0))->src
+ set $rsflags = ((struct RBasic*)$regsrc)->flags
+ printf "T_REGEXP: "
+ set print address off
+ output (char *)(($rsflags & RUBY_FL_USER1) ? \
+ ((struct RString*)$regsrc)->as.heap.ptr : \
+ ((struct RString*)$regsrc)->as.ary)
+ set print address on
+ printf " len:%ld ", ($rsflags & RUBY_FL_USER1) ? \
+ ((struct RString*)$regsrc)->as.heap.len : \
+ (($rsflags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
+ if $flags & RUBY_FL_USER6
+ printf "(none) "
+ end
+ if $flags & RUBY_FL_USER5
+ printf "(literal) "
+ end
+ if $flags & RUBY_FL_USER4
+ printf "(fixed) "
+ end
+ printf "encoding:%d ", ($flags & RUBY_ENCODING_MASK) >> RUBY_ENCODING_SHIFT
+ print (struct RRegexp *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_ARRAY
+ if ($flags & RUBY_FL_USER1)
+ set $len = (($flags & (RUBY_FL_USER3|RUBY_FL_USER4)) >> (RUBY_FL_USHIFT+3))
+ printf "T_ARRAY: len=%ld ", $len
+ printf "(embed) "
+ if ($len == 0)
+ printf "{(empty)} "
+ else
+ output/x *((VALUE*)((struct RArray*)($arg0))->as.ary) @ $len
+ printf " "
+ end
+ else
+ set $len = ((struct RArray*)($arg0))->as.heap.len
+ printf "T_ARRAY: len=%ld ", $len
+ if ($flags & RUBY_FL_USER2)
+ printf "(shared) shared="
+ output/x ((struct RArray*)($arg0))->as.heap.aux.shared
+ printf " "
+ else
+ printf "(ownership) capa=%ld ", ((struct RArray*)($arg0))->as.heap.aux.capa
+ end
+ if ($len == 0)
+ printf "{(empty)} "
+ else
+ output/x *((VALUE*)((struct RArray*)($arg0))->as.heap.ptr) @ $len
+ printf " "
+ end
+ end
+ print (struct RArray *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_FIXNUM
+ printf "T_FIXNUM: "
+ print (struct RBasic *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_HASH
+ printf "T_HASH: ",
+ if ((struct RHash *)($arg0))->ntbl
+ printf "len=%ld ", ((struct RHash *)($arg0))->ntbl->num_entries
+ end
+ print (struct RHash *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_STRUCT
+ printf "T_STRUCT: len=%ld ", \
+ (($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
+ ($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) >> (RUBY_FL_USHIFT+1) : \
+ ((struct RStruct *)($arg0))->as.heap.len)
+ print (struct RStruct *)($arg0)
+ x/xw (($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
+ ((struct RStruct *)($arg0))->as.ary : \
+ ((struct RStruct *)($arg0))->as.heap.ptr)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_BIGNUM
+ printf "T_BIGNUM: sign=%d len=%ld ", \
+ (($flags & RUBY_FL_USER1) != 0), \
+ (($flags & RUBY_FL_USER2) ? \
+ ($flags & (RUBY_FL_USER5|RUBY_FL_USER4|RUBY_FL_USER3)) >> (RUBY_FL_USHIFT+3) : \
+ ((struct RBignum*)($arg0))->as.heap.len)
+ if $flags & RUBY_FL_USER2
+ printf "(embed) "
+ end
+ print (struct RBignum *)($arg0)
+ x/xw (($flags & RUBY_FL_USER2) ? \
+ ((struct RBignum*)($arg0))->as.ary : \
+ ((struct RBignum*)($arg0))->as.heap.digits)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_RATIONAL
+ printf "T_RATIONAL: "
+ print (struct RRational *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_COMPLEX
+ printf "T_COMPLEX: "
+ print (struct RComplex *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_FILE
+ printf "T_FILE: "
+ print (struct RFile *)($arg0)
+ output *((struct RFile *)($arg0))->fptr
+ printf "\n"
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_TRUE
+ printf "T_TRUE: "
+ print (struct RBasic *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_FALSE
+ printf "T_FALSE: "
+ print (struct RBasic *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_DATA
+ if ((struct RTypedData *)($arg0))->typed_flag == 1
+ printf "T_DATA(%s): ", ((struct RTypedData *)($arg0))->type->wrap_struct_name
+ print (struct RTypedData *)($arg0)
+ else
+ printf "T_DATA: "
+ print (struct RData *)($arg0)
+ end
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_MATCH
+ printf "T_MATCH: "
+ print (struct RMatch *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_SYMBOL
+ printf "T_SYMBOL: "
+ print (struct RBasic *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_UNDEF
+ printf "T_UNDEF: "
+ print (struct RBasic *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_NODE
+ printf "T_NODE("
+ output (enum node_type)(($flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT)
+ printf "): "
+ print *(NODE *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_ZOMBIE
+ printf "T_ZOMBIE: "
+ print (struct RData *)($arg0)
+ else
+ printf "unknown: "
+ print (struct RBasic *)($arg0)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
+document rp
+ Print a Ruby's VALUE.
+end
+
+define rp_class
+ printf "(struct RClass *) %p", (void*)$arg0
+ if ((struct RClass *)($arg0))->ptr.origin != $arg0
+ printf " -> %p", ((struct RClass *)($arg0))->ptr.origin
+ end
+ printf "\n"
+ print *(struct RClass *)($arg0)
+ print *((struct RClass *)($arg0))->ptr
+end
+document rp_class
+ Print the content of a Class/Module.
+end
+
+define nd_type
+ print (enum node_type)((((NODE*)($arg0))->flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT)
+end
+document nd_type
+ Print a Ruby' node type.
+end
+
+define nd_file
+ print ((NODE*)($arg0))->nd_file
+end
+document nd_file
+ Print the source file name of a node.
+end
+
+define nd_line
+ print ((unsigned int)((((NODE*)($arg0))->flags>>RUBY_NODE_LSHIFT)&RUBY_NODE_LMASK))
+end
+document nd_line
+ Print the source line number of a node.
+end
+
+# Print members of ruby node.
+
+define nd_head
+ printf "u1.node: "
+ rp ($arg0).u1.node
+end
+
+define nd_alen
+ printf "u2.argc: "
+ p ($arg0).u2.argc
+end
+
+define nd_next
+ printf "u3.node: "
+ rp ($arg0).u3.node
+end
+
+
+define nd_cond
+ printf "u1.node: "
+ rp ($arg0).u1.node
+end
+
+define nd_body
+ printf "u2.node: "
+ rp ($arg0).u2.node
+end
+
+define nd_else
+ printf "u3.node: "
+ rp ($arg0).u3.node
+end
+
+
+define nd_orig
+ printf "u3.value: "
+ rp ($arg0).u3.value
+end
+
+
+define nd_resq
+ printf "u2.node: "
+ rp ($arg0).u2.node
+end
+
+define nd_ensr
+ printf "u3.node: "
+ rp ($arg0).u3.node
+end
+
+
+define nd_1st
+ printf "u1.node: "
+ rp ($arg0).u1.node
+end
+
+define nd_2nd
+ printf "u2.node: "
+ rp ($arg0).u2.node
+end
+
+
+define nd_stts
+ printf "u1.node: "
+ rp ($arg0).u1.node
+end
+
+
+define nd_entry
+ printf "u3.entry: "
+ p ($arg0).u3.entry
+end
+
+define nd_vid
+ printf "u1.id: "
+ p ($arg0).u1.id
+end
+
+define nd_cflag
+ printf "u2.id: "
+ p ($arg0).u2.id
+end
+
+define nd_cval
+ printf "u3.value: "
+ rp ($arg0).u3.value
+end
+
+
+define nd_cnt
+ printf "u3.cnt: "
+ p ($arg0).u3.cnt
+end
+
+define nd_tbl
+ printf "u1.tbl: "
+ p ($arg0).u1.tbl
+end
+
+
+define nd_var
+ printf "u1.node: "
+ rp ($arg0).u1.node
+end
+
+define nd_ibdy
+ printf "u2.node: "
+ rp ($arg0).u2.node
+end
+
+define nd_iter
+ printf "u3.node: "
+ rp ($arg0).u3.node
+end
+
+
+define nd_value
+ printf "u2.node: "
+ rp ($arg0).u2.node
+end
+
+define nd_aid
+ printf "u3.id: "
+ p ($arg0).u3.id
+end
+
+
+define nd_lit
+ printf "u1.value: "
+ rp ($arg0).u1.value
+end
+
+
+define nd_frml
+ printf "u1.node: "
+ rp ($arg0).u1.node
+end
+
+define nd_rest
+ printf "u2.argc: "
+ p ($arg0).u2.argc
+end
+
+define nd_opt
+ printf "u1.node: "
+ rp ($arg0).u1.node
+end
+
+
+define nd_recv
+ printf "u1.node: "
+ rp ($arg0).u1.node
+end
+
+define nd_mid
+ printf "u2.id: "
+ p ($arg0).u2.id
+end
+
+define nd_args
+ printf "u3.node: "
+ rp ($arg0).u3.node
+end
+
+
+define nd_noex
+ printf "u1.id: "
+ p ($arg0).u1.id
+end
+
+define nd_defn
+ printf "u3.node: "
+ rp ($arg0).u3.node
+end
+
+
+define nd_old
+ printf "u1.id: "
+ p ($arg0).u1.id
+end
+
+define nd_new
+ printf "u2.id: "
+ p ($arg0).u2.id
+end
+
+
+define nd_cfnc
+ printf "u1.cfunc: "
+ p ($arg0).u1.cfunc
+end
+
+define nd_argc
+ printf "u2.argc: "
+ p ($arg0).u2.argc
+end
+
+
+define nd_cname
+ printf "u1.id: "
+ p ($arg0).u1.id
+end
+
+define nd_super
+ printf "u3.node: "
+ rp ($arg0).u3.node
+end
+
+
+define nd_modl
+ printf "u1.id: "
+ p ($arg0).u1.id
+end
+
+define nd_clss
+ printf "u1.value: "
+ rp ($arg0).u1.value
+end
+
+
+define nd_beg
+ printf "u1.node: "
+ rp ($arg0).u1.node
+end
+
+define nd_end
+ printf "u2.node: "
+ rp ($arg0).u2.node
+end
+
+define nd_state
+ printf "u3.state: "
+ p ($arg0).u3.state
+end
+
+define nd_rval
+ printf "u2.value: "
+ rp ($arg0).u2.value
+end
+
+
+define nd_nth
+ printf "u2.argc: "
+ p ($arg0).u2.argc
+end
+
+
+define nd_tag
+ printf "u1.id: "
+ p ($arg0).u1.id
+end
+
+define nd_tval
+ printf "u2.value: "
+ rp ($arg0).u2.value
+end
+
+define rb_p
+ call rb_p($arg0)
+end
+
+define rb_numtable_entry
+ set $rb_numtable_tbl = $arg0
+ set $rb_numtable_id = (st_data_t)$arg1
+ set $rb_numtable_key = 0
+ set $rb_numtable_rec = 0
+ if $rb_numtable_tbl->entries_packed
+ set $rb_numtable_p = $rb_numtable_tbl->as.packed.bins
+ while $rb_numtable_p && $rb_numtable_p < $rb_numtable_tbl->as.packed.bins+$rb_numtable_tbl->num_entries
+ if $rb_numtable_p.k == $rb_numtable_id
+ set $rb_numtable_key = $rb_numtable_p.k
+ set $rb_numtable_rec = $rb_numtable_p.v
+ set $rb_numtable_p = 0
+ else
+ set $rb_numtable_p = $rb_numtable_p + 1
+ end
+ end
+ else
+ set $rb_numtable_p = $rb_numtable_tbl->as.big.bins[$rb_numtable_id % $rb_numtable_tbl->num_bins]
+ while $rb_numtable_p
+ if $rb_numtable_p->key == $rb_numtable_id
+ set $rb_numtable_key = $rb_numtable_p->key
+ set $rb_numtable_rec = $rb_numtable_p->record
+ set $rb_numtable_p = 0
+ else
+ set $rb_numtable_p = $rb_numtable_p->next
+ end
+ end
+ end
+end
+
+define rb_id2name
+ rb_numtable_entry global_symbols.id_str (ID)$arg0
+ if $rb_numtable_rec
+ rp $rb_numtable_rec
+ else
+ echo undef\n
+ end
+end
+document rb_id2name
+ Print the name of id
+end
+
+define rb_method_entry
+ set $rb_method_entry_klass = (struct RClass *)$arg0
+ set $rb_method_entry_id = (ID)$arg1
+ set $rb_method_entry_me = (rb_method_entry_t *)0
+ while !$rb_method_entry_me && $rb_method_entry_klass
+ rb_numtable_entry $rb_method_entry_klass->m_tbl $rb_method_entry_id
+ set $rb_method_entry_me = (rb_method_entry_t *)$rb_numtable_rec
+ if !$rb_method_entry_me
+ set $rb_method_entry_klass = (struct RClass *)$rb_method_entry_klass->ptr->super
+ end
+ end
+ if $rb_method_entry_me
+ print *$rb_method_entry_klass
+ print *$rb_method_entry_me
+ else
+ echo method not found\n
+ end
+end
+document rb_method_entry
+ Search method entry by class and id
+end
+
+define rb_classname
+ call classname($arg0)
+ rb_p $
+ print *(struct RClass*)($arg0)
+end
+
+define rb_ancestors
+ set $rb_ancestors_module = $arg0
+ while $rb_ancestors_module
+ rp $rb_ancestors_module
+ set $rb_ancestors_module = ((struct RClass *)($rb_ancestors_module))->ptr.super
+ end
+end
+document rb_ancestors
+ Print ancestors.
+end
+
+define rb_backtrace
+ call rb_backtrace()
+end
+
+define iseq
+ if dummy_gdb_enums.special_consts
+ end
+ if ($arg0)->type == ISEQ_ELEMENT_NONE
+ echo [none]\n
+ end
+ if ($arg0)->type == ISEQ_ELEMENT_LABEL
+ print *(LABEL*)($arg0)
+ end
+ if ($arg0)->type == ISEQ_ELEMENT_INSN
+ print *(INSN*)($arg0)
+ if ((INSN*)($arg0))->insn_id != YARVINSN_jump
+ set $i = 0
+ set $operand_size = ((INSN*)($arg0))->operand_size
+ set $operands = ((INSN*)($arg0))->operands
+ while $i < $operand_size
+ rp $operands[$i++]
+ end
+ end
+ end
+ if ($arg0)->type == ISEQ_ELEMENT_ADJUST
+ print *(ADJUST*)($arg0)
+ end
+end
+
+define rb_ps
+ rb_ps_vm ruby_current_vm
+end
+document rb_ps
+Dump all threads and their callstacks
+end
+
+define rb_ps_vm
+ print $ps_vm = (rb_vm_t*)$arg0
+ set $ps_threads = (st_table*)$ps_vm->living_threads
+ if $ps_threads->entries_packed
+ set $ps_threads_i = 0
+ while $ps_threads_i < $ps_threads->num_entries
+ set $ps_threads_key = (st_data_t)$ps_threads->as.packed.entries[$ps_threads_i].key
+ set $ps_threads_val = (st_data_t)$ps_threads->as.packed.entries[$ps_threads_i].val
+ rb_ps_thread $ps_threads_key $ps_threads_val
+ set $ps_threads_i = $ps_threads_i + 1
+ end
+ else
+ set $ps_threads_ptr = (st_table_entry*)$ps_threads->head
+ while $ps_threads_ptr
+ set $ps_threads_key = (st_data_t)$ps_threads_ptr->key
+ set $ps_threads_val = (st_data_t)$ps_threads_ptr->record
+ rb_ps_thread $ps_threads_key $ps_threads_val
+ set $ps_threads_ptr = (st_table_entry*)$ps_threads_ptr->fore
+ end
+ end
+end
+document rb_ps_vm
+Dump all threads in a (rb_vm_t*) and their callstacks
+end
+
+define rb_ps_thread
+ set $ps_thread = (struct RTypedData*)$arg0
+ set $ps_thread_id = $arg1
+ print $ps_thread_th = (rb_thread_t*)$ps_thread->data
+end
+
+# Details: https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/MachineInstructionsTraceWithGDB
+define trace_machine_instructions
+ set logging on
+ set height 0
+ set width 0
+ display/i $pc
+ while !$exit_code
+ info line *$pc
+ si
+ end
+end
+
+define SDR
+ call rb_vmdebug_stack_dump_raw_current()
+end
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..5808bf1082
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,127 @@
+*-*-*.def
+*.a
+*.bak
+*.dSYM
+*.dmyh
+*.dylib
+*.elc
+*.inc
+*.log
+*.o
+*.orig
+*.rej
+*.sav
+*.swp
+*~
+.*-*
+.*.list
+.*.time
+.DS_Store
+.ccmalloc
+.ext
+.pc
+.ppack
+.svn
+Makefile
+extconf.h
+y.output
+y.tab.c
+
+# /
+/*.pc
+/*_prelude.c
+/COPYING.LIB
+/ChangeLog-1.8.0
+/ChangeLog.pre-alpha
+/ChangeLog.pre1_1
+/Doxyfile
+/GNUmakefile
+/README.atheos
+/README.fat-patch
+/README.v6
+/TAGS
+/archive
+/autom4te*.cache
+/automake
+/beos
+/breakpoints.gdb
+/config.cache
+/config.h
+/config.h.in
+/config.status
+/config.status.lineno
+/configure
+/doc/capi
+/enc.mk
+/encdb.h
+/exts.mk
+/goruby
+/id.[ch]
+/largefile.h
+/lex.c
+/libruby*.*
+/miniprelude.c
+/miniruby
+/newdate.rb
+/newline.c
+/newver.rb
+/parse.c
+/parse.h
+/patches
+/patches-master
+/pitest.rb
+/ppack
+/prelude.c
+/preview
+/probes.h
+/rbconfig.rb
+/rename2.h
+/repack
+/revision.h
+/riscos
+/rubicon
+/ruby
+/ruby-man.rd.gz
+/test.rb
+/tmp
+/transdb.h
+/uncommon.mk
+/verconf.h
+/web
+/yasmdata.rb
+
+# /benchmark/
+/benchmark/bmx_*.rb
+
+# /enc/trans/
+/enc/trans/*.c
+
+# /ext/
+/ext/extinit.c
+
+# /ext/dl/callback/
+/ext/dl/callback/callback-*.c
+/ext/dl/callback/callback.c
+
+# /ext/ripper/
+/ext/ripper/eventids1.c
+/ext/ripper/eventids2table.c
+/ext/ripper/ripper.*
+/ext/ripper/ids1
+/ext/ripper/ids2
+
+# /ext/socket/
+/ext/socket/constants.h
+/ext/socket/constdefs.h
+/ext/socket/constdefs.c
+
+# /ext/tk/
+/ext/tk/config_list
+
+# /spec/
+/spec/mspec
+/spec/rubyspec
+
+# /win32/
+/win32/*.ico
+/win32/.time
diff --git a/.indent.pro b/.indent.pro
new file mode 100644
index 0000000000..6a207a0554
--- /dev/null
+++ b/.indent.pro
@@ -0,0 +1,21 @@
+-bap
+-nbbb
+-nbc
+-br
+-nbs
+-ncdb
+-ce
+-cli0.5
+-ndj
+-ei
+-nfc1
+-i4
+-l120
+-lp
+-npcs
+-psl
+-sc
+-sob
+
+-TID
+-TVALUE
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000000..db25c9eb08
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,71 @@
+# Copyright (C) 2011 Urabe, Shyouhei. All rights reserved.
+#
+# This file is a part of the programming language Ruby. Permission is hereby
+# granted, to either redistribute or modify this file, provided that the
+# conditions mentioned in the file COPYING are met. Consult the file for
+# details.
+
+# This is a Travis-CI build configuration file. The list of configurations
+# available is located in
+#
+# http://about.travis-ci.org/docs/user/build-configuration/
+#
+# and as Ruby itself is a project written in C language,
+#
+# http://about.travis-ci.org/docs/user/languages/c/
+#
+# is also a good place to look at.
+
+# Language specification.
+language: c
+
+# Compilers. Several compilers are provided in Travis, so we try them all.
+# The value set here is visible via $CC environment variable.
+compiler:
+ - gcc
+ - clang
+
+# Dependencies. Some header files are missing in a Travis' worker VM, so we
+# have to install them. The "1.9.1" here is OK. It is the most adopted
+# version string for Debian/Ubuntu, and no dependencies have been changed so
+# far since the 1.9.1 release.
+before_install:
+ - "sudo apt-get -qq update"
+ - "sudo apt-get -qq install $CC" # upgrade if any
+install: "sudo apt-get -qq build-dep ruby1.9.1 2>/dev/null"
+
+# Script is where the test runs. Note we just do "make test", not other tests
+# like test-all, test-rubyspec. This is because they take too much time,
+# enough for Travis to shut down the VM as being stalled.
+before_script:
+ - "autoconf"
+ - "./configure --with-gcc=$CC"
+ - "make -sj encs"
+ - "make -sj exts"
+script: "make test OPTS=-v"
+
+# Branch matrix. Not all branches are Travis-ready so we limit branches here.
+branches:
+ only:
+ - trunk
+ - ruby_1_9_3
+
+# We want to be notified when something happens.
+notifications:
+ irc:
+ channels:
+ - "irc.freenode.org#ruby-core"
+ - "irc.freenode.org#ruby-ja"
+ on_success: change # [always|never|change] # default: always
+ on_failure: change # [always|never|change] # default: always
+ template:
+ - "%{message} by @%{author}: See %{build_url}"
+
+# Local Variables:
+# mode: YAML
+# coding: utf-8-unix
+# indent-tabs-mode: nil
+# tab-width: 4
+# fill-column: 79
+# default-justification: full
+# End:
diff --git a/BSDL b/BSDL
new file mode 100644
index 0000000000..82725534fa
--- /dev/null
+++ b/BSDL
@@ -0,0 +1,22 @@
+Copyright (C) 1993-2010 Yukihiro Matsumoto. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/COPYING b/COPYING
index 9043404a83..a1f19ff99d 100644
--- a/COPYING
+++ b/COPYING
@@ -1,6 +1,6 @@
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
-You can redistribute it and/or modify it under either the terms of the GPL
-version 2 (see the file GPL), or the conditions below:
+You can redistribute it and/or modify it under either the terms of the
+2-clause BSDL (see the file BSDL), or the conditions below:
1. You may make and give away verbatim copies of the source form of the
software without restriction, provided that you duplicate all of the
diff --git a/COPYING.ja b/COPYING.ja
index 933cc7cb9a..e50d01c8d1 100644
--- a/COPYING.ja
+++ b/COPYING.ja
@@ -1,51 +1,51 @@
-$BK\%W%m%0%i%`$O%U%j!<%=%U%H%&%'%"$G$9!%(BGPL(the GNU General
-Public License)$B$^$?$O0J2<$K<($9>r7o$GK\%W%m%0%i%`$r:FG[I[$G(B
-$B$-$^$9!%(BGPL$B$K$D$$$F$O(BGPL$B%U%!%$%k$r;2>H$7$F2<$5$$!%(B
+本プログラムã¯ãƒ•リーソフトウェアã§ã™ï¼Ž2-clause BSDL
+ã¾ãŸã¯ä»¥ä¸‹ã«ç¤ºã™æ¡ä»¶ã§æœ¬ãƒ—ログラムをå†é…布ã§ãã¾ã™
+2-clause BSDLã«ã¤ã„ã¦ã¯BSDLファイルをå‚ç…§ã—ã¦ä¸‹ã•ã„.
- 1. $BJ#@=$O@)8B$J$/<+M3$G$9!%(B
+ 1. 複製ã¯åˆ¶é™ãªã自由ã§ã™ï¼Ž
- 2. $B0J2<$N>r7o$N$$$:$l$+$rK~$?$9;~$KK\%W%m%0%i%`$N%=!<%9$r(B
- $B<+M3$KJQ99$G$-$^$9!%(B
+ 2. ä»¥ä¸‹ã®æ¡ä»¶ã®ã„ãšã‚Œã‹ã‚’満ãŸã™æ™‚ã«æœ¬ãƒ—ログラムã®ã‚½ãƒ¼ã‚¹ã‚’
+ 自由ã«å¤‰æ›´ã§ãã¾ã™ï¼Ž
- (a) $B%M%C%H%K%e!<%:$K%]%9%H$7$?$j!$:n<T$KJQ99$rAwIU$9$k(B
- $B$J$I$NJ}K!$G!$JQ99$r8x3+$9$k!%(B
+ (a) ãƒãƒƒãƒˆãƒ‹ãƒ¥ãƒ¼ã‚ºã«ãƒã‚¹ãƒˆã—ãŸã‚Šï¼Œä½œè€…ã«å¤‰æ›´ã‚’é€ä»˜ã™ã‚‹
+ ãªã©ã®æ–¹æ³•ã§ï¼Œå¤‰æ›´ã‚’公開ã™ã‚‹ï¼Ž
- (b) $BJQ99$7$?K\%W%m%0%i%`$r<+J,$N=jB0$9$kAH?%FbIt$@$1$G(B
- $B;H$&!%(B
+ (b) 変更ã—ãŸæœ¬ãƒ—ãƒ­ã‚°ãƒ©ãƒ ã‚’è‡ªåˆ†ã®æ‰€å±žã™ã‚‹çµ„織内部ã ã‘ã§
+ 使ã†ï¼Ž
- (c) $BJQ99E@$rL@<($7$?$&$(!$%=%U%H%&%'%"$NL>A0$rJQ99$9$k!%(B
- $B$=$N%=%U%H%&%'%"$rG[I[$9$k;~$K$OJQ99A0$NK\%W%m%0%i(B
- $B%`$bF1;~$KG[I[$9$k!%$^$?$OJQ99A0$NK\%W%m%0%i%`$N%=!<(B
- $B%9$NF~<jK!$rL@<($9$k!%(B
+ (c) 変更点を明示ã—ãŸã†ãˆï¼Œã‚½ãƒ•トウェアã®åå‰ã‚’変更ã™ã‚‹ï¼Ž
+ ãã®ã‚½ãƒ•トウェアをé…布ã™ã‚‹æ™‚ã«ã¯å¤‰æ›´å‰ã®æœ¬ãƒ—ログラ
+ ãƒ ã‚‚åŒæ™‚ã«é…布ã™ã‚‹ï¼Žã¾ãŸã¯å¤‰æ›´å‰ã®æœ¬ãƒ—ログラムã®ã‚½ãƒ¼
+ スã®å…¥æ‰‹æ³•を明示ã™ã‚‹ï¼Ž
- (d) $B$=$NB>$NJQ99>r7o$r:n<T$H9g0U$9$k!%(B
+ (d) ãã®ä»–ã®å¤‰æ›´æ¡ä»¶ã‚’作者ã¨åˆæ„ã™ã‚‹ï¼Ž
- 3. $B0J2<$N>r7o$N$$$:$l$+$rK~$?$9;~$KK\%W%m%0%i%`$r%3%s%Q%$(B
- $B%k$7$?%*%V%8%'%/%H%3!<%I$d<B9T7A<0$G$bG[I[$G$-$^$9!%(B
+ 3. ä»¥ä¸‹ã®æ¡ä»¶ã®ã„ãšã‚Œã‹ã‚’満ãŸã™æ™‚ã«æœ¬ãƒ—ログラムをコンパイ
+ ルã—ãŸã‚ªãƒ–ジェクトコードや実行形å¼ã§ã‚‚é…布ã§ãã¾ã™ï¼Ž
- (a) $B%P%$%J%j$r<u$1<h$C$??M$,%=!<%9$rF~<j$G$-$k$h$&$K!$(B
- $B%=!<%9$NF~<jK!$rL@<($9$k!%(B
+ (a) ãƒã‚¤ãƒŠãƒªã‚’å—ã‘å–ã£ãŸäººãŒã‚½ãƒ¼ã‚¹ã‚’入手ã§ãるよã†ã«ï¼Œ
+ ソースã®å…¥æ‰‹æ³•を明示ã™ã‚‹ï¼Ž
- (b) $B5!3#2DFI$J%=!<%9%3!<%I$rE:IU$9$k!%(B
+ (b) 機械å¯èª­ãªã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã‚’添付ã™ã‚‹ï¼Ž
- (c) $BJQ99$r9T$C$?%P%$%J%j$OL>A0$rJQ99$7$?$&$(!$%*%j%8%J(B
- $B%k$N%=!<%9%3!<%I$NF~<jK!$rL@<($9$k!%(B
+ (c) 変更を行ã£ãŸãƒã‚¤ãƒŠãƒªã¯åå‰ã‚’変更ã—ãŸã†ãˆï¼Œã‚ªãƒªã‚¸ãƒŠ
+ ルã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã®å…¥æ‰‹æ³•を明示ã™ã‚‹ï¼Ž
- (d) $B$=$NB>$NG[I[>r7o$r:n<T$H9g0U$9$k!%(B
+ (d) ãã®ä»–ã®é…布æ¡ä»¶ã‚’作者ã¨åˆæ„ã™ã‚‹ï¼Ž
- 4. $BB>$N%W%m%0%i%`$X$N0zMQ$O$$$+$J$kL\E*$G$"$l<+M3$G$9!%$?(B
- $B$@$7!$K\%W%m%0%i%`$K4^$^$l$kB>$N:n<T$K$h$k%3!<%I$O!$$=(B
- $B$l$>$l$N:n<T$N0U8~$K$h$k@)8B$,2C$($i$l$k>l9g$,$"$j$^$9!%(B
+ 4. ä»–ã®ãƒ—ログラムã¸ã®å¼•用ã¯ã„ã‹ãªã‚‹ç›®çš„ã§ã‚れ自由ã§ã™ï¼ŽãŸ
+ ã ã—,本プログラムã«å«ã¾ã‚Œã‚‹ä»–ã®ä½œè€…ã«ã‚ˆã‚‹ã‚³ãƒ¼ãƒ‰ã¯ï¼Œã
+ れãžã‚Œã®ä½œè€…ã®æ„å‘ã«ã‚ˆã‚‹åˆ¶é™ãŒåŠ ãˆã‚‰ã‚Œã‚‹å ´åˆãŒã‚りã¾ã™ï¼Ž
- $B$=$l$i%U%!%$%k$N0lMw$H$=$l$>$l$NG[I[>r7o$J$I$KIU$$$F$O(B
- LEGAL$B%U%!%$%k$r;2>H$7$F$/$@$5$$!%(B
+ ãれらファイルã®ä¸€è¦§ã¨ãれãžã‚Œã®é…布æ¡ä»¶ãªã©ã«ä»˜ã„ã¦ã¯
+ LEGALファイルをå‚ç…§ã—ã¦ãã ã•ã„.
- 5. $BK\%W%m%0%i%`$X$NF~NO$H$J$k%9%/%j%W%H$*$h$S!$K\%W%m%0%i(B
- $B%`$+$i$N=PNO$N8"Mx$OK\%W%m%0%i%`$N:n<T$G$O$J$/!$$=$l$>(B
- $B$l$NF~=PNO$r@8@.$7$??M$KB0$7$^$9!%$^$?!$K\%W%m%0%i%`$K(B
- $BAH$_9~$^$l$k$?$a$N3HD%%i%$%V%i%j$K$D$$$F$bF1MM$G$9!%(B
+ 5. 本プログラムã¸ã®å…¥åŠ›ã¨ãªã‚‹ã‚¹ã‚¯ãƒªãƒ—トãŠã‚ˆã³ï¼Œæœ¬ãƒ—ログラ
+ ムã‹ã‚‰ã®å‡ºåŠ›ã®æ¨©åˆ©ã¯æœ¬ãƒ—ログラムã®ä½œè€…ã§ã¯ãªã,ãれãž
+ れã®å…¥å‡ºåŠ›ã‚’ç”Ÿæˆã—ãŸäººã«å±žã—ã¾ã™ï¼Žã¾ãŸï¼Œæœ¬ãƒ—ログラムã«
+ 組ã¿è¾¼ã¾ã‚Œã‚‹ãŸã‚ã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«ã¤ã„ã¦ã‚‚åŒæ§˜ã§ã™ï¼Ž
- 6. $BK\%W%m%0%i%`$OL5J]>Z$G$9!%:n<T$OK\%W%m%0%i%`$r%5%]!<%H(B
- $B$9$k0U;V$O$"$j$^$9$,!$%W%m%0%i%`<+?H$N%P%0$"$k$$$OK\%W(B
- $B%m%0%i%`$N<B9T$J$I$+$iH/@8$9$k$$$+$J$kB;32$KBP$7$F$b@U(B
- $BG$$r;}$A$^$;$s!%(B
+ 6. 本プログラムã¯ç„¡ä¿è¨¼ã§ã™ï¼Žä½œè€…ã¯æœ¬ãƒ—ログラムをサãƒãƒ¼ãƒˆ
+ ã™ã‚‹æ„å¿—ã¯ã‚りã¾ã™ãŒï¼Œãƒ—ログラム自身ã®ãƒã‚°ã‚ã‚‹ã„ã¯æœ¬ãƒ—
+ ログラムã®å®Ÿè¡Œãªã©ã‹ã‚‰ç™ºç”Ÿã™ã‚‹ã„ã‹ãªã‚‹æå®³ã«å¯¾ã—ã¦ã‚‚責
+ 任をæŒã¡ã¾ã›ã‚“.
diff --git a/ChangeLog b/ChangeLog
index b9803c52a7..ef2bfb6531 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,18469 +1,22484 @@
-Sun Jun 8 05:09:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jan 7 21:40:36 2013 Shugo Maeda <shugo@ruby-lang.org>
- * lib/uri/common.rb (URI::REGEXP::PATTERN): typo in REG_NAME
- regular expression. a patch from Ueda Satoshi
- <s-ueda AT livedoor.jp>. [ruby-dev:32514]
+ * vm_method.c (Init_eval_method): main.public and main.private
+ should be private.
-Sun Jun 8 05:05:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * proc.c (Init_Proc): main.define_method should be private.
- * lib/cgi.rb (read_multipart): exclude blanks from header values.
- [ruby-list:44327]
+ * test/ruby/test_module.rb: related test.
-Sun Jun 8 05:00:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 7 20:48:47 2013 Shugo Maeda <shugo@ruby-lang.org>
- * bignum.c (rb_cstr_to_inum): trailing spaces may exist at sqeezing
- preceeding 0s. [ruby-core:13873]
+ * eval.c (Init_eval): main.include should be private.
+ [ruby-core:51293] [Bug #7670]
-Sun Jun 8 04:56:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_module.rb (test_top_include_is_private): a new test
+ for the above change.
- * eval.c (error_print): put newline unless multiple line message ends
- with a newline. [ruby-dev:32429]
+Mon Jan 7 20:29:50 2013 Shugo Maeda <shugo@ruby-lang.org>
-Sun Jun 8 04:54:36 2008 James Edward Gray II <jeg2@ruby-lang.org>
+ * NEWS: remove description about `require "refinement"'.
- Merged 14070 from trunk.
-
- * lib/xmlrpc/server.rb (XMLRPC::Server#server): Improve signal handling so
- pressing control-c in the controlling terminal or sending SIGTERM stops
- the XML-RPC server.
+Mon Jan 7 20:15:49 2013 Shugo Maeda <shugo@ruby-lang.org>
-Sun Jun 8 04:46:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (Init_eval): enable Refinements by default.
+ [ruby-core:51286] [Bug #7667]
- * parse.y (newline_node): set line from outermost node before removing
- NODE_BEGIN. [ruby-dev:32406]
+ * eval.c (rb_mod_refine, top_using): show a warning when
+ Module#refine or main.using is called at the first time.
-Sun Jun 8 04:37:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/refinement/*: removed the extension library "refinement".
- * parse.y (stmt): remove unnecessary NODE_BEGIN. [ruby-core:13814]
+ * test/ruby/test_refinement.rb: fix for the above changes.
-Sun Jun 8 04:18:50 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jan 7 17:34:22 2013 Koichi Sasada <ko1@atdot.net>
- * object.c (nil_plus): remove unused function. [ruby-core:13737]
+ * include/ruby/ruby.h (RUBY_EVENT_SPECIFIED_LINE): make it special.
+ This flag is not contained by RUBY_EVENT_TRACEPOINT_ALL.
+ This event is experimental one. It is possible to remove/rename
+ flag name after 2.0.1.
-Sun Jun 8 04:15:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_trace.c (get_event_id): return :line if SPECIFIED_LINE was
+ occurred. `:specified_line' never been returned.
- * eval.c (rb_alias): do not call hook functions until initialization
- finishes. [ruby-talk:279538]
+Mon Jan 7 15:42:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 8 04:12:50 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * parse.y (f_kwrest): allow bare kwrest_mark as valid syntax. its
+ semantics is still undefined. [Bug #7662] [ruby-core:51269]
- * ext/win32ole/win32ole.c (ole_invoke): bug fix. [ruby-talk:279100]
+Mon Jan 7 15:31:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 8 03:54:52 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * parse.y (f_kwrest): reject duplicated kwrest argument name.
- * ext/curses/extconf.rb: check macro if cannot find func.
- [ruby-list:44224]
+Mon Jan 7 15:24:10 2013 Koichi Sasada <ko1@atdot.net>
-Sun Jun 8 03:50:40 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_trace.c (rb_threadptr_exec_event_hooks_orig): pop tag before
+ JUMP_TAG() if frame is `finish' frame.
+ Without this patch, there is an inconsistency between control
+ frame stack and tags stack.
+ [Bug #7668]
- * lib/cgi/session.rb (CGI::Session::FileStore::restore): use
- lockfile for exclusive locks. a patch from <tommy AT tmtm.org>.
- [ruby-dev:32296]
+ * test/ruby/test_settracefunc.rb: add a test for above.
-Sun Jun 8 03:46:55 2008 Tanaka Akira <akr@fsij.org>
+Mon Jan 7 15:21:48 2013 NAKAMURA Usaku <usa@ruby-lang.org>
- * missing/isinf.c (isinf): don't define if the macro is defined.
+ * Makefile.in, common.mk (fake, yes-fake, no-make): these dependecies
+ are not platform dependent.
-Sun Jun 8 03:34:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/Makefile.sub ($(arch)-fake.rb): workaround.
- * numeric.c (round): fallback definition.
+Mon Jan 7 12:09:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * numeric.c (flo_divmod, flo_round): use round() always.
- [ruby-dev:32269]
+ * vm_insnhelper.c (vm_callee_setup_arg_complex, vm_yield_setup_block_args):
+ set keyrest hash after making rest array, so that the last element
+ will not be overwritten. [ruby-core:51278] [Bug #7665]
-Sun Jun 8 03:34:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 7 09:37:24 2013 Koichi Sasada <ko1@atdot.net>
- * numeric.c (flodivmod): work around for infinity.
+ * NEWS: add a NEWS entry about RubyVM.
- * numeric.c (flo_divmod): work around for platforms have no round().
- [ruby-dev:32247]
+Sun Jan 6 19:06:57 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
-Sun Jun 8 03:34:23 2008 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
+ * win32/Makefile.sub: Fix build with VC.
+ Patch by Charlie Savage. Fixes [ruby-core:51261]
- * numeric.c (flo_divmod): round to the nearest integer.
- [ ruby-Bugs-14540 ]
+Sun Jan 6 18:43:48 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
-Sun Jun 8 03:08:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * bootstraptest/test_io.rb: add a test for [ruby-dev:46834].
- * lib/rexml/encodings/SHIFT-JIS.rb (REXML::Encoding): place -x for
- nkf conversion. a patch from <moonwolf AT moonwolf.com>.
- [ruby-dev:32183]
+ * io.c (rb_cloexec_fcntl_dupfd) Use an emulation with dup(2) when
+ fcntl(2) and/or F_DUPFD is unavailable.
+ Suggested by akr.
-Sun Jun 8 03:05:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (HAVE_FCNTL): NativeClient does not provide fcntl(2).
- * lib/optparse.rb (OptionParser::Switch::summarize): fix for long form
- option with very long argument. a patch from Kobayashi Noritada
- <nori1 AT dolphin.c.u-tokyo.ac.jp> in [ruby-list:44179].
+Sun Jan 6 11:11:26 2013 Eric Hodel <drbrain@segment7.net>
-Sun Jun 8 03:03:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * doc/syntax/modules_and_classes.rdoc: Fixed typo.
- * numeric.c (fix_pow): returns infinity for 0**-1. [ruby-dev:32084]
+Sun Jan 6 05:35:18 2013 Eric Hodel <drbrain@segment7.net>
-Sun Jun 8 02:57:32 2008 James Edward Gray II <jeg2@ruby-lang.org>
+ * doc/syntax/modules_and_classes.rdoc: Added singleton classes
+ documentation.
- Merged 13781 from trunk.
+Sun Jan 6 02:22:00 2013 Zachary Scott <zachary@zacharyscott.net>
- * lib/net/telnet.rb (Net::Telnet#login): Allowing "passphrase" in
- addition to "password" for Telnet login prompts. [ruby-Bugs-10746]
+ * lib/webrick/httpservlet/abstract.rb (WEBrick::HTTPServlet): Typo in
+ example. Patch by shlensky [Fixes #232 on github]
-Wed Oct 25 06:46:21 2007 James Edward Gray II <jeg2@ruby-lang.org>
+Sat Jan 5 21:15:10 2013 NARUSE, Yui <naruse@ruby-lang.org>
- Merged 13779 from trunk.
+ * lib/net/http/generic_request.rb:
+ Amazon ECA API and GTE/1.3 disallow requests whose host has port
+ number if its port number equals to default port number of the
+ scheme. [Bug #7650]
- * lib/net/telnet.rb (Net::Telnet#login): Making the password prompt
- pattern case insensitive. [ruby-Bugs-10746]
+Sat Jan 5 13:58:59 2013 Eric Hodel <drbrain@segment7.net>
-Sun Jun 8 02:54:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * doc/syntax/modules_and_classes.rdoc: Improved description of methods
+ on a module or class as suggested by Tobias Buhlmann
- * io.c (rb_io_tell, rb_io_seek): check errno too. [ruby-dev:32093]
+Sat Jan 5 13:38:07 2013 Masaki Matsushita <glass.saga@gmail.com>
-Sun Jun 8 01:51:52 2008 James Edward Gray II <jeg2@ruby-lang.org>
+ * string.c (rb_str_enumerate_lines): fix invalid byte sequence error
+ when a separator is passed. The patch is from yoshidam (Yoshida
+ Masato).
+ [Bug #7646] [ruby-dev:46827]
- Merged 13767, 13768, 13769, and 13770 from trunk.
+ * test/ruby/test_string.rb: a test for above.
- * lib/xmlrpc/parser.rb (XMLRPC::Convert::dateTime): Fixing a bug that
- caused time zone conversion to fail for some ISO 8601 date formats.
- [ruby-Bugs-12677]
+Sat Jan 5 12:25:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/xmlrpc/client.rb (XMLRPC::Client#do_rpc): Explicitly start
- the HTTP connection to support keepalive requests. [ruby-Bugs-9353]
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_in_out_err):
+ check stdout and stderr both.
- * lib/xmlrpc/client.rb (XMLRPC::Client#do_rpc): Improving the error
- message for Content-Type check failures. [ruby-core:12163]
+Sat Jan 5 10:21:54 2013 Eric Hodel <drbrain@segment7.net>
- * lib/xmlrpc/utils.rb (XMLRPC::ParseContentType#parse_content_type):
- Making Content-Type checks case insensitive. [ruby-Bugs-3367]
+ * doc/syntax/modules_and_classes.rdoc: Added documentation of syntax
+ for Modules and Classes.
+ * doc/syntax/methods.rdoc: Moved some text to the Modules and
+ Classes syntax document.
-Sun Jun 8 01:45:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jan 5 08:38:27 2013 Eric Hodel <drbrain@segment7.net>
- * marshal.c (r_bytes0): refined length check. [ruby-dev:32059]
+ * doc/syntax/methods.rdoc: Added return values and scope sections,
+ slightly modified from the original patch. Fixes #227 from github by
+ Dave Brown.
-Sun Jun 8 01:45:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jan 5 08:21:41 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * marshal.c (r_bytes0): check if source has enough data.
- [ruby-dev:32054]
+ * io.c (rb_cloexec_fcntl_dupfd): improve #ifdef condition.
+ * io.c (rb_maygvl_fd_fix_cloexec): ditto.
-Sun Jun 8 01:37:58 2008 Tanaka Akira <akr@fsij.org>
+Sat Jan 5 07:54:59 2013 Eric Hodel <drbrain@segment7.net>
- * ext/socket/socket.c (s_accept_nonblock): make accepted fd
- nonblocking. [ruby-talk:274079]
+ * lib/rubygems/commands/cleanup_command.rb: Clean all possible gems
+ using multiple passes. Fixes RubyGems bug #422. Refactored for
+ maintainability.
+ * test/rubygems/test_gem_commands_cleanup_command.rb: Test for above.
-Sun Jun 8 01:28:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jan 5 05:04:39 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * win32/mkexports.rb: deal with __fastcall name decorations.
- [ruby-list:44111]
+ * gc.c (vm_xrealloc): add a few comment why we avoid realloc(ptr,0).
-Sun Jun 8 01:23:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Jan 4 20:17:06 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
- * lib/rexml/source.rb (REXML::SourceFactory::SourceFactory): typo
- fixed. [ruby-list:44099]
+ * Makefile.in (RBCONFIG): Moved from common.mk in order to use the
+ variable in Makefile.in.
-Sun Jun 8 01:17:45 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * win32/Makefile.sub (RBCONFIG): Ditto.
- * {bcc32,win32}/Makefile.sub (COMMON_MACROS): workaround for old SDK's
- bug. [ruby-core:12584]
+Fri Jan 4 19:45:50 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
-Sun Jun 8 00:56:44 2008 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * common.mk (run, parse): Use BTESTRUBY instead of MINIRUBY to handle
+ cross-compiling cases, e.g. NativeClient.
- * lib/net/http.rb, lib/open-uri.rb: remove
- Net::HTTP#enable_post_connection_check. [ruby-dev:31960]
+Fri Jan 4 17:58:16 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
- * lib/net/imap.rb: hostname should be verified against server's
- indentity as persented in the server's certificate. [ruby-dev:31960]
+ * common.mk (yes-btest): btest depends on also $(arch)-fake.rb and
+ rbconfig.rb on building for NativeClient.
- * ext/openssl/lib/net/telnets.rb, ext/openssl/lib/net/ftptls.rb: ditto.
+ * Makefile.in (fake): Avoid generating $(arch)-fake.rb unless cross
+ compiling.
-Thu Jun 5 16:19:27 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * configure.in (CROSS_COMPILING): New substitution.
- * win32/win32.c (make_cmdvector): adjust escaped successive
- double-quote handling. (merge from trunk)
+Fri Jan 4 16:26:45 2013 Eric Hodel <drbrain@segment7.net>
-Thu Jun 5 12:24:25 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/rubygems/doctor.rb: Process directories in order in case the
+ filesystem doesn't. [ruby-trunk - Bug #7618]
- * win32/win32.c (init_env): initialize HOME and USER environment
- variables unless set. [ruby-core:12328] (merge from trunk)
+ Process specifications before other directories in case of bugs.
+ * test/rubygems/test_gem_doctor.rb: Test for above.
- * win32/win32.c (NtInitialize, getlogin): ditto.
+ * lib/rubygems.rb: Updated version.
- * configure.in, win32/Makefile.sub (LIBS): need to link shell32
- library for SH* functions on mswin32 and mingw32.
+ * test/rubygems/test_require.rb: Fixed double require of
+ benchmark.rb. RubyGems bug #420.
-Thu Jun 5 12:21:06 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/rubygems/test_gem_commands_check_command.rb: Fixed unused
+ variable warnings.
+ * test/rubygems/test_gem_commands_query_command.rb: ditto
+ * test/rubygems/test_gem_installer.rb: ditto
- * gc.c (id2ref): valid id should not refer T_VALUE nor T_ICLASS.
- [ruby-dev:31911]
+Fri Jan 4 15:05:25 2013 Eric Hodel <drbrain@segment7.net>
-Wed Jun 4 16:39:56 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rdoc/cross_reference.rb: Fixed matching of C#=== or #===. RDoc
+ bug #164
+ * test/rdoc/test_rdoc_cross_reference.rb: Test for above.
- * Makefile.in (ext/extinit.o): use $(OUTFLAG) as well as other
- objects. [ruby-Bugs-14228]
+ * lib/rdoc/parser/changelog.rb: Fixed parsing of dates. RDoc bug #165
+ * test/rdoc/test_rdoc_parser_changelog.rb: Test for above.
-Tue Jun 3 16:13:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rdoc/parser.rb: Fixed parsing multibyte files with incomplete
+ characters at byte 1024. [ruby-trunk - Bug #6393]
+ Fixed handling of -E. [ruby-trunk - Bug #6392]
+ * test/rdoc/test_rdoc_options.rb: Test for above.
+ * test/rdoc/test_rdoc_parser.rb: ditto.
+ * test/rdoc/test_rdoc_parser_c.rb: ditto.
+ * test/rdoc/test_rdoc_parser_changelog.rb: ditto.
+ * test/rdoc/test_rdoc_parser_markdown.rb: ditto.
+ * test/rdoc/test_rdoc_parser_rd.rb: ditto.
+ * test/rdoc/test_rdoc_rdoc.rb: ditto.
- * parse.y (yyerror): limit error message length. [ruby-dev:31848]
+ * lib/rdoc/tom_doc.rb: Fixed parsing of [] in TomDoc arguments list.
+ RDoc bug #167
+ * test/rdoc/test_rdoc_tom_doc.rb: Test for above.
- * regex.c (re_mbc_startpos): separated from re_adjust_startpos.
+ * lib/rdoc.rb: Update version.
-Tue Jun 3 15:27:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jan 4 11:51:00 2013 Zachary Scott <zachary@zacharyscott.net>
- * gc.c (os_obj_of, os_each_obj): hide objects to be finalized.
- [ruby-dev:31810]
+ * lib/forwardable.rb: Fix rdoc parameters for ::def_single_delegator.
+ Patch by Vladimir Andrijevik [Github Fixes #230]
-Wed Jun 4 19:15:57 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Jan 4 00:35:11 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
- * eval.c (remove_method): should not remove undef place holder.
- [ruby-dev:31817]
+ Fix failures on btest for NativeClient.
+ * bootstraptest/runner.rb (nacl?): New method to distinguish NaCl
+ cross build.
-Tue Jun 3 15:05:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bootstraptest/test_io.rb: Skip unsupported operations.
- * process.c (struct rb_exec_arg): proc should be a VALUE.
+ * bootstraptest/test_literal.rb: ditto.
- * process.c (rb_f_exec): suppress a warning.
+Fri Jan 4 00:29:40 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
- * process.c (rb_detach_process): cast for the platforms where size of
- pointer differs from size of int.
+ * io.c (rb_cloexec_fcntl_dupfd): Fix failures in
+ bootstrap_test/test_io.rb. NativeClient does not support F_DUPFD
+ but supports dup2(2).
- * process.c (rb_f_exec, rb_f_system): should not exceptions after
- fork. [ruby-core:08262]
+Thu Jan 3 17:46:50 2013 Kouhei Sutou <kou@cozmixng.org>
-Wed May 21 01:32:56 2008 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/rexml/element.rb (REXML::Elements#add): Remove too much
+ "elements" in document. Sorry...
- * lib/webrick/httpservlet/filehandler.rb: should normalize path
- name in path_info to prevent script disclosure vulnerability on
- DOSISH filesystems. (fix: CVE-2008-1891)
- Note: NTFS/FAT filesystem should not be published by the platforms
- other than Windows. Pathname interpretation (including short
- filename) is less than perfect.
+Thu Jan 3 17:42:32 2013 Kouhei Sutou <kou@cozmixng.org>
- * lib/webrick/httpservlet/abstract.rb
- (WEBrick::HTTPServlet::AbstracServlet#redirect_to_directory_uri):
- should escape the value of Location: header.
+ * lib/rexml/element.rb (REXML::Elements#each): Add missing
+ "elements" in document. [ruby-talk:402713]
+ Reported by Wesley Rishel. Thanks!!!
- * lib/webrick/httpservlet/cgi_runner.rb: accept interpreter
- command line arguments.
+Thu Jan 3 15:13:00 2013 Zachary Scott <zachary@zacharyscott.net>
-Sun May 18 01:57:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/lib/psych.rb (Psych.load): Return value of
+ Psych::SyntaxError.message should be same as example.
+ Patch by Ippei Obayashi [ruby-core:51193] [Bug #7636]
- * file.c (isdirsep): backslash is valid path separator on cygwin too.
- backported from 1.8 HEAD.
+Thu Jan 3 14:58:00 2013 Zachary Scott <zachary@zacharyscott.net>
-Sat May 17 23:53:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/forwardable.rb (SingleForwardable): Fix example in overview
+ Patch by Vladimir Andrijevik [Github Fixes #231]
- * file.c (file_expand_path): fix for short file name on Cygwin.
+Thu Jan 3 14:32:47 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
-Sat May 17 23:50:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (OBJCOPY): Fixes build error for NativeClient.
+ Avoid disabling OBJCOPY for NativeClient.
- * file.c (OpenFile): prevent conflict on Windows.
+ * thread_pthread.c (rb_reserved_fd_p): USE_SLEEPY_TIMER_THREAD is
+ always defined. Fixes compilation error for NativeClient.
- * file.c (USE_NTFS): fixed merge miss.
+Wed Jan 02 03:09:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Sat May 17 12:36:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/zlib/zlib.c (Zlib::GzipReader): Fix typo by zed_0xff
+ [Fixes Github #229]
- * file.c (file_expand_path): rb_str_set_len is not backported.
+Wed Jan 02 02:29:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Sat May 17 12:15:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c (rb_hash_update): Revert documentation from r38672
+ See: https://github.com/ruby/ruby/pull/228#issuecomment-11791013
- * file.c (file_expand_path): support for alternative data stream
- and ignored trailing garbages of NTFS.
+Wed Jan 02 02:16:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * file.c (rb_file_s_basename): ditto.
+ * hash.c (rb_hash_update): Documentation for Hash#merge and shallow
+ copies Patch by Yorick Peterse [Fixes Github #228]
- * file.c (rb_file_s_extname): ditto.
+Mon Dec 31 15:10:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Mon Mar 3 23:36:41 2008 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * vm_backtrace.c: Add documentation for Kernel#caller_locations,
+ Kernel#caller, and Thread::Backtrace::Location
- * lib/webrick/httpservlet/filehandler.rb: should normalize path
- separators in path_info to prevent directory traversal attacks
- on DOSISH platforms.
- reported by Digital Security Research Group [DSECRG-08-026].
+Mon Dec 31 13:05:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * lib/webrick/httpservlet/filehandler.rb: pathnames which have
- not to be published should be checked case-insensitively.
+ * test/ruby/test_backtrace.rb: Add test for r37957 [Feature #7434]
-Sun Sep 23 21:57:25 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Dec 30 23:33:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/http.rb: an SSL verification (the server hostname should
- be matched with its certificate's commonName) is added.
- this verification can be skipped by
- "Net::HTTP#enable_post_connection_check=(false)".
- suggested by Chris Clark <cclark at isecpartners.com>
+ * parse.y (simple_re_meta): escaped closing parenthesis has different
+ meaning. [Bug #7610] [ruby-core:51088]
- * lib/net/open-uri.rb: use Net::HTTP#enable_post_connection_check to
- perform SSL post connection check.
+Sun Dec 30 12:09:47 2012 Charlie Somerville <charlie@charliesomerville.com>
- * ext/openssl/lib/openssl/ssl.c
- (OpenSSL::SSL::SSLSocket#post_connection_check): refine error message.
+ * configure.in: use 4 argument form of AC_CHECK_HEADERS to force
+ autoconf to use compiler's result
-Sun Sep 23 06:08:38 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 30 10:58:04 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * ext/stringio/stringio.c (strio_init): separate from strio_initialize
- to share with strio_reopen properly. [ruby-Bugs-13919]
+ * test/ruby/test_keyword.rb: add a test for passing hash
+ as a last argument. [ruby-dev:46712] [Bug #7529]
-Sun Sep 23 05:42:35 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
+Sun Dec 30 10:51:29 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * lib/rdoc/options.rb (Options::check_diagram): dot -V output
- changed. [ ruby-Bugs-11978 ], Thanks Florian Frank.
+ * vm_insnhelper.c: set keyword hash on Proc/block calls.
+ [ruby-core:51172] [Bug #7630]
-Mon Sep 17 04:47:02 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_keyword.rb: add tests for above.
- * ruby.c (proc_options): -W should be allowed in RUBYOPT
- environment variable. [ruby-core:12118]
+Sat Dec 29 21:57:11 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
-Mon Sep 17 04:31:46 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/irb/completion.rb: treat rightly completion for symbol on irb
+ [Bug #7632].
- * range.c (range_step): fixed integer overflow. [ruby-dev:31763]
+Sat Dec 29 21:51:30 2012 Shugo Maeda <shugo@ruby-lang.org>
-Fri Sep 7 14:57:36 2007 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
+ * ext/curses/curses.c (window_cury, window_curx, window_maxy,
+ window_maxx, window_begy, window_begx): use RB_UNUSED_VAR()
+ to suppress unused-but-set-variable warnings.
- * ruby.c (rubylib_mangled_path): eliminate RSTRING_PTR
- [ruby-dev:31679]
+Sat Dec 29 16:45:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * ruby.c(push_include_cygwin): ditto.
+ * iseq.c (RubyVM::InstructionSequence): rdoc formatting
-Fri Sep 7 14:32:38 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 29 15:28:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * array.c (rb_ary_subseq): need integer overflow check.
- [ruby-dev:31736]
+ * iseq.c (RubyVM::InstructionSequence): Add rdoc for new iseq features
+ added from r38085, this includes ::of, #path, #absolute_path,
+ #label, #base_label, #first_lineno, and #inspect
- * array.c (rb_ary_splice): ditto. [ruby-dev:31737]
+Sat Dec 29 14:06:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * array.c (rb_ary_fill): ditto. [ruby-dev:31738]
+ * iseq.c (rb_iseq_line_trace_all, rb_iseq_line_trace_specify): Add
+ rdoc for experimental C level api of iseq, from r38076
- * string.c (rb_str_splice): integer overflow for length.
- [ruby-dev:31739]
+Sat Dec 29 11:37:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Sep 7 14:27:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * object.c (rb_obj_clone): attach clone to its singleton class during
+ cloning singleton class so that singleton_method_added will be called
+ on it. based on the patch by shiba (satoshi shiba)[Bug #5283] in
+ [ruby-dev:44477]. [Bug #5283]
- * eval.c (mnew): should preserve noex as safe_level.
+Sat Dec 29 10:10:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_call0): tighten security check condition..
+ * configure.in (crt_externs.h): use standard macro AC_CHECK_HEADERS.
-Fri Sep 7 14:19:16 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 28 23:12:44 2012 Charlie Somerville <charlie@charliesomerville.com>
- * configure.in (group_member): check if presents.
+ * configure.in: check for the whether crt_externs.h is present when compiling
+ for darwin (this header is missing in the iOS SDK)
+ * eval_intern.h: check HAVE_CRT_EXTERNS_H before including crt_externs.h, if
+ not defined, include missing/crt_externs.h instead
+ * hash.c: ditto
+ * missing/setproctitle.c: ditto
+ * missing/crt_externs.h: declare _NSGetEnviron() function and define environ
+ for iOS
- * configure.in (XCFLAGS): add _GNU_SOURCE on linux.
+Fri Dec 28 21:40:36 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * file.c (group_member): use system routine if available.
+ * lib/irb/context.rb: IRB::Context#new: Check from JobManager
+ inside IRB namespace [Bug #7628]. Thanks rafaelfranca for bug
+ report and its patch.
-Fri Sep 7 14:14:19 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Dec 28 17:06:17 2012 Akinori MUSHA <knu@iDaemons.org>
- * include/ruby/defines.h (flush_register_windows): call "ta 0x03"
- even on Linux/Sparc. [ruby-dev:31674]
+ * misc/ruby-electric.el (ruby-electric-curlies): Automatically
+ indent closing curly brackets when
+ ruby-electric-newline-before-closing-bracket is true.
-Fri Sep 7 14:12:37 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Fri Dec 28 11:50:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/win32ole/win32ole.c (ole_type_progid, reg_enum_key,
- reg_get_val, ole_wc2mb): fix the bug. Thanks, arton.
- [ruby-dev:31576]
+ * vm_insnhelper.c (vm_yield_setup_block_args): pass single argument to
+ single optional parameter unchanged without splatting. [Bug #7621]
+ [ruby-dev:46801]
-Fri Sep 7 14:02:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 28 11:17:47 2012 Shugo Maeda <shugo@ruby-lang.org>
- * process.c (detach_process_watcher): should not pass the pointer
- to an auto variable to the thread to be created. pointed and
- fix by KUBO Takehiro <kubo at jiubao.org> [ruby-dev:30618]
+ * proc.c (method_eq): fix the documentation to refer to owner.
+ [ruby-core:51105] [Bug #7613]
-Fri Sep 7 13:52:36 2007 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_method.rb (test_alias_onwer): new test to confirm
+ that `a == b' returns false if owners of a and b are different.
- * bignum.c (big_lshift): make shift offset long type.
- (big_rshift): ditto.
- (rb_big_lshift): ditto.
- (big_rshift): ditto.
- [ruby-dev:31434]
+Fri Dec 28 07:07:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Aug 16 08:44:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * def/id.def: use split(/^/) instead of String#lines to support
+ Ruby 1.8.5 as BASERUBY.
- * hash.c (rb_hash_delete_key): delete the entry without calling block.
+Thu Dec 27 21:56:56 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * hash.c (rb_hash_shift): should consider iter_lev too.
+ * variable.c (rb_mod_remove_const): fix segv caused by r38558.
- * hash.c (delete_if_i): use rb_hash_delete_key() so that the block
- isn't called twice. [ruby-core:11556]
+Tue Dec 28 01:13:48 2012 James Edward Gray II <james@graysoftinc.com>
-Thu Aug 16 08:43:50 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/csv.rb: Added more Hash methods to CSV::Row.
- * lib/rinda/tuplespace.rb: fix Rinda::TupleSpace keeper thread bug.
- the thread is started too early. [ruby-talk:264062]
+Thu Dec 27 23:27:15 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * test/rinda/test_rinda.rb: ditto.
+ * lib/irb/ruby-lex.rb: make lex_state to EXPR_END when next token
+ is an operator after SYMBEG [Bug #6378].
-Thu Aug 16 08:40:38 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 27 21:30:21 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * ext/pty/pty.c (establishShell): handshaking before close slave
- device. [ruby-talk:263410]
+ * lib/irb/ruby-lex.rb: allow to handle recursive heredocs on
+ irb[Bug #5648].
-Thu Aug 16 08:29:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 27 20:45:29 2012 Masaki Matsushita <glass.saga@gmail.com>
- * configure.in (ac_cv_func_isinf): set yes also on OpenSolaris.
- [ruby-Bugs-12859]
+ * ext/stringio/stringio.c (strio_getline): fix not to raise TypeError
+ when limit is nil.
+ [Bug #7232] [ruby-core:48531]
-Thu Aug 16 08:28:16 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/stringio/test_stringio.rb: a test for above.
- * lib/rexml/encodings/{ISO-8859-15,CP-1252}.rb: fixed invalid syntax.
+Thu Dec 27 21:08:23 2012 Charlie Somerville <charlie@charliesomerville.com>
-Thu Aug 16 08:26:08 2007 Tadayoshi Funaba <tadf@dotrb.org>
+ * vm_core.h (VM_DEFINECLASS_TYPE): explicit cast to enum type to avoid 64->32
+ shorten warning
- * lib/README: fixed a typo.
+Thu Dec 27 20:11:29 2012 Masaki Matsushita <glass.saga@gmail.com>
-Thu Aug 16 08:20:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/stringio/stringio.c (strio_ungetc): raise IOError instead of RuntimeError
+ if the string is frozen.
+ [Bug #7231] [ruby-core:48530]
- * ext/extmk.rb (extmake): save all CONFIG values.
+ * ext/stringio/stringio.c (strio_ungetbyte): ditto.
- * ext/extmk.rb (extmake): remove mkmf.log at clean, and extconf.h at
- distclean, respectively.
+ * test/stringio/test_stringio.rb: a test for above.
- * ext/extmk.rb: remove rdoc at clean, and installed list file at
- distclean, respectively.
+Wed Dec 26 23:55:18 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
-Thu Aug 16 07:58:18 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/irb/context.rb: fix IRB::Inspector#keys_with_inspector [Bug #7598]
- * sprintf.c (rb_f_sprintf): should not check positional number as
- width. [ruby-core:11838]
+Wed Dec 26 23:26:15 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
-Thu Aug 16 07:52:24 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/irb/context.rb: IRB::Context#use_readline= has been obsolete
+ [Bug #6339].
- * dln.c (conv_to_posix_path): removed.
+Wed Dec 26 21:32:46 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * ruby.c (rubylib_mangled_path, rubylib_mangled_path2): return
- VALUE instead of a pointer to static buffer.
+ * lib/irb/context.rb: make a correct prompt from
+ IRB.conf[:IRB_NAME] on irb [Bug #6338]. Patched by sho-h.
- * ruby.c (push_include_cygwin): fixed buffer overflow.
- [ruby-dev:31297]
+Wed Dec 26 21:09:19 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * ruby.c (ruby_init_loadpath): not convert built-in paths.
+ * lib/irb/ext/math-mode.rb: make not able to change math-mode
+ after irb starting [Bug #6302]. Patched by sho-h.
-Thu Aug 16 07:51:37 2007 Akinori MUSHA <knu@iDaemons.org>
+Wed Dec 26 12:52:36 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * defines.h: Pull the RUBY_MBCHAR_MAXSIZE definition from trunk,
- which is necessary for dir.c to compile on djgpp and emx.
+ * lib/irb/init.rb: change default debug level for
+ irb[ruby-dev:46805], [Bug #6301].
-Thu Aug 16 07:42:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 26 11:54:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * intern.h (is_ruby_native_thread): removed since declared as an int
- function in ruby.h already.
+ * configure.in: enable -fPIE when checking -pie for fixing
+ OpenBSD build error. Patch by George Koehler. Thank you!
+ [Bug #7606] [ruby-core:51082]
-Thu Aug 16 07:40:41 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 26 07:31:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * file.c (rb_file_s_rename): deleted code to get rid of a bug of
- old Cygwin.
+ * string.c (rb_enc_cr_str_copy_for_substr): empty string is always
+ valid or 7bit.
- * file.c (rb_file_truncate): added prototype of GetLastError()
- on cygwin. [ruby-dev:31239]
+ * string.c (rb_str_enumerate_lines, rb_str_chop): reduce duplicated
+ code.
- * intern.h (is_ruby_native_thread): prototype.
+ * string.c (rb_str_enumerate_chars): prevent shared copy from GC.
- * missing/strftime.c (strftime): fix printf format and actual
- arguments.
+Wed Dec 26 01:31:16 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * ext/Win32API/Win32API.c (Win32API_initialize): ditto.
+ * lib/irb/init.rb, lib/irb/context.rb: fix conf.debug_level=
+ [Bug #6301] and fix irb command option: -- irb_debug_level for irb.
- * ext/tk/tcltklib.c (ip_finalize): ditto.
+Wed Dec 26 00:59:18 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * ext/dl/ptr.c (rb_dlptr_inspect): ditto. [ruby-dev:31268]
+ * lib/irb/ruby-lex.rb: improve RubyLex performance for large files
+ [Bug #5202]. Patch by ryanmelt.
- * ext/dl/sym.c (rb_dlsym_inspect): ditto.
+Tue Dec 25 22:21:06 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * ext/socket/getnameinfo.c: include stdio.h always.
+ * lib/irb/output-method.rb: raise right exception when
+ IRB::OutputMethod#print don't defined [Bug #6657].
- * ext/win32ole/win32ole.c (ole_hresult2msg, folevariable_name,
- folevariable_ole_type, folevariable_ole_type_detail,
- folevariable_value, folemethod_visible): missing return value.
+Tue Dec 25 22:06:33 2012 Koichi Sasada <ko1@atdot.net>
-Thu Aug 16 07:32:13 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_trace.c (rb_threadptr_exec_event_hooks_and_pop_frame):
+ pop a frame before JUMP_TAG() if exception occurred.
+ This change fix bug of Ruby 1.9.
+ [ruby-core:51128] [ruby-trunk - Bug #7624]
- * lib/mkmf.rb (create_makefile): make OBJS depend on RUBY_EXTCONF_H
- only if extconf.h is created.
+ * vm_core.h (EXEC_EVENT_HOOK_AND_POP_FRAME): add to use
+ `rb_threadptr_exec_event_hooks_and_pop_frame()'.
-Thu Aug 16 07:29:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (vm_exec): use EXEC_EVENT_HOOK_AND_POP_FRAME() while
+ exception handling. While exception handling, if an exception
+ is raised in hooks, need to pop current frame and raise this
+ raised exception by hook.
- * {win32,wince,bcc32}/setup.mak (-version-): no RUBY_EXTERN magic.
+ * test/ruby/test_settracefunc.rb: add a test.
-Thu Aug 16 06:43:03 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 25 21:08:53 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * lib/mkmf.rb (init_mkmf): should remove mkmf.log too.
+ * lib/irb/init.rb, lib/irb/lc/ja/error.rb, lib/irb/lc/error.rb:
+ raise exception when illegal RC_NAME_GENERATOR defined [Bug #6455].
-Thu Aug 16 06:40:58 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 25 19:22:17 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * ext/openssl/ossl_config.c (ossl_config_set_section): do not
- initialize aggregations with dynamic values. [ruby-talk:259306]
+ * lib/irb/workspace.rb: define method to private on top-level irb
+ [Bug #5776]. Patch by davidbalbert.
-Thu Aug 16 06:39:19 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 25 19:09:51 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (get_backtrace): check the result more.
- [ruby-dev:31261] [ruby-bugs-12398]
+ * bignum.c, include/ruby/intern.h (rb_big_eql): exported.
-Thu Aug 16 06:32:25 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (recursive_check): object_id maybe a Bignum, not Fixnum on
+ LLP64. see also r38493 and r38548.
+ reported by Heesob Park at [ruby-core:51083] [Bug #7607], and patched
+ by shirosaki at [ruby-core:51095]
- * bignum.c (rb_big_lshift, rb_big_rshift): separated functions
- to get rid of infinite recursion. fixed calculation in edge
- cases. [ruby-dev:31244]
+Tue Dec 25 18:53:35 2012 Koichi Sasada <ko1@atdot.net>
- * numeric.c (rb_fix_lshift, rb_fix_rshift): ditto.
+ * vm_core.h, eval_intern.h (CHECK_STACK_OVERFLOW): move
+ CHECK_STACK_OVERFLOW() to vm_core.h and rename to
+ CHECK_VM_STACK_OVERFLOW().
+ This change is only move and rename.
-Thu Aug 16 06:26:58 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/instruction.rb: catch up above changes.
- * bignum.c (rb_big_pow): refine overflow check. [ruby-dev:31242]
+ * vm.c, vm_insnhelper.c: ditto.
-Thu Aug 16 06:25:48 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_insnhelper.c (vm_stackoverflow): add a function to unify
+ raising vm stackoverflow exception.
- * time.c (time_succ): Time#succ should return a time object in the
- same timezone mode to the original. [ruby-talk:260256]
+Tue Dec 25 16:16:54 2012 Koichi Sasada <ko1@atdot.net>
-Thu Aug 16 06:24:39 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_core.h (RUBY_VM_THREAD_VM_STACK_SIZE): change default
+ VM stack size (128 KB or 256 KB -> 512 KB or 1024 KB).
+ This re-sizing corrects smaller value introduced at r38478.
+ Newer value is same VM stack size of Ruby 1.9.
+ [ruby-dev:46797] [ruby-trunk - Bug #7603]
- * numeric.c (fix_pow): integer power calculation: 0**n => 0,
- 1**n => 1, -1**n => 1 (n: even) / -1 (n: odd).
+Tue Dec 25 13:38:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 16 06:11:34 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * error.c (compile_err_append, compile_warn_print, warn_print): use
+ rb_write_error_str() instead of writing to rb_stderr directly.
- * lib/base64.rb (Base64::b64encode): should not specify /o option
- for regular expression. [ruby-dev:31221]
+ * io.c (rb_write_error_str): a stopgap measure not to unblock GVL.
+ warning from require seems to still have race condition errors.
-Thu Aug 16 06:08:53 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 25 00:59:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * sprintf.c (rb_f_sprintf): more checks for format argument.
- [ruby-core:11569], [ruby-core:11570], [ruby-core:11571],
- [ruby-core:11573]
+ * node.h (NODE_OP_CDECL), compile.c (iseq_compile_each),
+ parse.y (stmt, arg): allow scoped constant op-assignment.
+ [ruby-core:40154] [Bug #5449]
-Thu Aug 16 05:39:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Dec 24 04:56:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * bignum.c (bignorm): do not empty Bignum. [ruby-dev:31229]
+ * lib/net/http/generic_request.rb (Net::HTTPGenericRequest):
+ set content-length to zero on empty post requests
+ by Gregory Ostermayr <gregory.ostermayr@gmail.com>
+ https://github.com/ruby/ruby/pull/201 fix GH-201
-Thu Aug 16 05:12:05 2007 pegacorn <subscriber.jp AT gmail.com>
+Sun Dec 23 19:09:16 2012 Koichi Sasada <ko1@atdot.net>
- * ext/openssl/ossl.h: include ossl_pkcs5.h. [ruby-dev:31231]
+ * thread.c: rename methods:
+ from Thread.async_interrupt_timing to Thread.handle_interrupt,
+ from Thread.async_interrupted? to Thread.pending_interrupt?.
+ Also rename option from `defer' to `never'.
+ [ruby-core:51074] [ruby-trunk - Feature #6762]
- * ext/openssl/ossl_pkcs5.h: new file for PKCS5. [ruby-dev:31231]
+ * vm_core.c, thread.c: rename functions and data structure
+ `async_errinfo' to `pending_interrupt'.
- * ext/openssl/ossl_x509name.c (ossl_x509name_to_s): use ossl_raise()
- instead of rb_raise(). [ruby-dev:31222]
+ * thread.c: add global variables sym_immediate, sym_on_blocking and
+ sym_never.
- * ext/sdbm/_sdbm.c: DOSISH platforms need io.h. [ruby-dev:31232]
+ * cont.c, process.c, vm.c, signal.c: ditto.
- * ext/syck/syck.h: include stdlib.h for malloc() and free().
- [ruby-dev:31232]
+ * lib/sync.rb, lib/thread.rb: catch up this renaming.
- * ext/syck/syck.h (syck_parser_set_input_type): prototype added.
- [ruby-dev:31231]
+ * test/ruby/test_thread.rb: ditto.
- * win32/win32.c: include mbstring.h for _mbspbrk(). [ruby-dev:31232]
+Sun Dec 23 17:57:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32.h (rb_w32_getcwd): prototype added. [ruby-dev:31232]
+ * lib/profiler.rb (Profiler__::PROFILE_PROC, print_profile): store
+ profile data per threads for concurrent-execution.
+ [ruby-core:22046] [Bug #1152]
-Thu Aug 16 05:02:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/profiler.rb (Profiler__::Wrapper): support calling singleton
+ methods of an instance of BasicObject.
- * bignum.c (rb_cstr_to_inum): check leading non-digits.
- [ruby-core:11691]
+ * lib/profiler.rb (Profiler__::PROFILE_PROC): use TracePoint.
-Thu Aug 16 05:00:01 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Dec 23 16:13:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * numeric.c (fix_pow): 0**2 should not raise floating point
- exception. [ruby-dev:31216]
+ * lib/erb.rb: typos for ERB::new link
-Thu Aug 16 04:56:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 23 16:06:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * win32/win32.c (CreateChild): enclose command line except for
- command.com which can not handle quotes. [ruby-talk:258939]
+ * lib/erb.rb: Document ERB::new trim_mode '-' for lines ending in -%>
+ [ruby-core:51084] [Bug #7608]
-Thu Aug 16 04:54:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 23 15:25:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * lib/mkmf.rb (link_command, cc_command, cpp_command): do not expand
- ::CONFIG which is an alias of MAKEFILE_CONFIG.
+ * lib/irb/ruby-lex.rb: Add handling for %i and %I quoting to irb
+ Patch by flori [ruby-core:49550] [Bug #7392] [Github Issue #157]
-Thu Aug 16 04:53:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 23 15:05:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * struct.c (rb_struct_init_copy): disallow changing the size.
- [ruby-dev:31168]
+ * vm_eval.c (rb_check_funcall_with_hook): rb_check_funcall with hook
+ which is called before calling method_missing or target method.
-Thu Aug 16 04:52:11 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * marshal.c (w_object, r_object0): use rb_check_funcall_with_hook
+ instead of respond_to? and call.
- * random.c: documentation fix. srand(0) initializes PRNG with '0',
- not with random_seed.
+Sun Dec 23 14:52:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Thu Aug 16 04:49:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * re.c (rb_reg_eqq): doc: #=== is not a synonym for #=~, added example
+ [ruby-dev:46746] [Bug #7571]
- * bcc32/{Makefile.sub,setup.mak}: remove surplus slash from srcdir.
+Sun Dec 23 14:35:13 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 16 04:40:37 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (BLOCKING_REGION): if fail_if_interrupted is false ignore
+ the result of blocking_region_begin(), since it always is true in
+ that case. suppress "uninitialized" warnings.
- * sprintf.c (rb_f_sprintf): sign bit extension should not be done
- if FPLUS flag is specified. [ruby-list:39224]
+Sun Dec 23 09:34:07 2012 Eric Hodel <drbrain@segment7.net>
-Thu Aug 16 04:39:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rubygems/commands/check_command.rb: Added --doctor and --dry-run
+ options to clean up after failed uninstallation.
+ * test/rubygems/test_gem_commands_check_command.rb: Test for above.
- * array.c (rb_ary_initialize): should call rb_ary_modify() first.
- [ruby-core:11562]
+ * lib/rubygems/commands/push_command.rb: Allow pushes from RubyGems
+ 2.0.0.preview3
-Thu Aug 16 04:38:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems/commands/update_command.rb: Use Gem.ruby_version
- * parse.y (yylex): return non-valid token for an invalid
- instance/class variable name. a patch from from Yusuke ENDOH
- <mame AT tsg.ne.jp>. [ruby-dev:31095]
+ * lib/rubygems/dependency.rb: Update style.
-Thu Aug 16 04:36:41 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems/installer.rb: Ensure installed gem specifications will
+ be useable. Refactor.
+ * test/rubygems/test_gem_installer.rb: ditto.
- * parse.y (dsym): return non-null NODE even if yyerror(). based on a
- patch from from Yusuke ENDOH <mame AT tsg.ne.jp>. [ruby-dev:31085]
+ * lib/rubygems/validator.rb: Fixed bug with unreadable files.
-Thu Aug 16 04:34:56 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems.rb: Fixed broken methods.
+ * test/rubygems/test_gem.rb: Test for above.
- * process.c (proc_exec_v, rb_proc_exec): preserve errno.
+ * test/rubygems/test_gem_commands_push_command.rb: Fixed overridden
+ Gem.latest_rubygems_version
-Thu Aug 16 04:30:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 23 01:52:01 2012 Akinori MUSHA <knu@iDaemons.org>
- * variable.c (rb_path2class): get rid of dangling pointer caused by
- optimized out value.
+ * io.c (rb_io_lines, rb_io_bytes, rb_io_chars, rb_io_codepoints):
+ Deprecate IO#{lines,bytes,chars,codepoints} and those of ARGF.
+ [Feature #6670]
-Thu Aug 16 04:24:28 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/stringio/stringio.c (strio_lines, strio_bytes, strio_chars)
+ (strio_codepoints): Deprecate
+ StringIO#{lines,bytes,chars,codepoints}. [Feature #6670]
- * ext/dl/lib/dl/win32.rb: seems that dl doesn't accept void argument.
- fixed [ruby-bugs:PR#5489].
+ * ext/zlib/zlib.c (rb_gzreader_lines, rb_gzreader_bytes):
+ Deprecate Zlib::GzipReader#{lines,bytes}. [Feature #6670]
-Thu Aug 16 04:23:44 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 23 01:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser): handle more
- extensions. [ruby-dev:30972]
+ * lib/optparse.rb: Documentation for OptionParser to remove 'shadowed
+ outer local variable' from example and make obvious ARGV with
+ non-option arguments.
+ Patch by Marcus Stollsteimer [ruby-core:47460] [Bug #6997]
-Thu Aug 16 04:14:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 23 00:08:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * process.c (ruby_setreuid, ruby_setregid): rename to get rid of name
- clash.
-Thu Aug 16 04:11:17 2007 Ryan Davis <ryand@zenspider.com>
+ * include/ruby/intern.h: add the prototype declaration of
+ rb_num_coerce_bit.
- * lib/rexml/dtd/dtd.rb: Fixed typo in code. Fixes bug #10420
+ * numeric.c (rb_num_coerce_bit): the new coerce function for bitwise
+ binary operation.
-Thu Aug 16 04:08:20 2007 Shugo Maeda <shugo@ruby-lang.org>
+ * bignum.c (rb_big_and): use coerce to convert the argument, which isn't
+ a Fixnum nor a Bignum, to the corresponding Integer object so that
+ bitwise operations can support Integer-mimic objects.
+ [Bug #1792] [ruby-core:39491]
- * lib/net/imap.rb (ResponseParser#next_token): fixed
- error message. (backported from HEAD)
+ * bignum.c (rb_big_or): ditto.
- * lib/net/imap.rb (ResponseParser#parse_error): fixed
- the condition not to refer @token.symbol unexpectedly.
- Thanks, Dick Monahan. (backported from HEAD)
+ * bignum.c (rb_big_xor): ditto.
-Thu Aug 16 04:05:20 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * numeric.c (bit_coerce): ditto.
- * marshal.c (w_extended): erroneous check condition when dump
- method is defined. [ruby-core:10646]
+ * numeric.c (fix_and): ditto.
-Sat Jun 9 10:40:00 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * numeric.c (fix_or): ditto.
- * stable version 1.8.5-p52 released.
+ * numeric.c (fix_xor): ditto.
-Thu Jun 7 14:53:46 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * test/ruby/test_integer.rb: add tests for the above changes.
- * eval.c (method_inspect): show proper class name.
- [ruby-talk:248647], Thanks Calamitas.
+ * test/ruby/test_bignum.rb: ditto.
-Mon May 28 19:37:24 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Dec 23 00:04:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (move_to_next_entry): revert r12338. not necessary
- on ruby_1_8_5.
+ * internal.h (QUOTE, QUOTE_ID): quote unprintable chars in strings and
+ IDs. [Bug #7574] [ruby-dev:46749]
-Sun May 27 05:52:37 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * string.c (rb_str_quote_unprintable): ditto.
- * eval.c (mnew): call of super via a method object should work again.
- [ruby-talk:248647], Thanks Calamitas.
+Sat Dec 22 23:59:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_method.rb (TestMethod::test_method_super): test for
- above fix.
+ * error.c (rb_compile_error, rb_compile_warn, rb_compile_warning),
+ (rb_warn, rb_warning): support PRIsVALUE.
-Wed May 23 06:51:46 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
+Sat Dec 22 22:04:58 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * lib/cgi.rb (CGI#[]): get rid of exceptions being raised.
- [ruby-dev:30740], Thanks Kentaro KAWAMOTO.
+ * cont.c (rb_fiber_start): unify conditions.
-Wed May 23 06:14:15 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 22 21:47:55 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * win32/win32.c (move_to_next_entry): loc also must move forward.
- [ruby-talk:251987]
+ * io.c (rb_io_wait_writable): use rb_thread_check_ints() instead
+ of rb_thread_fd_writable().
+ * io.c (rb_io_wait_readable): ditto.
-Wed May 23 05:55:04 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Dec 22 20:31:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (init_stdhandle): stderr should be without buffering,
- but mswin32 use buffering when stderr is not connected to tty.
+ * object.c (rb_mod_const_get): symbol cannot be nested constant name.
-Wed May 23 03:33:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 22 19:26:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/monitor.rb (ConditionVariable#wait, mon_enter, mon_exit_for_cond):
- ensures Thread.critical to be false. [ruby-talk:248300]
+ * object.c (rb_mod_const_get): check more strictly. [ruby-dev:46748]
+ [Bug #7573]
-Wed May 23 03:25:13 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 19 02:34:48 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * util.c (ruby_strtod): exponent is radix 10. [ruby-talk:248272]
+ * cont.c (rb_fiber_start): in case of jump with TAG_FATAL,
+ enqueue error into async_errinfo_queue, because you cannot call
+ TH_TAG_JUMP() in this function. [ruby-dev:45218] [Bug #5993]
-Wed May 23 02:09:32 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread.c (rb_threadptr_execute_interrupts): now INT2FIX(TAG_FATAL)
+ can be popped from async_errinfo_queue.
- * eval.c (rb_yield_0): should not clear state on TAG_NEXT when
- it's invoked from within lambda body. [ruby-talk:248136]
+ * vm.c (rb_vm_make_jump_tag_but_local_jump): revert r38441.
+ rb_vm_make_jump_tag_but_local_jump() shouldn't return exception
+ in case of state == TAG_FATAL.
- * eval.c (proc_invoke): handle TAG_NEXT which would be caused by
- next in the lambda body as well.
+ * test/ruby/test_fiber.rb (test_exit_in_fiber): fix a test to illuminate
+ Thread.exit should terminate current Thread.
-Wed May 23 01:55:49 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Dec 22 13:15:08 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * win32/win32.c (rb_w32_fclose, rb_w32_close): need to save errno
- before calling original fclose()/close().
+ * gc.c (obj_id_to_ref): add a macro to treat Bignum object id.
+ This follows the change r38493.
-Wed May 23 01:42:29 2007 Shugo Maeda <shugo@ruby-lang.org>
+ * gc.c (id2ref): fix for working fine with Bignum object id on x64
+ Windows.
+ * gc.c (wmap_finalize): ditto.
- * lib/net/imap.rb (disconnect): call shutdown for
- SSLSocket. Thanks, Technorama Ltd.
+Sat Dec 22 11:30:21 2012 Masaki Matsushita <glass.saga@gmail.com>
-Wed May 23 01:28:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * struct.c (make_struct): remove junk ID check to allow members who
+ have junk name like "foo\000".
+ * test/ruby/test_struct.rb: Test for above.
+ [Bug #7575] [ruby-dev:46750]
- * error.c (rb_notimplement), io.c (pipe_open): removed definite
- articles and UNIX manual section from messages. [ruby-dev:30690]
+Sat Dec 22 05:34:54 2012 Eric Hodel <drbrain@segment7.net>
- * io.c (pipe_open): raise NotImplementedError for command "-" on
- platforms where fork(2) is not available. [ruby-dev:30681]
+ * lib/net/http.rb: Requests may be created with a URI which sets the
+ Host header. Responses contain the requested URI for easier redirect
+ following. [ruby-trunk - Feature #6482]
+ * lib/net/http/generic_request.rb: ditto.
+ * lib/net/http/response.rb: ditto.
+ * NEWS (net/http): Updated for above.
+ * test/net/http/test_http.rb: Tests for above.
+ * test/net/http/test_http.rb: ditto.
+ * test/net/http/test_httpresponse.rb: ditto.
-Wed May 23 00:06:19 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Dec 22 02:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * ext/socket/socket.c (s_recv, s_recvfrom): some systems (such as
- windows) doesn't set fromlen if the socket is connection-oriented.
- reported by Bram Whillock in [ruby-core:10512] [ruby-Bugs#9061]
+ * lib/irb/slex.rb(#match): Typo, should be D_DETAIL
+ [ruby-core:51071] [Bug#7600]
-Tue Mar 20 15:37:24 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
+Sat Dec 22 02:29:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * distruby.rb: Add zip generation.
+ * lib/irb/input-method.rb, lib/irb.rb: Typo in
+ InputMethod#readable_atfer_eof? to #readable_after_eof?
+ [ruby-core:51069] [Bug #7599]
-Fri Mar 16 21:48:11 2007 Akinori MUSHA <knu@iDaemons.org>
+Sat Dec 22 02:19:38 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/dl/dl.c (rb_ary2cary): Fix a bug in type validation;
- submitted by sheepman <sheepman AT sheepman.sakura.ne.jp>
- in [ruby-dev:30554].
+ * vm_dump.c (rb_vm_bugreport): revert r38533.
+ * addr2line.c (fill_lines): add ELF sanity check.
+ [Bug #7597] [ruby-dev:46786]
-Fri Mar 16 18:28:06 2007 Akinori MUSHA <knu@iDaemons.org>
+Sat Dec 22 02:05:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * ext/etc/etc.c (etc_getgrgid): Fix a bug in Etc::getgrgid()
- always returning the (real) group entry of the running process;
- reported by: UEDA Hiroyuki <ueda AT netforest.ad.jp>
- in [ruby-dev:30586].
+ * lib/irb/inspector.rb, lib/irb/context.rb: Move IRB::INSPECTORS and
+ class methods to IRB::Inspector [ruby-core:51067][Bug #7598]
-Wed Mar 14 12:30:00 2007 Shigeo Kobayashi <shigeo@tinyforest.jp>
+Sat Dec 22 00:28:46 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.c: BigDecimal("-.31") is now
- treated as ("-0.31") not as ("0.31").
+ * object.c (rb_obj_hash): shouldn't assume object_id can be long.
+ based on a patch by Heesob Park at [ruby-core:51060].
+ cf. [Backport #7454]
-Fri Mar 16 18:05:40 2007 Akinori MUSHA <knu@iDaemons.org>
+Fri Dec 21 23:15:25 2012 Kouhei Sutou <kou@cozmixng.org>
- * lib/cgi.rb (CGI::header): IIS >= 5.0 does not need the nph
- assumption any more; submitted by MIYASAKA Masaru <alkaid AT
- coral.ocn.ne.jp> in [ruby-dev:30537].
+ * ext/fiddle/lib/fiddle/struct.rb (Fiddle::CStructEntity#set_ctypes):
+ CPtr -> Pointer.
+ * test/fiddle/test_c_struct_entry.rb
+ (Fiddle::TestCStructEntity#test_aref_pointer):
+ Added the test for the above.
-Tue Mar 13 17:29:43 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
+Fri Dec 21 23:12:05 2012 Kouhei Sutou <kou@cozmixng.org>
- * stable version 1.8.5-p35 released.
+ * ext/fiddle/lib/fiddle/struct.rb (Fiddle::CStructEntity#set_ctypes):
+ CPtr -> Pointer.
+ * test/fiddle/test_c_struct_entry.rb
+ (Fiddle::TestCStructEntity#test_aref_pointer_array):
+ Added the test for the above.
-Tue Mar 13 14:42:10 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
+Fri Dec 21 22:43:36 2012 Kouhei Sutou <kou@cozmixng.org>
- * test/fileutils/fileasserts.rb: Fix wrong error message.
+ * ext/fiddle/lib/fiddle/import.rb (Fiddle::Importer#sizeof):
+ CPtr -> Pointer.
+ * test/fiddle/test_import.rb (Fiddle::TestImport#test_sizeof):
+ Added the test for the above.
- * lib/fileutils.rb (FileUtils::mv): Type Error; should utilize
- Strings instead of Symbols here.
+Fri Dec 21 22:34:17 2012 Koichi Sasada <ko1@atdot.net>
-Mon Mar 12 17:22:44 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/ruby/test_iseq.rb: disable a test which checks features
+ removed at r38532.
- * lib/fileutils.rb (FileUtils::mv): fix incomplete backport of
- FileUtils.mv changes at r11988
+Fri Dec 21 22:02:00 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Mar 12 16:09:28 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/{dir.h,win32.c} (rb_w32_readdir): removed old rb_w32_readdir()
+ and renamed from rb_w32_readdir_with_enc().
+ [ruby-core:24864] [Feature #1927]
- * mkconfig.rb (patchlevel): read from version.h.
+ * dir.c (READDIR): follow above change.
-Sun Mar 11 18:57:50 2007 Akinori MUSHA <knu@iDaemons.org>
+Fri Dec 21 21:12:54 2012 Masaya Tarui <tarui@ruby-lang.org>
- * misc/README: Add a note about ruby-electric.el.
+ * vm_dump.c (rb_vm_bugreport): commentout addr2line call temporarily
+ in order to avoid segv. anyone can fix addr2line?
+ [Bug #7597] [ruby-dev:46786]
- * misc/ruby-mode.el (ruby-non-block-do-re): Fix
- ruby-non-block-do-re. [ruby-core:03719]
+Fri Dec 21 20:38:28 2012 Koichi Sasada <ko1@atdot.net>
- * misc/inf-ruby.el: Synchronize the comment section with trunk.
+ * iseq.c (Init_ISeq): remove definition of the following methods:
+ ISeq#line_trace_all and ISeq#line_trace_specify because they are
+ half baked.
+ C APIs are remained as experimental. These functions will be
+ renamed, removed their parameters may be changed.
+ You can use these methods by C exts. Please give us your comments.
- * misc/README, misc/rdebug.el: Add rdebug.el, Emacs ruby-debug
- interface based on rubydb3x.el; submitted by Martin Nordholts
- <enselic AT gmail.com> in [ruby-bugs:PR#9023].
+Fri Dec 21 20:21:04 2012 Koichi Sasada <ko1@atdot.net>
-Sun Mar 11 17:45:51 2007 Akinori MUSHA <knu@iDaemons.org>
+ * vm_trace.c (tracepoint_new): add code to support specified thread.
+ But not tested and this feature is not supported officially.
- * ext/dl/mkcallback.rb (mkfunc): Make sure that a callback
- function is found in the function table before trying to call
- it; submitted by sheepman <sheepman AT sheepman.sakura.ne.jp>
- in [ruby-dev:30524].
+Fri Dec 21 19:37:15 2012 Koichi Sasada <ko1@atdot.net>
-Tue Mar 6 18:58:37 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/shell/process-controller.rb: fix thread synchronization
- problem for [ruby-dev:30477].
-
-Sun Mar 4 23:53:27 2007 Minero Aoki <aamine@loveruby.net>
+ * ruby.c (process_options): need to acquire env from TOPLEVEL_BINDING
+ each time.
+ `bind->env' may update after `eval()'.
+ [Bug #7536]
- * lib/fileutils.rb (mv): could not move a directory between
- different filesystems. [ruby-dev:30411]
+Fri Dec 21 18:46:50 2012 Koichi Sasada <ko1@atdot.net>
-Sat Mar 3 21:41:31 2007 Akinori MUSHA <knu@iDaemons.org>
+ * include/ruby/debug.h, vm_core.h: define rb_trace_arg_t at
+ include/ruby/debug.h (move from vm_core.h).
- * eval.c (stack_check): Unset inline to fix build with GCC 3.4.6;
- submitted by: NISHIMATSU Takeshi <t_nissie AT yahoo.co.jp> in
- [ruby-list:43218].
- cf. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24556
+Fri Dec 21 17:48:15 2012 Koichi Sasada <ko1@atdot.net>
-Sat Mar 3 16:30:39 2007 Akinori MUSHA <knu@iDaemons.org>
+ * vm_core.h, vm_trace.c: fix multi-threading bug for tracing.
+ Move `trace_arg' from rb_tp_t::trace_arg to rb_thread_t::trace_arg.
+ `trace_arg' may changed by multiple threads.
+ rb_thread_t::trace_arg can represent rb_thread_t::trace_running
+ (null or non-null) and rb_thread_t::trace_running is removed.
+ After that, `rb_tp_t' is not needed to check tracing or not
+ (A running thread knows tracing or not). This is why I remove
+ tp_attr_check_active() and make new function get_trace_arg().
- * env.h (SCOPE_CLONE): Introduce a new scope flag to prevent a
- local_tbl region from getting freed many times; submitted by
- Chikanaga Tomoyuki <chikanag AT nippon-control-system.co.jp> in
- [ruby-dev:30460].
+ And this modification disable to work the following code:
+ TracePoint.trace{|tp|
+ Thread.new{p tp.event} # access `tp' from other threads.
+ }
+ I believe nobody mix threads at trace procedure.
+ This is current limitation.
+ [Bug #7590]
- * eval.c (proc_invoke): Ditto.
+ * cont.c (fiber_switch, rb_cont_call): use rb_thread_t::trace_arg
+ instead of rb_thread_t::trace_running.
- * gc.c (obj_free): Ditto.
+ * test/ruby/test_settracefunc.rb: add a multi-threading test.
- * parse.y (top_local_setup_gen): Ditto.
+Fri Dec 21 16:38:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Mar 3 15:41:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * template/id.h.tmpl (ID2ATTRSET): compile time constant macro for
+ ID_ATTRSET.
- * parse.y (stmt, arg): should not omit lhs of OP_ASGN1 even if
- empty. [ruby-dev:30452]
+ * defs/id.def (KeywordError): check duplication.
-Wed Feb 28 20:51:32 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * defs/id.def: support for other scope IDs,
+ ID_{INSTANCE,GLOBAL,CONST,CLASS}.
- * pack.c (pack_unpack): properly ignore non-base64 octets such as
- UTF-8 encoded BOMs; submitted by SOUMA Yutaka <holon@radastery.jp>
- to fix [ruby-core:10437]
+Fri Dec 21 14:45:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Wed Feb 28 00:08:11 2007 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
+ * lib/irb.rb, lib/irb/*: Documentation for IRB
- * mkconfig.rb (RbConfig): add CONFIG['PATCHLEVEL']
+Fri Dec 21 11:31:02 2012 Eric Hodel <drbrain@segment7.net>
- * common.mk: new target dist
+ * lib/rake/*: Updated to rake 0.9.6
+ * doc/rake/*: ditto
+ * test/rake/*: ditto
- * distruby.rb: new file
+Fri Dec 21 08:56:34 2012 Masaya Tarui <tarui@ruby-lang.org>
-Tue Feb 27 21:19:35 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_trace.c (rb_suppress_tracing): remove unused variable 'vm_tracing'
- * win32/win32.c (set_pioinfo_extra): new function for VC++8 SP1
- workaround. [ruby-core:10259]
+Fri Dec 21 01:01:45 2012 Masaya Tarui <tarui@ruby-lang.org>
- * win32/win32.c (NtInitialize): call above function.
+ * lib/irb/completion.rb (CompletionProc): support completion of
+ instance variables. [ruby-dev:46710] [Bug #7520]
-Mon Feb 26 09:57:58 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Dec 20 20:58:25 2012 Masaya Tarui <tarui@ruby-lang.org>
- * signal.c (ruby_signal): don't set SA_RESTART. a backport from
- the HEAD. [ruby-talk:220937] [ruby-talk:147220]
+ * vm_trace.c (rb_suppress_tracing): bugfix for vm->trace_running
+ counter. And if tracing is already true, vm_trace_running ops is
+ skipped to control overflow.
-Tue Feb 13 02:21:12 2007 Sam Roberts <sroberts@uniserve.com>
+Thu Dec 20 18:29:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (rb_f_syscall): Fix buffer overflow with syscall
- arguments. [ruby-bugs:PR#8541]
+ * include/ruby/ruby.h (RTEST, NIL_P): make bare expressions without
+ outermost parentheses.
-Sat Feb 10 09:33:47 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Thu Dec 20 17:29:00 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/win32ole/win32ole.c (ole_variant2val): sorry, fix the enbug.
+ * NEWS: fix the description for Refinements.
-Sat Feb 10 09:08:01 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Thu Dec 20 16:53:59 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/win32ole/win32ole.c (ole_variant2val): fix compile error
- on VC++.
+ * vm_core.h (rb_vm_defineclass_type_t),
+ compile.c (iseq_compile_each), insns.def (defineclass): change the
+ meaning of the third operand of defineclass as follows:
+ lower 3bits: the type of the defineclass
+ 0 = class, 1 = singleton class, 2 = module
+ 4th bit: a flag represents whether the defineclass is scoped
+ 0 = not scoped (e.g., class Foo)
+ 1 = scoped (e.g., class Bar::Baz)
+ 5th bit: a flag represents whether the superclass is specified
+ 0 = not specified (e.g., class Foo)
+ 1 = specified (e.g., class Bar < Foo)
+ If the superclass is specified and is not a class, a TypeError
+ should be raised. [ruby-dev:46747] [Bug #7572]
-Sat Feb 10 08:38:30 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * test/ruby/test_class.rb: related test.
- * ext/win32ole/win32ole.c (ole_variant2val): fix the bug when
- SAFEARRAY pointer is NULL.
+Thu Dec 20 16:52:37 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Tue Feb 6 20:41:39 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * NEWS: announce AEAD encryption support in the OpenSSL extension.
- * string.c (rb_str_sub_bang): calling rb_str_modify() should be just
- before actually modifying the string.
- fixed: [ruby-dev:30211] (originally reported by zunda)
+Thu Dec 20 16:40:13 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Jan 27 15:20:11 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c (nonspecial_obj_id): VALUE is not compatible with Fixnum on
+ LLP64 platform, such as 64bit Windows.
+ reported by Heesob Park at [ruby-core:50255] [Bug #7454], and the
+ fix is suggested by akr.
- * parse.y (dyna_var_lookup): should not alter dvar->val not to
- destroy living value. [ruby-core:10076]
+Thu Dec 20 16:39:04 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
- * parse.y (dyna_init): ditto.
+ * ext/openssl/ossl_cipher.c: fix errors for installations that do not
+ feature Authenticated Encryption.
+ * ext/openssl/extconf.rb: detect presence of EVP_CTRL_GCM_GET_TAG to
+ determine whether Authenticated Encryption can be used.
+ [Feature #6980] [ruby-core:47426]
-Wed Jan 24 18:05:39 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Dec 20 15:55:46 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
- * misc/ruby-mode.el (ruby-font-lock-syntactic-keywords): fix
- regexp font-lock bug. [ruby-talk:235758]
+ * ext/openssl/ossl.c: do not use FIPS_mode_set if not available.
+ * test/openssl/utils.rb: revise comment about setting FIPS mode to
+ false.
+ * test/openssl/test_fips.rb: remove tests that cause errors on
+ ruby-ci.
+ [Feature #6946] [ruby-core:47345]
-Sun Jan 14 07:26:44 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Thu Dec 20 15:22:59 2012 Eric Hodel <drbrain@segment7.net>
- * ext/win32ole/win32ole.c (ole_free, ole_type_free,
- olemethod_free, olevariable_free, oleparam_free,
- ole_event_free): fix memory leak. [ruby-core:09846]
+ * lib/rdoc/parser/ruby.rb: Ignore methods defined on constants to
+ prevent modules with the names of constants from appearing in the
+ documentation.
+ * test/rdoc/test_rdoc_parser_ruby.rb: Test for the above.
-Tue Jan 9 12:29:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 20 15:00:33 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
- * ext/etc/etc.c (etc_getpwuid, etc_getgrgid): fix to correctly
- convert uid/gid from VALUE.
+ * ext/openssl/ossl_cipher.c: add support for Authenticated Encryption
+ with Associated Data (AEAD) for OpenSSL versions that support the
+ GCM encryption mode. It's the only mode supported for now by OpenSSL
+ itself. Add Cipher#authenticated? to detect whether a chosen mode
+ does support Authenticated Encryption.
+ * test/openssl/test_cipher.rb: add tests for Authenticated Encryption.
+ [Feature #6980] [ruby-core:47426] Thank you, Stephen Touset for
+ providing a patch!
- * ext/etc/etc.c (etc_getpwuid): ditto.
+Thu Dec 20 12:56:53 2012 Eric Hodel <drbrain@segment7.net>
-Mon Dec 25 20:08:28 2006 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * lib/rdoc/markup/to_html.rb (class RDoc): Added current heading and
+ top links to headings.
+ * lib/rdoc/generator/template/darkfish/rdoc.css: ditto
+ * test/rdoc/test_rdoc_generator_markup.rb: Test for above
+ * test/rdoc/test_rdoc_markup_to_html.rb: ditto
- * ext/openssl/ossl.h: fixed compilation problem on gcc 3.2.
- [ruby-talk:214786]
+ * test/rdoc/test_rdoc_comment.rb: Removed trailing whitespace.
-Mon Dec 25 10:40:40 2006 URABE Shyouhei <shyouhei@ruby-lang.org>
+Thu Dec 20 11:05:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * stable version 1.8.5-p12 released.
+ * test/ruby/envutil.rb (assert_valid_syntax): move from
+ test_syntax.rb.
-Sat Dec 16 04:02:10 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/ruby/envutil.rb (assert_normal_exit): validate syntax before
+ running because this assertion passes even if the code fails by
+ SyntaxError.
- * ext/tk/tcltklib.c: shouldn't run the killed thread at callback.
- [ruby-talk: 227408]
+Thu Dec 20 10:29:58 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Fri Dec 15 17:21:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/openssl/test_pkey_dh.rb: revert special treatment of
+ FIPS-capable installations since FIPS mode is now disabled for the
+ tests.
- * lib/rdoc/ri/ri_options.rb: prevent NameError. [ruby-dev:29597]
+Thu Dec 20 10:23:12 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
-Thu Dec 14 23:37:38 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl.c: add OpenSSL.fips_mode= to allow enabling FIPS
+ mode manually.
+ * test/openssl/utils.rb: turn off FIPS mode for tests. This prevents
+ OpenSSL installations with FIPS mode enabled by default from raising
+ FIPS-related errors during the tests.
+ * test/openssl/test_fips.rb: add tests for FIPS-capable OpenSSL
+ installations.
+ [Feature #6946] [ruby-core:47345]
- * dir.c (glob_helper): get rid of possible memory leak.
+Thu Dec 20 06:59:52 2012 Koichi Sasada <ko1@atdot.net>
- * win32/win32.c (cmdglob, rb_w32_cmdvector, rb_w32_opendir,
- rb_w32_get_environ): not to use GC before initialization.
+ * vm.c: support variable VM/Machine stack sizes.
+ Specified by the following environment variables:
+ - RUBY_THREAD_VM_STACK_SIZE: vm stack size used at thread creation.
+ default: 128KB (32bit CPU) or 256KB (64bit CPU).
+ - RUBY_THREAD_MACHINE_STACK_SIZE: machine stack size used at thread
+ creation. default: 512KB or 1024KB.
+ - RUBY_FIBER_VM_STACK_SIZE: vm stack size used at fiber creation.
+ default: 64KB or 128KB.
+ - RUBY_FIBER_MACHINE_STACK_SIZE: machine stack size used at fiber
+ creation. default: 256KB or 256KB.
+ This values are specified at launched timing. You can not change
+ these values at running time.
+ Environ variables are only *hints* because:
+ - They are aligned to 4KB.
+ - They have minimum values (depend on OSs).
+ - Machine stack settings are ignored by some OSs.
+ Default values especially fiber stack sizes are increased.
+ This change affect Fiber's behavior:
+ (1) You can run more complex program on a Fiber.
+ (2) You can not make many (thousands) Fibers because of
+ lack of address space (on 32bit CPU).
+ If (2) bothers you,
+ (a) Use 64bit CPU with big memory, or
+ (b) Specify RUBY_FIBER_(VM|MACHINE)_STACK_SIZE correctly.
+ You need to choose correct stack size carefully. These values
+ are completely rely on systems (OS/compiler and so on).
+ [Feature #4614], [Bug #7212]
-Wed Dec 6 19:53:41 2006 WATANABE Hirofumi <eban@ruby-lang.org>
+ * vm_core.h (rb_vm_t::default_params): add to record above settings.
- * configure.in (SITE_DIR): fixed to emtpy RUBY_SITE_LIB in config.h on
- NetBSD. fixed: [ruby-dev:29358]
+ * vm.c (RubyVM::DEFAULT_PARAMS): add new constant to see
+ above setting.
-Mon Dec 4 10:43:46 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread_pthread.c: support RUBY_THREAD_MACHINE_STACK_SIZE.
- * parse.y (dyna_init_gen): dvar initialization only if dvar is
- assigned inner block. [ruby-talk:227402]
+ * cont.c: support RUBY_FIBER_(VM|MACHINE)_STACK_SIZE.
-Mon Dec 4 10:22:26 2006 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
+ * test/ruby/test_fiber.rb: add tests for above.
- * stable version 1.8.5-p2 released.
+ * test/ruby/test_thread.rb: ditto.
-Sun Dec 3 17:11:12 2006 Shugo Maeda <shugo@ruby-lang.org>
+Thu Dec 20 06:25:44 2012 Koichi Sasada <ko1@atdot.net>
- * lib/cgi.rb (CGI::QueryExtension::read_multipart): should quote
- boundary. JVN#84798830
+ * test/ruby/test_fiber.rb: remove a strange single quote character.
+ With this character, this script exits by SyntaxError.
-Sun Nov 26 16:36:46 2006 URABE Shyouhei <shyouhei@ruby-lang.org>
+Thu Dec 20 01:03:00 2012 Zachary Scott <zachary@zacharyscott>
- * version.h: addition of RUBY_PATCHLEVEL.
- * version.c: ditto.
+ * ext/.document: Add missing ext modules to .document
+ Patch by Ryunosuke SATO [Fixes Github #224]
-Fri Nov 24 10:17:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 19 23:52:16 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * bignum.c (bignorm): avoid segmentation. a patch from Hiroyuki
- Ito <ZXB01226@nifty.com>. [ruby-list:43012]
+ * ruby.c (load_file_internal): use original C string as the filename
+ for parser.
+ reported by whiteleaf at [ruby-list:49085] [ruby-dev:46738]
+ [Bug #7562]
-Thu Nov 2 15:43:39 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Dec 19 23:36:12 2012 Naohisa Goto <ngotogenome@gmail.com>
- * parse.y (primary): should set NODE even when compstmt is NULL.
- merge from trunk. fixed: [ruby-dev:29732]
+ * marshal.c (marshal_dump, marshal_load): fix SEGV during make rdoc
+ and test failure in TestMarshal#test_gc and test_context_switch
+ on SPARC Solaris 10 compiled with Oracle Solaris Studio 12.3.
+ [Bug #7591] [ruby-dev:46772]
-Sat Sep 23 21:34:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 19 19:34:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/cgi.rb (CGI::QueryExtension::read_multipart): CGI content
- may be empty. a patch from Jamis Buck <jamis at 37signals.com>.
+ * object.c (rb_mod_const_get): nul byte is invalid as constant name.
-Mon Sep 4 21:43:57 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 19 17:54:18 2012 Masaya Tarui <tarui@ruby-lang.org>
- * ext/dbm/extconf.rb: create makefile according to the result of check
- for dbm header. fixed: [ruby-dev:29445]
+ * vm_trace.c (rb_threadptr_exec_event_hooks): get rid of race
+ condition. [Bug #7589] [ruby-dev:46763]
-Tue Aug 29 19:10:10 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 19 16:30:28 2012 Eric Hodel <drbrain@segment7.net>
- * hash.c (rb_hash_s_create): fixed memory leak, based on the patch
- by Kent Sibilev <ksruby at gmail.com>. fixed: [ruby-talk:211233]
+ * doc/syntax/literals.rdoc: Added 0d decimal format. Thanks Nobu!
-Fri Aug 25 17:15:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 19 16:19:36 2012 Eric Hodel <drbrain@segment7.net>
- * stable version 1.8.5 released.
+ * doc/syntax/methods.rdoc: Fixed typo. Thanks to Josh Susser.
-Fri Aug 25 17:02:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 19 16:18:22 2012 Eric Hodel <drbrain@segment7.net>
- * gc.c (gc_sweep): typo fixed.
+ * lib/rubygems/commands/query_command.rb: Refactored to improve
+ maintainability.
+ * test/rubygems/test_gem_commands_query_command.rb: Note default gems
+ in gem list details.
-Tue Aug 22 18:47:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rubygems/uninstaller.rb: Detect all gems for uninstallation.
+ This allows duplicate installs of default gems to be removed.
+ * lib/rubygems/specification.rb: Allow use of ::each_spec.
+ * lib/rubygems/test_case.rb: Added install_default_gems.
+ * test/rubygems/test_gem_commands_uninstall_command.rb: Moved test
+ down to the uninstaller tests.
+ * test/rubygems/test_gem_uninstaller.rb: Test for uninstallation of
+ default gems and duplicate default gems.
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::handle_method):
- rdoc documents C module methods as instance methods. a patch in
- [ruby-core:08536].
+Wed Dec 19 15:23:50 2012 Eric Hodel <drbrain@segment7.net>
-Sat Aug 19 14:15:02 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * doc/syntax/methods.rdoc: Add () around keyword arguments example for
+ consistency. Thanks to Josh Susser.
- * win32/Makefile.sub (config.status): include winsock2.h instead of
- winsock.h when --with-winsock2 is specified.
- fixed: [ruby-dev:29296]
+Wed Dec 19 01:51:24 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Sat Aug 19 11:28:08 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (rb_vm_jump_tag_but_local_jump): remove unnecessary 2nd
+ argument.
- * file.c (rb_file_s_rename): use errno if set properly.
- fixed: [ruby-dev:29293]
+ * load.c (rb_load_internal): ditto.
-Sat Aug 19 11:09:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * eval_intern.h (rb_vm_jump_tag_but_local_jump): ditto.
- * parse.y (then): remove semicolon warning. [ruby-dev:29299]
+Tue Dec 18 18:57:58 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Aug 17 19:15:16 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_io_wait_writable): don't use rb_thread_wait_fd()
+ because it is for waiting until io readable.
- * file.c (rb_stat_[rRwWxX]): check for super user.
- fixed: [ruby-core:08616]
+ * io.c (rb_io_wait_writable): always use rb_thread_fd_writable()
+ instead of bare rb_wait_for_single_fd(). we shouldn't ignore
+ return value.
+ * io.c (rb_io_wait_readable): ditto. always use rb_thread_wait_fd().
-Thu Aug 17 14:47:06 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 18 18:55:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/mkmf.rb: added rdoc by Daniel Berger. [ruby-core:08177]
+ * thread.c (rb_thread_wait_fd_rw): fix infinite loop bug.
+ rb_wait_for_single_fd() never return positive number.
-Thu Aug 17 00:39:05 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Dec 18 17:24:40 2012 Eric Hodel <drbrain@segment7.net>
- * lib/rinda/ring.rb (do_reply): Fix for RingServer fails to find a
- TupleSpace when TupleSpace resides in the same ruby process with
- RingServer. a patch from Kent Sibilev. [ruby-core:08453]
+ * lib/rdoc/encoding.rb: Do not remove #! line from document when
+ setting encoding. This allows ruby executables to be parsed as ruby
+ files.
+ * test/rdoc/test_rdoc_encoding.rb: Test for above.
-Wed Aug 16 11:45:36 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rdoc/parser.rb: Set the parser file name of ruby executables
+ correctly.
+ * test/rdoc/test_rdoc_parser.rb: Test for above.
+
+Tue Dec 18 16:46:15 2012 Eric Hodel <drbrain@segment7.net>
+
+ * doc/syntax/literals.rdoc: Used simplified heredoc example that
+ doesn't include method definition. Added heredoc with backticks.
+
+Tue Dec 18 16:38:51 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/store.rb: Work around RDoc stores from older versions of
+ RDoc.
+ * test/rdoc/test_rdoc_store.rb: Test for above.
- * process.c (proc_setuid, proc_setgid, proc_seteuid, proc_setegid):
- get rid of bogus implementations on Mac OS X.
+Tue Dec 18 16:31:20 2012 Eric Hodel <drbrain@segment7.net>
-Tue Aug 15 19:10:18 2006 Eric Hodel <drbrain@segment7.net>
+ * lib/rdoc/ruby_lex.rb: Return a TkHEREDOC instead of a TkSTRING when
+ the heredoc identifier is followed by a line-end. This allows proper
+ display of some HEREDOCs in source view.
+ * lib/rdoc/ruby_token.rb: Added TkHEREDOC
+ * test/rdoc/test_rdoc_ruby_lex.rb: Test for above.
+
+Tue Dec 18 09:45:14 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * vm.c (rb_vm_make_jump_tag_but_local_jump): take care of the case
+ TAG_JUMP() with TAG_FATAL (ex. rb_fatal()). [ruby-core:50917]
+ [Bug #7570]
+
+ * test/ruby/test_fiber.rb (test_fatal_in_fiber): add a test for above.
+
+ * ext/-test-/fatal/extconf.rb, ext/-test-/fatal/rb_fatal.c: ditto.
+
+Tue Dec 18 13:17:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * vm_trace.c (tracepoint_attr_defined_class): Clean up rdoc for
+ TracePoint#defined_class
+
+Tue Dec 18 12:15:59 2012 Eric Hodel <drbrain@segment7.net>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#find_class_comment): Fix
- broken class-level documentation.
+ * lib/rubygems/specification.rb: Fixed ruby output of requirements
+ with multiple version specifiers.
+ * test/rubygems/test_gem_ext_cmake_builder.rb: Only look for specific
+ lines in cmake output. Should fix [ruby-trunk - Bug #7579]
-Wed Aug 16 11:09:26 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 18 11:45:26 2012 Eric Hodel <drbrain@segment7.net>
- * ruby.c (set_arg0): fill argv other than the first with an empty
- string instead of NULL.
+ * doc/syntax/literals.rdoc: Added 0o octal integers.
-Wed Aug 16 11:08:00 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 18 12:28:52 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
- * win32/win32.h: removed an excess macro. fixed: [ruby-dev:29258]
+ * test/openssl/test_ssl.rb: Use :TLSv1_2_client explicitly in
+ test_tls_v1_2 to prevent upstream bug.
+ [Bug #7197] [ruby-dev:46240]
-Tue Aug 8 23:49:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Dec 18 11:52:34 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
- * lib/irb/extend-command.rb (IRB::ExtendCommandBundle): pacify
- RDoc. a patch from Eric Hodel <drbrain at segment7.net>.
- [ruby-core:08522]
+ * ext/openssl/lib/ssl.rb: Enable insertion of empty fragments as a
+ countermeasure for the BEAST attack by default. The default options
+ of OpenSSL::SSL:SSLContext are now:
+ OpenSSL::SSL::OP_ALL & ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS
+ [Bug #5353] [ruby-core:39673]
-Tue Aug 8 11:32:54 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/openssl/test_ssl.rb: Adapt tests to new SSLContext default.
- * Makefile.in, common.mk, configure.in: fix for platforms without
- rm. patches from Yutaka kanemoto <kinpoco at gmail.com>.
- [ruby-dev:29215]
+ * NEWS: Announce the new default.
-Mon Aug 7 17:56:59 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Dec 18 06:36:12 2012 Koichi Sasada <ko1@atdot.net>
- * ext/bigdecimal/bigdecimal.c, ext/digest/rmd160/rmd160ossl.c,
- ext/digest/sha1/sha1ossl.c, ext/readline/readline.c: move
- incluion of config.h to pacify AIX. a patch from Yutaka
- Kanemoto <kinpoco at gmail.com>. [ruby-dev:29197]
+ * method.h: remove `VM_METHOD_TYPE_CFUNC_FRAMELESS' method type.
+ This method type is for optimized CFUNC such as Fixnum#+ and so on.
+ This feature is half-baked and no way to use them.
+ [Background]
+ Now, VM has opt_plus instructions to optimize `+' methods for
+ some Classes (such as Fixnum, Float (flonum)). We call this
+ type of instructions as `specialized instructions'.
+ This simple technique improve simple program dramatically.
+ However, we can make specialized instructions for only several
+ types (classes) and selectors (method names) because a large
+ instruction will be slow. In other words, this technique has no
+ extensibility.
+ To overcome this problem, VM_METHOD_TYPE_CFUNC_FRAMELESS was
+ introduced (r37198). This type is a variant of CFUNC, but called
+ their functions directly without building a method frame.
+ Any CFUNC method can be defined as frameless methods if a method
+ is not needed to make method frame. Frameless methods are faster
+ as specialized instructions (a bit slower, but no need to care).
+ No problem described at
+ http://charlie.bz/blog/why-do-singleton-methods-make-ruby-slow
+ because this technique doesn't see class, but see method body
+ itself. Alias is also no problem.
+ [Problem]
+ However, we can't set frameless method type for polymorphic methods
+ such as Array#[]. Necessity for method frame depends on which
+ parameter type. For example, Fixnum#+ needs method frame if
+ coerce is needed. Current VM_METHOD_TYPE_CFUNC_FRAMELESS is not
+ flexible and need more tuning to introduce it.
+ Expected behavior of frameless method type may be:
+ result = optimized_cfunc(params); /* call optimized cfunc */
+ if (result == Qundef) { result = normal_cfunc(); }
+ This is why I say this feature is half-baked.
+ We need to learn primitive method in Smalltalk more.
+ (I heard this name at RubyConf Taiwan this month. Thanks!)
+ [Conclusion]
+ I remove this feature and consider again.
+ This feature goes to next minor (2.1?).
+ Nobody may use this feature and there is no compatibility issue.
-Mon Aug 7 15:55:08 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * proc.c (rb_method_entry_arity): ditto.
- * ext/syck/syck.c (syck_move_tokens): should avoid negative
- memmove. [ruby-list:42625]
+ * vm_eval.c, vm_insnhelper.c, vm_method.c: ditto.
-Mon Aug 7 14:37:48 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Dec 18 04:58:22 2012 Koichi Sasada <ko1@atdot.net>
- * configure.in, common.mk: AIX link issue. a patch from Yutaka
- Kanemoto <kinpoco at gmail.com>. [ruby-dev:29190]
+ * vm_trace.c (fill_id_and_klass): TracePoint#defined_class returns
+ singleton class. `set_trace_func' passed attached class (which is
+ attached/modified by singleton class) by 6th block parameter if it
+ is singleton class. Previous behavior follows this spec.
+ However, this method named `defined_class' should return singleton
+ class directly because singleton methods are defined in singleton
+ class. There are no compatible issue because TracePoint is introduced
+ after 2.0.
+ But compatibility with `set_trace_func' is broken. This means that
+ you can not replace all `set_trace_func' code with TracePoint
+ without consideration of this behavior.
+ [Bug #7554]
- * ext/socket/socket.c: AIX socket support. [ruby-dev:29190]
+ * test/ruby/test_settracefunc.rb: change a test to catch up
+ an above change.
-Mon Aug 7 12:05:28 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Dec 18 03:03:10 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * dln.c, eval.c, gc.c, regex.c, ruby.h: shut up AIX alloca
- warning. a patch from Yutaka Kanemoto <kinpoco at gmail.com>.
- [ruby-dev:29191]
+ * ext/psych/lib/psych/visitors/to_ruby.rb: speed up node mapping so
+ common cases are evaluated first. Thanks Kevin Menard!
-Sun Aug 6 20:40:41 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Tue Dec 18 02:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * lib/date/format.rb (str[fp]time): %[EO]U didn't denote %U.
+ * lib/optparse.rb: Remove 'developer documentation' section from rdoc
+ Patch by Marcus Stollsteimer [ruby-core:50526][Bug #7504]
-Sat Aug 5 17:07:43 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Dec 18 02:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * parse.y (top_local_setup): local_vars[-1] should point
- ruby_scope itself to protect local_tbl from garbage collection.
- [ruby-dev:29049]
+ * lib/matrix.rb (#lup): typo in example [ruby-core:50946][Bug #7582]
-Sat Aug 5 13:54:03 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Dec 17 18:03:34 2012 Charlie Somerville <charlie@charliesomerville.com>
- * lib/date/format.rb (str[fp]time): "%\n" means "\n".
+ * class.c (rewrite_cref_stack, clone_method): rewrite a method's cref
+ stack when cloning into a new class to allow lexical const lookup to
+ work as expected [ruby-core:47834] [Bug #7107]
+ * test/ruby/test_class.rb (class TestClass): related test
-Fri Aug 4 15:21:00 2006 Eric Hodel <drbrain@segment7.net>
+Mon Dec 17 13:56:55 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (io_flush_buffer_sync2): avoid to return 0. because
+ rb_thread_call_without_gvl2 uses 0 internally.
+ * io.c (io_flush_buffer_async2): adapt the above.
+
+Mon Dec 17 12:05:32 2012 Eric Hodel <drbrain@segment7.net>
+
+ * doc/syntax/methods.rdoc: Added a description of singleton methods.
+
+Mon Dec 17 11:35:57 2012 Eric Hodel <drbrain@segment7.net>
- * lib: Merge RDoc and .document from HEAD.
- * lib/drb/ssl.rb: Close socket on SSLError [ruby-core:7197]
+ * doc/.document: Added doc/syntax
+
+Mon Dec 17 11:25:32 2012 Eric Hodel <drbrain@segment7.net>
+
+ * doc/syntax.rdoc: Added syntax guide table of contents
+ * doc/syntax/exceptions.rdoc: Syntax guide for exceptions
+ * doc/syntax/literals.rdoc: Syntax guide for literals
+ * doc/syntax/methods.rdoc: Syntax guide for methods
+
+Mon Dec 17 07:59:40 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems.rb: Updated VERSION
+
+ * test/rubygems/test_gem_installer.rb: Fixed ambiguous first argument
+ warning.
-Fri Aug 4 19:13:41 2006 Keiju Ishitsuka <keiju@ruby-lang.org>
+ * test/rubygems/test_gem_rdoc.rb: RDoc generation depends on installed
+ version of RDoc.
- * lib/irb/{init.rb,ruby-lex.rb,slex.rb}: can't input '\c' for
- [ruby-core: 7122].
+Sun Dec 16 02:04:41 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Aug 4 14:02:14 2006 James Edward Gray II <james@grayproductions.net>
+ * signal.c (rb_sigaltstack_size): cast sysconf() return value
+ explicitly. Fix compile error on Mac OS X.
- * lib/date/format.rb (__strptime, strftime): allow multi-line patterns
- in Date#strftime the same as Time#strftime accepts.
- fixed: [ruby-core:08466]
+Sun Dec 16 00:39:43 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Fri Aug 4 13:56:51 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * cont.c (rb_fiber_start): don't enqueue Qnil to async_errinfo_queue.
+ rb_vm_make_jump_tag_but_local_jump() could return Qnil (ex. when
+ finished by Thread.exit). [ruby-dev:45218] [Bug #5993]
- * pack.c (pack_pack): check argument overrun for 'P'. based on a
- patch by rucila <rucila at yahoo.cojp>. fixed: [ruby-dev:29182]
+ * test/ruby/test_fiber.rb (test_exit_in_fiber): add test for it.
-Tue Aug 1 17:44:03 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 15 23:56:51 2012 Naohisa Goto <ngotogenome@gmail.com>
- * win32/win32.c (init_stdhandle): assign standard file handles.
+ * ext/fiddle/pointer.c (rb_fiddle_ptr2cptr): fix error message
+ forgotten to be changed from DL to Fiddle.
-Tue Aug 1 12:24:58 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 15 23:14:32 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (Init_Binding): fix old commit miss.
+ * signal.c (default_handler): remove rb_register_sigaltstack()
+ call. sigaltstack was already registered when creating threads.
-Mon Jul 31 17:08:20 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Dec 15 23:08:56 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * win32/win32.c (exit_handler): new function; release winsock and
- environment work area.
+ * signal.c (rb_sigaltstack_size): new. calculate stack size for
+ sigsegv handler. enlarge value when x86 or x86_64 on Linux.
+ Linux has very small MINSIGSTKSZ size (2048 bytes) and
+ our sigsegv routine need 5KiB at least. [Bug #7141]
+ * internal.h: add declaration of rb_sigaltstack_size().
+ * vm_core.h: remove ALT_STACK_SIZE definition.
- * win32/win32.c (NTInitialize): setup exit_handler.
+ * signal.c (rb_register_sigaltstack): replace ALT_STACK_SIZE with
+ rb_sigaltstack_size();
+ * gc.c (Init_heap): ditto.
+ * vm.c (th_init): ditto.
- * win32/win32.c (StartSockets): use exit_handler.
+Sat Dec 15 18:24:21 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * win32/win32.c (rb_w32_getenv): use GetEnvironmentStrings() instead
- of GetEnvironmentVariable(), because the latter cannot distinguish
- wheather a null environment variable exists or not.
- fixed: [ruby-talk:205123]
+ * rational.c (f_round_common): should check overflow.
-Mon Jul 31 16:15:13 2006 Tanaka Akira <akr@fsij.org>
+Sat Dec 15 18:00:00 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * test/ruby/test_process.rb (TestProcess#test_rlimit_nofile):
- setrlimit may fail with EINVAL.
- reported by MIYAMUKO Katsuyuki. [ruby-dev:29174]
+ * rational.c (float_rationalize): reduced.
-Mon Jul 31 13:38:22 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Dec 15 14:18:44 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/webrick/httprequest.rb (WEBrick::HTTPReuqest#parse_uri): improve
- for the value of IPv6 address in the Host: header field.
+ * io.c (finish_writeconv): uses rb_write_internal2 if
+ fptr->write_lock have.
-Mon Jul 31 09:22:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 15 13:57:08 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ruby.h: use ifdef (or defined) for macro constants that may or
- may not be defined to shut up gcc's -Wundef warnings.
- [ruby-core:08447]
+ * thread.c (rb_mutex_owned_p): remove static.
+ * io.c (io_flush_buffer): don't hold mutex if already have.
+ Now recursive lock may occur when following scenario.
+ fptr_finalize -> finish_writeconv_sync -> finish_writeconv
+ -> io_fflush.
-Sun Jul 30 23:26:22 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 15 13:38:30 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (rb_call0): trace call/return of method defined from block.
- fixed: [ruby-core:08329]
+ * io.c (io_flush_buffer): uses io_flush_buffer_async2 instead of
+ io_flush_buffer_async.
+ * io.c (io_flush_buffer_async2): new helper function for
+ io_flush_buffer. It uses rb_thread_call_without_gvl2() instead
+ of rb_thread_io_blocking_region.
+ * io.c (io_flush_buffer_sync2): new helper function for
+ io_flush_buffer_async2.
- * eval.c (rb_trap_eval): make the current thread runnable to deal with
- exceptions which occurred within the trap. fixed: [ruby-dev:27729]
+Sat Dec 15 13:04:26 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/cgi/session.rb, lib/cgi/session/pstore.rb: suppress warnings.
- fixed: [ruby-talk:204896]
+ * io.c (internal_write_func2): new helper function for rb_write_internal2().
+ * io.c (rb_write_internal2): new function. it uses
+ rb_thread_call_without_gvl2() instead of rb_thread_io_blocking_region().
+ * io.c (rb_binwrite_string): uses rb_write_internal2 instead of
+ rb_write_internal. [Bug #7134]
-Sat Jul 29 06:12:06 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat Dec 15 12:55:29 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/tk/lib/multi-tk.rb: freeze ip_name for security reason.
+ * io.c (rb_io_wait_writable): add to call rb_thread_wait_fd()
+ likes rb_io_wait_readable.
-Sat Jul 29 01:23:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 15 11:54:50 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/logger.rb: improves the amount of documentation that Rdoc
- picks up when processing logger.rb by moving the require
- statement back before the comment block. a patch from Hugh
- Sasse <hgs at dmu.ac.uk>. [ruby-core:08422]
+ * io.c (rb_io_wait_writable): don't call rb_thread_fd_writable()
+ when EINTR. EINTR mean signal interrupt was happen. We don't
+ need any wait.
-Thu Jul 27 22:21:52 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 15 11:53:36 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * time.c (time_to_s): fixed format mismatch.
+ * thread.c (rb_thread_wait_fd_rw): remove silly rb_thread_alone()
+ check.
-Thu Jul 27 21:19:54 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 15 10:22:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * math.c (domain_check): a new function to check domain error
- explicitly for systems that return NaN like FreeBSD.
- [ruby-core:07019]
+ * thread.c (rb_thread_polling): revert but deprecate.
- * math.c (math_acos, math_asin, math_acosh, math_atanh, math_log,
- math_log10, math_sqrt): use domain_check().
+ * include/ruby/intern.h (rb_thread_polling): deprecate.
- * math.c (math_sqrt): fix documentation flaw.
+Sat Dec 15 08:37:01 2012 Masaya Tarui <tarui@ruby-lang.org>
-Thu Jul 27 18:12:12 2006 WATANABE Hirofumi <eban@ruby-lang.org>
+ * test/rubygems/test_gem_ext_cmake_builder.rb (test_self_build):
+ get rid of false positive.
- * time.c: need to declare time_utc_offset.
+Sat Dec 15 08:05:56 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Jul 27 17:01:01 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_thread.rb (test_uninitialized, test_backtrace,
+ test_thread_timer_and_interrupt, test_thread_join_in_trap,
+ test_thread_join_current, test_thread_join_main_thread,
+ test_main_thread_status_at_exit, test_thread_status_in_trap,
+ test_thread_status_raise_after_kill, test_mutex_owned,
+ test_mutex_owned2): move these tests from TestThreadGroup class
+ to TestThread because they are not thread group tests.
- * io.c (io_close): always calls "close" method of the receiver.
- [ruby-core:6911] [ruby-core:8112]
+ * test/ruby/test_thread.rb (test_thread_status_raise_after_kill):
+ add t.join.
-Thu Jul 27 16:49:01 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_threadgroup.rb: new file. moved ThreadGroup test
+ from test_thread.rb.
- * time.c (time_to_s): use +0900 style timezone string for local time.
- [ruby-dev:29143]
+Sat Dec 15 08:02:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Jul 27 16:41:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_thread.rb (TestThread::Thread::new.): remove
+ th.abort_on_exception change. Test template shouldn't change
+ global flag. It prevent to test a normal case.
- * ext/openssl/ossl.h: move <ruby.h> inclusion point to shut up
- Solaris compiler. [ruby-core:08114]
+Sat Dec 15 06:15:14 2012 Eric Hodel <drbrain@segment7.net>
-Wed Jul 26 22:20:59 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in (HAVE_GCC_ATOMIC_BUILTINS): Set -march=i486 to enable
+ __sync_val_compare_and_swap. Patch by KOSAKI Motohiro.
+ [ruby-trunk - Bug #7485]
- * configure.in: add support for as and ASFLAGS. [ruby-dev:29138]
+Sat Dec 15 03:42:34 2012 Naohisa Goto <ngotogenome@gmail.com>
-Wed Jul 26 22:13:45 2006 Minero Aoki <aamine@loveruby.net>
+ * ext/.document: add fiddle/pointer.c, fiddle/handle.c, and
+ fiddle/win32/lib as documentation.
- * lib/net/http.rb: sync with HEAD (rev 1.132).
+Sat Dec 15 03:06:40 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/net/http.rb (Net::HTTP#post, request_post, request): should
- set Content-Type: x-www-form-urlencoded by default.
+ * file.c (rb_file_flock): use rb_thread_wait_for() instead of
+ rb_thread_polling(). When getting EAGAIN, we need to wait a
+ while even if no multi threading.
+ * thread.c (sleep_for_polling, rb_thread_polling) removed.
- * lib/net/http.rb (Net::HTTPHeader#content_type): should return
- nil when there's no Content-Type.
+Sat Dec 15 00:03:31 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/net/http.rb (Net::HTTPHeader#sub_type): should return nil
- when there's no sub Content-Type (e.g. "Content-Type: text").
+ * signal.c (rb_f_kill): remove rb_thread_polling() because this
+ has no good effect and makes meaningless 100ms delay. 1)
+ when sending signal to another process, waiting has just silly.
+ 2) when sending signal to current process, 100ms is often not
+ enough time to wait. It depend on kernel behavior. And,
+ rb_thread_polling() doesn't make sense anyway. When rb_thread_alone()
+ is true, it doesn't wait at all and Process.kill() users don't
+ expect threading changes Process.kill() behavior. [Bug #7560]
- * lib/net/http.rb (Net::HTTPHeader#type_params): wrongly failed
- when there's no Content-Type.
+Fri Dec 14 17:10:57 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 26 18:35:38 2006 Minero Aoki <aamine@loveruby.net>
+ * parse.y (parser_params): parser_tokline to track the line number at
+ which token started. [ruby-dev:46737] [Bug #7559]
- * ext/strscan/strscan.c: sync with HEAD (rev 1.25).
+ * parse.y (fcall): operation with starting line number.
- * ext/strscan/strscan.c (strscan_do_scan):
- StringScanner.new("").scan(//) should return "". [ruby-Bugs:4361]
+ * parse.y (command, primary, method_call): point method name line.
-Wed Jul 26 18:14:19 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (gettable_gen): return token line for __LINE__.
- * ext/pty/pty.c (getDevice): retry once after GC on failure.
- [ruby-core:08282]
+Fri Dec 14 16:56:59 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed Jul 26 17:28:16 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_super_method): remove volatile introduced
+ in r38365.
- * sprintf.c (rb_f_sprintf): prepend ".." to %u for negative bignum,
- but not "-". fixed: [ruby-core:08167]
+ * vm_insnhelper.c (vm_call_method): use __forceinline to prevent
+ VC++ to make vm_call_general and vm_call_super_method as the same
+ method. Thanks, Heesob Park. [Bug #7556] [ruby-core:50867]
-Wed Jul 26 16:39:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Dec 14 14:59:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_scan): add string modification check.
- [ruby-core:7216]
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_separately):
+ take file and line by using caller_locations if not given.
-Wed Jul 26 16:06:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_separately):
+ count assertions in separated tests.
- * lib/cgi.rb (CGI::QueryExtension::read_multipart): check
- multipart boundary end. a patch from Fujioka <fuj at rabbix.jp>
- [ruby-dev:28470]
+Fri Dec 14 14:16:42 2012 Eric Hodel <drbrain@segment7.net>
-Wed Jul 26 01:02:59 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rdoc/rubygems_hook.rb: Fixed generation of documentation.
+ Disabled rdoc generation by default to match RubyGems defaults.
+ Reduced diff with RubyGems::RDoc.
+ * test/rdoc/test_rdoc_rubygems_hook.rb: Tests for the above.
+ * test/rubygems/test_gem_rdoc.rb: ditto.
- * configure.in: suppress warnings by automake 1.8 or later.
+ * lib/rdoc/store.rb: Removed useless variable assignment
-Tue Jul 25 00:30:06 2006 Eric Hodel <drbrain@segment7.net>
+Fri Dec 14 13:58:40 2012 Eric Hodel <drbrain@segment7.net>
- * lib/prettyprint.rb: RD to RDoc conversion by Hugh Sasse.
+ * lib/rubygems/commands/rdoc_command.rb: When overwriting
+ documentation, remove existing documentation first.
-Tue Jul 25 14:49:51 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/rubygems/server.rb: Fixed documentation links.
+ * test/rubygems/test_gem_server.rb: Test for the above.
- * lib/mkmf.rb (configuration): typo.
+ * lib/rubygems/rdoc.rb: Reduced diff with RDoc::RubyGemsHook
+ * test/rubygems/test_gem_rdoc.rb: ditto
-Tue Jul 25 13:14:32 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Dec 14 04:08:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * process.c (rb_proc_times): rename hz to hertz to avoid name
- crash on AIX. [ruby-dev:29126]
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_separately):
+ added to execute given test source on separate process,
+ catch its resulted exception and raise it on main process.
-Mon Jul 24 22:03:40 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 14 07:43:44 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * eval.c (backtrace): skip frames successive on node and method name.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: quote strings that begin
+ with non-word characters. Thanks Alex Tambellini!
+ * test/psych/test_yaml.rb: appropriate test case
-Mon Jul 24 17:55:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Dec 13 23:14:17 2012 Shugo Maeda <shugo@ruby-lang.org>
- * process.c (rb_f_system): add security check. [ruby-talk:202947]
+ * vm_insnhelper.c (vm_call_super_method): a workaround for the
+ failure of TestRefinement#test_refine_recursion in Windows.
+ See [ruby-core:50871] for details.
- * process.c (rb_f_system): move signal right before fork to avoid
- signal handler intervention.
+Thu Dec 13 23:10:52 Charlie Somerville <charlie@charliesomerville.com>
-Mon Jul 24 15:51:52 2006 Tanaka Akira <akr@fsij.org>
+ * object.c (Init_Object): use rb_mod_init_copy for Class#initialize_copy
+ * class.c (rb_class_init_copy): rename to class_init_copy_check, performs type
+ checks on arguments to prevent reinitialization of initialized class
+ [ruby-core:50869] [Bug #7557]
+ * class.c (rb_mod_init_copy): use class_init_copy_check if receiver is T_CLASS
+ * test/ruby/test_class.rb (class TestClass): related test
- * ext/readline/readline.c (readline_readline): rl_deprep_term_function
- may be NULL with libedit. reported by Ryan Davis. [ruby-dev:29070]
+Thu Dec 13 16:53:10 2012 Eric Hodel <drbrain@segment7.net>
-Mon Jul 24 15:19:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rdoc/class_module.rb: Fixed duplicate comments for classes and
+ modules from C.
+ * test/rdoc/test_rdoc_class_module.rb: Test for the above.
- * eval.c (rb_call0): revert last change. [ruby-dev:29112]
- [ruby-core:08374]
+ * lib/rdoc/parser/c.rb: Reload C variable names to allow proper
+ updates of an ri store for C files.
+ * lib/rdoc/rdoc.rb: ditto.
+ * lib/rdoc/store.rb: ditto.
+ * test/rdoc/test_rdoc_parser_c.rb: Test for the above.
+ * test/rdoc/test_rdoc_store.rb: ditto.
-Sun Jul 23 22:59:49 2006 Tanaka Akira <akr@fsij.org>
+Thu Dec 13 14:20:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * test/socket/test_unix.rb: disabled on cygwin.
- reported by Kouhei Yanagita. [ruby-dev:29080]
+ * lib/irb*: merge doc from doc/irb/ird.rd and improve overall
+ documentation of IRB
+ * doc/irb/irb.rd: remove stale documentation
-Fri Jul 21 21:21:08 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 13 14:10:00 2012 Shugo Maeda <shugo@ruby-lang.org>
- * eval.c (rb_call0): include funcalled methods in caller list.
- fixed: [ruby-core:08290]
+ * marshal.c (r_entry0): don't taint classes and modules because
+ Marshal.load just returns the dumped classes and modules.
+ [Bug #7325] [ruby-core:49198]
-Fri Jul 21 12:11:00 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_marshal.rb: related test.
- * ext/extmk.rb, lib/mkmf.rb (with_destdir): remove drive letter before
- prepending destdir on DOSISH.
+Thu Dec 13 14:10:13 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Jul 20 15:07:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_require.rb (TestRequire#test_loaded_features_encoding):
+ need to check compatibility, not equality of encodings.
- * ruby.h: export classes/modules to implement sandbox.
- [ruby-core:08283]
+Thu Dec 13 14:02:15 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Jul 20 00:06:29 2006 Keiju Ishitsuka <keiju@ishitsuka.com>
+ * file.c (rb_file_join): check encoding compatibility before joining
+ strings.
- * lib/irb/completion.rb: support for completion of numeric
- number. [ruby-dev: 29038]
+Thu Dec 13 13:06:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 19 23:53:05 2006 Kouhei Sutou <kou@cozmixng.org>
+ * proc.c (umethod_bind): allow another form of method transplanting
+ from a module via UnboundMethod. [ruby-core:34267][Feature #4254]
- * lib/rss/parser.rb, lib/rss/utils.rb: added documents.
+Thu Dec 13 12:07:25 2012 Shugo Maeda <shugo@ruby-lang.org>
-Tue Jul 18 22:10:13 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/ruby.h (RB_UNUSED_VAR): new macro to suppress
+ warnings for unused variables.
- * process.c (rb_f_system): block SIGCHLD during the process
- execution, like glibc system(3) does. [ruby-talk:202361]
+ * ext/bigdecimal/bigdecimal.c (ENTER): use RB_UNUSED_VAR() to
+ suppress annoying warnings by -Wunused-but-set-variable in gcc 4.6.
-Tue Jul 18 23:12:14 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Dec 13 11:22:33 2012 Koichi Sasada <ko1@atdot.net>
- * win32/win32.c (open_ifs_socket): should not use plain malloc.
+ * method.h: remove "VM_METHOD_TYPE__MAX" from rb_method_type_t.
+ rb_method_type_t is not a number and "_MAX" causes misunderstanding.
- * win32/win32.c (rb_w32_opendir): should not use plain realloc.
+ * proc.c (rb_method_entry_arity): ditto.
-Tue Jul 18 18:05:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_eval.c (vm_call0_body): ditto.
- * test/ruby/test_float.rb (TestFloat::test_strtod): update test to
- conform strtod change.
+ * vm_insnhelper.c (vm_call_method): ditto.
-Tue Jul 18 15:49:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 12 21:40:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * pack.c (pack_unpack): propagate association array to copied
- string. [ruby-core:08223]
+ * lib/tmpdir.rb (Dir::Tmpname#create): deal with a prefix name which
+ starts with tilde as a plain name, not expanding as home directory.
+ [ruby-core:50793] [Bug #7547]
- * pack.c (pack_unpack): return referenced string itself if it has
- same length as specified. a patch from <nobu at ruby-lang.org>
- in [ruby-core:08225].
+Wed Dec 12 19:48:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * pack.c (pack_pack): taint 'p' packed strings.
+ * ext/json: merge JSON 1.7.5.
+ fix tests and other fixes.
-Tue Jul 18 14:03:02 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 12 18:30:29 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer::unmount): remove
- inpect argument from sprintf. [ruby-dev:29039]
+ * class.c (rb_prepend_module): move refined methods from the origin
+ of a class to the class, because refinements should have priority
+ over prepended modules.
-Tue Jul 18 10:53:37 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_refinement.rb: related test.
- * object.c (rb_cstr_to_dbl): limit out-of-range message.
+Wed Dec 12 18:27:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * util.c (ruby_strtod): return end pointer even if ERANGE occurred.
- fixed: [ruby-dev:29041]
+ * time.c (zone_str): lookup or insert by using st_update() at once.
-Mon Jul 18 00:43:05 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 12 15:30:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * util.c (ruby_strtod): stop at dot not followed by digits.
- fixed: [ruby-dev:29035]
+ * configure.in: add -fno-omit-frame-pointer if libexecinfo is used.
+ At least on FreeBSD ruby will crash on getting C backtrace
+ when it is compiled with other than -O0.
-Tue Jul 18 00:01:27 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_dump.c: enable backtrace on FreeBSD even if with optimizations.
- * ext/extmk.rb: remove LIBRUBY_SO if static linked extensions exist.
+Wed Dec 12 16:08:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jul 17 23:30:46 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/rdoc/test_rdoc_rdoc.rb (TestRDocRDoc#test_normalized_file_list_non_file_directory):
+ use File::NULL for portability if possible.
- * configure.in (rb_cv_msvcrt): defaulted to msvcrt. Workaround for a
- bug of cygwin 1.5.20.
+Wed Dec 12 16:07:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jul 17 13:43:05 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * method.h (rb_method_flag_t): name a magic number for NOEX_SAFE and
+ NOEX_WITH as NOEX_SAFE_SHIFT_OFFSET.
- * pack.c (define_swapx): should not use plain malloc.
+ * method.h (rb_method_type_t, method_optimized_type): C89 forbids a
+ comma after the last element in enum.
-Mon Jul 17 12:58:41 2006 WATANABE Hirofumi <eban@ruby-lang.org>
+ * proc.c (rb_method_entry_arity), vm_eval.c (vm_call0_body),
+ vm_insnhelper.c (vm_call_method): add VM_METHOD_TYPE__MAX case.
- * configure.in: should use ac_cv_lib_dl_dlopen=no on MinGW.
+Wed Dec 12 14:16:35 2012 Eric Hodel <drbrain@segment7.net>
-Sat Jul 15 23:50:12 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rdoc/class_module.rb: Added RDoc::ClassModule#documented? which
+ checks comment_location. Hide RDoc::ClassModule#comment=.
+ * test/rdoc/test_rdoc_class_module.rb: Test for above.
- * eval.c (rb_require_safe): wait for another thread requiring the same
- feature. fixed: [ruby-core:08229]
+ * lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml:
+ Fix display of the table of contents in the sidebar.
-Sat Jul 15 01:27:13 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rdoc/generator/template/darkfish/table_of_contents.rhtml:
+ Use #comment_location when displaying classes or modules.
- * dir.c (has_magic): glob names contain alphabets to enable case fold
- search also for directories. fixed: [ruby-talk:201917]
+ * test/rdoc/test_rdoc_store.rb: Use comment_location.
-Sat Jul 15 01:09:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 12 13:40:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * st.c (malloc): use xmalloc/xcalloc instead of plain
- malloc/calloc, to detect memory allocation failure. see
- <http://www.nongnu.org/failmalloc/>.
+ * vm_insnhelper.c (vm_getivar): no uninitialized instance variables
+ warnings for non-object if attr method.
- * gc.c (rb_memerror): should not raise empty nomem_error.
+Wed Dec 12 06:43:37 2012 Benoit Daloze <eregontp@gmail.com>
-Fri Jul 14 13:08:13 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * iseq.c (rb_iseq_parameters): fix limit for optional arguments.
- * ext/tk/lib/tk.rb: add methods for new features of latest Tcl/Tk8.5.
+ * test/ruby/test_keyword.rb: tests for above.
- * ext/tk/lib/tk/namespace.rb: ditto.
+ * vm_core.h (struct rb_iseq_struct): update documentation
+ with keyword arguments. [Bug #7540] [ruby-core:50735]
-Fri Jul 14 02:30:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 12 03:45:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/monitor.rb: document patch from Hugh Sasse <hgs at dmu.ac.uk>.
- [ruby-core:08205]
+ * vm.c (vm_exec): pass exceptions while handling an exception.
-Fri Jul 14 01:09:46 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_trace.c (rb_threadptr_exec_event_hooks): propagate exceptions.
+ revert r38293 partially.
- * parse.y (then): error in warning action.
+Wed Dec 12 03:09:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 14 00:10:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * sample/test.rb (Progress#initialize): add --verbose option and show
+ messages in one line unless --verbose is given.
- * array.c (rb_ary_pop): may cause realloc oscillation. a patch
- from MORITA Naoyuki <mlgetter at kidou.sakura.ne.jp>.
- [ruby-dev:29028]
+Wed Dec 12 01:47:02 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Jul 13 22:23:56 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * eval.c (rb_using_refinement): make the method table of an iclass
+ for a refinement that of the refinement, not that of the origin of
+ the refinement, which is set by rb_include_class_new(). This
+ change is needed to make module prepend into a refinement work
+ properly.
- * ext/tk/lib/tk/composite.rb: improve handling of the classname on the
- option database for the widget class which includes TkComposite.
+ * test/ruby/test_refinement.rb: related test.
-Thu Jul 13 20:32:19 2006 Kouhei Sutou <kou@cozmixng.org>
+Wed Dec 12 01:05:04 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rss/parser.rb: updated documents by a patch from
- Hugh Sasse <hgs at dmu.ac.uk>. [ruby-core:8194]
+ * tool/make-snapshot: add --disable-rubygem to both MINIRUBY and RUBY.
+ On making miniprelude.c, it seems use MINIRUBY. this fixes #7541
+ but rubygems also needs to be fixed for older rubies.
-Wed Jul 12 13:54:09 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 12 00:32:11 2012 Naohisa Goto <ngotogenome@gmail.com>
- * parse.y (then): we'd like to reserve colon here for the future.
- warning added.
+ * test/dl/test_func.rb (test_name_with_block, test_bind, test_qsort1):
+ call unbind to release the callback closure because maximum number
+ of callbacks is limited to DL::MAX_CALLBACK (== 5) with pure DL
+ without Fiddle.
-Tue Jul 11 20:58:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 12 00:13:34 2012 Naohisa Goto <ngotogenome@gmail.com>
- * ruby.h: export rb_cMethod. [ruby-talk:201259]
+ * ext/dl/lib/dl/func.rb (DL::Function#unbind, #bound?): suppress
+ NoMethodError when Fiddle is available. [ruby-core:50756] [Bug #7543]
+ * test/dl/test_func.rb (test_bound*, test_unbind*): tests for the above.
-Tue Jul 11 19:13:33 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Dec 11 19:38:37 2012 Naohisa Goto <ngotogenome@gmail.com>
- * ext/tk/lib/multi-tk.rb: remove restriction on the class of
- pseudo-toplevel.
+ * ext/fiddle/function.c (Fiddle::Function.new): new keyword argument
+ :name to set the name attribute.
+ * ext/fiddle/lib/fiddle/import.rb (import_function, bind_function):
+ set function name by using the :name keyword argument.
+ Re-fixes r38243. [ruby-core:50566]
+ * test/fiddle/test_function.rb (test_name): test for the :name keyword
+ argument and Fiddle::Function#name.
-Tue Jul 11 18:00:57 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Dec 11 16:57:33 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/lib/multi-tk.rb: security fix.
+ * common.mk: Added --pages-dir to rdoc creation. Now doc/ items show
+ up at top-level.
+ * .document: Moved doc/* entries to doc/.document
+ * doc/.document: ditto
-Tue Jul 11 17:33:39 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Dec 11 16:44:37 2012 Eric Hodel <drbrain@segment7.net>
- * string.c (rb_str_dump): need to extend len for \b.
+ * lib/rdoc/options.rb: Added --page-dir option for moving pages in
+ doc/ to the top-level.
+ * lib/rdoc/rdoc.rb: ditto.
+ * test/rdoc/test_rdoc_options.rb: Test for the above.
+ * test/rdoc/test_rdoc_rdoc.rb: ditto.
-Mon Jul 10 22:00:00 2006 Shigeo Kobayashi <shigek@ruby-lang.org>
+Tue Dec 11 15:24:05 2012 Eric Hodel <drbrain@segment7.net>
- * ext/bigdecimal/bigdecimal.c: Allows '_' to appear within
- digits. [ruby-dev:28872]
+ * ext/pathname/lib/pathname.rb: Hide private methods from RDoc.
- * ext/bigdecimal/lib/bigdecimal/util.rb: Bug in to_r reported by
- [ruby-list:42533] fixed.
+Tue Dec 11 15:11:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Jul 10 19:22:19 2006 Tanaka Akira <akr@fsij.org>
+ * tool/make-snapshot (BASERUBY): add --disable-gem to avoid load gems.
+ [Bug #7541] [ruby-core:50736]
- * gc.c (gc_sweep): expand heap earlier.
- reported by MORITA Naoyuki. [ruby-dev:28960]
+Tue Dec 11 12:00:19 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Jul 10 18:59:34 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/dl/win32/extconf.rb: Fix typo
+ by Santiago Pastorino <santiago@wyeworks.com>
+ https://github.com/ruby/ruby/pull/221 fix GH-221
- * ext/tk/lib/tk/font.rb: sorry. mistaken to patch.
+Tue Dec 11 01:53:37 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Mon Jul 10 18:46:52 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/matrix: alias {row|column}_size to {row|column}_count and use
+ the latter.
+ [Bug #7369] [ruby-core:49409]
- * ext/tk/tcltklib.c: make SEGV risk lower at exit.
+Tue Dec 11 00:26:58 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/tk/lib/tk.rb: ditto.
+ * fix the behavior when a module is included into a refinement.
+ This change is a little tricky, so it might be better to prohibit
+ module inclusion to refinements.
- * ext/tk/lib/multi-tk.rb: fail to call function-style methods on slave
- interpreters. The strategy (MultiTkIp_PseudoToplevel_Evaluable) to
- fix the problem is a little tricky. You may have to take care of
- conflicting with it.
+ * include/ruby/ruby.h (RMODULE_INCLUDED_INTO_REFINEMENT): new flag
+ to represent that a module (iclass) is included into a refinement.
- * ext/tk/lib/tk.rb: a little change for the pseudo-toplevel strategy.
+ * class.c (include_modules_at): set RMODULE_INCLUDED_INTO_REFINEMENT
+ if klass is a refinement.
- * ext/tk/lib/tk/font.rb: ditto.
+ * eval.c (rb_mod_refine): set the superclass of a refinement to the
+ refined class for super.
- * ext/tk/lib/tk/msgcat.rb: ditto.
+ * eval.c (rb_using_refinement): skip the above superclass (the
+ refined class) when creating iclasses for refinements. Otherwise,
+ `using Refinement1; using Refinement2' creates iclasses:
+ <Refinement2> -> <RefinedClass> -> <Refinement1> -> RefinedClass,
+ where <Module> is an iclass for Module, so RefinedClass is
+ searched before Refinement1. The correct iclasses should be
+ <Refinement2> -> <Refinement1> -> RefinedClass.
- * ext/tk/lib/tkextlib/itk/incr_tk.rb: ditto.
+ * vm_insnhelper.c (vm_search_normal_superclass): if klass is an
+ iclass for a refinement, use the refinement's superclass instead
+ of the iclass's superclass. Otherwise, multiple refinements are
+ searched by super. For example, if a refinement Refinement2
+ includes a module M (i.e., Refinement2 -> <M> -> RefinedClass,
+ and if refinements iclasses are <Refinement2> -> <M>' ->
+ <Refinement1> -> RefinedClass, then super in <Refinement2> should
+ use Refinement2's superclass <M> instead of <Refinement2>'s
+ superclass <M>'.
- * ext/tk/sample/demos-en/widget: fail to call function-style methods
- on sample scripts. To fix it, a strategy which similar to the way
- on MultiTiIp is used. Please take care when re-write and re-run a
- demo script on the Widget-Demo code viewer.
+ * vm_insnhelper.c (vm_search_super_method): do not raise a
+ NotImplementError if current_defined_class is a module included
+ into a refinement. Because of the change of
+ vm_search_normal_superclass(), the receiver might not be an
+ instance of the module('s iclass).
- * ext/tk/sample/demos-jp/widget: ditto.
+ * test/ruby/test_refinement.rb: related test.
-Mon Jul 10 13:58:40 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Mon Dec 10 18:35:25 2012 Shugo Maeda <shugo@ruby-lang.org>
- * signal.c (ruby_nativethread_signal, posix_nativethread_signal,
- sigsend_to_ruby_thread, install_nativethread_sighandler):
- nativethread-support on signal handler. RE-backport from 1.9.
+ * vm_method.c (rb_method_entry_without_refinements): use
+ rb_resolve_refined_method() to search superclasses if
+ me->def->orig_me is 0. This change fixes make test-all
+ TESTS="json ruby/test_refinement.rb".
- * ruby.h (HAVE_NATIVETHREAD_KILL): ditto.
+ * test/ruby/test_refinement.rb: related test.
- * eval.c (ruby_native_thread_kill): ditto.
+Mon Dec 10 17:59:07 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Jul 10 10:54:14 2006 Ryan Davis <ryand@zenspider.com>
+ * ext/fiddle/win32/*: library ports from DL to Fiddle.
- * lib/rdoc/parsers/parse_f95.rb: massive overhaul from Yasuhiro
- Morikawa including new file suffixes, function support, public
- variables and constants, derived-types, defined operators and
- assignments, namelists, and subroutine and function
- arguments. Truly massive.
+ * ext/dl/win32/extconf.rb: check fiddle. often case dl compiled prior
+ to fiddle, so this change is no meaning. in most cases, simply
+ fiddle/win32 overwrite dl/win32.
- * lib/rdoc/diagram.rb: diagrams are now cached.
+Mon Dec 10 15:23:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/irb/completion.rb: fixed a crasher when completing against
- an unnamed class/module.
+ * vm_trace.c (rb_threadptr_exec_event_hooks): exceptions in event
+ hooks should not propagate outside.
- * lib/rdoc/parsers/parse_c.rb: private comment (--/++) support in
- C-file rdoc.
+Mon Dec 10 15:11:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/debug.rb: minor clarification in help.
+ * compile.c (iseq_compile_each): count flip-flop state in local iseq
+ not in each iseqs, so that the keys can be other than hidden
+ strings. [ruby-core:47253] [Bug #6899]
- * lib/pp.rb: minor clarification on exception.
+ * vm_insnhelper.c (lep_svar_get, lep_svar_set, vm_getspecial): store
+ flip-flop states in an array instead of a hash.
-Mon Jul 10 09:29:12 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * iseq.c (set_relation): main iseq also can has local scope.
- * eval.c (rb_clear_cache_for_undef): clear entries for included
- module. fixed: [ruby-core:08180]
+Mon Dec 10 10:36:12 2012 Narihiro Nakamura <authornari@gmail.com>
-Mon Jul 10 01:48:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/irb/magic-file.rb: set a encoding, which is detected from
+ the file to read, to the internal encoding.
+ [Bug #4281][ruby-dev:43036]
- * st.h (st_data_t): use pointer sized integer for st_data_t.
- [ruby-dev:28988]
+Mon Dec 10 09:40:19 2012 Eric Hodel <drbrain@segment7.net>
-Sun Jul 9 18:06:47 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems/ext/cmake_builder.rb: Added a builder for cmake.
+ * lib/rubygems/ext.rb: ditto.
+ * lib/rubygems/installer.rb: ditto.
+ * test/rubygems/test_gem_ext_cmake_builder.rb: Test for above.
- * lib/mkmf.rb (try_constant): fix for value 1 at cross compiling.
+Mon Dec 10 09:13:08 2012 Eric Hodel <drbrain@segment7.net>
- * lib/mkmf.rb (create_makefile): prevent substitution of macro
- definition. fixed: http://www.yotabanana.com/lab/20060624.html#p02
+ * lib/rubygems/package.rb: Omit directories when packaging gems like
+ RubyGems 1.8.x
+ * test/rubygems/test_gem_package.rb: Test for above.
-Sun Jul 9 00:54:34 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 9 17:36:59 2012 Shugo Maeda <shugo@ruby-lang.org>
- * eval.c (next_jump): deal with destination of next.
- fixed: [ruby-core:08169]
+ * vm_insnhelper.c (vm_call_opt_send): Kernel#send should not use
+ refinements.
-Fri Jul 7 00:38:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * proc.c (mnew): Kernel#method, Kernel#public_method,
+ Module#instance_method, and Module#public_instance_method should
+ not use refinements.
- * hash.c (rb_hash_default): should not call default procedure if
- no key is given. [ruby-list:42541]
+ * vm_method.c (rb_method_boundp): Kernel#respond_to? should not use
+ refinements.
-Fri Jul 7 00:29:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_refinement.rb: related test.
- * time.c (time_mload): a patch from Daniel Berger
- <Daniel.Berger at qwest.com>. [ruby-core:08128]
+Sun Dec 9 06:19:04 2012 Eric Hodel <drbrain@segment7.net>
-Thu Jul 6 22:21:57 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rdoc/markdown/entities.rb: Added documentation.
- * process.c (rb_proc_times): use sysconf(_SC_CLK_TCK) value prior to
- HZ and CLK_TCK. fixed: [ruby-talk:200293]
+ * lib/rdoc/parser/ruby.rb: Updated style
-Thu Jul 6 22:17:21 2006 Minero Aoki <aamine@loveruby.net>
+ * lib/rdoc/ruby_lex.rb: Parse characters up to \u{FFFFF}
+ * test/rdoc/test_rdoc_ruby_lex.rb: Test for above.
- * ext/racc/cparse/cparse.c: sync with original code, rev 1.8.
+Sat Dec 8 22:38:35 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/racc/cparse/cparse.c: should mark CparseParams objects.
+ * eval.c (rb_mod_refine): don't override Module#include. It's
+ unnecessary now because refinements are activated only in refine
+ blocks.
- * lib/racc/parser.rb: sync with original code, rev 1.8.
+Sat Dec 8 22:33:26 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/racc/parser.rb: update coding style.
+ * eval.c: remove Module#refinements.
-Mon Jul 3 19:04:38 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/ruby/test_refinement.rb: remove tests for Module#refinements.
- * ext/tk/tcltklib.c (ip_make_menu_embeddable): help to make a menu
- widget embeddable (pack, grid, and so on) like as a general widget.
- However, an embeddable menu may require to be definied some event
- bindings for general use.
+Sat Dec 8 13:17:55 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/tk/lib/tk/event.rb: [bug fix] Tk.callback_break and
- Tk.callback_continue don't work on MultiTkIp.
+ * eval.c (top_using): raise a RuntimeError if using is called in a
+ module definition or a method definition.
- * ext/tk/lib/multi-tk.rb: ditto.
+ * test/ruby/test_refinement.rb: related test.
- * ext/tk/lib/tk.rb: lack of Tk.callback_return.
+Sat Dec 8 15:01:35 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/lib/tk/menu.rb: improve creating clone menus.
+ * lib/rubygems/commands/cleanup_command.rb: Skip default gems when
+ cleaning up.
+ * test/rubygems/test_gem_commands_cleanup_command.rb: Test for above.
-Mon Jul 3 14:42:06 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems/commands/query_command.rb: Fixed listing remote gems.
- * ext/etc/extconf.rb (PW_UID2VAL, PW_GID2VAL): defaulted to conversion
- from int, and sys/types.h needs to be included before grp.h.
- fixed: [ruby-dev:28938]
+ * lib/rubygems/dependency_installer.rb: Ignore non-files when looking
+ for local gems.
+ * test/rubygems/test_gem_dependency_installer.rb: Test for above.
-Mon Jul 3 01:14:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rubygems/uninstaller.rb: The user must confirm uninstalling gems
+ that have dependencies.
+ * test/rubygems/test_gem_uninstaller.rb: Test for above.
- * string.c (rb_str_inspect): encode \b (\010) for escape.
- [ruby-dev:28927]
+ * lib/rubygems.rb (module Gem): Updated version.
- * string.c (rb_str_dump): ditto.
+ * test/rubygems/*.pem: Updated to run in FIPS mode.
+ * test/rubygems/test_gem_security.rb: ditto.
+ * test/rubygems/test_gem_security_signer.rb: ditto.
-Sun Jul 2 19:17:56 2006 Minero Aoki <aamine@loveruby.net>
+Sat Dec 8 12:34:01 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/racc/cparse/cparse.c: sync with original code (rev 1.7).
+ * vm_insnhelper.c (vm_search_normal_superclass): super in a
+ refinement always uses the refined class as its superclass.
- * ext/racc/cparse/cparse.c: use rb_catch instead of rb_iterate.
- Giving a block to a Ruby-level method by rb_iterate is obsolete on
- Ruby 1.9. Note that current cparse.c still includes one
- rb_iterate call on Ruby 1.8, but it is not a problem (at least
- just now).
+ * test/ruby/test_refinement.rb: related test.
-Sat Jul 1 15:15:49 2006 Tanaka Akira <akr@m17n.org>
+Sat Dec 8 11:59:59 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test/socket/test_nonblock.rb: add timeout to send/receive
- an empty UDP packet.
- [ruby-dev:28820]
+ * eval.c (rb_mod_refine): raise an ArgumentError if a given
+ block is of a Proc object.
-Fri Jun 30 23:46:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_method): store refined methods in inline
+ cache to improve performance. It's safe now because blocks cannot
+ be yielded with different refinements in the new specification.
- * configure.in: should test isinf for Solaris with GCC compiler.
- a patch from <ville.mattila at stonesoft.com>. [ruby-core:07791]
+ * test/ruby/test_refinement.rb: related test.
- * configure.in: -shared patch from Andrew Morrow
- <andrew.c.morrow at gmail.com>. [ruby-core:08100]
+Sat Dec 8 11:17:53 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Jun 29 18:58:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * eval.c (rb_mod_refine), vm_eval.c (rb_yield_refine_block):
+ Module#refine activates all refinements defined in that module
+ only in a given block.
- * ext/bigdecimal/bigdecimal.c (BigDecimal_version): fix patch
- failure.
+ * string.c (sym_to_proc, sym_call): don't use refinements.
-Thu Jun 29 18:00:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_refinement.rb: related test.
- * ext/bigdecimal/bigdecimal.c: add RDoc document. a patch from
- mathew <meta at pobox.com>. [ruby-core:07050]
+Sat Dec 8 09:24:42 2012 Eric Hodel <drbrain@segment7.net>
-Wed Jun 28 15:47:14 2006 Eric Hodel <drbrain@segment7.net>
+ * ext/openssl/ossl_x509name.c: Completed documentation for
+ OpenSSL::X509::Name.
- * lib/optparse.rb: RDoc patch from Robin Stocker <robin@nibor.org>
- [ruby-core:08087]
+Sat Dec 8 07:57:12 2012 Koichi Sasada <ko1@atdot.net>
-Wed Jun 28 19:04:34 2006 Tanaka Akira <akr@m17n.org>
+ * ext/objspace/objspace.c (iow_size): return size of internal object
+ for ObjectSpace.memsize_of().
- * test/socket/test_unix.rb: test_seqpacket_pair removed.
- [ruby-dev:28846]
+ * test/objspace/test_objspace.rb: add a test.
-Tue Jun 27 23:03:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Dec 08 02:39:23 2012 James Edward Gray II <james@graysoftinc.com>
- * string.c: RDoc update for =~ method. a patch from Alex Young
- <alex at blackkettle.org>. [ruby-core:08068]
+ * lib/csv.rb: A fix for row comparison by Stephen Wattam. [Bug #7528]
-Tue Jun 27 22:47:18 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat Dec 8 01:27:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/tcltklib.c: forgot to update TCLTKLIB_RELEASE_DATE.
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): no need to
+ check all reports.
- * ext/tk/lib/tk.rb (tk_tcl2ruby): [bug fix] sometimes fail to convert
- a tcl string to a ruby object if the tcl string includes "\n".
+Sat Dec 8 00:10:34 2012 Shugo Maeda <shugo@ruby-lang.org>
-Tue Jun 27 16:04:05 2006 WATANABE Hirofumi <eban@ruby-lang.org>
+ * vm_eval.c (yield_under, eval_under): do not activate refinements
+ of the receiver in module_eval and instance_eval.
- * win32/win32.h: define isascii on MinGW for msvcrt compatibility.
+ * eval.c (ruby_Init_refinement): undef Class#refine.
- * configure.in: set ac_cv_header_sys_time_h=no on MinGW
- for msvcrt compatibility.
+ * eval.c (ruby_Init_refinement): remove Module#using.
-Tue Jun 27 11:36:02 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (ruby_Init_refinement): main.using should be private.
- * ext/etc/etc.c (setup_passwd, setup_group): allow bignum uid, gid and
- so on. [ruby-talk:199102]
+ * eval.c (rb_mod_refine): the argument of Module#refine should not
+ be a module.
-Mon Jun 26 13:37:27 2006 Eric Hodel <drbrain@segment7.net>
+ * insns.def (defineclass): do not activate refinements in a class or
+ module.
- * lib/rdoc: Merge from HEAD.
- Add options to limit the ri search path.
+Fri Dec 7 23:42:11 2012 Shugo Maeda <shugo@ruby-lang.org>
-Tue Jun 27 00:54:08 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/refinement/refinement.c: include ruby/ruby.h instead of the
+ declaration of rb_warn().
- * util.c (powersOf10): constified.
+Fri Dec 7 16:07:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Mon Jun 26 18:37:44 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * doc/etc.rd: Removed stale documentation file
+ * ext/etc/etc.c: Merged documentation from doc/etc.rd and updated
+ rdoc, added documentation for Etc::Passwd and Etc::Group
- * ext/tk/tcltklib.c (ip_delete): fix SEGV when a slave-ip is
- deleted on callback.
+Fri Dec 7 16:00:57 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Jun 26 10:47:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): no need to
+ retry skipped test. this fix makes 40% faster the whole test-all
+ with -j5 on Windows.
- * io.c (pipe_open): avoid closing uninitialized file descriptors.
- a patch from <tommy at tmtm.org> [ruby-dev:28600]
+Fri Dec 7 14:22:29 2012 Eric Hodel <drbrain@segment7.net>
-Mon Jun 26 09:56:22 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/rdoc/markup/to_joined_paragraph.rb: Completed documentation
+ * lib/rdoc/parser/c.rb: ditto
+ * lib/rdoc/parser/changelog.rb: ditto
+ * lib/rdoc/servlet.rb: ditto
+ * lib/rdoc/store.rb: ditto
- * win32/win32.[ch] (rb_w32_send, rb_w32_sendto): constified.
+ * lib/rdoc/store.rb: Improved HTML error page. Completed
+ documentation
-Sun Jun 25 23:02:12 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rdoc/parser/ruby.rb: Fixed bug attaching a comment to A::B = 42
+ * test/rdoc/test_rdoc_parser_ruby.rb: Test for above
- * Makefile.in, mkconfig.rb: catch-up for latest autoconf.
+ * test/rdoc/test_rdoc_comment.rb: Removed garbage
-Sat Jun 24 06:35:00 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri Dec 7 14:03:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * signal.c: revert last change.
+ * lib/timeout.rb (Timeout#timeout): since async_interrupt_timing
+ re-raises a deferred exception, replace the timeout exception with
+ Timeout::Error after it. [Bug #7503]
- * ruby.h: ditto.
+Fri Dec 7 13:07:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * eval.c: ditto.
+ * doc/forwardable.rd: Remove stale documentation file
+ * lib/forwardable.rb: Merge documentation from doc/forwardable.rd
-Thu Jun 22 11:52:02 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Dec 7 09:47:35 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/net/http.rb (Net::HTTPResponse): duplicated error 501;
- HTTPInternalServerError should be error 500. [ruby-core:08037]
+ * time.c (time_mdump): dump timezone string to private instance variable
+ on marshaling.
-Thu Jun 22 05:15:58 2006 Tanaka Akira <akr@m17n.org>
+ * time.c (time_mload): load timezone string from private instance
+ variable named 'zone'.
- * ext/socket/socket.c (sock_s_socketpair): try GC only once.
- [ruby-dev:28778]
+Fri Dec 7 01:15:07 2012 Naohisa Goto <ngotogenome@gmail.com>
-Wed Jun 21 21:28:32 2006 Tadayoshi Funaba <tadf@dotrb.org>
+ * ext/fiddle/lib/fiddle/function.rb (Fiddle::Function#name): new
+ attribute needed to switch Win32::Registry from DL to Fiddle.
- * lib/date.rb (jd_to_commercial): now works fine even if in
- mathn-ized context.
+ * ext/fiddle/lib/fiddle/import.rb (import_function, bind_function):
+ set function name to the returned Fiddle::Function object.
-Wed Jun 21 17:32:31 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri Dec 7 00:11:44 2012 Shugo Maeda <shugo@ruby-lang.org>
- * signal.c (ruby_nativethread_signal, posix_nativethread_signal,
- sigsend_to_ruby_thread, install_nativethread_sighandler):
- nativethread-support on signal handler (backport from 1.9).
+ * test/ruby/test_refinement.rb: fix some tests to use neither
+ Module#using nor Module#module_eval.
- * ruby.h (HAVE_NATIVETHREAD_KILL): ditto.
+Thu Dec 6 23:27:50 2012 Shugo Maeda <shugo@ruby-lang.org>
- * eval.c (ruby_native_thread_kill): ditto.
+ * eval.c (ruby_Init_refinement): a new function to enable
+ Refinements with a warning "Refinements are experimental...".
-Wed Jun 21 08:39:54 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/refinement/refinement.c, ext/refinement/extconf.rb: a new
+ extension library to enable Refinements.
- * lib/xmlrpc/create.rb (XMLRPC::Create::conv2value): merge Date
- and Time processing. [ruby-core:08033]
+Thu Dec 6 18:23:05 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed Jun 21 01:40:25 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * revised r37993 to avoid SEGV/ILL in tests. In r37993, a method
+ entry with VM_METHOD_TYPE_REFINED holds only the original method
+ definition, so ci->me is set to a method entry allocated in the
+ stack, and it causes SEGV/ILL. In this commit, a method entry
+ with VM_METHOD_TYPE_REFINED holds the whole original method entry.
+ Furthermore, rb_thread_mark() is changed to mark cfp->klass to
+ avoid GC for iclasses created by copy_refinement_iclass().
- * parse.y (yylex, reswords): modifier token is no longer returned in
- fname state. [ruby-dev:28775]
+ * vm_method.c (rb_method_entry_make): add a method entry with
+ VM_METHOD_TYPE_REFINED to the class refined by the refinement if
+ the target module is a refinement. When a method entry with
+ VM_METHOD_TYPE_UNDEF is invoked by vm_call_method(), a method with
+ the same name is searched in refinements. If such a method is
+ found, the method is invoked. Otherwise, the original method in
+ the refined class (rb_method_definition_t::body.orig_me) is
+ invoked. This change is made to simplify the normal method lookup
+ and to improve the performance of normal method calls.
-Wed Jun 21 01:12:46 2006 Kouhei Sutou <kou@cozmixng.org>
+ * vm_method.c (EXPR1, search_method, rb_method_entry),
+ vm_eval.c (rb_call0, rb_search_method_entry): do not use
+ refinements for method lookup.
- * lib/rss/rss.rb: RSS::Element.def_corresponded_attr_writer
- supported date type.
+ * vm_insnhelper.c (vm_call_method): search methods in refinements if
+ ci->me is VM_METHOD_TYPE_REFINED. If the method is called by
+ super (i.e., ci->call == vm_call_super_method), skip the same
+ method entry as the current method to avoid infinite call of the
+ same method.
-Tue Jun 20 22:08:36 2006 Kouhei Sutou <kou@cozmixng.org>
+ * class.c (include_modules_at): add a refined method entry for each
+ method defined in a module included in a refinement.
- * test/rss/test_parser.rb: split parser tests into ...
- * test/rss/test_parser_1.0.rb: ... RSS 1.0 parsing tests and ...
- * test/rss/test_parser_2.0.rb: ... RSS 2.0 parsing tests.
+ * class.c (rb_prepend_module): set an empty table to
+ RCLASS_M_TBL(klass) to add refined method entries, because
+ refinements should have priority over prepended modules.
-Tue Jun 20 21:19:06 2006 Kouhei Sutou <kou@cozmixng.org>
+ * proc.c (mnew): use rb_method_entry_with_refinements() to get
+ a refined method.
- * lib/rss/rss.rb: provided default RSS::Element#children.
+ * vm.c (rb_thread_mark): mark cfp->klass for iclasses created by
+ copy_refinement_iclass().
- * lib/rss/0.9.rb: used default RSS::Element#children.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
+ * vm.c (Init_VM), cont.c (fiber_init): initialize th->cfp->klass.
-Tue Jun 20 21:04:33 2006 Kouhei Sutou <kou@cozmixng.org>
+ * test/ruby/test_refinement.rb (test_inline_method_cache): do not skip
+ the test because it should pass successfully.
- * lib/rss/rss.rb: provided default RSS::Element#_tags.
+ * test/ruby/test_refinement.rb (test_redefine_refined_method): new
+ test for the case a refined method is redefined.
- * lib/rss/0.9.rb: used default RSS::Element#_tags.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
+Thu Dec 6 17:29:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jun 20 20:47:07 2006 Kouhei Sutou <kou@cozmixng.org>
+ * parse.y (parser_here_document): flush string content between new
+ line and :string_embexpr. [ruby-core:48703] [Bug #7255]
- * lib/rss/rss.rb: hide RSS::Element.install_model.
- (RSS::Element.install_have_child_element,
- RSS::Element.install_have_children_element,
- RSS::Element.install_text_element,
- RSS::Element.install_date_element): call
- RSS::Element.install_model internally.
+Thu Dec 6 16:35:21 2012 Eric Hodel <drbrain@segment7.net>
- * lib/rss/0.9.rb: followed new API.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/content.rb: ditto.
- * lib/rss/dublincore.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/syndication.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
- * lib/rss/trackback.rb: ditto.
+ * test/rake/helper.rb: Load envutil correctly. Removed useless rescue
+ for signal propagation tests
+ * lib/rake/file_utils.rb: Prefer the built ruby.
+ * test/rake/test_rake_functional.rb: ditto
-Tue Jun 20 20:18:05 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Dec 6 15:20:34 2012 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/extconf.rb: add check for OBJ_NAME_do_all_sorted.
+ * lib/rdoc/context.rb: Don't warn for duplicate methods while loading.
+ * test/rdoc/test_rdoc_context.rb: Test for above.
- * ext/openssl/ossl_cipher.c (ossl_s_ciphers): new method
- OpenSSL::Cipher.ciphers. it returns all the cipher names.
+Thu Dec 6 14:26:22 2012 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/lib/openssl/cipher.rb:
- - add constants AES128, AES192, AES256. [ruby-dev:28610]
- - reimplement without eval()
+ * lib/rubygems/command_manager.rb: Removed string concatenation
+ syntax. [Bug #6265]
+ * lib/rubygems/commands/install_command.rb: ditto
+ * lib/rubygems/commands/uninstall_command.rb: ditto
+ * lib/rubygems/indexer.rb: ditto
+ * lib/rubygems/security/policy.rb: ditto
+ * lib/rubygems/security.rb: ditto
+ * lib/rubygems/uninstaller.rb: ditto
+ * test/rubygems/test_gem_commands_cert_command.rb: ditto
+ * test/rubygems/test_gem_package.rb: ditto
+ * test/rubygems/test_gem_security.rb: ditto
+ * test/rubygems/test_gem_security_policy.rb: ditto
- * ext/openssl/lib/openssl/digest.rb: reimplement without eval().
+Thu Dec 6 14:10:08 2012 Eric Hodel <drbrain@segment7.net>
- * test/openssl/test_cipher.rb, test_digest: fix about reimplemented
- features.
+ * lib/rubygems/package.rb: Set rubygems_version before validation.
+ Fixes issue with bundler.
+ * test/rubygems/test_gem_package.rb: Test for above.
- * sample/openssl/cipher.rb: rewrite all.
+ * lib/rubygems/remote_fetcher.rb: Only update the cache when we have
+ permission. [ruby-trunk - Bug #7509]
+ * lib/rubygems/source.rb (class Gem): ditto
+ * test/rubygems/test_gem_remote_fetcher.rb: Test for above.
+ * lib/rubygems/test_utilities.rb: ditto
-Sat Jun 19 11:21:46 2006 Eric Hodel <drbrain@segment7.net>
+ * lib/rubygems/specification.rb: Derive base_dir properly for default
+ gems. [ruby-trunk - Bug #7496]
+ * test/rubygems/test_gem_specification.rb: Test for above.
- * lib/test/unit/assertions.rb: Merge RDoc from HEAD.
+ * lib/rubygems.rb: Untaint Dir.pwd when searching for gemdeps files
+ for operation under $SAFE=1
-Tue Jun 20 01:06:57 2006 Kouhei Sutou <kou@cozmixng.org>
+Thu Dec 06 12:07:11 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rss/rss.rb:
- - cleanup validation mechanism. Now, #XXX_validation is
- needless.
- - changed internal variable name RSS::Element::MODEL to
- RSS::Element::MODELS.
- - RSS::Element.install_model requires uri.
+ * vm_trace.c: TracePoint#enable should not cause an error
+ when it is already enabled. TracePoint#disable is too.
+ [ruby-core:50561] [ruby-trunk - Bug #7513]
- * lib/rss/0.9.rb: followed new validation API.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/content.rb: ditto.
- * lib/rss/dublincore.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/syndication.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
- * lib/rss/trackback.rb: ditto.
+ * test/ruby/test_settracefunc.rb: add tests.
-Mon Jun 19 23:40:59 2006 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Dec 6 07:19:58 2012 Eric Hodel <drbrain@segment7.net>
- * ext/nkf/lib/kconv.rb: remove default -m0 and fix document.
+ * lib/rdoc*: Improved display of ChangeLog files as HTML.
+ * test/rdoc*: Test for above.
- * ext/nkf/nkf-8/{nkf.c, config.h, utf8tbl.c, utf8tbl.h}:
- imported nkf 2.0.7.
+Thu Dec 6 04:34:19 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon Jun 19 22:31:59 2006 Kouhei Sutou <kou@cozmixng.org>
+ * thread.c (rb_uninterruptible): helper function for providing
+ temporary async_interrupt_timing(Object => :defer)
- * lib/rss/rss.rb:
- - provided default #to_s as RSS::Element#to_s.
- - removed RSS::Element#other_element.
- - RSS::Element#tag requires attributes as Hash instead of Array.
+ * io.c (rb_f_p): use rb_uninterruptible.
+ * io.c (rb_f_p_internal): helper function for rb_f_p().
+ * io.c (struct rb_f_p_arg): new struct for rb_f_p_internal.
- * lib/rss/0.9.rb: removed #to_s to use RSS::Element#to_s.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
- * lib/rss/trackback.rb: ditto.
+ * test/ruby/test_thread.rb (test_async_interrupt_and_p): test for
+ the above.
- * lib/rss/2.0.rb: removed #other_element.
+Thu Dec 6 04:27:10 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon Jun 19 22:09:16 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * io.c (io_binwrite): check interrupt before io issue.
+ * test/ruby/test_thread.rb (test_async_interrupt_and_io):
+ test for the above.
- * ext/win32ole/win32ole.c(ole_invoke): support some kind of
- method of word. [ruby-Bugs#3237]
+Thu Dec 6 01:10:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/win32ole/tests/test_word.rb: ditto.
+ * vm_eval.c (rb_method_call_status): use Qundef as no self instead of
+ the current self.
- * ext/win32ole/tests/testall.rb: ditto.
+ * vm_eval.c (send_internal): public_send does not consider how it is
+ called, as mentioned in r14173. patched by charliesome (Charlie
+ Somerville). [ruby-core:50489] [Bug #7499]
-Mon Jun 19 00:02:17 2006 Kouhei Sutou <kou@cozmixng.org>
+Wed Dec 5 23:50:23 2012 Narihiro Nakamura <authornari@gmail.com>
- * lib/rss/rss.rb: automatically detected attributes.
+ * gc.c (getrusage_time): uses clock_gettime() with
+ CLOCK_PROCESS_CPUTIME_ID when available, which provides a 1ns
+ precision on linux. [ruby-core:50495] [Bug #7500]
+ patched by Aman Gupta.
- * lib/rss/0.9.rb: removed #_attrs.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
- * lib/rss/trackback.rb: ditto.
+Wed Dec 5 22:46:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/parser.rb: followed new internal API.
+ * vm.c (rb_vm_make_proc): save the proc made from the given block so
+ that it will not get collected. [ruby-core:50545] [Bug #7507]
-Mon Jun 19 00:00:17 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Dec 5 22:13:57 2012 Naohisa Goto <ngotogenome@gmail.com>
- * ext/tk/lib/multi-tk.rb: fix bug: initialize improper tables.
+ * ext/dl/lib/dl/func.rb (DL::Function#bind): When Fiddle is used,
+ @ptr should be updated. This fixes SEGV raised in DL::Function#call
+ after calling DL::Function#bind. [Bug #7516] [ruby-dev:46708]
-Sun Jun 18 22:36:13 2006 Kouhei Sutou <kou@cozmixng.org>
+ * test/dl/test_func.rb (test_bind): test for the above
- * lib/rss/rss.rb: RSS::Element#initialize accepts initial
- attributes.
- * lib/rss/0.9.rb: ditto.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/dublincore.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
- * lib/rss/trackback.rb: ditto.
+Wed Dec 5 18:53:00 2012 Masaya Tarui <tarui@ruby-lang.org>
- * lib/rss/utils.rb: added Utils.element_initialize_arguments? to
- detect backward compatibility initial arguments.
+ * thread.c (rb_thread_s_async_interrupt_timing): have to check ints
+ before jumping out.
+ * test/ruby/test_thread.rb (test_async_interrupt_with_return): add test
+ rescue has to catch a queued async exception at the time of return.
+ * test/ruby/test_thread.rb (test_async_interrupt_with_break): add test
+ rescue has to catch a queued async exception at the time of break.
- * lib/rss/parser.rb: user initial attributes to initialize
- RSS::Element.
+Wed Dec 5 16:54:28 2012 Koichi Sasada <ko1@atdot.net>
-Sun Jun 18 18:24:42 2006 Kouhei Sutou <kou@cozmixng.org>
+ * test/ruby/memory_status.rb: suppress warning.
+ A patch from NAKAMURA Usaku.
- * lib/rss/converter.rb: use NKF for Uconv fallback.
+Wed Dec 5 16:06:54 2012 Eric Hodel <drbrain@segment7.net>
-Sun Jun 18 18:22:04 2006 Kouhei Sutou <kou@cozmixng.org>
+ * lib/rdoc/parser/changelog.rb: Parse more ChangeLog file variations.
+ * test/rdoc/test_rdoc_parser_changelog.rb: Test for above.
- * test/rss/test_image.rb: shared name space configuration.
+Wed Dec 5 12:17:11 2012 Naohisa Goto <ngotogenome@gmail.com>
-Sun Jun 18 18:13:25 2006 Kouhei Sutou <kou@cozmixng.org>
+ * ext/dl/lib/dl/func.rb (DL::Function#initialize, DL::Function#bind):
+ ABI should be set by using CFunc#calltype even when Fiddle is used.
+ When Fiddle is used and a block is given, name should not be ignored.
+ [ruby-core:50562] [Bug #7514]
- * lib/rss/rss.rb: improved ignore_unknown_element
- handling. RSS::NotExpectedTagError provides tag URI.
- * lib/rss/parser.rb: ditto.
- * lib/rss/0.9.rb: ditto.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/content.rb: ditto.
- * lib/rss/dublincore.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/syndication.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
- * lib/rss/trackback.rb: ditto.
+ * ext/dl/lib/dl/import.rb (DL::Importer#bind_function): should respect
+ abi and name when Fiddle is used.
- * test/rss/rss-assertions.rb: checked URI of not expected tag too.
- * test/rss/test_parser.rb: ditto.
+ * test/dl/test_func.rb (test_name_with_block): test for "name" method
+ with giving a block.
-Sun Jun 18 18:08:36 2006 Kouhei Sutou <kou@cozmixng.org>
+Wed Dec 5 11:55:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * lib/rss/rss.rb: changed empty namespace URI representation to ""
- from nil.
- * lib/rss/parser.rb: ditto.
- * lib/rss/0.9.rb: ditto.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
+ * doc/shell.rd, doc/shell.rd.ja: Removed stale doc files
+ * lib/shell.rb, lib/shell/*: Merge and updates docs from doc/shell.rd*
-Sun Jun 18 18:03:50 2006 Kouhei Sutou <kou@cozmixng.org>
+Wed Dec 5 11:42:38 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rss/parser.rb: removed a guard for requiring open-uri.
+ * test/ruby/test_settracefunc.rb: disable trace.
-Sun Jun 18 18:01:26 2006 Kouhei Sutou <kou@cozmixng.org>
+Wed Dec 5 11:37:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/rss.rb: fixed typo: except -> expect
- * lib/rss/parser.rb: ditto.
- * test/rss/rss-assertions.rb: ditto.
- * test/rss/test_parser.rb: ditto.
+ * lib/mkmf.rb (MakeMakefile#macro_defined?): use clearly different
+ strings from conflict markers.
-Sun Jun 18 17:52:39 2006 Kouhei Sutou <kou@cozmixng.org>
+Wed Dec 5 04:25:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * lib/rss/rss.rb: RSS::Element#calc_indent became to be deprecated.
- * lib/rss/0.9.rb: ditto.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
- * lib/rss/trackback.rb: ditto.
+ * lib/README: Add rdoc modeline directive and formatting libs
- * test/rss/test_1.0.rb: removed RSS::Element.indent_size tests.
- * test/rss/test_2.0.rb: ditto.
+Wed Dec 5 04:04:02 2012 Masaya Tarui <tarui@ruby-lang.org>
-Sun Jun 18 00:49:11 2006 Tanaka Akira <akr@m17n.org>
+ * test/ruby/test_thread.rb (test_async_interrupt_blocking): bugfix
+ about deferred check
- * ext/socket/socket.c (bsock_recv_nonblock): new method
- BasicSocket#recv_nonblock.
- (udp_recvfrom_nonblock): renamed from ip_recvfrom_nonblock.
- IPSocket#recvfrom_nonblock is moved to UDPSocket#recvfrom_nonblock.
- (unix_recvfrom_nonblock): removed.
- UNIXSocket#recvfrom_nonblock is removed.
+Wed Dec 5 03:35:37 2012 Masaya Tarui <tarui@ruby-lang.org>
-Sat Jun 17 22:17:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_core.h (RUBY_VM_CHECK_INTS_BLOCKING): check async queue everytime.
+ * thread.c (sleep_forever): check RUBY_VM_CHECK_INTS_BLOCKING first.
+ * thread.c (sleep_timeval): ditto.
+ * test/ruby/test_thread.rb (test_async_interrupt_blocking): add a test
+ exceptions are correctly deferred and raised on :on_blocking context.
- * lib/mathn.rb (Integer::prime_division): raise ZeroDivisionError
- on zeros. [ruby-dev:28739]
+Wed Dec 5 02:36:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 17 14:53:32 2006 Tanaka Akira <akr@m17n.org>
+ * common.mk, defs/id.def, template/id.c.tmpl: generate id.c as well as id.h.
- * lib/pathname.rb: backport from 1.9.
- (Kernel#Pathname): new method.
+Wed Dec 5 00:56:21 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Jun 17 10:30:41 2006 Kouhei Sutou <kou@cozmixng.org>
+ * thread.c (rb_mutex_owned_p): new method that return current
+ thread have the target mutex or not. [Feature #7505] [ruby-dev:46697]
+ * test/ruby/test_thread.rb (test_mutex_owned, test_mutex_owned2):
+ test for the above.
+ * NEWS: new for the above.
- * lib/rss/rss.rb (Hash#merge, Enumerable#sort_by): removed.
+Wed Dec 5 00:05:47 2012 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * lib/rss/rss.rb (RSS::RootElementMixin#to_xml): added.
- [ruby-talk:197284]
+ * lib/erb.rb (make_compiler, add_put_cmd, add_insert_cmd): extract
+ methods.
- We can convert RSS version easily like the following:
- rss10 = RSS::Parser.parse(File.read("1.0.rdf"))
- File.open("2.0.rss", "w") {|f| f.print(rss10.to_xml("2.0"))}
+Tue Dec 4 18:21:04 2012 Naohisa Goto <ngotogenome@gmail.com>
- * test/rss/test_1.0.rb: added #to_xml test.
- * test/rss/test_2.0.rb: ditto.
+ * test/ruby/memory_status.rb (Memory): use fiddle/types if available.
- * test/rss/rss-testcase.rb: added some helper methods that
- generates sample RSS 2.0.
+ * test/ruby/memory_status.rb (Memory::Win32): :stdcall is needed on
+ x86 WIN32. This commit partly reverts r38054.
- * sample/rss/convert.rb: added a sample script to convert RSS format.
+Tue Dec 4 18:05:58 2012 Naohisa Goto <ngotogenome@gmail.com>
-Sat Jun 17 10:23:22 2006 Kouhei Sutou <kou@cozmixng.org>
+ * ext/fiddle/lib/fiddle/types.rb: copied from ext/dl/lib/dl/types.rb
+ and modified for Fiddle, needed for migration from DL to Fiddle.
- * lib/rss/rss.rb (Kernel#funcall): removed.
- * lib/rss/parser.rb (Kernel.URI): removed.
+Tue Dec 4 17:57:09 2012 Naohisa Goto <ngotogenome@gmail.com>
- * lib/rss/maker/: supported
- xxx.new_yyy do |yyy|
- yyy.zzz = zzz
- ...
- end
- style and this style became the style of the recommendation.
+ * ext/fiddle/lib/fiddle/import.rb (import_function, bind_function):
+ should respect call_type for migration from DL to Fiddle.
+ [Bug #7484] [ruby-core:50405]
- Old style
- yyy = xxx.new_yyy
- yyy.zzz = zzz
- ...
- is supported too but this style isn't recommended.
- [ruby-talk:197284]
+Tue Dec 4 16:54:00 2012 Eric Hodel <drbrain@segment7.net>
- * test/rss/test_*maker*.rb: used new recommended style.
+ * .document: Added ChangeLog and doc/ChangeLog-* as documentation
-Sat Jun 17 09:03:47 2006 Kouhei Sutou <kou@cozmixng.org>
+Tue Dec 4 16:47:46 2012 Eric Hodel <drbrain@segment7.net>
- * lib/rss, test/rss: backported from trunk. (2005-11-16 - now)
+ * lib/rdoc/parser/changelog.rb: Added a ChangeLog parser to RDoc.
+ * lib/rdoc/parser.rb: ditto
+ * test/rdoc/test_rdoc_parser_changelog.rb: Test for above.
- * lib/rss/rss.rb (RSS::VERSION): 0.1.5 -> 0.1.6.
- * test/rss/test_version.rb (RSS::TestVersion#test_version): ditto.
+Tue Dec 4 16:23:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/trackback.rb: added TrackBack prefix.
- * lib/rss/maker/trackback.rb: ditto.
+ * marshal.c (path2class, path2module): use PRIsVALUE.
- * lib/rss/rss.rb : removed needless argument 'prefix'.
- * lib/rss/parser.rb: ditto.
+ * marshal.c (w_object, marshal_dump, marshal_load): use
+ rb_check_funcall if possible.
- * lib/rss/1.0.rb: added rdf:Bag.
+ * marshal.c (w_object, marshal_dump, r_object0, marshal_load): use
+ RB_GC_GUARD() (directly or indirectly) instead of volatile.
- * lib/rss/taxonomy.rb: implemented taxonomy module.
- * test/rss/test_taxonomy.rb: added tests for taxonomy support.
+ * variable.c (rb_path_to_class): prevent the argument from GC.
- * lib/rss/1.0.rb: added convenience method 'resources'.
- * lib/rss/taxonomy.rb: ditto.
- * test/rss/rss-assertions.rb: added test for 'resources'.
- * test/rss/test_taxonomy.rb: ditto.
+Tue Dec 04 13:55:07 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rss/rss.rb: fixed a indentation bug.
- * lib/rss/taxonomy.rb: fixed <taxo:topic> #to_s bug.
- * test/rss/test_taxonomy.rb: added a #to_s test.
+ * vm_opts.h: enable optimization - operand unification.
+ Operand unification technique enable to combine
+ an instruction and specific operands and make new
+ instruction.
- * lib/rss/maker/taxonomy.rb: implemented taxonomy module for RSS
- Maker.
- * lib/rss/taxonomy.rb: supported RSS Maker.
- * lib/rss/maker.rb: added taxonomy module support.
+ * defs/opt_operand.def: add several configuration
+ of operand unification.
- * lib/rss/rss.rb: adjusted to other element API.
- * lib/rss/1.0.rb: adjusted to other element API but backward
- compatibility is reserved.
- * lib/rss/0.9.rb: ditto.
+ * insns.def: use `int' instead to suppress warning.
- * test/rss/test_maker_taxo.rb: added test case for taxonomy module
- for RSS Maker.
- * test/rss/test_setup_maker_1.0.rb: added tests for taxo:topic.
+Mon Dec 3 17:58:53 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/rss/test_setup_maker_1.0.rb: added backward compatibility
- test.
- * test/rss/test_setup_maker_0.9.rb: ditto.
- * test/rss/test_setup_maker_2.0.rb: ditto.
+ * parse.y: replace parser->enc with current_enc.
- * test/rss/rss-testcase.rb: added convenience method for setting
- up taxo:topic.
- * test/rss/rss-assertions.rb: added assertion for taxo:topic.
+Tue Dec 4 08:33:46 2012 Eric Hodel <drbrain@segment7.net>
- * sample/rss/blend.rb: followed new API.
+ * README.EXT: Converted to RDoc format
+ * README.EXT.ja: ditto
- * lib/rss/taxonomy.rb: changed class or module prefix to
- Taxonomy from Taxo.
- * lib/rss/maker/taxonomy.rb: ditto.
+Tue Dec 4 08:32:10 2012 Eric Hodel <drbrain@segment7.net>
- * test/rss/test_taxonomy.rb: use #reject directory.
+ * lib/rdoc/ri/driver.rb: Fixed ri page display for files with
+ extensions.
+ * test/rdoc/test_rdoc_ri_driver.rb: Test for above
- * lib/rss/: use #__send__ instead of #send.
- * test/rss/: ditto.
+Tue Dec 4 04:11:50 2012 Eric Hodel <drbrain@segment7.net>
- * lib/rss/parser.rb: added entity handling type predicate.
- * lib/rss/rexmlparser.rb: ditto.
- * lib/rss/xmlparser.rb: ditto.
- * lib/rss/xmlscanner.rb: ditto.
+ * .document: Add NEWS for `ri ruby:NEWS`
+ * NEWS: Set format as rdoc
+ * doc/NEWS-1.8.7: ditto
+ * doc/NEWS-1.9.1: ditto
+ * doc/NEWS-1.9.2: ditto
+ * doc/NEWS-1.9.3: ditto
- * lib/rss/xmlscanner.rb: more robust entity handling.
+Mon Dec 3 20:37:22 2012 Koichi Sasada <ko1@atdot.net>
- * test/rss/test_parser.rb: added an entity handling test.
+ * vm_exec.c: check VM_COLLECT_USAGE_DETAILS.
- * test/rss/test_2.0.rb: added RSS 2.0 tests.
- * test/rss/rss-assertions.rb: extended XML stylesheet assertion.
- * lib/rss/0.9.rb: added initialize method.
- * test/rss/test_1.0.rb: cleanup.
+Mon Dec 3 20:28:02 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rss/image.rb: added Image prefix.
- * lib/rss/maker/image.rb: ditto.
+ * compile.c (iseq_specialized_instruction):
+ change condition of using `opt_send_simple'.
+ More method invocations can be simple.
- * lib/rss/rss.rb: improved type conversion.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/0.9.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/syndication.rb: ditto.
+Mon Dec 3 20:03:38 2012 Koichi Sasada <ko1@atdot.net>
- * test/rss/test_2.0.rb: added type conversion tests.
- * test/rss/test_accessor.rb: ditto.
- * test/rss/test_to_s.rb: ditto.
- * test/rss/test_syndication.rb: ditto.
- * test/rss/test_setup_maker_2.0.rb: ditto.
- * test/rss/test_setup_maker_1.0.rb: ditto.
- * test/rss/test_setup_maker_0.9.rb: ditto.
- * test/rss/test_maker_sy.rb: ditto.
- * test/rss/test_maker_image.rb: ditto.
- * test/rss/test_maker_2.0.rb: ditto.
- * test/rss/test_maker_0.9.rb: ditto.
- * test/rss/test_image.rb: ditto.
+ * test/ruby/test_objectspace.rb: skip RuntimeError
+ which says a message "can't modify frozen File".
+ Is that correct behavior?
- * test/rss/test_maker_1.0.rb: use assert instead of assert_equal.
+Mon Dec 03 20:00:19 2012 Koichi Sasada <ko1@atdot.net>
- * test/rss/rss-assertions.rb: improved type conversion assertions.
+ * vm_exec.c: vm_analysis_insn should be static.
- * lib/rss/rss.rb: added backward compatibility codes.
- * lib/rss/parser.rb: ditto.
- * test/rss/test_parser.rb: ditto.
- * test/rss/test_2.0.rb: ditto.
+Mon Dec 3 19:10:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 17 02:01:00 2006 Tanaka Akira <akr@m17n.org>
+ * random.c (Init_Random), rational.c (Init_Rational): make marshal
+ methods private. [Feature #6539]
- * lib/pp.rb (Kernel#pretty_inspect): defined for pretty printed
- string.
+Mon Dec 3 18:29:27 2012 Koichi Sasada <ko1@atdot.net>
-Sat Jun 17 00:23:58 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * iseq.h: iseq_catch_table_entry::catch_type should be
+ Fixnum because they are pushed into Array in a compiler.
+ [Bug #7502]
- * parse.y (reswords): kDO_BLOCK was missing. fixed: [ruby-core:7995]
+ * test/ruby/test_objectspace.rb: add a test of this issue.
-Sat Jun 17 00:02:15 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Mon Dec 3 18:25:16 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/win32ole/win32ole.c (ole_propertyput): support
- PROPERTYPUTREF. [ruby-talk:183042]
+ * template/id.h.tmpl (preserved_ids): "empty?" is not an attribute name.
- * ext/win32ole/tests/test_propertyputref.rb: ditto.
+Mon Dec 3 16:23:09 2012 Koichi Sasada <ko1@atdot.net>
-Thu Jun 15 23:02:47 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * vm_backtrace.c (vm_backtrace_to_ary): check negative size (2nd arg).
- * ext/win32ole/win32ole.c (fole_methods): The return value
- of WIN32OLE#ole_methods should include PROPERTYPUTREF methods.
+Mon Dec 3 15:50:33 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/win32ole/win32ole.c (fole_put_methods): The return value
- of WIN32OLE#ole_put_methods should include PROPERTYPUTREF methods.
+ * misc/ruby-additional.el (ruby-mode-set-encoding): Unbreak by
+ fixing a typo, s/set/setq/.
- * ext/win32ole/tests/test_ole_methods.rb: ditto.
+Mon Dec 3 14:14:19 2012 Koichi Sasada <ko1@atdot.net>
- * ext/win32ole/tests/testall.rb : ditto.
+ * compile.c (iseq_compile_each): joke shouldn't use id.h defined ids.
-Wed Jun 14 18:23:28 2006 Eric Hodel <drbrain@segment7.net>
+ * id.c (Init_id): ditto.
- * enum.c (enum_any): Documentation typo.
+ * common.mk: fix dependency.
-Wed Jun 14 15:01:09 2006 Eric Hodel <drbrain@segment7.net>
+Mon Dec 3 12:43:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser#warn): Don't print
- warnings when -q is set.
+ * misc/ruby-mode.el (ruby-block-end-re, ruby-delimiter)
+ (ruby-mode-syntax-table, ruby-parse-partial, ruby-beginning-of-indent):
+ merge from Emacs.
-Wed Jun 14 23:03:53 2006 Tanaka Akira <akr@m17n.org>
+ * misc/ruby-mode.el (ruby-calculate-indent): fix indentation of
+ argument lines in parentheses. [Bug #5140]
- * configure.in: check sizeof(rlim_t).
- check setrlimit.
+Mon Dec 3 07:52:41 2012 Eric Hodel <drbrain@segment7.net>
- * process.c (proc_getrlimit): new method Process.getrlimit.
- (proc_setrlimit): new method Process.setrlimit.
+ * lib/rdoc/parser.rb: Improved modeline support. Patch by nobu.
+ * test/rdoc/test_rdoc_parser.rb: Test for above.
- * ruby.h (NUM2ULL): new macro.
+Sun Dec 3 00:06:00 2012 Kenta Murata <mrkn@mrkn.jp>
-Mon Jun 12 22:25:09 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_new): stop checking string
+ taintness. [Bug #5508] [ruby-core:40510]
- * sprintf.c (rb_f_sprintf): adjust precision length to prevent
- splitting multi-byte characters. [ruby-list:42389]
+Sun Dec 2 19:26:47 2012 Masaya Tarui <tarui@ruby-lang.org>
-Sun Jun 11 23:20:07 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (RB_GC_SAVE_MACHINE_CONTEXT, rb_gc_save_machine_context):
+ extract rb_gc_save_machine_context to RB_GC_SAVE_MACHINE_CONTEXT.
+ NOTE: machine_regs and machine_stack_end must be set in current scope.
- * lib/optparse.rb (OptionParser::Arguable#getopts): pass self to the
- parser.
+Sun Dec 2 18:46:24 2012 Koichi Sasada <ko1@atdot.net>
-Sun Jun 11 10:00:57 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * array.c, enum.c, insns.def, io.c, numeric.c, parse.y, process.c,
+ range.c: use prepared IDs.
+ A patch from charliesome (Charlie Somerville).
+ [Bug #7495]
- * win32/win32.h (write): not need to define on bcc.
+ * common.mk: add dependency to id.h.
-Sun Jun 11 08:30:33 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk: replace ID_H_INCLUDES with id.h.
- * lib/optparse.rb (OptionParser#getopts): new methods.
+Sun Dec 2 16:48:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Sat Jun 10 18:02:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/weakref.rb (rdoc): Clean up usage, add example,
+ note ArgumentError on WeakRef.new
- * ext/bigdecimal/lib/bigdecimal/newton.rb (Newton::nlsolve): typo
- fixed: raize -> raise. [ruby-talk:196608]
+Sun Dec 2 16:45:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Thu Jun 8 14:19:17 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * gc.c (WeakMap): Add doc for internal reference, use lib/weakref.rb
- * win32/win32.[ch] (rb_w32_read, rb_w32_write): new functions.
- use recv() and send() when fd is socket. fixed: [ruby-dev:28694]
+Sun Dec 2 07:24:23 2012 Eric Hodel <drbrain@segment7.net>
-Wed Jun 7 16:22:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rdoc/parser.rb: Parse files with a -*- rdoc -*- modeline
+ * test/rdoc/test_rdoc_parser.rb: Test for above
- * lib/tempfile.rb (Tempfile::make_tmpname): put dot between
- basename and pid. [ruby-talk:196272]
+Sun Dec 2 06:02:00 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Jun 7 14:53:04 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * gc.h (SET_MACHINE_STACK_END): add volatile for preventing
+ harmful optimization. [ruby-dev:46665] [Bug #7468]
- * win32/win32.c (errmap): add some winsock errors.
+Sun Dec 2 05:01:58 2012 Koichi Sasada <ko1@atdot.net>
-Wed Jun 7 11:34:38 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * iseq.c (rb_iseq_line_trace_each): iterate `line' event only.
- * configure.in: add new configure option `--with-winsock2' for mingw.
+ * test/ruby/test_iseq.rb: add a test for this change.
- * win32/Makefile.sub (config.h): define USE_WINSOCK2 in config.h
- instead of in CPPFLAGS.
+Sun Dec 2 02:46:04 2012 Koichi Sasada <ko1@atdot.net>
- * ext/socket/extconf.rb: determine whether to use winsock2 or not
- by using with_config.
+ * vm_trace.c: add TracePoint#inspect.
-Wed Jun 7 10:45:10 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/ruby/test_settracefunc.rb: add a test for this change.
- * win32/{configure.bat, setup.mak, Makefile.sub, win32.h}: add
- new configure option `--with-winsock2'.
+Sat Dec 1 21:18:19 2012 Koichi Sasada <ko1@atdot.net>
- * win32/win32.c (StartSockets): ditto.
+ * test/ruby/test_backtrace.rb: add a test for
+ Thread::Backtrace::Location#inspect.
+ BTW, tests for `caller_locations' are not enough.
+ Any volunteers are welcome.
- * ext/socket/extconf.rb: ditto.
+Sat Dec 1 21:06:58 2012 Koichi Sasada <ko1@atdot.net>
- * win32/win32.c (open_ifs_socket): new function.
+ * vm_backtrace.c (location_inspect_m): add
+ Thread::Backtrace::Location#inspect.
+ It same as loc_obj.to_s.inspect.
- * win32/win32.c (StartSockets, rb_w32_socket): use open_ifs_socket()
- instead of socket().
- ifs socket support is backported from trunk.
+Sat Dec 1 19:24:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 7 09:14:44 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * io.c (rb_io_puts): recurse for the argument itself, not converted
+ array elements. [ruby-core:42444] [Bug #5986]
- * eval.c (rb_call0): binding for the return event hook should have
- consistent scope. [ruby-core:07928]
+Sat Dec 1 19:01:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
- event_hooks. no guarantee for arbitrary hook deletion.
- [ruby-dev:28632]
+ * marshal.c (w_object, r_object0): call private marshal methods.
+ [Feature #6539]
-Mon Jun 5 18:12:12 2006 Tanaka Akira <akr@m17n.org>
+Sat Dec 1 18:52:22 2012 Eric Hodel <drbrain@segment7.net>
- * ext/socket/socket.c (sock_s_unpack_sockaddr_in): reject
- non-AF_INET/AF_INET6 sockaddr.
- (sock_s_unpack_sockaddr_un): reject non-AF_UNIX sockaddr.
- [ruby-dev:28691]
+ * lib/rubygems/commands/cleanup_command.rb: Fix cleanup command for
+ multiple gems. [ruby-trunk - #7481] by Kouhei Sutou
+ * test/rubygems/test_gem_commands_cleanup_command.rb: Test for above.
+ * lib/rubygems.rb: Autoload Gem::Source to prevent test failures
-Sun Jun 4 20:40:19 2006 Tanaka Akira <akr@m17n.org>
+Sat Dec 1 18:17:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c: fix sockaddr_un handling.
- [ruby-dev:28677]
+ * complex.c (Init_Complex), time.c (Init_Time): make marshal methods
+ private. [Feature #6539]
-Fri Jun 2 22:08:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * object.c (Init_Object): make remove_instance_variable public.
+ [Feature #6539]
- * lib/forwardable.rb: RDoc typo fix from Jan Svitok
- <jan.svitok at gmail.com>. [ruby-core:07943]
+ * id.c (Init_id), template/id.h.tmpl: add initialize_{copy,clone,dup}
+ and respond_to_missing?.
-Fri Jun 2 19:02:09 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * vm_method.c (rb_method_entry_make): make above methods private.
+ [Feature #6539]
- * ext/openssl/extconf.rb: use create_header.
+Sat Dec 1 16:40:22 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/openssl/ossl.h, ext/openssl/openssl_missing.h:
- include RUBY_EXTCONF_H.
+ * test/ruby/test_thread.rb: move ConditionVariable related test
+ into test/thread/test_cv.rb.
+ * test/thread/test_cv.rb: new file.
+ * test/thread/test_cv.rb (test_condvar_empty_signal): new tests.
+ * test/thread/test_cv.rb (test_condvar_empty_broadcast): ditto.
-Fri Jun 2 17:16:52 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 1 15:14:25 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/mkmf.rb (CLEANINGS): remove extconf.h by distclean if created.
+ * test/ruby/test_thread.rb (test_cv_wait_deadlock): enable
+ cv deadlock test.
-Fri Jun 2 00:11:19 2006 Tanaka Akira <akr@m17n.org>
+Sat Dec 1 14:23:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/socket/socket.c (s_recvfrom): alen may be zero with UNIXSocket
- too. (tested on NetBSD 3.0)
- (s_recvfrom_nonblock): extracted from sock_recvfrom_nonblock.
- (sock_recvfrom_nonblock): use s_recvfrom_nonblock.
- (ip_recvfrom_nonblock): new method: IPSocket#recvfrom_nonblock
- (unix_recvfrom_nonblock): new method: UNIXSocket#recvfrom_nonblock
- (s_accept_nonblock): extracted from sock_accept_nonblock.
- (sock_accept_nonblock): use s_accept_nonblock.
- (tcp_accept_nonblock): new method: TCPServer#accept_nonblock
- (unix_accept_nonblock): new method: UNIXServer#accept_nonblock
+ * lib/thread.rb (ConditionVariable): use hash instead of array for
+ @waiters.
+ * test/thread/test_queue.rb (test_sized_queue_and_wakeup): remove
+ a test because @waiters no longer have a chance to duplicated. Now it's
+ a hash.
-Thu Jun 1 19:12:37 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 1 17:16:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_cmdvector): backslashes inside single-quotes
- no longer has special meanings. fixed: [ruby-list:42311]
+ * misc/ruby-electric.el (ruby-electric-curlies): use kill-region
+ instead of interactive command delete-backward-char.
-Thu Jun 1 16:14:41 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Dec 1 17:12:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_getcwd): runtime's getcwd() will not success
- if the length of the cwd is longer than MAX_PATH.
- fixed [ruby-list:42335]
+ * misc/inf-ruby.el (inferior-ruby-mode): fix the
+ compilation-shell-minor-mode configuration. a patch by
+ j2petkov (Jean-Christophe Petkovich) in [ruby-core:46518].
+ [Bug #6742]
-Thu Jun 1 11:29:14 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Dec 1 15:05:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_getcwd): set errno if not set.
- fixed [ruby-list:42346]
+ * dir.c (glob_helper): use NAMLEN() to tell the length of d_name
+ instead of strlen(), which can access beyond the boundary.
-Sat May 27 11:29:46 2006 nobuyoshi nakada <nobu@ruby-lang.org>
+Sat Dec 1 13:48:13 2012 Eric Hodel <drbrain@segment7.net>
- * ext/extmk.rb (extmake): remove extinit files if no statically linked
- extensions.
+ * lib/rubygems/specification.rb: Don't add default gems to $LOAD_PATH
+ as they are already there.
-Fri May 26 09:05:11 2006 nobuyoshi nakada <nobu@ruby-lang.org>
+Sat Dec 1 12:22:17 2012 Kouhei Sutou <kou@cozmixng.org>
- * ruby.h, lib/mkmf.rb (create_header): clear command line options for
- macros moved to extconf.h.
+ * re-added r38053 that is reverted by r38061. Problems by r38053
+ are resolved by r38096. r38096 removed GEM_SKIP configuration.
- * ext/extmk.rb (extract_makefile, extmk): made RUBY_EXTCONF_H and
- EXTSTATIC permanent.
+ The below is ChangeLog of r38053:
- * ext/{dbm,digest/*,socket,zlib}/extconf.rb: used $defs and $INCFLAGS.
+ * defs/default_gems: Add base directory column.
- * {bcc32,win32,wince}/Makefile.sub (COMPILE_C, COMPILE_CXX): added
- $(INCFLAGS).
+ * tool/rbinstall.rb:
+ - Install .gemspecs of default gem to
+ #{GEM_HOME}/specifications/default/.
+ - Update files parameter of .gemspecs by relative path from
+ library directory.
- * lib/mkmf.rb (configuration): add $defs unless extconf.h was created.
+Sat Dec 1 11:09:12 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu May 25 01:52:07 2006 nobuyoshi nakada <nobu@ruby-lang.org>
+ * variable.c (rb_class_path_no_cache): add a function to get the class
+ path without caching the computed path. Some classes are frozen, and
+ will raise an exception without this.
- * lib/mkmf.rb (pkg_config): particular config commands support.
+ * probes.d (cmethod-entry, cmethod-return): separate cmethods from
+ regular methods to match set trace func.
- * ext/extmk.rb: deal with $static set in extconf.rb.
+ * probes_helper.h: refactor macros. Fix probes to avoid calling
+ #inspect when profiling.
- * mkconfig.rb: merge multiple entries to an entry with multiple lines.
+ * insns.def: update for use with new macros.
- * lib/mkmf.rb: allow a series of commands to link.
+ * vm_eval.c: ditto
- * win32/Makefile.sub: embed manifests.
+ * vm_insnhelper.c: ditto
- * win32/setup.mak: suffix OS name by runtime version.
+ * test/dtrace/test_singleton_function.rb: fix test for new output.
-Wed May 24 23:52:11 2006 nobuyoshi nakada <nobu@ruby-lang.org>
+ * test/dtrace/test_cmethod.rb: test the cmethod probes.
- * configure.in (ac_install_sh): ignore dummy install-sh.
- [ruby-talk:193876]
+Sat Dec 1 09:44:16 2012 Eric Hodel <drbrain@segment7.net>
-Wed May 24 03:10:48 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/rdoc/test_rdoc_options.rb: Windows drive letters are
+ case-insensitive.
- * ext/openssl/lib/openssl/ssl.rb
- (OpenSSL::SSL::SocketForwarder#setsockopt,getsockopt): typo fixed.
+Sat Dec 1 09:42:13 2012 Eric Hodel <drbrain@segment7.net>
-Mon May 22 17:54:12 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/rubygems.rb: Search for gem deps file up the directory tree.
+ * test/rubygems/test_gem.rb: Test for above.
- * ext/socket/socket.c (sock_recvfrom_nonblock): use rb_read_pending
- instead of rb_io_read_pending.
- [ruby-dev:28663]
+Sat Dec 1 09:33:32 2012 Eric Hodel <drbrain@segment7.net>
-Mon May 22 17:30:04 2006 Tanaka Akira <akr@m17n.org>
+ * test/runner.rb: Set GEM_HOME, GEM_PATH and GEM_SKIP to empty set.
+ With default_gem support in RubyGems GEM_SKIP prevents loading of
+ built-in gems.
- * rubyio.h (rb_io_set_nonblock): declared.
+Sat Dec 1 07:16:17 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * io.c (rb_io_set_nonblock): new function.
- (io_getpartial): nonblocking read support.
- (io_read_nonblock): new method: IO#read_nonblock.
- (io_write_nonblock): new method: IO#write_nonblock.
+ * compile.c (ADD_CATCH_ENTRY): add a cast to fix SEGV with x64 mingw
+ on Windows 8. Without cast, 0 might be non zero value at higher bits
+ in rb_ary_new3().
+ [ruby-core:50258] [Bug #7456]
- * ext/socket/socket.c
- (sock_connect_nonblock): new method: Socket#connect_nonblock.
- (sock_accept_nonblock): new method: Socket#accept_nonblock.
- (sock_recvfrom_nonblock): new method: Socket#recvfrom_nonblock.
+Sat Dec 1 04:07:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
- [ruby-core:7917]
+ * parse.y (parser.utf8): remove unused property.
-Mon May 22 15:57:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * parse.y (UTF8_ENC): remove unused macro.
- * eval.c (umethod_bind): should not update original class.
- [ruby-dev:28636]
+ * parse.y (parser_tokadd_utf8): use rb_utf8_encoding() directly.
-Mon May 22 13:38:57 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 1 03:49:45 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (ev_const_get): should support constant access from
- within instance_eval(). [ruby-dev:28327]
+ * lib/sync.rb (Sync_m#sync_synchronize): add Thread.async_interrupt_timing
+ for protecting from async interrupt.
+ * lib/sync.rb (Sync_m#sync_lock): ditto.
-Thu May 18 17:51:32 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 1 03:38:04 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * time.c (time_timeval): should round for usec floating
- number. [ruby-core:07896]
+ * lib/thread.rb (ConditionVariable#broadcast): s/RuntimeError/StandardError/
+ * lib/thread.rb (ConditionVariable#signal): ditto.
- * time.c (time_add): ditto.
+Sat Dec 1 03:29:52 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu May 18 17:11:45 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/thread.rb (SizedQueue#pop): rewrite by using ConditionVariable.
+ * lib/thread.rb (SizedQueue#push): ditto.
+ * lib/thread.rb (SizedQueue#max): ditto.
+ * lib/thread.rb (Queue#pop): ditto.
+ * lib/thread.rb (Queue#push): ditto.
- * lib/cgi.rb (CGI::out): support utf-8. a patch from Fujioka
- <fuj at rabbix.jp>. [ruby-dev:28649]
+ * lib/thread.rb (SizedQueue#num_waiting): adopt the above changes.
+ * lib/thread.rb (SizedQueue#initialize): ditto.
+ * lib/thread.rb (Queue#num_waiting): ditto.
+ * lib/thread.rb (Queue#initialize): ditto.
+ * test/thread/test_queue.rb (test_sized_queue_and_wakeup): ditto.
-Thu May 18 00:42:12 2006 nobuyoshi nakada <nobu@ruby-lang.org>
+Sat Dec 1 03:45:47 2012 Koichi Sasada <ko1@atdot.net>
- * ext/extmk.rb, lib/mkmf.rb: use BUILD_FILE_SEPARATOR in Makefiles.
+ * thread.c (Thread.async_interrupt_timing): fix RDoc.
+ :never is not used any more.
-Wed May 17 17:55:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 1 02:56:19 2012 Koichi Sasada <ko1@atdot.net>
- * dir.c (sys_warning): should not call a vararg function
- rb_sys_warning() indirectly. [ruby-core:07886]
+ * iseq.c: add RubyVM::InstructionSequence (ISeq) inspection methods.
+ * ISeq#path returns path of this ISeq written.
+ * ISeq#absolute_path returns absolute path.
+ * ISeq#label returns label (method name and so on).
+ * ISeq#base_label returns base label (see Thread::Backtrace::Location).
+ * ISeq#first_lineno returns first line number of this ISeq.
+ * ISeq.of(obj) returns ISeq object which obj (Proc or Method)
+ is contains.
-Wed May 17 08:17:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_iseq.rb: add tests.
- * util.c (ruby_strtod): try to reduce errors using powersOf10
- table. [ruby-dev:28644]
+Sat Dec 1 02:58:51 2012 Eric Hodel <drbrain@segment7.net>
-Tue May 16 15:34:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/ruby.h (rb_event_flag_t): Maintain integer precision
+ for clang error (VALUE aka unsigned long vs unsigned int)
- * re.c (rb_reg_initialize): should not allow modifying literal
- regexps. frozen check moved from rb_reg_initialize_m as well.
+Sat Dec 1 02:53:18 2012 Eric Hodel <drbrain@segment7.net>
-Tue May 16 09:20:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/rubygems/test_gem_dependency_installer.rb: Use Gem.read_binary
+ instead of File.binread for ruby 1.8 compatibility in the rubygems
+ source repository. Updates r38075
- * re.c (rb_reg_initialize): should not modify untainted objects in
- safe levels higher than 3.
+Sat Dec 1 02:33:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * re.c (rb_memcmp): type change from char* to const void*.
+ * thread.c (rb_threadptr_interrupt_mask, async_interrupt_timing_func):
+ merge into them into rb_thread_s_async_interrupt_timing.
+ * thread.c (rb_thread_s_async_interrupt_timing): ditto.
- * dir.c (dir_close): should not close untainted dir stream.
+Sat Dec 1 02:11:47 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * dir.c (GetDIR): add tainted/frozen check for each dir operation.
+ * thread.c (rb_threadptr_interrupt_mask): add argument check.
+ * thread.c (async_interrupt_timing_arg_check_i): helper function
+ for the above.
+ * test/ruby/test_thread.rb (test_async_interrupt_timing_invalid_argument):
+ test for the above.
-Mon May 15 17:42:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 1 01:19:34 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
- typo fixed. a patch from Florian Gross <florg at florg.net>.
+ * lib/thread.rb (ConditionVariable#broadcast): protect from
+ async interrupt by using Thread.async_interrupt_timing.
+ * lib/thread.rb (ConditionVariable#signal): ditto.
+ * lib/thread.rb (ConditionVariable#wait): ditto.
-Sat May 13 16:14:05 2006 Tanaka Akira <akr@m17n.org>
+Sat Dec 1 02:04:23 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/pp.rb (PP.mcall): new method.
- (Struct#pretty_print): call Kernel#class and Struct#members even if
- overridden.
- (Struct#pretty_print_cycle): ditto.
- [ruby-core:7865]
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_in_out_err):
+ raise if assert_in_out_err misused.
-Thu May 11 19:57:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 1 02:08:16 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * util.c (ruby_strtod): differ addition to minimize error.
- [ruby-dev:28619]
+ * test/rdoc/test_rdoc_rubygems_hook.rb
+ (TestRDocRubygemsHook#test_setup_unwritable): 1. check the existence
+ of the file(directory) before touch it. 2. remove test
+ file(directory) after the test. see [ruby-core:50388].
-Fri Aug 11 15:39:25 2006 Eric Hodel <drbrain@segment7.net>
+Sat Dec 1 01:51:06 2012 Koichi Sasada <ko1@atdot.net>
- * lib/yaml/tag.rb: Replace nodoc with stopdoc so Module methods get
- documented.
+ [EXPERIMENTAL]
+ * iseq.c: add following two methods.
+ * ISeq#line_trace_all returns all line traces (line numbers)
+ * ISeq#line_trace_specify(pos, set) set `pos'th line event to
+ specified_line event (if set is true).
+ These features are introduced for debuggers (mainly to make
+ breakpoint).
-Thu May 11 18:10:43 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * iseq.h: add decl. of C APIs.
- * util.c (ruby_strtod): should not raise ERANGE when the input
- string does not have any digits. [ruby-dev:28629]
+ * test/ruby/test_iseq.rb: add tests.
-Sun May 7 03:09:51 2006 Stephan Maka <stephan@spaceboyz.net>
+ * vm_trace.c: add `specified_line' event.
- * lib/resolv.rb (Resolv::DNS::Requester::ConnectedUDP#initialize):
- Use AF_INET6 for nameservers containing colons.
+ * include/ruby/ruby.h: ditto.
-Sat May 6 00:38:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 1 01:49:52 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * signal.c (trap): sig should be less then NSIG. Coverity found
- this bug. a patch from Kevin Tew <tewk at tewk.com>.
- [ruby-core:07823]
+ * test/rubygems/test_gem_dependency_installer.rb: gems are of course
+ binary files, so use a binary reading method when reading it.
+ see [ruby-core:50388].
-Thu May 4 02:24:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 1 01:21:07 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/syck/emitter.c (syck_scan_scalar): avoid accessing
- uninitialized array element. a patch from Pat Eyler
- <rubypate at gmail.com>. [ruby-core:07809]
+ * lib/rubygems/command.rb (Gem::Command#get_all_gem_names_and_versions):
+ who assumes that the pathname of a gem never contains ':' ?
+ yes, on Unixen pathnames can contain ':', and on Windows they almost
+ certainly contain ':'. see [ruby-core:50388].
- * array.c (rb_ary_fill): initialize local variables first. a
- patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
+ * lib/rubygems/requirement.rb (Gem::Requirement::PATTERN_RAW): extract
+ the regexp to match the version specifier from PATTERN to use in
+ above method.
- * ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
- type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
- [ruby-core:07808]
+Sat Dec 1 00:48:19 2012 Naohisa Goto <ngotogenome@gmail.com>
-Wed May 3 02:12:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/fiddle/extconf.rb, ext/fiddle/function.c
+ (Fiddle::Function::STDCALL): FFI_STDCALL is not a macro, but an
+ enumeration. [ruby-core:50398] [Bug #7483]
- * ext/socket/socket.c (make_hostent_internal): accept ai_family
- check from Sam Roberts <sroberts at uniserve.com>.
- [ruby-core:07691]
+Sat Dec 1 00:08:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon May 1 12:23:19 2006 <sinara@blade.nagaokaut.ac.jp>
+ * test/rubygems/test_gem_installer.rb
+ (TestGemInstaller#test_check_executable_overwrite_other_non_gem):
+ on Windows, rubygems always generate a wrapper .bat file when
+ installing a file into bin, so testing no-overwrite a wrapper file
+ and a non-wrapper file is nonsense. see [ruby-core:50388].
- * numeric.c (num_div): use floor rather than rb_Integer().
- [ruby-dev:28589]
+Fri Nov 30 23:39:58 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * numeric.c (flo_divmod): the first element of Float#divmod should
- be an integer. [ruby-dev:28589]
+ * test/rubygems/test_gem_installer.rb
+ (TestGemInstaller#test_check_executable_overwrite_default_bin_dir):
+ if the executable to be overwritten was generated by rubygems, the
+ error message differs from the only copied one's.
+ see [ruby-core:50388].
- * test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
+Fri Nov 30 23:27:26 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Apr 29 22:42:08 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/rubygems/test_gem_ext_ext_conf_builder.rb
+ (TestGemExtExtConfBuilder::test_class_make): reading with binary mode
+ of course introduce \r on Windows. see [ruby-core:50388].
- * ext/openssl/ossl_asn1.c (ossl_asn1_decode0): should initialize
- flag. [ruby-core:07785]
+Fri Nov 30 23:11:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Apr 28 10:53:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rubygems/specification.rb
+ (Gem::Specification.validate_permissions): don't check executability
+ of the source on Windows. they will be wrapped to .bat files when
+ installing. see [ruby-core:50388].
- * util.c (ruby_strtod): should not cut off 18 digits for no
- reason. [ruby-core:07796]
+Fri Nov 30 22:44:14 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * util.c (ruby_strtod): fixed wrong conversion.
+ * vm_core.h (rb_vm_struct): add thread_destruct_lock field.
+ * thread.c (Init_Thread): ditto.
+ * thread.c (rb_vm_gvl_destroy): ditto.
-Thu Apr 27 01:38:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread.c (thread_start_func_2): make sure vm->running_thread
+ don't point to dead thread.
+ * thread.c (timer_thread_function): close a race against thread
+ destruction. [Bug #4911][ruby-dev:43859]
- * array.c (rb_ary_fill): internalize local variable "beg" to
- pacify Coverity. [ruby-core:07770]
+ * vm_core.h (rb_thread_set_current): reset running time of
+ current thread instead of previous thread. We no longer
+ assume previous running thread still live.
-Wed Apr 26 16:59:24 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 30 21:57:43 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * pack.c (pack_unpack): now supports CRLF newlines. a patch from
- <tommy at tmtm.org>. [ruby-dev:28601]
+ * revert r38053 because it causes too many test failures.
+ if you've already installed r38053 or later, remove the installed
+ lib/ruby/gems/2.0.0 directory and reinstall this revision or later.
-Tue Apr 25 18:00:05 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri Nov 30 21:07:56 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/tcltklib.c (delete_slaves): maybe increment the reference
- count of a NULL Tcl_Obj [ruby-core:07759].
+ * lib/test/unit/parallel.rb (Test::Unit::Worker.run): wrap LoadError
+ because it's Gem::LoadError sometimes. see [Bug #6882]
-Tue Apr 25 07:55:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 30 20:47:44 2012 Koichi Sasada <ko1@atdot.net>
- * lib/jcode.rb (String::tr_s): should have translated non
- squeezing character sequence (i.e. a character) as well. thanks
- to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
+ * thread.c: TracePoint#self returns invoking/exiting thread object
+ at thread_begin/end event.
-Tue Apr 25 00:08:24 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_settracefunc.rb: fix test.
- * regex.c (re_compile_pattern): should check if c is not a
- multibyte character. a patch from KIMURA Koichi
- <kimura.koichi at canon.co.jp>. [ruby-dev:28598]
+Fri Nov 30 19:55:17 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Apr 21 15:19:13 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/ruby/memory_status.rb (Memory::Win32): use fiddle instead of dl,
+ but I doubt fiddle is not compatible with dl. (if you are interested,
+ see the diff.) [ruby-core:50194] [Bug #7443]
- * ext/tk/tcltklib.c (lib_eventloop_ensure): refer freed pointer
- [ruby-core:07744] and memory leak.
+Fri Nov 30 19:37:44 2012 Kouhei Sutou <kou@cozmixng.org>
-Fri Apr 21 12:14:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * defs/default_gems: Add base directory column.
- * ext/socket/socket.c: document update patch from Sam Roberts
- <sroberts at uniserve.com>. [ruby-core:07701]
+ * tool/rbinstall.rb:
+ - Install .gemspecs of default gem to
+ #{GEM_HOME}/specifications/default/.
+ - Update files parameter of .gemspecs by relative path from
+ library directory.
-Wed Apr 19 13:55:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 30 19:30:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * parse.y (arg): too much NEW_LIST()
+ * vm_trace.c:
+ tracepoint_attr_return_value (TracePoint#return_value):
+ include `:b_return` for method doc
+ tracepoint_enable_m, tracepoint_disable_m (#enable/#disable):
+ don't have block argument, document block scope
- * eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
+Fri Nov 30 18:52:56 2012 Koichi Sasada <ko1@atdot.net>
-Wed Apr 19 11:57:04 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_trace.c (tracepoint_disable_m, tracepoint_enable_m):
+ fix block parameter.
+ No argument should be given to a block which is passed
+ to TracePoint#enable (and disable).
- * eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
- [ruby-dev:28585]
+Fri Nov 30 18:23:26 2012 Koichi Sasada <ko1@atdot.net>
- * parse.y (list_concat): revert last change.
+ * thread.c: rename Thread.control_interrupt
+ to Thread.async_interrupt_timing.
+ The option name `:never' is also changed to `:defer'.
+ [ruby-core:50375] [ruby-trunk - Feature #6762]
- * parse.y (arg): use NODE_ARGSCAT for placeholder.
+ * thread.c: remove Thread.check_interrupt.
+ This method is difficult to understand by name.
-Wed Apr 19 11:13:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread.c: add Thread.async_interrupted?.
+ This method check any deferred async interrupts.
- * lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
- mathew <meta at pobox.com>. [ruby-core:07738]
+ * test/ruby/test_thread.rb: change tests for above.
-Wed Apr 19 10:13:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 30 18:24:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * variable.c (rb_const_set): raise error when no target klass is
- supplied. [ruby-dev:28582]
+ * vm_trace.c: Documentation for TracePoint API
+ [ruby-core:47243] [Feature #6895]
-Wed Apr 19 09:49:36 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 30 17:43:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (list_concat): should not modify nodes other than
- NODE_ARRAY. [ruby-dev:28583]
+ * string.c (rb_str_cmp_m): try to compare with to_str result if
+ possible before calling <=> method. [ruby-core:49279] [Bug #7342]
-Tue Apr 18 17:40:37 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * string.c (rb_str_cmp_m): use rb_check_funcall instead of respond_to
+ and call.
- * ext/tk/lib/multi-tk.rb: add a binding to a container for a slave IP.
+ * string.c (rb_str_cmp_m): return fixed value, one of -1,0,+1 always.
- * ext/tk/lib/tk.rb: update RELEASE_DATE.
+Fri Nov 30 16:19:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/tcltklib.c: forget to reset a Tcl interpreter.
+ * vm_dump.c (rb_vm_bugreport): get rid of calling methods in sigsegv
+ handler. based on a patch by charliesome (Charlie Somerville)
+ [ruby-core:49573] [Bug #7402]
- * ext/tk/stubs.c: fix potential bugs about handling rb_argv0.
+Fri Nov 30 16:05:44 2012 Eric Hodel <drbrain@segment7.net>
-Tue Apr 18 00:11:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * NEWS: Added RubyGems 2.0.0
- * eval.c: block_unique should be 1, not frame_unique.
- [ruby-dev:28577]
+Fri Nov 30 15:24:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Aug 11 15:39:25 2006 Eric Hodel <drbrain@segment7.net>
+ * parse.y (parser_yylex): fix false usage of local variable, it cannot
+ appear in fname state [ruby-core:49659] [Bug #7408]
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#find_body): Make RDoc
- ignore C function prototypes. Patch by Tilman Sauerbeck
- <tilman at code-monkey.de>. [ruby-core:8574]
- * lib/yaml/tag.rb: Replace nodoc with stopdoc so Module methods get
- documented.
+Fri Nov 30 15:20:12 2012 Eric Hodel <drbrain@segment7.net>
-Mon Apr 10 01:03:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rubygems/package.rb: Load YAML for building gems.
+ * test/rubygems/test_gem_commands_contents_command.rb: Sort expected
+ output of default gem contents. Re-fixes r38004 and r38005.
- * prec.c (prec_prec_f): documentation patch from
- <gerardo.santana at gmail.com>. [ruby-core:07689]
+Fri Nov 30 15:15:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Sat Apr 8 02:34:34 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_trace.c (set_trace_func): Formatting of params and events
- * bignum.c (rb_big_pow): second operand may be too big even if
- it's a Fixnum. [ruby-talk:187984]
+Fri Nov 30 14:45:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Sat Apr 8 02:12:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/net/http.rb: Net::HTTP::Patch to list of HTTP Request Classes
+ Patch by Ryunosuke SATO [Fixes #217 on github]
- * README.EXT: update symbol description. [ruby-talk:188104]
+Fri Nov 30 14:05:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Thu Apr 6 23:28:47 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/cgi.rb: CGI example for HTML generation
+ Patch by Marcus Stollsteimer [ruby-core:50303] [Bug #7465]
- * COPYING: explicitly note GPLv2. [ruby-talk:187922]
+Fri Nov 30 13:52:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Thu Apr 6 11:18:37 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * time.c: Documentation improvements, grammar and formatting
+ Patch by Bernd Homuth [ruby-core:49203] [Bug #7326]
- * ext/tk/lib/tk/panedwindow.rb: lack of arguments. [ruby-core:7681]
+Fri Nov 30 13:48:33 2012 Eric Hodel <drbrain@segment7.net>
-Thu Apr 6 01:04:47 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/rdoc.rb: Set version to 4.0.0.preview2
+ * lib/rubygems.rb: Set version to 2.0.0.preview2
- * ext/tk/tcltklib.c: fix SEGV when embedding to an application.
- [ruby-core:7600]
+Fri Nov 30 13:11:53 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/tcltklib.c: fix SEGV at exit. [ruby-talk:186489]
+ * lib/rubygems/commands/setup_command.rb: Remove old files on install
+ of RubyGems. (not by rbinstall.rb).
+ * test/rubygems/test_gem_commands_setup_command.rb: Test for above.
- * ext/tk/tkutil/tkutil.c: follow to changing specification of
- instance_eval on ruby-1.9.x.
+Fri Nov 30 12:47:59 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/tk/lib/tk.rb: ditto.
+ * lib/abbrev.rb (Abbrev#abbrev): A fixed string prefix pattern
+ should only match the beginning of each word, not the beginning
+ of every line in it.
- * ext/tk/lib/multi-tk.rb: ditto.
+ * lib/abbrev.rb (Abbrev#abbrev): Stop using a regexp that causes a
+ false warning. [Bug #7471]
- * ext/tk/lib/tk.rb: remove warning about redefinition of methods.
+Fri Nov 30 12:30:55 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/tk/lib/tk/variable.rb: remove warning about unseting Tcl
- variables.
+ * test/test_abbrev.rb: Add tests for lib/abbrev.rb.
-Wed Mar 29 20:54:44 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Fri Nov 30 12:27:51 2012 Eric Hodel <drbrain@segment7.net>
- * ext/win32ole/win32ole.c (fole_getproperty): WIN32OLE#[] should accept
- multi arguments.
+ * lib/rubygems/spec_fetcher.rb: Allow prerelease spec fetching to fail
+ for bundler.
+ * test/rubygems/test_gem_spec_fetcher.rb: Test for above.
- * ext/win32ole/tests/testWIN32OLE.rb (test_setproperty_bracket): ditto.
+Fri Nov 30 12:20:53 2012 Eric Hodel <drbrain@segment7.net>
-Wed Mar 29 10:07:44 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/rake/backtrace.rb: Removed duplication in
+ Rake::Backtrace::SUPPRESSED_PATHS
+ * test/rake/test_rake_backtrace.rb: Skip tests when tmpdir is in the
+ suppressed pattern.
- * ext/nkf/nkf-utf8/nkf.c (nkf_each_char_to_hex, encode_fallback_subchar,
- e2w_conv): support C90 compiler.
+Fri Nov 30 11:07:45 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed Mar 29 06:48:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * revert r37993 to avoid SEGV in tests.
- * eval.c (backtrace): reports aliased method names in a generated
- backtrace. a patch from "U.Nakamura" <usa at garbagecollect.jp>.
- [ruby-dev:28471]
+Fri Nov 30 10:38:54 2012 Eric Hodel <drbrain@segment7.net>
-Mon Mar 27 22:19:09 2006 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/rdoc/ri/driver.rb: Relaxed matching for pages to be more
+ user-friendly.
+ * test/rdoc/test_rdoc_ri_driver.rb: Test for above.
- * ext/nkf/nkf-utf8/{nkf.c, utf8tbl.c, config.h}: imported nkf 2.0.6.
- * Add --ic / --oc option and mapping tables.
- * Add fallback option.
- * Add --no-best-fit-chars option.
- * Fix some bugs.
+Fri Nov 30 09:50:16 2012 Eric Hodel <drbrain@segment7.net>
- * ext/nkf/nkf.c (nkf_split_options): added for parse option string.
+ * lib/rdoc/markdown.rb: Fixed warnings with -w
- * ext/nkf/lib/kconv.rb (Kconv.to*): add -m0.
- Note that Kconv.to* still imply -X.
+Fri Nov 30 09:38:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 27 03:17:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/ruby.h (RB_GC_GUARD_PTR): add note.
- * eval.c (rb_call0): insecure calling should be checked for non
- NODE_SCOPE method invocations too.
+ * vm_backtrace.c (backtrace_to_str_ary): use RB_GC_GUARD() instead of
+ RB_GC_GUARD_PTR() which has no effect.
+ (backtrace_to_location_ary): ditto.
+ (vm_backtrace_to_ary): ditto.
- * eval.c (rb_alias): should preserve the current safe level as
- well as method definition.
+Fri Nov 30 09:22:52 2012 Eric Hodel <drbrain@segment7.net>
-Fri Mar 24 23:14:30 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rubygems/commands/contents_command.rb: Sort output from command.
+ Replaces r38004, r38005
+ * test/rubygems/test_gem_commands_contents_command.rb: ditto.
- * eval.c (yield_under_i): pass self again for instance_eval().
- [ruby-dev:28466]
+ * lib/rubygems/defaults.rb: Use Gem.path_separator for jruby support.
+ * lib/rubygems/path_support.rb: ditto
-Fri Mar 24 17:20:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 30 08:34:03 2012 Eric Hodel <drbrain@segment7.net>
- * process.c (rb_f_sleep): remove description about SIGALRM which
- is not valid on the current implementation. [ruby-dev:28464]
+ * lib/rdoc/generator/darkfish.rb: Silenced warning
+ * test/rdoc/test_rdoc_rdoc.rb: ditto
-Thu Mar 23 10:47:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rdoc/markup/parser.rb: Use byteslice when available for
+ performance
+ * test/rdoc/test_rdoc_markup_parser.rb: Test for above
+ * lib/rdoc/test_case.rb: ditto
- * eval.c (method_missing): should support argument splat in
- super. [ruby-talk:185438]
+ * lib/rdoc/parser/ruby.rb: Fixed bug parsing yield({})
+ * test/rdoc/test_rdoc_parser_ruby.rb (end):
-Mon Mar 20 12:05:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rdoc/rubygems_hook.rb: Skip default gems. Display generator
+ name properly.
+ * test/rdoc/test_rdoc_rubygems_hook.rb: Test for above
- * configure.in: Solaris SunPro compiler -rapth patch from
- <kuwa at labs.fujitsu.com>. [ruby-dev:28443]
+ * lib/rdoc/servlet.rb: Fixed typo.
-Mon Mar 20 09:40:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 30 08:09:56 2012 Narihiro Nakamura <authornari@gmail.com>
- * configure.in: remove enable_rpath=no for Solaris.
- [ruby-dev:28440]
+ * gc.c : remove a unused function.
-Fri Mar 17 19:08:49 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Nov 30 07:46:42 2012 Narihiro Nakamura <authornari@gmail.com>
- * ext/openssl/ossl_ssl.c, ext/openssl/ossl_nsspki.c: fix typo.
- [ruby-core:07571]
+ * gc.c (rb_objspace_call_finalizer): finalize_deferred may free up
+ a object which is reachable from a part after this function,
+ e.g. ruby_vm_destruct(). [ruby-dev:46647] [Bug #7452]
-Wed Mar 15 16:54:21 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/ruby/test_gc.rb (test_finalizing_main_thread): add a test
+ for above.
- * lib/mkmf.rb (create_makefile): support libraries without *.so.
+Fri Nov 30 07:43:44 2012 Koichi Sasada <ko1@atdot.net>
-Wed Mar 15 16:35:43 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * thread.c (rb_thread_interrupted): avoid warning of
+ implicit conversion.
- * ext/openssl/ossl_ssl.c, ext/openssl/ossl_nsspki.c: should use
- "rb_str_new(0, 0)" to make empty string.
+ * thread.c (rb_threadptr_execute_interrupts): ditto.
-Sat Mar 11 14:24:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 30 07:34:28 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rdoc/ri/ri_formatter.rb (RI::TextFormatter::wrap): removed
- space before argument parenthesis. [ruby-talk:183630]
+ * vm_backtrace.c: add GC guards.
- * ruby.1: a clarification patch from David Lutterkort
- <dlutter at redhat.com>. [ruby-core:7508]
+Fri Nov 30 07:21:33 2012 Koichi Sasada <ko1@atdot.net>
-Sat Mar 4 15:26:40 2006 Tanaka Akira <akr@m17n.org>
+ [EXPERIMENTAL: NEED DISCUSS]
+ * vm_trace.c: add events
+ * :thread_begin - hook at thread beginning.
+ * :thread_end - hook at thread ending.
+ * :b_call - hook at block enter.
+ * :b_return - hook at block leave.
+ This change slow down block invocation.
+ Please try and give us feedback until 2.0 code freeze.
- * gc.c (id2ref): fix symbol test.
+ * include/ruby/ruby.h: ditto.
-Sat Mar 4 01:08:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * compile.c (rb_iseq_compile_node): ditto.
- * lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
- directories. a patch from Eric Hodel <drbrain at segment7.net>.
- [ruby-core:07423]
+ * insns.def: ditto.
-Thu Mar 2 19:44:18 2006 Tanaka Akira <akr@m17n.org>
+ * thread.c: ditto.
- * gc.c: align VALUE with sizeof(RVALUE) globally.
- (is_pointer_to_heap): check alignment out of loop.
- (id2ref): avoid collision between symbols and objects.
- (rb_obj_id): ditto. moved from object.c.
- [ruby-talk:178364] [ruby-core:7305]
+ * vm.c: ditto.
-Thu Mar 2 18:58:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/debug.h: add a comment.
- * eval.c (rb_thread_fd_writable): should not re-schedule output
- from KILLED thread (must be error printing).
+ * test/ruby/test_settracefunc.rb: add a tests.
-Thu Mar 2 17:57:49 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Nov 30 06:56:30 2012 Ryan Davis <ryand-ruby@zenspider.com>
- * gc.c: commited magic for reducing RVALUE size on windows. (24->20byte)
- [ruby-core:7474]
+ * test/minitest/*: Imported minitest 4.3.2 (r8027)
-Thu Mar 2 12:59:14 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Nov 30 04:16:29 2012 Eric Hodel <drbrain@segment7.net>
- * win32/win32.c (filetime_to_unixtime): should set tm_isdst to -1.
- stat() didn't treat daylight saving time property on WinNT.
- [ruby-talk:182100]
+ * lib/rake/*: Updated to rake 0.9.5
+ * test/rake/*: ditto.
+ * NEWS: ditto.
-Thu Mar 2 08:02:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 30 02:53:47 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * gc.c (add_heap): heap_slots may overflow. a patch from Stefan
- Weil <weil at mail.berlios.de>.
+ * vm.c: add a return hook when a method raises an exception.
-Wed Mar 1 00:24:31 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * probes_helper.h: look up klass and method if none are provided.
- * lib/rdoc/parsers/parse_rb.rb (read_escape): could not handle /\^/.
- merged Mr. Ishizuka's lib/irb/ruby-lex.rb 's patch rev 1.29.
- [ruby-talk:181631] [ruby-dev:28404]
+ * eval.c: update macro usage.
-Tue Feb 28 09:32:17 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_eval.c: ditto.
- * lib/drb/extservm.rb (invoke_service_command): cannot invoke command
- if command name is quoted on mswin32. [ruby-dev:28400]
+ * vm_insnhelper.c: ditto.
-Mon Feb 27 00:19:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/dtrace/test_function_entry.rb: test for change.
- * ruby.h (SYM2ID): should not cast to signed long.
- [ruby-core:07414]
+Fri Nov 30 02:27:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Feb 24 20:07:23 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * compile.c (compile_array_): refix r37991 remove assertion:
+ it is true only if type == COMPILE_ARRAY_TYPE_HASH.
+ [ruby-dev:46658] [Bug #7466]
- * test/drb/drbtest.rb (add_service_command): quote pathnames in the
- server's command line for space contained directory names.
- Thanks, arton. [ruby-dev:28386]
+ * vm.c (m_core_hash_from_ary): add assertion instead of above.
-Fri Feb 24 12:11:08 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm.c (m_core_hash_merge_ary): ditto.
- * instruby.rb: install *.exe.manifest and *.dll.manifest if exist.
- It's for VC++8.
+Thu Nov 29 19:15:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Feb 24 11:33:52 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * compile.c (compile_array_): hash elements must be paired even for
+ literal elements. [ruby-dev:46658] [Bug #7466]
- * bcc32/Makefile.sub (HAVE_HYPOT): bcc32 has hypot().
+Thu Nov 29 22:39:35 2012 Naohisa Goto <ngotogenome@gmail.com>
-Fri Feb 24 11:19:58 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/openssl/ossl_ssl.c (ssl_npn_encode_protocol_i): fix byte order
+ issue on big-endian architecture [ruby-core:50292] [Bug #7463]
- * time.c (time_new_internal): add prototype to tell the compiler
- arugments types.
+Thu Nov 29 22:23:31 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
- * win32/win32.c (NtInitialize): need to set a handler for VC++8.
+ * test/openssl/test_cipher.rb (test_ctr_if_exists): add CTR mode test
+ if underlying OpenSSL supports it. See #4408
-Fri Feb 24 08:19:16 2006 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Nov 29 21:42:16 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test.rb: Removed. Obsolete by test/nkf.
+ * vm_method.c (rb_method_entry_make): add a method entry with
+ VM_METHOD_TYPE_REFINED to the class refined by the refinement if
+ the target module is a refinement. When a method entry with
+ VM_METHOD_TYPE_UNDEF is invoked by vm_call_method(), a method with
+ the same name is searched in refinements. If such a method is
+ found, the method is invoked. Otherwise, the original method in
+ the refined class (rb_method_definition_t::body.orig_def) is
+ invoked. This change is made to simplify the normal method lookup
+ and to improve the performance of normal method calls.
- * ext/.document: enabled documents in nkf and kconv
+ * vm_method.c (EXPR1, search_method, rb_method_entry),
+ vm_eval.c (rb_call0, rb_search_method_entry): do not use
+ refinements for method lookup.
- * ext/nkf/nkf.c ext/nkf/lib/kconv.rb: Add rdoc.
+ * vm_insnhelper.c (vm_call_method): search methods in refinements if
+ ci->me is VM_METHOD_TYPE_REFINED. If the method is called by
+ super (i.e., ci->call == vm_call_super_method), skip the same
+ method entry as the current method to avoid infinite call of the
+ same method.
-Thu Feb 23 22:39:59 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * class.c (include_modules_at): add a refined method entry for each
+ method defined in a module included in a refinement.
- * bcc32/Makefile.sub: use borlndmm.dll if possible. bcc32's RTL internal
- memory manager cannot handle large memory block properly.
- ex: 10000.times { "" << "." * 529671; GC.start } # crash
- [ruby-dev:28230]
+ * class.c (rb_prepend_module): set an empty table to
+ RCLASS_M_TBL(klass) to add refined method entries, because
+ refinements should have priority over prepended modules.
-Thu Feb 23 13:20:28 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * proc.c (mnew): use rb_method_entry_with_refinements() to get
+ a refined method.
- * eval.c (SETUP_ARGS0): fixed memory corruption. [ruby-dev:28360]
+ * test/ruby/test_refinement.rb (test_inline_method_cache): do not skip
+ the test because it should pass successfully.
-Tue Feb 21 02:18:46 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/ruby/test_refinement.rb (test_redefine_refined_method): new
+ test for the case a refined method is redefined.
- * configure.in (mingw): have link. [ruby-list:41838]
+Thu Nov 29 17:45:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/Makefile.sub (config.h): ditto.
+ * variable.c (rb_const_set): show namespace in warning messages.
+ [Feature #7190]
-Tue Feb 21 02:07:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Nov 29 17:31:53 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * parse.y (f_arglist): should set command_start = Qtrue for
- command body. [ruby-talk:180648]
+ * lib/rubygems.rb (Gem.load_yaml): return if Kernel#gem is not defined
+ yet. This causes crash if test-all requires libraries in a certain
+ order. A simple reproducible code is
+ ruby --disable-gem -e'require"yaml";require"minitest/autorun"'
-Mon Feb 20 17:37:26 2006 Tanaka Akira <akr@m17n.org>
+Thu Nov 29 17:19:26 2012 Eric Hodel <drbrain@segment7.net>
- * mkconfig.rb: alias RbConfig for Config.
+ * lib/tracer.rb: Updated to match removal of custom_require from
+ RubyGems.
+ * test/test_tracer.rb: ditto. Improved failure message if the test
+ fails
-Mon Feb 20 12:27:53 2006 Kent Sibilev <ksruby@gmail.com>
+Thu Nov 29 17:15:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * lib/rational.rb (Integer::gcd): small typo fix.
- [ruby-core:07395]
+ * gc.c: Documentation for GC, GC::Profiler, ObjectSpace, and
+ ObjectSpace::WeakMap [ruby-core:50245] [Bug #7449]
-Mon Feb 20 01:05:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Nov 29 17:12:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rational.rb (Integer::gcd): replaced by gcd4 in
- [ruby-core:07390]. [ruby-core:07377]
+ * tool/generic_erb.rb, tool/id2token.rb: add --path-separator option
+ for mingw where make and built ruby live in different world.
-Mon Feb 20 00:57:02 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * tool/vpath.rb: extract from tool/instruction.rb.
- * ext/openssl/ossl.h (OSSL_Debug): should not use __func__.
- [ruby-dev:28339]
+Thu Nov 29 17:11:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Feb 19 04:46:29 2006 Guy Decoux <ts@moulon.inra.fr>
+ * test/io/wait/test_io_wait.rb (TestIOWait#fill_pipe):
+ Errno::EWOULDBLOCK may not be the same as Errno::EAGAIN. patch by
+ phasis68 (Heesob Park) at [ruby-core:49894]. [Bug #7420]
- * eval.c: initial value for block_unique must be 1.
- [ruby-talk:180420]
+Thu Nov 29 17:03:38 2012 Eric Hodel <drbrain@segment7.net>
-Sat Feb 18 23:58:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rubygems/test_case.rb: Determine path to certificates to avoid
+ build-dir problems.
+ * test/rubygems/test_gem_security_signer.rb: Use predetermined paths
+ to avoid build-dir problems.
- * lib/tracer.rb (Tracer::Tracer.add_filter): turn on tracer mode
- only when caller() level size is one. [ruby-core:07389]
+Thu Nov 29 16:18:14 2012 Eric Hodel <drbrain@segment7.net>
- * lib/rdoc/parsers/parse_rb.rb: need not to require "tracer".
- [ruby-core:07389]
+ * lib/rubygems/test_case.rb: Disable loading of keys and certificates
+ outside rubygems or ruby tests as the files are not available (or
+ necessary).
- * sample/rtags.rb: ditto.
+Thu Nov 29 16:14:41 2012 Koichi Sasada <ko1@atdot.net>
-Sat Feb 18 12:18:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_backtrace.c (rb_debug_inspector_open): use RARRAY_LENINT() for
+ int variable.
- * lib/fileutils.rb (FileUtils::fu_world_writable): make it
- private. [ruby-core:07383]
+Thu Nov 29 15:59:55 2012 Koichi Sasada <ko1@atdot.net>
-Sat Feb 18 00:22:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/debug.h: add rb_debug_inspector_* APIs.
- * lib/tracer.rb: merged a minor clarification patch from Daniel
- Berger <Daniel.Berger at qwest.com>. [ruby-core:07376]
+ * vm_backtrace.c: ditto.
-Fri Feb 17 11:18:42 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * common.mk: add dependency from vm_backtrace.o to
+ include/ruby/debug.h.
- * util.c (ruby_strtod): Float("1e") should fail. [ruby-core:7330]
+ * proc.c (rb_binding_new_with_cfp): constify.
- * pack.c (EXTEND32): unpack("l") did not work where sizeof(long) != 4.
- [ruby-talk:180024]
+ * vm.c (rb_vm_get_ruby_level_next_cfp): constify.
- * pack.c (pack_unpack): fixed integer overflow on template "w".
- [ruby-talk:180126]
+ * vm_core.h, vm_trace.c: move decls.
-Fri Feb 17 09:39:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Nov 29 15:56:14 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * eval.c (rb_thread_wait_for): sleep should always sleep for
- specified amount of time. [ruby-talk:180067]
+ * lib/rdoc/test_case.rb (RDoc::TestCase#verbose_capture_io):
+ defined for asserts of warnings.
-Thu Feb 16 01:10:48 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/rdoc: use verbose_capture_io on asserts of warnings.
+ they failed when tests was run with RUBYOPT=-W0.
- * eval.c (backtrace): frame->orig_func may not be initialized.
- [ruby-core:07367]
+Thu Nov 29 15:53:38 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Feb 15 16:52:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/psych/extconf.rb: added --enable-bundled-libyaml option. this
+ enforces using bundled libyaml.
- * eval.c (rb_eval): NODE_OP_ASGN1 should allow splat in its
- argument list. [ruby-core:07366]
+Thu Nov 29 15:51:54 2012 Eric Hodel <drbrain@segment7.net>
- * parse.y (arg): avoid unnecessary extra argument.
- [ruby-core:07366]
+ * lib/rubygems*: Updated to RubyGems 2.0
+ * test/rubygems*: ditto.
- * eval.c (rb_eval): honor visibility on OP_ASGN1 and
- OP_ASGN2. [ruby-core:07366]
+ * common.mk (prelude): Updated for RubyGems 2.0 source rearrangement.
-Wed Feb 15 10:09:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * tool/change_maker.rb: Allow invalid UTF-8 characters in source
+ files.
- * eval.c (yield_under_i): should not pass self as an argument to
- the block for instance_eval. [ruby-core:07364]
+Thu Nov 29 15:38:14 2012 Koichi Sasada <ko1@atdot.net>
-Wed Feb 15 09:20:35 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/debug.h: provide rb_tracearg_*() APIs,
+ instead of rb_tracepoint_attr_*().
+ These APIs are for debuggers/profilers.
+ They will be explained in another docs sometime.
- * eval.c (rb_obj_instance_eval): should be no singleton classes for
- true, false, and nil. [ruby-dev:28186]
+ * vm_trace.c: ditto.
-Tue Feb 14 18:48:33 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Nov 29 15:10:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * eval.c (DMETHOD_P): accessing wrong frame. [ruby-dev:28181]
+ * test/minitest/test_minitest_unit.rb: restore orig_verbose only
+ if it is set. This broke rdoc's tests.
+ http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20121129T050102Z.diff.html.gz
- * eval.c (proc_invoke): preserve FRAME_DMETH flag.
+Thu Nov 29 14:56:30 2012 Koichi Sasada <ko1@atdot.net>
-Tue Feb 14 15:13:51 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * vm_trace.c (rb_tracepoint_attr_method_id):
+ rename TracePoint#id to TracePoint#method_id.
- * ext/zlib/zlib.c: supress warning on test/zlib. [ruby-dev:28323]
+ * include/ruby/debug.h: ditto.
-Tue Feb 14 14:01:17 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/ruby/test_settracefunc.rb: ditto,
- * time.c (search_time_t): support non 32bit time_t environments.
+Thu Nov 29 14:49:10 2012 Koichi Sasada <ko1@atdot.net>
- * win32/Makefile.sub (config.h): VC++8 has ``long long'' type.
+ * vm_trace.c (rb_tracepoint_attr_defined_class):
+ rename TracePoint#klass to TracePoint#defined_class.
+ [ruby-core:50187] Re: [ruby-trunk - Feature #6895]
- * win32/Makefile.sub (config.h): VC++8's time_t is 64bit value.
+ * include/ruby/debug.h: ditto.
- * win32/win32.c (rb_w32_utime): drop read-only attribute before
- changing file time.
+ * test/ruby/test_settracefunc.rb: ditto.
- all changes are backported from CVS HEAD.
+Thu Nov 29 14:27:57 2012 Koichi Sasada <ko1@atdot.net>
-Tue Feb 14 11:21:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c (gc_stat): prepare Symbol objects at first time
+ to make it fast.
- * io.c (argf_forward): should not use frame->argv.
- [ruby-core:07358]
+Thu Nov 29 14:02:15 2012 Koichi Sasada <ko1@atdot.net>
-Mon Feb 13 18:08:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c (gc_stat): GC.stat supports new information
+ * total_allocated_object: total allocated object number.
+ * total_freed_object: total freed object number.
+ Above two numbers are only accumulated and they will
+ overflow (return to 0). Please use them as a hint.
- * eval.c (rb_call0): argument update propagation. [ruby-dev:28044]
+Thu Nov 29 12:13:54 2012 Ryan Davis <ryand-ruby@zenspider.com>
- * env.h: remove argv member from struct FRAME.
+ * lib/minitest/*: Imported minitest 4.3.2 (r8026)
+ * test/minitest/*: ditto
-Mon Feb 13 13:27:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Nov 29 11:06:06 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (eval): should push class from binding if supplied.
- [ruby-core:07347]
+ * thread.c (thread_start_func_2): remove unused code. When
+ th->safe_level == 4, th->errinfo never be thrown. So, to
+ create new exception makes no sense.
-Mon Feb 13 00:04:00 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Thu Nov 29 10:29:53 2012 Koichi Sasada <ko1@atdot.net>
- * lib/erb.rb (ERB::Compiler): add instance variable @insert_cmd to
- change <%='s behavior. (backported 1.15 - 1.16)
+ * vm_backtrace.c: same as a last patch.
-Sat Feb 11 02:04:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Nov 29 10:24:25 2012 Koichi Sasada <ko1@atdot.net>
- * eval.c (eval): no need to push ruby_class. [ruby-dev:28176]
+ * vm_backtrace.c: use `long' for return values of `NUM2LONG()'.
-Sat Feb 11 01:57:44 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Nov 29 09:52:08 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * eval.c (rb_f_autoload): check if ruby_cbase is nil (during
- instance_eval for objects cannot have singleton classes,
- e.g. fixnums and symbols). [ruby-dev:28178]
+ * thread.c (do_select): suppress warning (uninitialized value warning)
+ with UNINITIALIZED_VAR().
-Tue Feb 7 23:03:24 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Nov 29 09:36:09 2012 Koichi Sasada <ko1@atdot.net>
- * ext/zlib/zlib.c: should not access ruby objects in finalizer.
- [ruby-dev:28286]
+ * eval.c (ruby_cleanup): delay THREAD_KILLED timing.
+ It should be located just before rb_thread_terminate_all().
-Mon Feb 6 16:02:51 2006 WATANABE Hirofumi <eban@ruby-lang.org>
+Thu Nov 29 09:10:17 2012 Koichi Sasada <ko1@atdot.net>
- * file.c (rb_thread_flock): ERROR_NOT_LOCKED is not an error on Cygwin.
- In such situation, flock() should return 0.
+ * vm_backtrace.c (vm_backtrace_to_ary): support range argument
+ like Array#[].
+ [ruby-core:50092] [ruby-trunk - Feature #7434]
+ Test and document is not available. Please help us.
-Mon Feb 6 00:41:08 2006 Tanaka Akira <akr@m17n.org>
+Thu Nov 29 06:46:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ruby.h (RSTRUCT_LEN, RSTRUCT_PTR): defined for source level
- compatibility with ruby 1.9.
+ * thread.c (thread_start_func_2): small cleanups.
-Sun Feb 5 21:05:34 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Nov 29 06:37:08 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * numeric.c (fix_to_s): removed workaround for radix 2. Historically,
- rb_fix2str could only handle radix 8, 10, 16. (Rev1.37) But for now,
- it can handle radix 2..36. [ruby-Bugs#3438] [ruby-core:7300]
+ * thread.c (thread_start_func_2): remove unused code.
+ this function never be used for main thread.
-Sun Feb 5 18:55:08 2006 Minero Aoki <aamine@loveruby.net>
+Thu Nov 29 06:27:55 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/net/http.rb: imported from trunk, rev 1.129
+ * thread.c (thread_start_func_2): remove unused code.
+ errinfo = th->errinfo; and errinfo = rb_errinfo(); are
+ the same.
- * lib/net/http.rb (add_field, get_fields): keep 1.8.2 backward
- compatibility.
+Thu Nov 29 05:26:32 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_backtrace.c (backtrace_to_str_ary2): rename to backtrace_to_str_ary.
- * lib/net/https.rb: imported from trunk, rev 1.3.
+ * vm_backtrace.c (rb_backtrace_to_str_ary): use `backtrace_to_str_ary()'.
- * lib/net/https.rb: #use_ssl? definition moved from net/http.rb.
+ * vm_backtrace.c (backtrace_to_frame_ary): rename to
+ backtrace_to_location_ary.
-Sun Feb 5 14:22:15 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Nov 29 05:19:25 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/pstore.rb: should return default value if name is not found.
- [ruby-core:7304]
+ * probes.d: Change function-entry probe to method-entry.
+ * insns.def: ditto
+ * probes_helper.h: ditto
+ * test/dtrace/test_function_entry.rb: ditto
+ * test/dtrace/test_singleton_function.rb: ditto
+ * vm.c: ditto
+ * vm_eval.c: ditto
+ * vm_insnhelper.c: ditto
- * lib/pstore.rb: should raise PStore::Error if not in transaction.
+Thu Nov 29 04:45:17 2012 Koichi Sasada <ko1@atdot.net>
-Sat Feb 4 22:51:43 2006 Tanaka Akira <akr@m17n.org>
+ * vm_backtrace.c: rename Class name from
+ ::RubyVM::Backtrace and ::RubyVM::Backtrace::Location
+ to ::Thread::Backtrace and ::Thread::Backtrace::Location.
- * eval.c: apply the FreeBSD getcontext/setcontext workaround
- only before FreeBSD 7-CURRENT.
+Wed Nov 28 23:52:02 2012 Masaya Tarui <tarui@ruby-lang.org>
-Sat Feb 4 21:19:23 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * NEWS (Thread) remove incompatible changes about trap.
- * win32/win32.c (LK_ERR): ERROR_NOT_LOCKED is not an error.
- In such situation, flock() should return 0.
+Wed Nov 28 23:39:01 2012 Koichi Sasada <ko1@atdot.net>
-Sat Feb 4 15:56:37 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * thread.c (rb_mutex_sleep): fix to allow spurious wakeup.
+ [ruby-dev:46654] [ruby-trunk - Bug #7455]
- * numeric.c (fix_to_s): (2**32).to_s(2) fails with exception where
- sizeof(int) == 4 < sizeof(long). [ruby-core:7300]
+ * NEWS: write about spurious wakeup.
-Fri Feb 3 15:06:50 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Nov 28 22:57:23 2012 Koichi Sasada <ko1@atdot.net>
- * ext/syck/syck.c (syck_move_tokens): should reset p->cursor or etc
- even if skip == 0. This causes buffer overrun.
- (ex: YAML.load('--- "..' + '\x82\xA0' * 511 + '"'))
+ * thread_win32.c: catch up latest change of BLOCKING_REGION.
-Thu Feb 2 23:51:18 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Nov 28 22:54:21 2012 Koichi Sasada <ko1@atdot.net>
- * ext/syck/emitter.c (syck_emitter_write): should not set '\0' on
- emitter's marker. if marker points to the end of buffer, this causes
- buffer overrun. (ex: YAML.dump("." * 12288))
+ * vm_insnhelper.c (vm_call_method): fix undefined behavior.
+ Should not access scope local variable from outer scope.
-Thu Feb 2 16:01:24 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Nov 28 22:20:55 2012 Masaya Tarui <tarui@ruby-lang.org>
- * eval.c (eval): need not to protect $SAFE value.
- [ruby-core:07177]
+ * test/ruby/test_thread.rb (test_thread_status_in_trap): change test for
+ thread status in trap. now can accept Thread#join and Thread#value in trap.
-Thu Feb 2 14:45:53 2006 Ville Mattila <ville.mattila@stonesoft.com>
+Wed Nov 28 21:58:47 2012 Koichi Sasada <ko1@atdot.net>
- * configure.in: The isinf is not regognized by autoconf
- library guesser on solaris 10. [ruby-core:7138]
+ * include/ruby/thread.h (rb_thread_call_without_gvl2): change
+ meaning of function.
+ This function is called with same parameters of
+ `rb_thread_call_without_gvl()'.
+ However, if interrupts are detected, then return immediately.
-Wed Feb 1 22:01:47 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * thread.c: implement `rb_thread_call_without_gvl2()'.
+
+Wed Nov 28 21:31:21 2012 Masaya Tarui <tarui@ruby-lang.org>
+
+ * thread.c (thread_join_sleep): check spurious wakeup by itself for
+ corresponding status change in trap context.
+ * vm_core.h (struct rb_thread_struct): add rb_thread_list_t and use as join_list for
+ reentry by trap context.
+ * thread.c (thread_start_func_2): ditto.
+ * thread.c (remove_from_join_list): ditto.
+ * thread.c (rb_thread_atfork): ditto.
+ * thread.c (thread_join): ditto. & remove trap handler check.
+ * thread.c (sleep_forever): add argument : spurious_check.
+ * thread.c (sleep_timeval): ditto.
+ * thread.c (rb_thread_sleep_forever): set spurious_check.
+ * thread.c (rb_thread_sleep_deadly): ditto.
+ * thread.c (sleep_for_polling): ditto.
+ * thread.c (rb_thread_wait_for): ditto.
+ * thread.c (sleep_wait_for_interrupt): bypass spurious_check.
+
+Wed Nov 28 21:23:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/psych/yaml/emitter.c (yaml_emitter_write_indicator): constify.
+
+ * ext/psych/yaml/emitter.c (yaml_emitter_write_block_scalar_hints):
+ ditto.
- * configure.in, hash.c (ruby_setenv): use setenv(3) and unsetenv(3)
- where they are supported. modifing environ variable seems to
- segfault solaris 10. [ruby-core:7276] [ruby-dev:28270]
+ * ext/psych/extconf.rb: mingw32 also needs macros for win32, not
+ only mswin32.
- * ruby.c (set_arg0): if use setenv(3), environ space cannot be used
- for altering argv[0].
+ * ext/psych/extconf.rb: compile sources in the source directory
+ without copying by using VPATH.
-Tue Jan 31 14:46:28 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Nov 28 21:18:57 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * struct.c (rb_struct_select): update RDoc description.
- [ruby-core:7254]
+ * lib/mkmf.rb (MakeMakefile#each_compile_rules): splat $(*VPATH*) for
+ each VPATH elements.
-Tue Jan 31 11:58:51 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Nov 28 16:40:14 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/tk/lib/multi-tk.rb: add MultiTkIp#eval and bg_eval.
+ * vm_core.h (enum rb_thread_status): remove THREAD_TO_KILL
+ * vm_core.h (struct rb_thread_struct): add to_kill field
+ * thread.c (terminate_i): convert THREAD_TO_KILL to to_kill.
+ * thread.c (rb_threadptr_to_kill): ditto.
+ * thread.c (rb_thread_kill): ditto.
+ * thread.c (rb_thread_wakeup_alive): ditto.
+ * thread.c (thread_list_i): ditto.
+ * thread.c (static const char): ditto.
+ * thread.c (thread_status_name): ditto.
+ * thread.c (rb_thread_status): ditto.
+ * thread.c (rb_thread_inspect): ditto.
+ * vm_backtrace.c (thread_backtrace_to_ary): ditto.
- * ext/tk/lib/tk/namespace.rb: TkNamespace#eval was enbugged at the
- last commit. Now it will return a proper object.
+ * thread.c (rb_threadptr_execute_interrupts): fix thread status
+ overwritten issue. [Bug #7450] [ruby-core:50249]
+
+ * test/ruby/test_thread.rb (test_hread_status_raise_after_kill):
+ test for the above.
+ * test/ruby/test_thread.rb (test_thread_status_in_trap): test for
+ thread status in trap.
+ * test/ruby/test_thread.rb (test_status_and_stop_p): remove
+ Thread.control_interrupt unsafe test. Thread#kill no longer
+ changes thread status. Instead of, Thread#kill receiver changes
+ their own status when receiving kill signal.
-Tue Jan 31 00:10:26 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Nov 28 16:21:46 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/syck/rubyext.c (syck_resolver_transfer): workaround for SEGV.
- ex: ruby -ryaml -e 'YAML.load("!map:B {}")' [ruby-core:7217]
+ * thread.c (struct rb_mutex_struct): add allow_trap field.
+ * internal.h (rb_mutex_allow_trap): added.
+ * thread.c (rb_mutex_lock, rb_mutex_unlock): check mutex->allow_trap.
+ * thread.c (mutex_sleep): remove trap check because it uses
+ rb_mutex_lock and rb_mutex_unlock internally.
+ * thread.c (rb_mutex_allow_trap): new helper function for the above.
-Sat Jan 28 07:56:57 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * io.c (io_binwrite): mark fptr->write_lock as writable in trap.
- * lib/rdoc/usage.rb: support "a:0:33" style caller[-1]. In this case
- file name is "a:0". I don't know this really happens though...
- [ruby-Bugs:3344]
+ * test/ruby/test_signal.rb (test_trap_puts): test for the above.
-Wed Jan 25 22:29:04 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 28 16:59:12 2012 Koichi Sasada <ko1@atdot.net>
- * configure.in, dln.c, file.c, intern.h, missing.h (eaccess): use
- system routine if provided. fixed: [ruby-core:07195]
+ * proc.c: remove Proc#== and Proc#eql?.
+ Proc objects compared with their object ids.
+ [Bug #4559]
-Sun Jan 22 23:27:13 2006 Go Noguchi <gonoguti@yahoo.co.jp>
+ * test/ruby/test_proc.rb: remove related test.
- * lib/test/unit/autorunner.rb (process_args): ignore arguments after
- '--' so that test scripts can handle them. fixed: [ruby-dev:28258]
+Wed Nov 28 16:41:04 2012 Eric Hodel <drbrain@segment7.net>
-Sun Jan 22 22:09:52 2006 Tanaka Akira <akr@m17n.org>
+ * lib/rdoc/servlet.rb: Add support for serving documentation from a
+ subdirectory.
+ * lib/rdoc/generator/darkfish.rb: ditto
+ * test/rdoc/test_rdoc_servlet.rb: Test for above
+ * test/rdoc/test_rdoc_servlet.rb: ditto
- * eval.c (POST_GETCONTEXT): define separately from PRE_GETCONTEXT on
- IA64 to avoid reusing variable address.
+Wed Nov 28 15:37:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Jan 22 20:03:35 2006 Tanaka Akira <akr@m17n.org>
+ * configure.in: fix r37294: run only on i[3-6]86-linux.
- * eval.c (ruby_setjmp): define PRE_GETCONTEXT and POST_GETCONTEXT
- instead of FUNCTION_CALL_MAY_RETURN_TWICE.
- define PRE_GETCONTEXT to clear carry flag for workaround of
- FreeBSD/i386 getcontext/setcontext bug.
- [ruby-dev:28263]
+Wed Nov 28 15:31:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Jan 21 00:36:47 2006 Tanaka Akira <akr@m17n.org>
+ * io.c (FMODE_SYNCWRITE): removed unused macro.
- * eval.c (FUNCTION_CALL_MAY_RETURN_TWICE): use only on SPARC and IA64
- before gcc 4.0.3.
- [ruby-dev:28247]
+Wed Nov 28 15:19:25 2012 Naohisa Goto <ngotogenome@gmail.com>
-Thu Jan 19 22:21:23 2006 Minero Aoki <aamine@loveruby.net>
+ * configure.in: revert r37911, r37906 and r37904 which break build
+ with non-gcc and/or non-IA32 compilers, e.g. Solaris Studio,
+ Fujitsu C Compiler. [ruby-dev:46646] [Bug #7451]
- * lib/fileutils.rb (mv): should remove file after copying.
- [ruby-dev:28223]
+Wed Nov 28 14:50:55 2012 Koichi Sasada <ko1@atdot.net>
-Wed Jan 18 23:37:06 2006 Tanaka Akira <akr@m17n.org>
+ * ext/psych/extconf.rb: copy sources into build directory,
+ not into srcdir.
- * eval.c (FUNCTION_CALL_MAY_RETURN_TWICE): don't clobber %l7 of SPARC
- if enable-shared.
- (ruby_setjmp): call FUNCTION_CALL_MAY_RETURN_TWICE after getcontext
+Wed Nov 28 14:34:06 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_mutex_lock): moved trap context check from
+ rb_mutex_trylock because try_lock have no change to make
+ a deadlock.
+ * thread.c (rb_mutex_trylock): ditto.
+ * NEWS: news for the above.
+
+Wed Nov 28 13:39:54 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_s_new): uses main_thread->status instead of
+ th->inhibit_thread_creation for preventing thread creation.
+ * vm_core.h (rb_vm_struct): remove inhibit_thread_creation field.
+ * thread.c (rb_thread_terminate_all): ditto.
+
+Wed Nov 28 13:27:29 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/extconf.rb: use embedded libyaml if no system libyaml is
+ found. [ruby-core:49463]
+ * ext/psych/lib/psych.rb: updating to psych 2.0.0
+ * ext/psych/lib/psych/deprecated.rb: updated docs
+ * ext/psych/psych.gemspec: updated to psych 2.0.0
+ * ext/psych/psych.h: fixing header file include for rename
+ * ext/psych/psych_emitter.c: renamed to avoid libyaml conflict.
+ * ext/psych/psych_emitter.h: ditto
+ * ext/psych/psych_parser.c: ditto
+ * ext/psych/psych_parser.h: ditto
+ * ext/psych/psych_to_ruby.c: ditto
+ * ext/psych/psych_to_ruby.h: ditto
+ * ext/psych/psych_yaml_tree.c: ditto
+ * ext/psych/psych_yaml_tree.h: ditto
+ * ext/psych/yaml/LICENSE: embedding libyaml 0.1.4
+ * ext/psych/yaml/api.c: ditto
+ * ext/psych/yaml/config.h: ditto
+ * ext/psych/yaml/dumper.c: ditto
+ * ext/psych/yaml/emitter.c: ditto
+ * ext/psych/yaml/loader.c: ditto
+ * ext/psych/yaml/parser.c: ditto
+ * ext/psych/yaml/reader.c: ditto
+ * ext/psych/yaml/scanner.c: ditto
+ * ext/psych/yaml/writer.c: ditto
+ * ext/psych/yaml/yaml.h: ditto
+ * ext/psych/yaml/yaml_private.h: ditto
+
+Wed Nov 28 12:54:59 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_join): A trap handler check was moved from
+ thread_join_m because Thread#value should be raised an exception
too.
- reported by Pav Lucistnik and Marius Strobl.
- http://lists.freebsd.org/pipermail/freebsd-sparc64/2006-January/003739.html
+ * thread.c (thread_join_m): remove trap handler check.
+ * test/ruby/test_thread.rb (test_thread_join_in_trap): add test
+ for thread#value.
+ * NEWS: documentation fix for the above.
+
+Wed Nov 28 11:07:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/fiddle/closure.c: Documentation for Fiddle
+ * ext/fiddle/lib/fiddle/import.rb: ditto
+ * ext/fiddle/lib/fiddle/value.rb: ditto
+ * ext/fiddle/lib/fiddle/pack.rb: ditto
+ * ext/fiddle/lib/fiddle/cparser.rb: ditto
+ * ext/fiddle/lib/fiddle/struct.rb: ditto
+ * ext/fiddle/lib/fiddle/function.rb: ditto
+
+Wed Nov 28 09:15:51 2012 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * ext/strscan/strscan.c: Added #charpos for multibyte string position.
+ * test/strscan/test_stringscanner.rb: ditto
+
+Wed Nov 28 09:00:34 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/fiddle/fiddle.c: adding alignment constants for compatibility
+ with DL.
+ * ext/fiddle/fiddle.h: ditto
+ * ext/fiddle/lib/fiddle/cparser.rb: importing the C parser for DL
+ backwards compatibility.
+ * ext/fiddle/lib/fiddle/import.rb: importing the import DSL for DL
+ backwards compatibility.
+ * ext/fiddle/lib/fiddle/pack.rb: importing structure pack for DL
+ backwards compatibility.
+ * ext/fiddle/lib/fiddle/value.rb: ditto
+ * ext/fiddle/lib/fiddle/struct.rb: importing struct DSL for DL backwards
+ compatibility.
+ * test/dl/test_c_struct_entry.rb: importing tests
+ * test/dl/test_c_union_entity.rb: ditto
+ * test/dl/test_cparser.rb: ditto
+ * test/dl/test_import.rb: ditto
+ * test/fiddle/test_c_struct_entry.rb: ditto
+ * test/fiddle/test_c_union_entity.rb: ditto
+ * test/fiddle/test_cparser.rb: ditto
+ * test/fiddle/test_import.rb: ditto
-Tue Jan 17 11:32:46 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Nov 28 08:56:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * win32/setup.mak (MAKE): workaround for nmake 8.
+ * doc/globals.rdoc: Add documentation file for magic globals
+ [ruby-core:29048] [Bug #3022]
-Tue Jan 17 11:10:21 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Nov 28 08:55:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * win32/{Makefile.sub,setup.mak}: invoke .bat via shell. workaround
- for nmake 8.
+ * .document: Add README's to be included with docs
-Mon Jan 16 10:26:23 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Nov 28 08:26:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * ext/syck/emitter.c (syck_emit_seq, syck_emit_map, syck_emit_item):
- should output complex key mark even if map's key is empty seq/map.
- [ruby-core:7129]
+ * ext/dl/lib/dl.rb: Deprecation notice for DL
-Sat Jan 14 05:37:06 2006 Tanaka Akira <akr@m17n.org>
+Wed Nov 28 08:25:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * io.c (READ_DATA_PENDING, READ_DATA_PENDING_COUNT): defined
- for DragonFly BSD 1.4.0.
+ * ext/fiddle/closure.c: Documentation for Fiddle
+ * ext/fiddle/pointer.c: ditto
+ * ext/fiddle/function.c: ditto
+ * ext/fiddle/lib/fiddle.rb: ditto
+ * ext/fiddle/fiddle.c: ditto
+ * ext/fiddle/handle.c: ditto
-Sat Jan 14 03:43:24 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Nov 28 04:53:40 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * file.c (rb_file_s_chmod): avoid warning where sizeof(int) !=
- sizeof(void*).
+ * ext/fiddle/handle.c: Make Fiddle independent of DL, copy DL::Handle
+ to Fiddle::Handle.
+ * ext/fiddle/pointer.c: Make Fiddle independent of DL, copy
+ DL::Pointer to Fiddle::Pointer.
+ * test/fiddle/test_func.rb: relevant tests
+ * test/fiddle/test_handle.rb: ditto
+ * test/fiddle/test_pointer.rb: ditto
+ * ext/dl/lib/dl/struct.rb: use Fiddle::Pointer if available
+ * ext/fiddle/extconf.rb: check for dlfcn.h
+ * ext/fiddle/fiddle.c: add constants for sizeof() things
+ * ext/fiddle/fiddle.h: include dlfcn.h
+ * ext/fiddle/function.c: expose a C function for creating new
+ Fiddle::Function objects.
+ * ext/fiddle/lib/fiddle.rb: include constants for dl backwards compat
+ * ext/fiddle/lib/fiddle/function.rb: read the pointer from the
+ function for dl backwards compat.
+ * test/dl/test_callback.rb: check the addresses of the pointers rather
+ than their types.
+ * test/fiddle/helper.rb: remove dependency on dl
+ * test/fiddle/test_closure.rb: ditto
+ * test/fiddle/test_fiddle.rb: ditto
-Fri Jan 13 19:14:56 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Nov 28 03:03:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rdoc/diagram.rb:
- - properly quote bare element attributes
- - terminates dangling elements (e.g. <img>, <br>, <link>, etc)
- - converts "CVS" to the more HTML-friendly acronym element
- - adds missing type attributes to style elements
+ * configure.in (opt-dir): don't use non portable flag -E of sed.
- based on Paul Duncan's patch <pabs@pablotron.org> [ruby-core:7028]
+Wed Nov 28 02:55:35 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rdoc/generators/html_generator.rb: ditto.
- * lib/rdoc/generators/template/html/hefss.rb: ditto.
- * lib/rdoc/generators/template/html/html.rb: ditto.
- * lib/rdoc/generators/template/html/kilmer.rb: ditto.
+ * configure.in (ARCH_FLAG): __sync_val_compare_and_swap_4 needs
+ -march=$target_cpu on at least linux gcc 4.1.
+ patched by KOSAKI Motohiro
-Thu Jan 12 11:53:08 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Nov 27 22:03:09 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/tk/sample/tkballoonhelp.rb: [bug fix] couldn't add to a widget
- which is constructed with TkComposite module.
- [new feature] support 'command' option which is called just before
- popping up the balloon help.
+ * string.c (rb_str_enumerate_chars, rb_str_enumerate_codepoints)
+ (rb_str_enumerate_lines): Dummy initialization of ary has been
+ replaced with UNINITIALIZED_VAR().
-Wed Jan 11 15:00:00 2006 Ville Mattila <mulperi@iki.fi>
+Tue Nov 27 21:29:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * io.c (READ_PENDING*): Support solaris 64-bit environments.
- Solaris defines a opaque FILE struct when compiling 64 bit
- binaries. This means that we dont have access to _ptr etc.
- members anymore. The solution by Steven Lumos is to define
- FILE64 that has needed members available. I've modified
- the origanal patch a bit so that it compiles both with gcc
- and now free sun studio 11 compiler and both amd64 and sparc.
- NOTE! We have to 64 bit solaris FILE structure time to time
- otherwise we'll get breakage.
- [ruby-core:7106]
+ * bignum.c (bigdivrem): optimize the way to retry calculation of
+ bigdivrem so that the calculation is started from the point where
+ the last interruption was occurred.
-Tue Jan 10 19:42:33 2006 Tanaka Akira <akr@m17n.org>
+ * bignum.c (bigdivrem1): ditto.
- * gc.c (garbage_collect): mark ruby_current_node.
- if an exception is raised in a finalizer called written in C by
- rb_gc_call_finalizer_at_exit, ruby_set_current_source may use
- collected ruby_current_node and mark_source_filename may corrupt
- memory.
+ * test/ruby/test_bignum.rb: add a test case for rb_bigdivrem in the
+ case that an interruption is occurred during bigdivrem1 is running.
-Tue Jan 10 13:30:34 2006 akira yamada <akira@ruby-lang.org>
+Tue Nov 27 19:56:43 2012 Koichi Sasada <ko1@atdot.net>
- * ext/syck/rubyext.c (syck_resolver_transfer): should be able to load
- !ruby/object:Bignum syntax 1.8.3 dumped. [ruby-core:6159]
+ * vm.c (rb_vm_make_env_object): make Proc object if Env is possible
+ to point block.
+ [ruby-core:41038] [ruby-trunk - Bug #5634]
-Tue Jan 10 12:47:41 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * vm.c (rb_vm_make_proc): No need to make Proc object here.
- * lib/yaml/rubytypes.rb (Fixnum): Bignum could not be loaded in
- ruby 1.8.3/1.8.4. [ruby-core:6115]
+ * bootstraptest/test_proc.rb: add tests.
- * lib/yaml/rubytypes.rb (Numeric): Subclass of Numeric could not
- be dumped properly. [ruby-core:7047]
+Tue Nov 27 18:51:06 2012 Naohisa Goto <ngotogenome@gmail.com>
-Tue Jan 10 12:00:48 2006 Aaron Schrab <aaron @nospam@ schrab.com>
+ * ruby_atomic.h (ATOMIC_CAS): added for Solaris and other platforms.
+ * ruby_atomic.h, signal.c (NEED_RUBY_ATOMIC_OPS): renamed from
+ NEED_RUBY_ATOMIC_EXCHANGE.
+ * signal.c (ruby_atomic_compare_and_swap): naive, non-atomic
+ compare-and-swap implementation only used for platforms without
+ valid support for atomic operations.
- * lib/yaml/rubytypes.rb (Symbol#yaml_new): YAML loading of quoted
- Symbols broken. [ruby-Bugs:2535]
+Tue Nov 27 17:43:46 2012 Eric Hodel <drbrain@segment7.net>
-Mon Jan 9 19:54:35 2006 arton <artonx@yahoo.co.jp>
+ * lib/rdoc/*: Added --root option for building documentation outside
+ the source directory.
+ * test/rdoc/*: ditto
+ * common.mk (rdoc): Added --root to rdoc rule
- * ext/zlib/extconf.rb: zlib compiled DLL version 1.2.3 distributed by
- http://www.zlib.net/ has zdll.lib. [ruby-dev:28209]
+Tue Nov 27 16:24:45 2012 Eric Hodel <drbrain@segment7.net>
-Mon Jan 9 14:17:12 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/rdoc/test_rdoc_ri_paths.rb: Fixed duplicate path bug which
+ caused windows failures.
- * win32/Makefile.sub (OPTFLAGS): I have experienced trouble on y- flag,
- (VisualC++6) so use -O2b2xg- if $(MSC_VER) < 1400. [ruby-core:7040]
+Tue Nov 27 16:06:00 2012 Eric Hodel <drbrain@segment7.net>
-Mon Jan 9 14:17:12 2006 Kero van Gelder <rubyforge @nospam@ kero.tmfweb.nl>
+ * test/rdoc/test_rdoc_generator_darkfish.rb: Updated tests for windows
+ * test/rdoc/test_rdoc_options.rb: ditto
+ * test/rdoc/test_rdoc_parser.rb: ditto
+ * test/rdoc/test_rdoc_rdoc.rb: ditto
+ * test/rdoc/test_rdoc_ri_driver.rb: ditto
+ * test/rdoc/test_rdoc_servlet.rb: ditto
- * lib/webrick/httpservlet/filehandler.rb: fixed typo. [ruby-core:7075]
+Tue Nov 27 15:13:51 2012 Eric Hodel <drbrain@segment7.net>
-Sat Jan 7 15:40:07 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk (rdoc): Set --debug for rdoc generation in case of bugs
- * parse.y (singleton): get rid of segfault on syntax error.
- fixed: [ruby-core:07070]
+Tue Nov 27 14:56:45 2012 Eric Hodel <drbrain@segment7.net>
-Fri Jan 6 10:16:20 2006 Steven Lumos <steven@lumos.us>
+ * lib/rdoc/rubygems_hook.rb: Updated for (upcoming) RubyGems 2
+ import.
+ * test/rdoc/test_rdoc_rubygems_hook.rb: ditto
- * io.c (READ_DATA_PENDING): defined for 64bit Solaris on SPARC.
- [ruby-core:7057]
- (READ_DATA_PENDING_COUNT): ditto.
- (READ_DATA_PENDING_PTR): ditto.
+Tue Nov 27 13:59:29 2012 Narihiro Nakamura <authornari@gmail.com>
-Sun Jan 1 17:07:59 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * NEWS: add improvements of the garbage collector.
- * win32/win32.c (rb_w32_seekdir): should not segfault even if passed
- the location which rb_w32_telldir didn't return. [ruby-core:7035]
- (I think HEAD implementation is better. but binary compatibility)
+Tue Nov 27 13:27:46 2012 Eric Hodel <drbrain@segment7.net>
- * test/ruby/test_dir.rb: added.
+ * lib/rdoc*: Updated to RDoc 4.0 (pre-release)
+ * bin/rdoc: ditto
+ * test/rdoc*: ditto
+ * NEWS: Updated with RDoc 4.0 information
-Sat Dec 31 22:57:00 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 27 12:17:11 2012 Koichi Sasada <ko1@atdot.net>
- * eval.c (rb_thread_save_context): should not recycle scope object used
- in a thread. fixed: [ruby-dev:28177]
+ * thread.c (rb_thread_terminate_all): retry broadcast only when
+ an exception is raised.
-Fri Dec 30 18:22:42 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 27 12:02:25 2012 Koichi Sasada <ko1@atdot.net>
- * gc.c (garbage_collect): mark objects refered from aborting threads.
- [ruby-dev:28190]
+ * thread.c (rb_thread_terminate_all): broadcast terminate event
+ not only an interrupt exception but any exceptions.
- * win32/Makefile.sub: VC++8 support.
+Tue Nov 27 10:55:09 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Dec 30 14:24:53 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+ * eval.c (ruby_cleanup): set thread status to THREAD_KILLED
+ for preventing thr.raise.
+ * test/ruby/test_thread.rb (test_main_thread_status_at_exit):
+ test for the above.
- * dir.c (glob_helper): do not use TRUE for djgpp.
+Tue Nov 27 10:31:29 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Dec 30 04:54:40 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * thread.c (rb_thread_terminate_all): suppress a warning.
- * file.c (eaccess): workaround for VC++8 runtime.
+Tue Nov 27 09:29:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * win32/win32.c (ioinfo): VC++8 support.
+ * thread.c (thread_join): raises ThreadError if target thread
+ is a main thread.
+ * test/ruby/test_thread.rb (test_thread_join_main_thread):
+ test for the above.
+ * NEWS: news for the above.
-Thu Dec 29 23:59:37 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 27 09:24:47 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (rb_gc_mark_threads): leave unmarked threads which won't wake
- up alone, and mark threads in the loading table. [ruby-dev:28154]
+ * thread.c (thread_join): raises ThreadError if target thread
+ is a current thread.
+ * test/ruby/test_thread.rb (test_thread_join_current):
+ test for the above.
+ * NEWS: news for the above.
- * eval.c (rb_gc_abort_threads), gc.c (gc_sweep): kill unmarked
- threads. [ruby-dev:28172]
+Tue Nov 27 09:59:16 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 29 17:02:07 2005 Tanaka Akira <akr@m17n.org>
+ * ext/extmk.rb (extmake): close mkmf.log for each libraries so that
+ failure messages are not mixed.
- * test/ruby/envutil.rb (EnvUtil.rubybin): search "ruby" instead of
- "miniruby". [ruby-dev:28140]
+Tue Nov 27 09:58:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Dec 27 16:59:52 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/digest/*/extconf.rb, ext/openssl/extconf.rb: get git rid of
+ post-1.8 feature require_relative for cross compilation.
+ [ruby-core:50160] [Bug #7439]
- * test/drb/drbtest.rb (DRbService::self.ext_service): increase
- timeout limit. a patch from Kazuhiro NISHIYAMA
- <zn at mbf.nifty.com>. [ruby-dev:28132]
+Tue Nov 27 09:17:59 2012 Koichi Sasada <ko1@atdot.net>
-Tue Dec 27 08:29:18 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * NEWS: add TracePoint.
- * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLSocket#post_connection_chech):
- treat wildcard character in commonName. [ruby-dev:28121]
+Tue Nov 27 08:16:03 2012 Koichi Sasada <ko1@atdot.net>
-Mon Dec 26 22:32:47 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_trace.c: rename TracePoint#file and TracePoint#line
+ to TracePoint#path and TracePoint#lineno respectively.
+ They are consistent to RubyVM::Backtrace::Location.
- * eval.c (rb_eval), gc.c (gc_mark_children), node.h (NEW_ALIAS,
- NEW_VALIAS), parse.y (fitem): allow dynamic symbols to
- NODE_UNDEF and NODE_ALIAS.
- backported from trunk. fixed: [ruby-dev:28105]
+ * include/ruby/debug.h: ditto.
-Mon Dec 26 08:50:36 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_core.h: ditto.
- * eval.c (ev_const_get): fixed a bug in constant reference during
- instance_eval. [yarv-dev:707]
+ * test/ruby/test_settracefunc.rb: ditto.
- * eval.c (ev_const_defined): ditto.
+Tue Nov 27 08:04:26 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/yaml.rb (YAML::add_domain_type): typo fixed. a patch from
- Joel VanderWerf <vjoel at path.berkeley.edu>.
- [ruby-talk:165285] [ruby-core:6995]
+ * thread.c (rb_thread_terminate_all): broadcast eTerminateSignal
+ again when Ctrl-C was pressed. [Feature #1952] [ruby-dev:39107]
-Sat Dec 24 18:58:14 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 27 07:58:03 2012 Koichi Sasada <ko1@atdot.net>
- * stable version 1.8.4 released.
+ * vm_core.h: add members to rb_trace_arg_t:
+ * `klass_solved' represents klass and id is checked.
+ * `line' represents line calculated from cfp.
+ * `file' represents line calculated from cfp.
-Fri Dec 23 10:30:23 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_trace.c: fix to use above data structures.
+ No need to calculate klass and id, line and file
+ pairs for each trace points.
- * ext/digest/sha2/sha2.c (ULL): support AIX C. a patch from
- Kailden <kailden at gmail.com>. [ruby-core:06984]
+Tue Nov 27 07:47:09 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Dec 21 16:53:06 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * thread.c (rb_thread_terminate_all): add RUBY_VM_CHECK_INTS_BLOCKING().
+ Otherwise the loop in this function behave as busy loop because
+ native_sleep() return immediately when RUBY_VM_INTERRUPTED() is true.
- * file.c (w32_io_info): should return handle because FileIndex is
- valid only while file is open. [ruby-dev:28088]
+Tue Nov 27 04:12:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 21 14:53:26 2005 Tanaka Akira <akr@m17n.org>
+ * ext/extmk.rb (extmake): git rid of post-1.8 features for cross
+ compilation. [ruby-core:50160] [Bug #7439]
- * lib/pathname.rb (test_kernel_open): use File.identical?.
- [ruby-talk:171804]
+Tue Nov 27 00:13:41 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Dec 20 22:41:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (rb_mutex_trylock, rb_mutex_unlock, mutex_sleep):
+ raises ThreadError if called from trap handler as Thread#join.
+ * NEWS: news for the above.
- * eval.c (eval_under_i): evaluate source in caller's frame.
- [ruby-dev:28076]
+Mon Nov 26 23:55:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (rb_call_super): use original method name on exception.
- [ruby-dev:28078]
+ * NEWS: update for Thread#join incompatible change.
-Tue Dec 20 13:11:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Nov 26 22:44:24 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/syck/rubyext.c: fixed GC problem (backported HEAD 1.55 - 1.62)
- [ruby-dev:27839]
+ * thread.c (rb_thread_terminate_all): use native_sleep() instead
+ of rb_thread_schedule(). Otherwise, it consume 100% cpu meaninglessly.
+ [Bug #5368] [ruby-dev:44546]
+ * thread.c (thread_start_func_2): last sub-thread wakes up main thread.
- * ext/syck/syck.h (S_FREE): small hack. no need to check if pointer is
- NULL or not before S_FREE.
+Mon Nov 26 21:16:04 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * st.c: uses malloc instead of xmalloc to avoid GC. syck uses st_insert
- in gram.c to insert node from rb_syck_bad_anchor_handler into
- SyckParser's hash table. if GC occurs in st_insert, it's not under
- SyckParser's mark system yet. so RString can be released wrongly.
- [ruby-dev:28057]
+ * vm_core.h (RUBY_VM_SET_TIMER_INTERRUPT, RUBY_VM_SET_INTERRUPT)
+ (RUBY_VM_SET_FINALIZER_INTERRUPT, RUBY_VM_SET_TRAP_INTERRUPT)
+ (RUBY_VM_INTERRUPTED): use enum symbol instead of immediate value.
+ * thread.c (thread_join_m, rb_threadptr_execute_interrupts): ditto.
+ * signal.c (signal_exec): ditto.
-Tue Dec 20 12:53:23 2005 why the lucky stiff <why@ruby-lang.org>
+Mon Nov 26 20:23:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/syck/rubyext.c (syck_emitter_reset): to ensure compatibility
- with previous Ruby versions, documents are no longer headless.
+ * thread.c (thread_join_m): use th->interrupt_mask instead of
+ th->in_trap.
-Tue Dec 20 01:46:48 2005 Tanaka Akira <akr@m17n.org>
+ * vm_core.h (struct rb_thread_struct): remove in_trap member.
+ * signal.c (signal_exec): ditto.
+ * thread.c (thread_create_core): ditto.
+ * thread.c (Init_Thread): ditto.
- * io.c (rb_f_backquote): fix a GC problem on
- IA64 with gcc 4.0.3 20051216 (prerelease) -O3.
+Mon Nov 26 20:23:49 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Dec 19 23:32:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_argf.rb (TestArgf#test_chars): since marshal data is
+ binary, shouldn't pass via text mode. use base64 encoded data.
- * parse.y (rb_symname_p): fixed wrong validation. [ruby-dev:28047]
+Mon Nov 26 19:45:18 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Dec 17 03:57:01 2005 Tanaka Akira <akr@m17n.org>
+ * ruby_atomic.h (ATOMIC_CAS): new macro for compare-and-exchange.
- * bignum.c (rb_big_rshift): fix a GC problem on
- IA64 with gcc 4.0.3 20051216 (prerelease).
+ * vm_core.h (struct rb_thread_struct): add interrupt_mask member.
+ * thread.c (thread_create_core, Init_Thread): initialize
+ th->thread_mask.
-Sat Dec 17 03:30:23 2005 Tanaka Akira <akr@m17n.org>
+ * vm_core.h (RUBY_VM_INTERRUPTED_ANY): new macro for avoiding
+ bare th->interrupt_flag.
+ * vm_core.h (RUBY_VM_INTERRUPTED, RUBY_VM_INTERRUPTED): check
+ th->interrupt_mask.
+ * thread.c (set_unblock_function, rb_thread_schedule): replace
+ th->interrupt_flag with RUBY_VM_INTERRUPTED_ANY()
- * eval.c (bmcall): fix a GC problem by tail call on
- IA64 with gcc 4.0.3 20051216 (prerelease).
+ * signal.c (signal_exec): set up thread->interrupt_mask for
+ preventing recursive trap handler.
+ * vm_core.h (RUBY_VM_CHECK_INTS, RUBY_VM_CHECK_INTS_BLOCKING): ditto.
-Fri Dec 16 00:54:06 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread.c (rb_threadptr_execute_interrupts):
+ don't process interrupt if it is masked.
+ [Bug #6009] [ruby-core:42524]
- * signal.c (Init_signal): revert C++ style comment.
- [ruby-dev:28041]
+Mon Nov 26 19:43:42 2012 Koichi Sasada <ko1@atdot.net>
-Thu Dec 15 12:35:14 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * iseq.c (make_compile_option_value): add trace_instruction option.
+ a patch by davidbalbert (David Albert).
+ [Bug #6786]
- * lib/tmpdir.rb: merged RDoc patch from Eric Hodel <drbrain at
- segment7.net>. [ruby-core:06894]
+Mon Nov 26 19:10:53 2012 Koichi Sasada <ko1@atdot.net>
-Thu Dec 15 01:33:31 2005 Tanaka Akira <akr@m17n.org>
+ * bootstraptest/test_thread.rb: try to `join' each 100
+ threads.
+ This benchmark seems consuming long time on travis-ci
+ several times (and make `failure').
- * ext/zlib/zlib.c (zstream_run): fix a GC problem by tail call on
- x86_64 with gcc 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)
+Mon Nov 26 18:22:56 2012 Koichi Sasada <ko1@atdot.net>
-Wed Dec 14 12:11:46 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+ * common.mk: specify label `built-ruby'.
- * test/gdbm/test_gdbm.rb: specify pid for the argument of
- Process.wait. workaround for Cygwin.
+ * benchmark/driver.rb: quote path.
-Wed Dec 14 12:01:26 2005 Tanaka Akira <akr@m17n.org>
+Mon Nov 26 18:26:28 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * marshal.c (r_object0): fix a GC problem for reading a bignum on
- IA64 with gcc 3.3.5 (Debian 1:3.3.5-13).
+ * signal.c (signal_exec): add volatile to make sure setjmp safe.
-Tue Dec 13 12:23:47 2005 Tanaka Akira <akr@m17n.org>
+Mon Nov 26 18:19:47 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * re.c (rb_reg_regcomp): fix a GC problem on x86_64 with
- gcc 3.3.5 (Debian 1:3.3.5-13).
+ * signal.c (signal_exec): suppress "warning: variable 'signum'
+ might be clobbered by 'longjmp' or 'vfork'" warning.
-Tue Dec 13 01:44:16 2005 Tanaka Akira <akr@m17n.org>
+Mon Nov 26 18:15:47 2012 Koichi Sasada <ko1@atdot.net>
- * array.c (rb_ary_diff): fix a GC problem on IA64 with
- gcc 3.3.5 (Debian 1:3.3.5-13).
- When rb_ary_push is called, there was no register which contains
- `hash' but `&RHASH(hash)->tbl' instead.
+ * benchmark/driver.rb: accept multiple `-e'.
+ You don't need to use `;' separation character.
+ [ruby-core:50139] [ruby-trunk - Bug #7380]
-Tue Dec 13 00:08:09 2005 Tanaka Akira <akr@m17n.org>
+Mon Nov 26 17:10:04 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * sprintf.c (rb_str_format): fix a GC problem.
- [ruby-dev:28001]
+ * string.c (rb_str_enumerate_chars, rb_str_enumerate_codepoints)
+ (rb_str_enumerate_lines): suppress "may be used uninitialized in
+ this function" warning.
-Mon Dec 12 15:54:56 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Nov 26 17:00:12 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/openssl/test_ssl.rb (test_parallel): call GC.start to close
- unused files. [ruby-dev:27981]
+ * vm_core.h (rb_thread_struct): added 'in_trap' member for marking
+ running trap handler.
+ * signal.c (signal_exec): turn on in_trap when running trap.
+ * thread.c (Init_Thread, thread_create_core): initialize in_trap
+ when creating new threads.
+ * thread.c (thread_join_m): raise ThreadError when running trap
+ handler.Bug [#6416][ruby-core:44956]
+ * test/ruby/test_thread.rb (test_thread_join_in_trap): new test
+ for the above.
-Mon Dec 12 00:33:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Nov 26 16:36:13 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/digest/digest.c (rb_digest_base_s_digest): add volatile to
- protect temporary context object. [ruby-dev:27979]
+ * io.c (argf_each_codepoint): add missing ARGF#codepoints [Bug #7438]
- * ext/iconv/iconv.c (Init_iconv): rb_gc_register_address() should
- be called before actual variable initialization.
- [ruby-dev:27986]
+Mon Nov 26 15:50:29 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Dec 9 23:31:02 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bignum.c (bigdivrem): restart calculation when bigdivrem1 was
+ interrupted by signal. Otherwise, ruby script may see a garbage
+ value.
- * lib/rexml/encoding.rb (encoding=): give priority to particular
- conversion to iconv. [ruby-core:06520]
+Mon Nov 26 15:33:02 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Dec 8 02:07:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bignum.c (big_div_struct): added volatile to 'stop' member.
+ Otherwise, "if (bds->stop)" check in bigdivrem1 don't read
+ memory and ignore interrupt.
+ * bignum.c (bigdivrem, rb_big_stop): ditto.
- * eval.c (umethod_bind): adjust invoking class for module method.
- [ruby-dev:27964]
+Mon Nov 26 12:11:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 8 00:40:52 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * win32/Makefile.sub (DLNOBJ): missing in r37821.
- * eval.c (call_trace_func): klass parameter should be a
- class/module that defines calling method. [ruby-talk:169307]
+Mon Nov 26 10:50:19 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Dec 7 17:10:27 2005 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * test/ruby/test_process.rb (test_setsid): added a few wait for
+ preventing that Process.getsid(io.pid) makes Errno::ESRCH.
- * sprintf.c (rb_f_sprintf): [ruby-dev:27967]
+Sun Nov 25 22:34:00 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Wed Dec 7 15:31:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * array.c (ary_resize_smaller): new function to resize array.
- * sprintf.c (rb_str_format): integer overflow check added.
+ * array.c (rb_ary_delete): refactoring to extract a function.
- * sprintf.c (GETASTER): ditto.
+ * array.c (rb_ary_delete_same): refactoring.
+ It renames function, reduces duplicated code and removes unused
+ code.
-Wed Dec 7 01:02:04 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * gc.c (wmap_final_func): follow the above change.
- * ext/tk/README.macosx-aqua: [new document] tips to avoid the known
- bug on platform specific dialogs of Tcl/Tk Aqua on MacOS X.
+ * internal.h (rb_ary_delete_same): ditto.
- * ext/tk/tcltklib.c: fix bug on switching threads and waiting on the
- deleted interpreter on vwait and tkwait command.
+Sun Nov 25 22:27:33 2012 Benoit Daloze <eregontp@gmail.com>
- * ext/tk/lib/multi-tk.rb: kill the meaningless loop for the deleted Tk
- interpreter.
+ * array.c: fixes for the updated documentation in r35858:
+ Typos and #take/#drop accept to take/drop 0 elements.
- * ext/tk/sample/demos-jp/image3.rb: [bug fix] wrong argument.
+Sun Nov 25 19:43:29 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * ext/tk/sample/demos-en/image3.rb: ditto.
+ * NEWS: add a news about iconv.
- * ext/tk/sample/demos-jp/menu.rb: fix message for MacOS X.
+Sun Nov 25 03:49:23 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/tk/sample/demos-jp/menu8x.rb: ditto.
+ * lib/set.rb, test/test_set.rb: Move tests embedded in lib/set.rb
+ to test/test_set.rb.
- * ext/tk/sample/demos-en/menu.rb: ditto.
+Sun Nov 25 03:44:50 2012 Akinori MUSHA <knu@iDaemons.org>
-Tue Dec 6 16:37:57 2005 Yuya Nishida <yuya@j96.org>
+ * string.c (rb_str_each_line, rb_str_lines): String#lines now
+ returns an array instead of an enumerator. Passing a block is
+ deprecated but still supported for backwards compatibility.
+ Based on the patch by yhara. [Feature #6670]
- * eval.c (exec_under): avoid accessing ruby_frame->prev.
- [ruby-dev:27948]
+ * string.c (rb_str_each_char, rb_str_chars): Ditto for
+ String#chars.
-Thu Dec 1 00:50:33 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_str_each_codepoint, rb_str_codepoints): Ditto for
+ String#codepoints.
- * eval.c (rb_funcall2): allow to call protected methods.
- fixed: [ruby-dev:27890]
+ * string.c (rb_str_each_byte, rb_str_bytes): Ditto for
+ String#bytes.
-Wed Nov 30 23:52:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * NEWS: Add notes for the above changes.
- * parse.y (NEWHEAP, ADD2HEAP): set count after pointer was set.
- fixed: [ruby-dev:27896]
+Sun Nov 25 02:07:37 2012 Akinori MUSHA <knu@iDaemons.org>
-Wed Nov 30 13:43:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_warning)
+ (Test::Unit::Assertions#assert_warn), test/ruby/envutil.rb,
+ test/ruby/test_enumerator.rb, test/ruby/test_io_m17n.rb,
+ test/ruby/test_regexp.rb, test/ruby/test_syntax.rb:
+ assert_warn() and assert_warning() are reversed.
- * misc/ruby-mode.el (ruby-expr-beg): support $! at the end of
- expression. [ruby-dev:27868]
+Sat Nov 24 21:08:50 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Mon Nov 28 18:55:43 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * gc.c (wmap_final_func): rename variables to clarify the meaning.
+ In wmap2obj the key is WeakRef and the value is referenced object.
+ In obj2wmap the key is referenced object and the value is an array
+ of WeakRef.
- * ext/socket/socket.c (init_inetsock_internal): remove setting
- SO_REUSEADDR option on server socket on Cygwin.
- fixed: [ruby-core:6765] ([ ruby-Bugs-2872 ])
+ * gc.c (wmap_finalize): ditto.
+ [ruby-core:49044] [Bug #7304]
-Mon Nov 28 13:08:54 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat Nov 24 21:01:55 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * win32/win32.c (rb_w32_strerror): remove all CR and LF. (avoid broken
- error message on bccwin32 + winsock)
+ * array.c (rb_ary_delete_same_obj): new function for WeakRef.
+ This deletes same objects as item argument in the array.
-Mon Nov 28 09:21:49 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * internal.h (rb_ary_delete_same_obj): add a declaration.
- * lib/mkmf.rb (create_makefile): should not change sodir with
- dir.gsub!. (bccwin32 failed to install third party exntesions)
- [ruby-dev:27834]
+ * gc.c (wmap_final_func): remove WeakRef object reference from the
+ array. rb_ary_delete() is not usable because it uses rb_equal() to
+ compare object references.
-Sun Nov 27 00:56:13 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * gc.c (wmap_finalize): remove recycled object references from weak
+ map hash properly. How to get object reference from object id was
+ wrong. st_delete() doesn't work properly if key and value arguments
+ are same. The key of obj2wmap is referenced object and the value of
+ obj2wmap is WeakRef array.
- * lib/wsdl/xmlSchema/complexContent.rb: missing
- ComplexContent#elementformdefault method.
+ * gc.c (wmap_aset): obj2wmap should contain WeakRef array in the
+ definition.
-Sat Nov 26 19:57:45 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+ * test/test_weakref.rb
+ (TestWeakRef#test_not_reference_different_object,
+ TestWeakRef#test_weakref_finalize): add tests for above.
+ [ruby-core:49044] [Bug #7304]
- * dln.c (conv_to_posix_path): should initialize posix.
+Sat Nov 24 19:44:41 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Nov 24 21:05:58 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/nkf/nkf-utf8/nkf.c (unicode_iconv_combine): returning flags are
+ nkf_char.
- * configure.in (AC_CHECK_FUNCS): need to check link().
- fixed: [ruby-dev:27814]
+Sat Nov 24 19:29:18 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Thu Nov 24 01:22:25 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/ruby/test_rubyoptions.rb (test_usage, test_usage_long):
+ reduced, renamed.
- * file.c (w32_io_info): CreateFile failed on Win9x if file was already
- opened. (FILE_SHARE_READ was needed, but actually I don't understand
- the flags of CreateFile well...)
+Sat Nov 24 13:10:14 2012 Koichi Sasada <ko1@atdot.net>
-Wed Nov 23 20:59:01 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm_trace.c (rb_tracepoint_attr_raised_exception): should not check
+ value before event checking.
- * ext/tk/lib/tk.rb: add Tk.pkgconfig_list and Tk.pkgconfig_get
- [Tk8.5 feature].
+ * vm_trace.c (rb_tracepoint_attr_return_value): ditto.
- * ext/tk/lib/tk/text.rb: supports new indices modifires on a Text
- widget [Tk8.5 feature].
+ * test/ruby/test_settracefunc.rb: add tests for TracePoint#return_value
+ and TracePoint#raised_exception.
- * ext/tk/lib/tk/virtevent.rb: add TkNamedVirtualEvent.
+Sat Nov 24 12:47:27 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * ext/tk/lib/tk/autoload.rb: ditto.
+ * test/ruby/test_process.rb (TestProcess#test_setsid): "./ruby-trunk"
+ doesn't work on all environments. EnvUtil.rubybin would be suitable.
- * ext/tk/lib/tk/event.rb: add :data key for virtual events [Tk8.5
- feature].
+Sat Nov 24 12:28:04 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Wed Nov 23 18:55:31 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * array.c (rb_ary_aref): fix Segmentation fault at TestArray#test_aref
+ on x64 mingw. Variable argument of rb_scan_args() should be a pointer
+ (VALUE *), but 0 of variable argument seems not equal to null pointer
+ on x64 mingw.
- * file.c (w32_io_info): should not call GetFileInformationByHandle
- for pipe.
+Sat Nov 24 11:47:14 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * file.c (w32_io_info): checks return value from rb_w32_get_osfhandle.
+ * process.c (proc_getsid): adds new method for getting session id.
+ Contributed from fumiyas (Fumiyasu SATOH). Thank you!
+ [Feature #6757] [ruby-dev:45977]
+ * configure.in: adds getsid check.
+ * test/ruby/test_process.rb (TestProcess#test_setsid): new test
+ for the above.
+ * NEWS: news for the above.
- * file.c (w32_io_info): now can identify directory on WinNT.
+Sat Nov 24 10:59:14 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Nov 23 03:40:49 2005 Guy Decoux <ts@moulon.inra.fr>
+ * thread.c (thread_create_core): don't use th->thread_id before
+ initialized.
- * re.c (KR_REHASH): should cast to unsigned for 64bit CPU.
- [ruby-core:06721]
+Sat Nov 24 00:00:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 23 11:01:33 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * ruby.c (proc_options, process_options, ruby_process_options): take
+ care of the case argc is 0, and check if argv has NULL.
+ [ruby-core:49889] [Bug #7423]
- * intern.h, file.c: failed to compile on windows.
+Sat Nov 24 00:00:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 23 07:26:44 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * configure.in (--disable-dln): option to disable dynamic linking
+ feature. [ruby-core:37676] [Feature #4946]
- * ext/openssl/extconf.rb: check for X509V3_EXT_nconf_nid.
+Fri Nov 23 23:44:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_x509ext.c (MakeX509ExtFactory): should use
- OPENSSL_malloc to allocate X509V3_CTX.
+ * lib/mkmf.rb (MakeMakefile#pkg_config): strip all white spaces for
+ mingw64+MSYS pkg-config which erroneously emits extra newlines.
+ [ruby-core:47998] [Bug #7163]
- * ext/openssl/ossl_x509ext.c (ossl_x509extfactory_create_ext): use
- X509V3_EXT_nconf_nid to avoid SEGV (and to build extensions which
- values are placed in separate section).
+Fri Nov 23 17:31:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/openssl/test_x509ext.rb: new file.
+ * ruby.c (usage): wrap description lines if options are too long.
-Wed Nov 23 01:22:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Nov 23 11:13:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * file.c (test_identical): test if two files are identical.
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_usage2): refine
+ assertion.
- * file.c (rb_f_test): support DOSISH systems where st_ino is not
- reliable. fixed: [ruby-core:06672]
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_usage2): now
+ --help option is for modern terminals.
- * win32.h, win32.c (rb_w32_osid): check the running platform.
+Fri Nov 23 10:45:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Tue Nov 22 23:52:06 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/ipsocket.c (IPSocket#peeraddr): Fix example
+ [ruby-core:46429] [Bug #6732]
- * lib/optparse.rb: match incomplete (in current enconding) multibyte
- string. http://inamode6.tokuhirom.dnsalias.org/show/1551
+Fri Nov 23 02:40:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Tue Nov 22 18:36:11 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/cgi/core.rb: Documentation for CGI#header alias
+ Based on a patch by Marcus Stollsteimer
+ [ruby-core:49585] [Bug #7405]
- * win32/win32.c (winnt_stat): set mapped errno instead of ENOENT.
+Thu Nov 22 23:48:10 2012 Narihiro Nakamura <authornari@gmail.com>
-Tue Nov 22 14:46:57 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * gc.c (is_swept_object): extract from is_dead_object().
- * file.c (rb_file_s_basename): skip slashes just after UNC top slashes.
+ * gc.c (rb_gcdebug_print_obj_condition): add the function for debug.
+ This function shows some conditions of given object (e.g.,
+ marked, in heap, swept).
- * test/ruby/test_path.rb (test_dirname, test_basename): follow new
- spec. and add new tests.
+ * gc.c (rb_gcdebug_sentinel): add the function for debug.
+ This function allow check to inadvertently free up an object.
-Tue Nov 22 13:18:32 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Nov 22 23:45:18 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * win32/win32.c (rb_w32_stat): Dir.chdir('//server/shared');
- p Dir.glob('*') should work on WinNT. (implemented our own
- stat(2) on WinNT) [ruby-list:41552] [ruby-dev:27711]
+ * array.c (rb_ary_shared_with_p): fix cache validity check.
+ If #pop or #shift has been called against $: or $", the array will
+ be still shared with the snapshot. We check array length for cache
+ validity.
+ [ruby-core:49518] [Bug #7383]
-Tue Nov 22 02:31:53 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/ruby/test_require.rb
+ (TestRequire#test_require_with_array_pop,
+ TestRequire#test_require_with_array_shift): add tests for above.
- * ext/tk/lib/tkextlib/tile.rb: bug fix (Tk::Tile::USE_TTK_NAMESPACE
- is not defined).
+Thu Nov 22 21:48:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Nov 22 01:45:21 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk, win32/Makefile.sub (probes.dmyh): now be made in current
+ (=build) directory if build from the repository.
- * file.c (rb_file_s_basename): DOSISH_UNC is defined on cygwin but
- DOSISH is not. fixed: [ruby-dev:27797]
+Thu Nov 22 21:34:51 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Mon Nov 21 22:50:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_rubyoptions.rb: added a test.
- * file.c (rb_path_skip_prefix, rb_file_s_basename): UNC without path
- should not be splitted. fixed: [ruby-dev:27776] [ruby-dev:27786]
+Thu Nov 22 20:32:07 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * parse.y (dsym): prohibit empty symbol literal by interpolation.
- fixed: [ruby-talk:166529]
+ * complex.c (string_to_c_strict, string_to_c): check NUL.
+ * rational.c (string_to_r_strict, string_to_r): ditto.
-Mon Nov 21 16:03:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 22 20:21:45 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * win32/setup.mk: findstr doesn't exist on win9x.
- fixed: [ruby-dev:27756]
+ * Makefile.in (.dmyh.h): removed $(VPATH). GNU make don't
+ recognize suffix rule with VPATH.
-Sun Nov 20 22:34:06 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 22 18:11:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * parse.y (rb_symname_p): [ not followed by ] is not valid symbol.
- fixed: [ruby-talk:166520]
+ * common.mk, Makefile.in, win32/Makefile.sub (.dmyh.h): nmake merges
+ explicit rules for same target, but not merges explicit rules and
+ implicit rules -- always explicit rules win. So, need to add an
+ explicit rule for probes.h. [Bug #7421] [ruby-core:49839]
-Sat Nov 19 19:57:54 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Nov 22 18:01:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/fileutils.rb (FileUtils::ln): ln documentation fix.
- [ruby-core:06661]
+ * Makefile.in (probes.o): add -C to ignore #include in probes.d.
-Sat Nov 19 07:34:32 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * probes.d: include vm_opts.h instead of vm_core.h.
- * ext/tk/lib/tk/font.rb: remove dependency on Ruby's version (1.8
- or 1.9).
+ * vm_opts.h (VM_COLLECT_USAGE_DETAILS): move definition from vm_core.h.
- * ext/tk/lib/tkextlib/ICONS/icons.rb: ditto.
+Thu Nov 22 17:45:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/sample/tkextlib/treectrl/demo.rb: ditto.
+ * ext/nkf/nkf-utf8: Merge b0a6577a521d1bba5e19853f95d5c4b9be1072b5.
+ Support JIS X 0213 and some bugfixes.
-Fri Nov 18 17:57:08 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Nov 22 17:39:37 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * file.c (rb_file_s_dirname): should use skipprefix for UNC path.
- pointed out by nobu ([ruby-dev:27744]). fixed: [ruby-core:5076]
+ * tool/gen_dummy_probes.rb: don't change #include, #if and #endif
+ lines. [Bug #7370]
-Fri Nov 18 17:35:09 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Nov 22 16:58:26 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/tk/lib/multi-tk.rb: add restriction to access the entried
- command table and manipulate other IPs (for reason of security).
- Now, a IP object can be controlled by only its master IP or the
- default IP.
+ * Makefile.in: run preprocessor when making probe.h
+ * probes.d: define probe insn and insn__operand only when
+ VM_COLLECT_USAGE_DETAILS is 1. [Bug #7370]
- * ext/tk/lib/remote-tk.rb: add restriction to manipulate.
+Thu Nov 22 16:20:49 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/tk/tcltklib.c (ip_is_slave_of_p): add TclTkIp#slave_of?(ip)
- to check manipulability.
+ * vm.c: Don't define vm_collect_usage_operand() and
+ static void vm_collect_usage_insn() when disabling
+ VM_COLLECT_USAGE_DETAILS. (refix r37796)
- * ext/tk/lib/tk.rb: bug fix on handling of Tcl's namespaces.
+Thu Nov 22 15:26:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/lib/tk/namespace.rb: ditto.
+ * vm_insnhelper.h: partly revert r37631 (DTrace support).
+ "vm usage information is always collected, so uncomment the
+ functions." causes performance impact. [Bug #7370]
+ Off course this revert disables related probes.
-Fri Nov 18 17:26:06 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Nov 22 14:14:36 2012 Akinori MUSHA <knu@iDaemons.org>
- * file.c (rb_file_s_dirname): added checks for some patterns with drive
- letter. fixed: [ruby-dev:27738]
+ * re.c (rb_memsearch_ss): Apply performance improvement to short
+ byte array search for platforms without memmem(3).
+ [Feature #6311] [ruby-dev:45530]
- * test/ruby/test_path.rb (test_dirname): added tests for above
- patterns.
+Thu Nov 22 12:52:19 2012 Akinori MUSHA <knu@iDaemons.org>
-Fri Nov 18 12:18:02 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/ruby/test_string.rb (TestString#test_index): Add some
+ corner cases to tests for String#index, which might fail if ruby
+ directly used a buggy memmem(3) implementation.
- * win32/win32.h (S_IFIFO): r,w = IO.pipe; r.stat.pipe? now
- returns true on VisualC++6.
+Thu Nov 22 08:06:42 2012 Narihiro Nakamura <authornari@gmail.com>
-Wed Nov 16 23:24:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_gc.rb (test_profiler_clear): fix wrong method
+ calls [Bug #7419] [ruby-core:49828].
- * common.mk (static-ruby): overridable.
+Thu Nov 22 02:22:33 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/extmk.rb (parse_args): force to link extensions statically only
- if static is given for extstatic.
+ * NEWS: edited (order etc).
- * ext/extmk.rb (RUBY, RUBYW): overridable.
+Wed Nov 21 22:52:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 15 23:46:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/io/wait/wait.c (io_wait_readable): add alias wait_readable.
- * lib/find.rb (Find::find): should not ignore symbolic links to
- non-existing files. [ruby-talk:165866]
+ * ext/io/wait/wait.c (io_wait_writable): this is easier to use than
+ IO.select for a single IO object and is immune to the
+ limitations/inefficiency of select() on platforms where poll/ppoll
+ is available. patched by Eric Wong. [Feature #4646]
-Tue Nov 15 16:23:26 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Nov 21 22:27:52 2012 Narihiro Nakamura <authornari@gmail.com>
- * array.c (rb_ary_fill): previous commit disabled this usage:
+ * gc.c (garbage_collect): remove a duplicative probe.
- a = [0,1,2,3,4,5,6,7,8,9]
- a.fill {|i| a[i] * 10} #=> [nil, nil, ...., nil]
+Wed Nov 21 22:08:48 2012 Narihiro Nakamura <authornari@gmail.com>
- previous commit has the advantage of early garbage collection, but
- potensially this would break some script. so I reverted behavior.
+ * gc.c (gc_profile_clear): realloc profile records if its size is
+ higher than the threshold, GC_PROFILE_RECORD_DEFAULT_SIZE * 2.
-Tue Nov 15 16:04:10 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Nov 21 21:53:29 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * array.c (rb_ary_fill): tail elements were vanished when the middle
- part of array was filled. (ie: [0,1,2,3,4].fill(-1,2,1) => [0,1,-1])
+ * complex.c (nucomp_to_c): added.
- * test/ruby/test_array.rb (test_fill): added.
+Wed Nov 21 21:35:38 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Tue Nov 15 14:39:16 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/util.h: removed extra semicolon in definition of
+ macro.
+ * compile.c: ditto.
+ * cont.c: ditto.
+ * math.c: ditto.
+ * node.c: ditto.
+ * parse.y: ditto.
- * array.c (rb_ary_fill): should adjust array length correctly when
- an array is expanded in the fill process. [ruby-core:06625]
+Wed Nov 21 18:46:37 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Mon Nov 14 23:49:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * rational.c (read_digits): due to a bit tighter rb_cstr_to_inum().
- * file.c (rb_file_s_readlink): ERANGE will occur only on GPFS.
- [ruby-dev:27699]
+Wed Nov 21 16:13:37 2012 Koichi Sasada <ko1@atdot.net>
-Mon Nov 14 17:36:22 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * benchmark/bm_so_nsieve_bits.rb: add an encoding pragma because
+ this benchmark using strings (literals) as binary sequence.
+ Now, they are UTF-8 strings. [ruby-dev:46578]
- * array.c (rb_ary_first): RDoc update from Daniel Berger
- <djberg96@yahoo.com>. [ruby-core:06577].
+Wed Nov 21 00:57:43 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Nov 11 10:31:44 2005 Zach Dennis <zdennis@mktec.com>
+ * file.c (Init_File): null device definition uses rb_define_const
+ instead of rb_file_const.
- * ext/socket/socket.c: Socket Documentation. [ruby-core:6552]
+Wed Nov 21 00:28:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Nov 11 08:20:56 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_m17n_comb.rb (test_str_crypt): Use RbConfig to get
+ libc's directory. Patched by Vit Ondruch [ruby-core:49763] [Bug #7312]
- * Makefile.in (OUTFLAG): keep trailing spaces. [ruby-dev:27666]
+Tue Nov 20 23:28:26 2012 Masaki Matsushita <glass.saga@gmail.com>
- * mkconfig.rb: substitution refereces added.
+ * marshal.c: add marshal readahead. marshalized Array, Hash and Struct
+ have size at least number of its elements, marshal readahead will
+ read the certain readable length and buffer when it needs more bytes.
+ marshal readahead prevents many calls to IO#getbyte and IO#read,
+ then it enables performance improvement.
+ [ruby-dev:45637] [Feature #6440]
-Fri Nov 11 07:44:18 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Nov 20 22:35:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in: undef HAVE_LINK on BeOS. (link(2) always returns
- EINVAL, and this causes error in test/fileutils.)
+ * Makefile.in (.d.h): replace char * to const char * because somehow
+ current dtrace removes const of function declaration in probes.d.
- * file.c: overwride chown(2) and fchown(2) on BeOS. (these functions
- should not change user/group id if -1 is passed as corresponding
- argument, and this causes error in test/fileutils too)
- [ruby-dev:27672]
+Tue Nov 20 21:41:04 2012 Koichi Sasada <ko1@atdot.net>
- * file.c (rb_file_s_link): checks HAVE_LINK.
+ * include/ruby/debug.h: introduced.
+ Debugging/profiling features will be located.
-Tue Nov 8 15:32:27 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * vm_trace.c: expose C-level TracePoint APIs.
+ Note that they are experimental.
- * lib/drb/ssl.rb (DRb::SSLConfig#accept): fixed typo.
- [ruby-dev:27560] [ruby-core:4627]
+ * vm_trace.c, include/ruby/debug.h: rename `rb_hook_flag_t'
+ to `rb_event_hook_flag_t'.
+ Macro names `RUBY_HOOK_FLAG_*' are also renamed to
+ `RUBY_EVENT_HOOK_FLAG_*'.
-Mon Nov 7 13:43:51 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * debug.h, vm_debug.h: rename debug.h to vm_debug.h.
- * ext/tk/stubs.c (_nativethread_consistency_check): use simpler
- (low cost) way to check whether the Tcl interpreter was compiled
- with threads enabled of not.
+ * common.mk: ditto.
- * ext/tk/tcltklib.c: reduce warnings.
+ * debug.c, main.c, vm_core.h: ditto.
- * ext/tk/tkutil/tkutil.c: ditto.
+Tue Nov 20 21:12:37 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Nov 7 00:06:58 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * configure.in (RUBY_DTRACE_AVAILABLE): only check dtrace availability.
- * lib/yaml.rb: removed :nodoc: to generate Kernel doc. [ruby-core:6324]
+ * configure.in (RUBY_DTRACE_POSTPROCESS): restore.
-Sun Nov 6 23:39:13 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 20 21:22:44 2012 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/iconv/iconv.c (Iconv::BrokenLibrary): exception when detected a
- bug of underlying library.
+ * test/win32ole/test_win32ole_type.rb (test_implemented_ole_types):
+ IShellDispatch6 bundled in Windows 8. Thanks to phasis68 (Heesob
+ Park). [ruby-core:49580][Bug #7403]
-Sun Nov 6 21:46:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Nov 20 21:06:41 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/tk/stubs.c (ruby_tcl_create_ip_and_stubs_init): should touch
- interpreter after initialization is done. [ruby-dev:27638]
+ * complex.c: some improvements.
+ * rational.c: ditto.
-Sun Nov 6 20:13:27 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 20 21:01:16 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * file.c (rb_file_s_readlink): readlink(2) on AIX fails with ERANGE if
- buffer size is less than required. fixed: [ruby-dev:27634]
+ * common.mk (incs): BSD make cannot deal with non-prefixed dependency
+ and prefixed target.
-Wed Nov 2 20:25:28 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Nov 20 20:10:23 2012 Yusuke Endoh <mame@tsg.ne.jp>
- * ext/tk/extconf.rb: ext/tk/extconf.rb: change the check parameter
- for Win32.
+ * array.c (rb_ary_bsearch): fix rdoc bug (O(n log n) -> O(log n)).
+ Patch by Charlie Somerville. [ruby-core:49661] [Bug #7409]
-Wed Nov 2 20:14:53 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * range.c (range_bsearch): ditto.
- * ext/tcltklib: merge into ext/tk and remove.
+Tue Nov 20 19:02:44 2012 Koichi Sasada <ko1@atdot.net>
-Wed Nov 2 19:03:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm_trace.c: rename and add TracePoint APIs.
+ (1) TracePoint.new(...){...} creates a new trace point
+ but does not make it enable.
+ (2) TracePoint.trace(...){...} creates a new trace point
+ and enable it (same as old behavior).
+ (3) TracePoint#enable make it enable (renamed from TracePoint#retrace).
+ If block given, when enable only in block.
+ (4) TracePoint#disable make it disable (renamed from TracePoint#untrace).
+ If block given, when disable only in block.
+ (5) TracePoint#enabled? returns this trace is enable or not.
+ [Feature #6895]
- * ext/tcltklib/tcltklib.c (ip_rbUpdateObjCmd,
- ip_rb_threadUpdateObjCmd): passed improper flags to DoOneEvent().
+ * test/ruby/test_settracefunc.rb: add tests.
- * ext/tk/tkutil.c: use rb_obj_respond_to() instead of rb_respond_to().
+Tue Nov 20 18:35:05 2012 Koichi Sasada <ko1@atdot.net>
-Tue Nov 1 14:20:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_trace.c: add two methods:
+ (1) TracePoint#return_value which returns return
+ value on the :return and :c_return event.
+ (2) TracePoint#raised_exception which returns raised exception
+ value on the :raise event.
+ Each methods raise RuntimeError if it is called at unsupported
+ event.
+ Please review and give us feedback until next preview
+ release (Dec/2012) of Ruby 2.0.0.
+ [Feature #6895]
- * eval.c (rb_call_super): should call method_missing if super is
- called from Kernel method.
+ * insns.def, vm.c, vm_eval.c, vm_insnhelper.c, eval.c, thread.c:
+ ditto.
- * eval.c (exec_under): frame during eval should preserve external
- information.
+ * vm_trace.c, vm_core.h: move definition of rb_trace_arg_t from
+ vm_trace.c to vm_core.h.
+ Caller fills rb_trace_arg_t and pass the pointer of this variable.
-Tue Nov 1 10:50:17 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/ruby/test_settracefunc.rb: fix tests to test this change.
- * ext/openssl/extconf.rb: should check ERR_peek_last_error().
- [ruby-dev:27597]
+Tue Nov 20 17:31:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl.c (ossl_raise): ditto.
+ * configure.in: fix dtrace didn't work on darwin.
-Mon Oct 31 17:34:46 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in (RUBY_DTRACE_AVAILABLE): unify RUBY_DTRACE_POSTPROCESS
+ and RUBY_DTRACE_BSD_BROKEN.
- * configure.in: use proper option for Sun linker. A patch from
- Shinya Kuwamura <kuwa at labs.fujitsu.com>. [ruby-dev:27603]
+Tue Nov 20 15:20:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Mon Oct 31 11:27:22 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * file.c (File.extname): Documentation for extname on dotfiles and
+ files ending with a dot. Also, added example for this.
+ [ruby-core:47852] [Bug #7112]
- * test/gdbm/test_gdbm.rb, test/sdbm/test_sdbm.rb (test_s_open_error):
- skip on Win32/DOS platforms.
+Tue Nov 20 14:19:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon Oct 31 05:49:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/ruby/test_signal.rb (TestSignal#test_signame): fix windows
+ test failure. Process.kill on windows can't send a signal to
+ another process.
- * ext/openssl/ossl_cipher.c (ossl_cipher_update): input data must
- not be empty. [ruby-talk:161220]
+Tue Nov 20 13:58:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/openssl/test_cipher.rb: add test for Cipher#update("").
+ * io.c (Init_IO): moved all rb_file_const() into file.c.
+ * file.c (Init_File): replace with rb_file_const() with
+ rb_define_const() because RDoc don't care rb_file_const.
+ [Bug #5530]
-Mon Oct 31 05:37:20 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Nov 20 12:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * lib/webrick/httpservlet/cgihandler.rb
- (WEBrick::HTTPServlet::CGIHandler#do_GET): the value of Set-Cookie:
- header field should be splited into each cookie. [ruby-Bugs:2199]
+ * ruby.c (usage_msg): Fix typo [ruby-core:49205] [Bug #7327]
- * lib/webrick/cookie.rb (WEBrick::Cookie.parse_set_cookie): new method
- to parse the value of Set-Cookie: header field.
+Tue Nov 20 12:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * test/webrick/test_cookie.rb, test/webrick/test_cgi.rb,
- test/webrick/webrick.cgi: add some test for cookie.
+ * file.c (File::NULL): Document File::NULL constant
+ [ruby-core:49384] [Bug #7365]
-Mon Oct 31 03:19:36 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 20 12:05:15 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/readline/readline.c (readline_readline): type check.
- [ruby-core:6089]
+ * win32/win32.c (rb_w32_read): Windows 8 fixed one of a bug of console
+ API.
+ based on the patch by Heesob Park at [ruby-core:49479] [Bug #7379]
- * numeric.c (fix_rshift): RDoc fix. [ruby-core:6351]
+Tue Nov 20 11:14:33 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * util.h (strtod): add #undef for platforms defines strtod()
- macro. [ruby-dev:27563]
+ * configure.in (--enable-dtrace): always call RUBY_DTRACE_BSD_BROKEN
+ for portability.
+ As the note, FreeBSD 8 has DTrace as the optional
+ feature (it is enabled by the build option), but doesn't have USDT.
+ FreeBSD 9 has USDT but they are still optional. FreeBSD 10 will
+ enable them by default.
+ The variable $rb_cv_prog_dtrace_g is "yes" only on FreeBSD 9 with
+ optional DTrace or FreeBSD 10. If it is "no", you cannot know
+ whether it doesn't need -G or DTrace is disabled. (by checking
+ error code, you can know)
-Mon Oct 31 02:35:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Nov 19 22:55:48 2012 Naohisa Goto <ngotogenome@gmail.com>
- * test/ruby/test_float.rb (test_precision): test by assert_in_delta.
- [ruby-dev:27575]
+ * configure.in (--enable-dtrace): change help message
-Sat Oct 29 01:58:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 20 11:05:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * ext/etc/etc.c: document update from mathew <meta@pobox.com>.
- [ruby-core:06473]
+ * lib/tracer.rb (Tracer.trace_func): printf to stdout
+ Patch by Michal Fojtik [ruby-core:45219] [Bug #6490]
- * ext/fcntl/fcntl.c: ditto.
+Mon Nov 19 21:24:18 2012 Naohisa Goto <ngotogenome@gmail.com>
-Thu Oct 27 16:45:31 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_dump.c: not to include probes.h because the code does not depend
+ on it.
+ * common.mk (vm_dump.$(OBJEXT)): remove dependency on probes.h
- * string.c (scan_once): wrong condition to use mbclen2().
- [ruby-dev:27535]
+Tue Nov 20 10:14:22 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Oct 26 09:27:27 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * thread.c (rb_thread_s_check_interrupt): removed redundant
+ GET_THREAD().
- * ext/syck/implicit.c (syck_type_id_to_uri): should return
- newly allocated memory. otherwise, type_id will be freed
- twice. [ruby-dev:27384] [ruby-core:6385]
+Tue Nov 20 10:12:46 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Oct 26 09:04:51 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * thread.c (rb_threadptr_async_errinfo_active_p): added a small
+ comment.
- * ruby.h (Qfalse, Qtrue, Qnil, Qundef): make sure these immediate
- values have VALUE type. there is an environment where sizeof(VALUE)
- != sizeof(int) like IA64. if 32bit integer (Qtrue) is passed to ANYARGS
- and received by 64bit integer (VALUE), upper bits may have garbage value.
- [ruby-dev:27513]
+Tue Nov 20 10:05:56 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Oct 26 01:58:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (rb_thread_blocking_region_end): replaced GET_THREAD()
+ with ruby_thread_from_native(). We don't have GVL here.
- * configure.in (RUBY_EXTERN): macro to export symbols in shared
- library. [ruby-core:05528]
+Tue Nov 20 09:56:15 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * defines.h, {bcc32,win32,wince}/Makefile.sub (RUBY_EXTERN): moved to
- configuration pass.
+ * thread.c (rb_threadptr_execute_interrupts) removed.
+ * thread.c (rb_threadptr_execute_interrupts_common) renamed to
+ rb_threadptr_execute_interrupts. I.e. unified
+ rb_threadptr_execute_interrupts and rb_threadptr_execute_interrupts_common.
+ * thread.c (rb_thread_schedule, rb_thread_execute_interrupts) s/_common//.
- * ext/extmk.rb (extmake): RUBY_EXTERN for static linked extensions.
+Tue Nov 20 09:48:34 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Oct 25 15:32:00 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * signal.c (rb_get_next_signal): removed pointless signal
+ disabling. pthread_sigmask() only changes current thread
+ mask.
- * lib/rational.rb: applied documentation patch from Gavin Sinclair
- <gsinclair@gmail.com>. [ruby-core:06364]
+Tue Nov 20 09:36:55 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/irb.rb (IRB::Irb::eval_input): handle prompts with newlines
- in irb auto-indentation mode. [ruby-core:06358]
+ * signal.c (install_sighandler): added comments why we need
+ rb_disable_interrupt().
-Tue Oct 25 02:12:08 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 20 09:31:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rdoc/markup/simple_markup.rb (SM::SimpleMarkup::LABEL_LIST_RE):
- reduce redundant backtrack. [ruby-talk:161771]
+ * signal.c (rb_disable_interrupt, rb_enable_interrupt): removed
+ USE_TRAP_MASK.
+ * signal.c (trap_arg, trap_ensure): removed.
+ * signal.c (trap, sig_trap): removed pointless signal disabling.
+ We don't need it because we no longer run trap handler on signal
+ handler context.
-Tue Oct 25 00:27:35 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Nov 20 09:20:49 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rinda/*: RDoc documentation from Eric Hodel
- <drbrain@segment7.net> added.
+ * prelude.rb: Moved Mutex#synchronize to
+ * thread.c (rb_mutex_synchronize_m): here. [Bug #4266]
-Mon Oct 24 21:14:29 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 20 08:36:15 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * configure.in, io.c: use sys/syscall.h if syscall.h is not available.
- [ruby-core:06247]
+ * signal.c (sig_signame): implements Signal.signame method
+ [Feature #5613]
+ * test/ruby/test_signal.rb (test_signame): adds test for above
+ * NEWS: add an item about above
-Mon Oct 24 20:49:45 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Nov 19 16:30:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/Win32API/lib/win32/resolv.rb (get_info): support multiple DNS.
- fixed: [ruby-list:40058], [ruby-dev:27479]
+ * struct.c (rb_struct_each_pair): yield associated pairs so that
+ an unsplat argument can get both, for consistency with Hash,
+ OpenStruct, and etc. [ruby-dev:46533] [Bug #7382]
-Mon Oct 24 07:57:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Nov 19 16:17:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/canvas.rb (TkCanvasItemConfig::__item_val2ruby_optkeys):
- typo fixed. [ruby-talk:162187]
+ * configure.in (LIBS): libelf is need on only FreeBSD.
- * ext/tk/lib/tk/menu.rb (TkMenuEntryConfig::__item_val2ruby_optkeys):
- ditto. [ruby-core:06359]
+Mon Nov 19 16:08:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Oct 23 21:50:15 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * common.mk (RUBYLIB): purelib option in runruby.rb is deprecated
+ since r28841, so set to an empty list to get rid of a bogus path in
+ child processes, which caused an insecure operation exception in
+ test/ruby/test_encoding.rb:test_unsafe.
- * ext/enumerator/enumerator.c: applied documentation patch from
- James Edward Gray II <james@grayproductions.net>.
- [ruby-core:06348]
+Mon Nov 19 15:40:50 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Sun Oct 23 07:11:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * .travis.yml (script): add OPTS=-v, requested by @_ko1.
- * ext/tcltklib/extconf.rb: improve messages [ruby-core:06325].
+Mon Nov 19 15:09:07 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/lib/tk.rb, ext/tk/lib/tk/canvas.rb, ext/tk/lib/tk/entry.rb,
- ext/tk/lib/tk/frame.rb, ext/tk/lib/tk/image.rb,
- ext/tk/lib/tk/itemconfig.rb, ext/tk/lib/tk/labelframe.rb,
- ext/tk/lib/tk/listbox.rb, ext/tk/lib/tk/menu.rb,
- ext/tk/lib/tk/radiobutton.rb, ext/tk/lib/tk/scale.rb,
- ext/tk/lib/tk/spinbox.rb, ext/tk/lib/tk/text.rb,
- ext/tk/lib/tk/toplevel.rb: improve conversion of option values.
+ * configure.in: fix didn't enable_dtrace=yes on auto.
- * ext/tk/lib/tkextlib/*: ditto.
+ * configure.in: see enable_dtrace for adding libelf on FreeBSD.
- * ext/tk/lib/tkextlib/*: update to support ActiveTcl8.4.11.2.
+ * common.mk: VPATH is not needed.
- * ext/tk/lib/tkextlib/trofs/*: support Trofs 0.4.3.
+Mon Nov 19 14:55:51 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tkextlib/tile/*: support Tile 0.7.2.
+ * thread.c: add `Thread#backtrace_locations' method.
+ This method is similar to `caller_locations' method for
+ specific method.
+ And fix to accept `level' and `n' parameters for `Thread#backtrace'
+ and `Thread#backtrace_locations'.
+ `caller' (and `caller_locations') do not return `caller' method
+ frame.
+ However, `Thread#backtrace' (and `Thread#backtrace_locations')
+ return `Thread#backtrace' method frame itself
+ if `Thread.current.backtrace' was called.
- * ext/tk/lib/tkextlib/vu/*: support vu 2.3.0.
+ * vm_backtrace.c: ditto.
- * ext/tk/lib/tkextlib/tcllib/*: support Tcllib 1.8 (Tklib 0.3).
+ * internal.h: ditto.
-Sat Oct 22 23:54:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_backtrace.rb: add tests.
- * ext/extmk.rb, lib/mkmf.rb (with_config): support --with-extension
- options. [ruby-dev:27449]
+Mon Nov 19 14:54:32 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Oct 22 13:26:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * Makefile.in, common.mk (probes.h): moved to common.mk and changed to
+ see $(srcdir).
- * object.c (sym_inspect), parse.y (parser_yylex, rb_symname_p): check
- if valid as a symbol name more strictly. [ruby-dev:27478]
+ * common.mk (probes.dmyh): now created it on $(srcdir) always.
- * test/ruby/test_symbol.rb: tests for [ruby-core:03573].
+ * win32/Makefile.sub (.SUFFIXES): removed common suffix.
- * time.c (rb_strftime): removed meaningless volatile modifiers, and
- concatenate successive nul characters at once. [ruby-dev:27472]
+Mon Nov 19 10:00:10 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Oct 21 19:21:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * Makefile.in (.SUFFIX): bsdmake needs .SUFFIX is defined before use.
- * rubysig.h (CHECK_INTS): fixed typo. (I believe bit-or is improper)
+ * common.mk: fix path of probes.dmyh.
-Fri Oct 21 17:49:32 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * common.mk (vm_dump.o): depend probes.h.
- * bin/erb (ERB::Main::run): typo fixed. [ruby-core:06337]
+ * configure.in: FreeBSD's USDT requires libelf.
-Fri Oct 21 15:27:17 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Nov 19 01:11:59 2012 Naohisa Goto <ngotogenome@gmail.com>
- * bignum.c (bignew_1): convertion from `int' to `char' discards
- upper bits, (ie. (char)0xff00 -> 0) so it's better to test if
- nonzero and set 0 or 1 instead of simply casting ... as a flag usage.
- (but I believe this won't cause actual bug in current implementation)
- [ruby-dev:27055]
+ * vm_core.h, probes_helper.h (RUBY_DTRACE_FUNC_ENTRY_HOOK,
+ RUBY_DTRACE_FUNC_RETURN_HOOK): move from vm_core.h to new file
+ probes_helper.h for narrowing dependency to probes.h.
+ * common.mk (VM_CORE_H_INCLUDES): remove dependency to probes.h.
+ * common.mk (vm.$(OBJEXT)): add dependency to probes_helper.h.
+ * vm.c, vm_insnhelper.c: include probes_helper.h.
- * time.c: should use LONG_LONG instead of `long long'.
+Sun Nov 18 16:33:00 2012 Naohisa Goto <ngotogenome@gmail.com>
-Thu Oct 20 09:37:15 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * configure.in, Makefile.in, common.mk: support DTrace on Solaris 10,
+ based on r26235 by Yugui. On Solaris 10, low optimization level
+ may also be needed, e.g. optflags="-xO1" or "-xO0" with Oracle
+ SolarisStudio 12.3 cc.
- * lib/mkmf.rb (create_makefile): Borland make seems not to allow
- empty dependency list. If this change is not good, please correct
- it.
+ * configure.in (--enable-dtrace): new option to enable/disable
+ DTrace support. By default, trying to enable if dtrace command
+ is found on the system. It is disabled when cross compiling.
-Thu Oct 20 07:55:09 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (RUBY_DTRACE_POSTPROCESS): new macro. checks whether
+ the dtrace on the system needs postprocessing with "dtrace -G".
+ The postprocessing is needed on Solaris 10 and other platforms.
- * lib/mkmf.rb (create_makefile): get rid of a restriction
- of Borland make. fixed: [ruby-dev:27460]
+ * configure.in (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether
+ the dtrace supports USDT.
-Thu Oct 20 00:13:18 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * configure.in (DTRACE): move after RUBY_DTRACE_POSTPROCESS.
- * rubysig.h (CHECK_INTS): fix typo.
+ * configure.in (LD): On Solaris, /usr/ccs/bin/ld is preferred.
-Wed Oct 19 23:58:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in, Makefile.in, common.mk (DTRACE_OBJ): new macro for
+ DTrace probe object generated by postprocessing with "dtrace -G".
- * lib/mkmf.rb (create_makefile): do not create unnecessary empty
- directories. fixed: [ruby-dev:27451]
+ * Makefile.in, common.mk (probes.$(OBJEXT)): DTrace probe object
+ generated by the postprocessing. New file probes.stamp is for
+ rebuilding related objects that may be modified by "dtrace -G".
-Wed Oct 19 19:26:15 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in, Makefile.in, common.mk (DTRACE_GLOMMED_OBJ): new
+ macro for DTrace static library hacks.
- * parse.y (rb_gc_mark_parser): get rid of segfault with old yacc.
- fixed: [ruby-dev:27439]
+ * configure.in, Makefile.in (LIBRUBY_A_OBJS): ditto.
-Wed Oct 19 08:28:32 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * Makefile.in, common.mk (ruby-glommed.$(OBJEXT)): new target with
+ rule for DTrace static library hacks.
- * file.c (rb_file_join): elements may contain null pointer strings.
- report and fixed by Lloyd Zusman (hippoman): [ruby-core:06326]
+ * common.mk (DTRACE_DEPENDENT_OBJS): objects depended on probes.h.
-Wed Oct 19 02:34:33 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 18 09:31:47 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * eval.c, gc.c, time.c: made internal symbols static. [ruby-dev:27435]
+ * complex.c (read_comp): mathn compliant.
+ * rational.c (read_num): ditto.
-Wed Oct 19 01:27:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 18 02:50:12 2012 Luis Lavena <luislavena@gmail.com>
- * regex.c (re_compile_pattern): numeric literal inside character class
- disabled succeeding backtrack. fixed: [ruby-list:41328]
+ * win32/file.c (replace_to_long_name): correct logic around wildcard
+ characters detection and ensure wide-chars are used as pattern.
+ [ruby-core:49451] [Bug #7374]
-Mon Oct 17 21:18:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 18 02:02:46 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * parse.y (parser_heap): byacc never free parser stack.
- fixed: [ruby-dev:27428]
+ * complex.c (read_comp): modified handling of polar form.
-Mon Oct 17 16:04:47 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Nov 18 00:50:44 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * file.c (chmod_internal, lchmod_internal): fixed type of 2nd argument.
+ * complex.c (read_comp): fixed handling of polar form.
-Sun Oct 16 22:16:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 18 00:14:46 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/extmk.rb: omit non-existing directories.
+ * complex.c (string_to_c_strict, string_to_c): rewrote without regexp.
+ * rational.c (string_to_r_strict, string_to_r): ditto.
-Sun Oct 16 14:30:05 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat Nov 17 23:53:05 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/rinda/rinda.rb (Rinda::Tuple#initialize): check remote hash
- tuple. fixed: [ruby-list:41227]
+ * complex.c (make_patterns): should not accept extra sign.
- * test/rinda/test_rinda.rb: test it.
+Sat Nov 17 21:45:12 Luis Lavena <luislavena@gmail.com>
-Sun Oct 16 03:38:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * win32/file.c (replace_to_long_name): skip expansion for all wildcard
+ characters.
+ [ruby-core:49451] [Bug #7374]
- * rubysig.h (CHECK_INTS): prevent signal handler to run during
- critical section. [ruby-core:04039]
+ * test/ruby/test_file_exhaustive.rb: add more assertions to test.
- * eval.c (load_wait): need not to call rb_thread_schedule()
- explicitly. [ruby-core:04039]
+Sat Nov 17 12:14:50 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * eval.c (rb_thread_schedule): clear rb_thread_critical.
- [ruby-core:04039]
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: use literal YAML style
+ when emitting multi-line strings. Thanks @atambo
-Sat Oct 15 19:56:38 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * test/psych/test_yaml.rb: test for change.
- * bin/erb: typo fixed, again. thanks, Doug Kearns.
+Sat Nov 17 12:03:41 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Oct 14 22:08:26 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/psych/lib/psych/scalar_scanner.rb: avoid raising exceptions when
+ parsing Floats and Integers. Thanks riffraff [ruby-core:44426]
+ * test/psych/test_numeric.rb: associated test
- * win32/win32.c (ioctl): should set errno.
+Sat Nov 17 11:34:31 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Fri Oct 14 16:57:32 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * st.c (st_update): pass the key in st_table so that we can free
+ memory of the key in st_table when deleting.
+ [ruby-core:49220] [Bug #7330]
- * lib/webrick/config.rb (Config::FileHandler): :UserDir should be nil.
- It is harmful to permit the access to ~/public_html by default.
- suggested by Hiroyuki Iwatsuki.
+ * test/-ext-/st/test_update.rb
+ (Bug::StTable#test_pass_objects_in_st_table): add a test.
-Thu Oct 13 23:29:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 17 11:26:36 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * parse.y (HEAPCNT): bison allocates indivisible size.
- fixed: [ruby-core:06261]
+ * ext/psych/lib/psych/core_ext.rb: move Kernel#y so that it can
+ manually be required as 'psych/y'.
- * io.c, pack.c, ext/syck/rubyext.c, ext/syck/syck.h, missing/isinf.c:
- get rid of warnings. fixed: [ruby-core:06247]
+ * ext/psych/lib/psych/y.rb: ditto
-Wed Oct 12 12:52:57 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Nov 17 08:13:48 2012 Benoit Daloze <eregontp@gmail.com>
- * ext/openssl/ossl.c (Init_openssl): should call
- OpenSSL_add_ssl_algorithms().
+ * lib/abbrev.rb: fix r37113. Correct examples, fix style
+ and show explicit dependency (require 'abbrev').
-Wed Oct 12 11:08:54 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+Sat Nov 17 07:35:15 2012 Luis Lavena <luislavena@gmail.com>
- * file.c (rb_f_test): typo in RDoc comments.
+ * win32/file.c (replace_to_long_name): skip automatic path expansion
+ when wildcard character is used. [ruby-core:49451] [Bug #7374]
-Tue Oct 11 21:41:58 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_file_exhaustive.rb: add a test for above.
- * eval.c (rb_obj_respond_to): check if obj responds to the given
- method with the given visibility. [ruby-dev:27408]
+Sat Nov 17 00:50:23 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * eval.c (rb_respond_to): conform to Object#respond_to?. [ruby-dev:27411]
+ * marshal.c (w_object): add flonum to arg->data to keep reference index
+ consistency. [ruby-core:49323] [Bug #7348]
-Tue Oct 11 00:01:21 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_marshal.rb: add a test for above.
- * st.c (st_free_table): do not call free() but xfree().
- [ruby-core:06205]
+Sat Nov 17 00:40:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Oct 8 20:04:40 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk (incs): dist files need probes.dmyh.
- * eval.c (Init_Binding): add Binding#dup method. [yarv-dev:666]
+ * common.mk (probes.dmyh): depends on generator script.
- * parse.y (rb_parser_malloc, rb_parser_free): manage parser stack on
- heap. [ruby-list:41199]
+ * Makefile.in, common.mk, configure.in, win32/Makefile.sub (probes.h):
+ select generating with dtrace or copying dummy file by suffix rules.
- * ext/iconv/charset_alias.rb: parse config.charset_alias file directly.
+Fri Nov 16 19:24:10 2012 Koichi Sasada <ko1@atdot.net>
-Fri Oct 7 09:54:00 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread.c (rb_thread_call_without_gvl2): change the parameter of
+ `func' from `int *skip_interrupt' to `VALUE *flags'.
+ If (flags & RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS) is not zero,
+ then skip checking interrupt.
+ [ruby-core:46547]
- * lib/cgi.rb (CGI::Cookie::parse): Cookies from Nokia devices may
- not be parsed correctly. A patch from August Z. Flatby
- (augustzf) in [ruby-Patches-2595]. [ruby-core:06183]
+ * include/ruby/thread.h: ditto.
-Thu Oct 6 20:12:16 2005 Minero Aoki <aamine@loveruby.net>
+Fri Nov 16 18:59:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/strscan/strscan.c (strscan_free): remove useless code.
- [ruby-dev:26368] [ruby-dev:27389]
- (backported from trunk, rev 1.22)
+ * Makefile.in (no-dtrace-probes.h): dmyprobes.h is in srcdir.
-Wed Oct 5 04:42:38 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * common.mk (dmyprobes.h): ditto.
- * lib/xmlrpc/server.rb (XMLRPC::Server#initialize): should mount the
- servlet on "/".
+Fri Nov 16 17:57:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Oct 5 03:59:09 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * Makefile.in (probes.h): split build commands for dtrace-available
+ and unavailable platforms.
- * lib/xmlrpc/server.rb (XMLRPC::Server#serve): delete wrong call
- of "join".
+ * Makefile.in (incs): probes.h is a platform dependent file, so it
+ cannot be a part of prereq target. move it to all-incs.
-Mon Oct 3 00:04:00 2005 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * configure.in (DTRACE): move after AC_PROG_CC since cross_compiling
+ is set in it.
- * pack.c (EXTEND16): [ruby-dev:27383]
+ * configure.in (DTRACE): ignore non-prefixed version if
+ cross-compiling.
-Thu Sep 29 10:26:18 2005 Tanaka Akira <akr@m17n.org>
+ * Makefile.in, win32/Makefile.sub (probes.h): fix copying dmyprobes.h
+ path when outplace-build.
- * ext/dl/dl.c (rb_io_to_ptr): abolish sizeof(FILE).
- [ruby-dev:27317]
+Fri Nov 16 15:27:36 2012 Masaki Matsushita <glass.saga@gmail.com>
-Thu Sep 29 07:22:05 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/pop.rb (POP3.certs): fix typo in comment.
+ patch from no6v (Nobuhiro IMAI) <nov@yo.rim.or.jp>.
+ [ruby-dev:46519] [Bug #7355]
- * evalc. (rb_f_send): underscores need to be escaped.
- fixed by Doug Kearns. [ruby-core:06053]
+Fri Nov 16 12:36:47 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Sep 29 00:57:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/rake/helper.rb (Rake::TestCase#setup): revert r37669.
+ @orig_PWD should be the original pwd.
- * eval.c (ev_const_get), variable.c (rb_const_get_0): retry only when
- autoload succeeded.
+ * test/rake/test_*.rb: don't use @orig_PWD to load libraries.
+ It should be specified with relative path from the file.
- * variable.c (rb_autoload_load): now return true if autoload
- succeeded. fixed: [ruby-dev:27331]
+Fri Nov 16 10:22:52 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Sep 28 23:42:15 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/rake/helper.rb (Rake::TestCase#setup): @orig_PWD shouldn't be
+ Dir.pwd when the build directory is different from source directory.
- * file.c (apply2files): add prototype.
+Fri Nov 16 09:41:08 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * file.c (rb_stat_inspect): constified.
+ * lib/rake/version.rb: workaround fix to build. see #7366
+ [ruby-dev:46522]
- * class.c (rb_mod_init_copy, rb_class_init_copy), file.c (rb_stat_init_copy),
- numeric.c (num_init_copy), object.c (rb_obj_init_copy, Init_Object),
- re.c (match_init_copy, rb_reg_init_copy), time.c (time_init_copy):
- undocumented.
+Fri Nov 16 07:23:18 2012 Eric Hodel <drbrain@segment7.net>
-Wed Sep 28 23:09:23 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rake*: Updated to rake 0.9.4
+ http://rake.rubyforge.org/doc/release_notes/rake-0_9_4_rdoc.html for
+ a list of changes in 0.9.4.
- * lib/delegate.rb: document update from James Edward Gray II
- <james@grayproductions.net>. [ruby-core:06027]
+ * test/rake*: ditto
-Wed Sep 28 15:14:19 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * NEWS: ditto
- * lib/webrick/cgi.rb (WEBrick::CGI#start): req.query_string should
- refer the value of QUERY_STRING. [ruby-list:41186]
+Fri Nov 16 06:58:52 2012 Eric Hodel <drbrain@segment7.net>
- * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#query_string=):
- add new method.
+ * lib/rake*: Updated to rake 0.9.3. See
+ http://rake.rubyforge.org/doc/release_notes/rake-0_9_3_rdoc.html for
+ a list of changes in 0.9.3.
-Wed Sep 28 10:45:44 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/rake*: ditto
- * ext/tcltklib/tcltklib.c: cannot compile with Tcl/Tk8.0.x
- [ruby-dev:27335].
+ * bin/rake: ditto
-Wed Sep 28 08:12:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * NEWS: ditto
- * io.c (read_buffered_data): check if reached EOF. fixed: [ruby-dev:27334]
+Thu Nov 15 22:39:32 2012 Yusuke Endoh <mame@tsg.ne.jp>
-Wed Sep 28 07:56:52 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * range.c (range_bsearch): fix some bugs: a documentation bug, a wrong
+ condition, missed break in switch/case, and workaround for GCC
+ optimization. See [ruby-core:49364] in detail. A great patch from
+ Heesob Park. [Bug #7352] [Feature #4766]
- * lib/yaml/basenode.rb (YAML::BaseNode::match_segment): fix typo.
- [ruby-dev:27237], [ruby-core:05854]
+ * array.c (rb_ary_bsearch): fix similar bug (missed break).
- * lib/yaml/tag.rb (Module#yaml_as): suppress warnings.
+ * test/ruby/test_range.rb: add two test cases for above.
- * lib/yaml/types.rb (YAML::PrivateType, YAML::DomainType): ditto.
+Thu Nov 15 22:41:57 2012 Koichi Sasada <ko1@atdot.net>
-Wed Sep 28 03:23:35 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_exec.h (GENTRY): GENTRY should be pointer size.
+ A patch by yoshidam (Yoshida Masato) [Bug #7332].
- * rubysig.h: fixed build problem with --enable-pthread on platforms
- which don't have setitimer().
+Thu Nov 15 13:20:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Mon Sep 26 22:32:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * man/erb.1: Fix grammar and copyright dates
+ * man/goruby.1: ditto
+ * man/irb.1: ditto
+ * man/rake.1: ditto
+ * man/ri.1: ditto
+ * man/ruby.1: ditto
+ Patch by Arthur Gunn
+ [Fixes Github #210]
- * eval.c (set_trace_func): add rb_secure(4) to prevent adding
- tracing function.
+Thu Nov 15 11:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Sun Sep 25 12:05:10 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * man/ruby.1: Grammar edits for man page
+ Based on a patch by Michael Endsley [Fixes Github #183]
- * bin/erb: typo fixed.
+Thu Nov 15 00:47:20 2012 Yusuke Endoh <mame@tsg.ne.jp>
-Sun Sep 25 01:46:43 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * array.c (rb_ary_bsearch): add Array#bsearch for binary search.
+ [ruby-core:36390] [Feature #4766]
- * misc/ruby-mode.el (ruby-calculate-indent): arrange deep-indent
- closing parenthesis at same column as the opening.
+ * test/ruby/test_array.rb: add a test for above.
-Sun Sep 25 00:42:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * range.c (range_bsearch): add Range#bsearch for binary search.
+ [ruby-core:36390] [Feature #4766]
- * misc/ruby-mode.el (ruby-expr-beg): deal with heredoc separately.
- fixed: [ruby-list:41168]
+ * test/ruby/test_range.rb: add a test for above
- * misc/ruby-mode.el (ruby-calculate-indent): not to deepen indent
- level for continuous line inside parentheses.
- http://nabeken.tdiary.net/20050915.html#p02
+ * NEWS: added the two new methods.
-Sun Sep 25 00:18:11 2005 Tanaka Akira <akr@m17n.org>
+Wed Nov 14 13:25:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * eval.c (unknown_node): show more information. [ruby-dev:26196]
+ * lib/fileutils.rb (chmod): Add "X" to modes, convert format to table
+ [ruby-core:48965] [Bug #7288]
-Sat Sep 24 08:56:01 2005 Minero Aoki <aamine@loveruby.net>
+Wed Nov 14 11:51:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * lib/fileutils.rb (cd): no longer accept :noop option, related
- code is useless (backported from trunk, rev 1.67).
- [ruby-core:05858] [ruby-Bugs:2494]
+ * lib/csv.rb (init_comments): Document private method #init_comments.
+ Based on a patch from Vincent Batts [ruby-core:49172] [Bug #7319]
-Sat Sep 24 08:38:07 2005 Minero Aoki <aamine@loveruby.net>
+Wed Nov 14 00:54:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * lib/fileutils.rb: fix visibility of FileUtils::NoWrite, Verbose,
- DryRun (backported from trunk, rev 1.66). [ruby-core:05954]
+ * Makefile.in (probes.h): create from probes.d
- * test/fileutils/test_nowrite.rb: test it.
+Tue Nov 13 18:44:01 2012 Koichi Sasada <ko1@atdot.net>
- * test/fileutils/test_dryrun.rb: new file.
+ * vm_insnhelper.c (vm_call_cfunc_with_frame): don't use ci after
+ EXEC_EVENT_HOOK because ci can be overridden.
- * test/fileutils/test_verbose.rb: new file.
+ * vm_eval.c: ditto.
-Sat Sep 24 02:40:20 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * method.h: change invoker's parameters types.
- * lib/delegate.rb: document update from James Edward Gray II
- <james@grayproductions.net>. [ruby-core:05942]
+ * vm_method.c (call_cfunc_invoker_func): ditto.
-Thu Sep 22 23:36:24 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 13 18:01:54 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/mkmf.rb (find_executable0): default path if environment is not
- set. [ruby-dev:27281]
+ * eval.c (rb_mod_using): raise an ArgumentError if cyclic using is
+ detected. based on the patch by Charlie Somerville.
+ [ruby-core:49092] Bug #7308
-Thu Sep 22 16:33:12 2005 Shugo Maeda <shugo@ruby-lang.org>
+ * test/ruby/test_refinement.rb: related test.
- * test/readline/test_readline.rb (TestReadline::replace_stdio):
- merged the patch of [ruby-dev:25232] instead of [ruby-dev:25223].
+Tue Nov 13 17:40:04 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Sep 21 23:30:44 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk (vm_insnhelper.c): this target is useless and causes
+ ruby always need rebuild.
- * lib/mkmf.rb (configuration): generalized nmake dependent code.
+Tue Nov 13 17:35:49 2012 Koichi Sasada <ko1@atdot.net>
-Wed Sep 21 09:07:55 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * compile.c (insn_data_to_s_detail): remove debug lines.
- * stable version 1.8.3 released.
+Tue Nov 13 17:28:47 2012 Koichi Sasada <ko1@atdot.net>
-Wed Sep 21 08:52:25 2005 why the lucky stiff <why@ruby-lang.org>
+ * vm_insnhelper.c (vm_caller_setup_args): save and restore
+ ci->argc and ci->blockptr before and after method invocations
+ because these method dispatches can override call_info.
- * ext/syck/token.c: correctly compute identation of a block
- scalar's parent node. [ruby-talk:150620]
+ * bootstraptest/test_method.rb: add tests for this fix.
-Wed Sep 21 08:20:24 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 13 16:38:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * README.EXT, README.EXT.ja: add new features.
+ * common.mk (dmyprobes.h): always create for make dist.
-Wed Sep 21 07:43:58 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * Makefile.in (probes.h): create or copy dmyprobes.h
- * lib/optparse.rb (default_argv, Arguable#options): defaults strings
- to be parsed to Arguable instance.
+ * win32/Makefile.sub: only do copy dmyprobes.h.
-Wed Sep 21 02:44:09 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 13 15:37:21 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * file.c (path_check_0): disallow sticky world writable directory
- in PATH (and $LOAD_PATH). [ruby-dev:27226]
+ * Makefile.in (.SUFFIX): .SUFFIX is needed here for .d.h on bsd make.
- * file.c (fpath_check): typo fixed.
+Tue Nov 13 15:34:35 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Sep 20 22:29:49 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * common.mk Makefile.in win32/Makefile.sub (.d.h): it's not common.
- * test/wsdl/simpletype/rpc/test_rpc.rb, test/wsdl/ref/test_ref.rb,
- test/wsdl/any/test_any.rb test/soap/wsdlDriver/test_calc.rb:
- suppress deliberate warnings with $VERBOSE = nil.
+Tue Nov 13 12:27:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Sep 20 21:26:23 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: disable dtrace because it doesn't work on FreeBSD.
- * ext/io/wait/lib/nonblock.rb: disable on platforms non-blocking flag
- is not available. fixed: [ruby-dev:27187]
+ * common.mk (clean-local): rm probes.h.
-Tue Sep 20 18:23:04 2005 Tanaka Akira <akr@m17n.org>
+ * common.mk (parse.o): depend $(PROBES_H_INCLUDES).
- * eval.c (thread_mark): mark th->last_status. [ruby-dev:27179]
+ * common.mk (.d.h): moved from Makefile.in and use BASERUBY.
-Tue Sep 20 18:20:33 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * tool/gen_dummy_probes.rb: reimplemented with ruby because sed is not
+ available on Windows Microsoft VC++ environment.
- * lib/yaml.rb: require 'yaml/constants'. [ruby-core:5776]
+Tue Nov 13 12:30:26 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Sep 20 17:48:34 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * win32/README.win32: added mention about build directory. currently
+ we can not build ruby in win32 directory. this problem is reported
+ by Masahiro Kitajima <katonbo@katontech.com>.
- * lib/xmlrpc/client.rb (XMLRPC::Client::do_rpc): add charset
- information to content-type header.[ruby-core:5127]
+Tue Nov 13 11:03:47 2012 Masaki Matsushita <glass.saga@gmail.com>
- * lib/xmlrpc/server.rb (CGIServer::serve): ditto.
+ * re.c (rb_memsearch_ss): performance improvement by using memmem(3) if
+ possible. [ruby-dev:45530] [Feature #6311]
- * lib/xmlrpc/server.rb (ModRubyServer::serve): ditto.
+ * configure.in: check existence of memmem(3) and that it is not broken.
- * lib/xmlrpc/server.rb (WEBrickServlet::service): ditto.
+Tue Nov 13 06:50:02 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Tue Sep 20 17:34:46 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * probes.d: add DTrace probe declarations. [ruby-core:27448]
- * test/webrick/test_cgi.rb: set ENV["PATH"] to CGIEnvPath on
- windows. bcc32's runtime is not installed into system directory,
- so it cannot be found without this setting. [ruby-dev:27166]
+ * array.c (empty_ary_alloc, ary_new): added array create DTrace probe.
-Tue Sep 20 17:10:38 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * compile.c (rb_insns_name): allowing DTrace probes to access
+ instruction sequence name.
- * test/dbm/test_dbm.rb (TestDBM::test_s_open_error): remove
- test_s_open_error test to detect duplicate open.
- [ruby-dev:27202]
+ * Makefile.in: translate probes.d file to appropriate header file.
-Tue Sep 20 17:08:31 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * common.mk: declare dependencies on the DTrace header.
- * io.c: PIPE_BUF is not defined on BeOS. use _POSIX_PIPE_BUF instead.
- [ruby-dev:27185]
+ * configure.in: add a test for existence of DTrace.
-Tue Sep 20 16:53:53 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * eval.c (setup_exception): add a probe for when an exception is
+ raised.
- * test/readline/test_readline.rb (TestReadline::replace_stdio):
- BSD seek support from [ruby-dev:25223]. fixed: [ruby-dev:27150]
+ * gc.c: Add DTrace probes for mark begin and end, and sweep begin and
+ end.
-Tue Sep 20 15:39:40 2005 why the lucky stiff <why@ruby-lang.org>
+ * hash.c (empty_hash_alloc): Add a probe for hash allocation.
- * ext/syck/emitter.c (syck_scan_scalar): prevent indicators from
- appearing alone or at the end of plain scalars. [ruby-core:5826]
+ * insns.def: Add probes for function entry and return.
- * ext/syck/emitter.c (syck_emit_scalar): treat typed scalar nodes
- as complex keys.
+ * internal.h: function declaration for compile.c change.
- * lib/syck.h: version 0.60.
+ * load.c (rb_f_load): add probes for `load` entry and exit, require
+ entry and exit, and wrapping search_required for load path search.
- * lib/yaml/basenode.rb (YAML::BaseNode#at): transform keys during
- key searches.
+ * object.c (rb_obj_alloc): added a probe for general object creation.
- * ext/syck/rubyext.c: loading of binary-typed nodes. prevent
- emission of plain strings that look like symbols, but which aren't.
+ * parse.y (yycompile0): added a probe around parse and compile phase.
-Tue Sep 20 05:50:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * string.c (empty_str_alloc, str_new): DTrace probes for string
+ allocation.
- * test/xmlrpc/test_webrick_server.rb (setup_http_server):
- should not include 'webrick/https' unless 'use_ssl' because
- it fails where openssl is not installed.
+ * test/dtrace/*: tests for DTrace probes.
-Tue Sep 20 00:34:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm.c (vm_invoke_proc): add probes for function return on exception
+ raise, hash create, and instruction sequence execution.
- * io.c (io_close): call rb_io_close() directly if io is a T_FILE
- object. [ruby-dev:27156]
+ * vm_core.h: add probe declarations for function entry and exit.
-Mon Sep 19 19:09:08 2005 Minero Aoki <aamine@loveruby.net>
+ * vm_dump.c: add probes header file.
- * file.c (rb_file_chown): should accept nil. [ruby-dev:27171]
- (backport from trunk, rev 1.208)
+ * vm_eval.c (vm_call0_cfunc, vm_call0_cfunc_with_frame): add probe on
+ function entry and return.
-Mon Sep 19 18:35:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_exec.c: expose instruction number to instruction name function.
- * ext/dl/dl.c (rb_io_to_ptr): fix DragonFlyBSD support.
- [ruby-dev:27151]
+ * vm_insnhelper.c: add function entry and exit probes for cfunc
+ methods.
-Mon Sep 19 14:17:04 2005 Minero Aoki <aamine@loveruby.net>
+ * vm_insnhelper.h: vm usage information is always collected, so
+ uncomment the functions.
- * ext/syck/emitter.c (syck_emit): passing an int* value to the
- long* parameter causes unaligned access on LP64 systems.
- [ruby-dev:27161]
+Mon Nov 12 19:14:50 2012 Akinori MUSHA <knu@iDaemons.org>
-Mon Sep 19 13:44:03 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * configure.in (isinf, isnan): isinf() and isnan() are macros on
+ DragonFly which cannot be found by AC_REPLACE_FUNCS(). This
+ workaround enforces the fact that they exist on DragonFly.
- * ext/win32ole/win32ole.c: avoid core dump with WIN32OLE_EVENT.
- [ruby-dev:27133]
+Mon Nov 12 15:59:38 2012 Shugo Maeda <shugo@ruby-lang.org>
-Mon Sep 19 10:36:06 2005 Minero Aoki <aamine@loveruby.net>
+ * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo),
+ vm_insnhelper.c (vm_search_method): revert r37616 because it's too
+ slow. [ruby-dev:46477]
- * lib/fileutils.rb (cp_r): default is :dereference_root=>true for
- backward compatibility. [ruby-dev:27145]
+ * test/ruby/test_refinement.rb (test_inline_method_cache): skip
+ the test until the bug is fixed efficiently.
- * test/fileutils/test_fileutils.rb (test_cp_r): test it.
+Mon Nov 12 14:28:01 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Sep 19 09:57:39 2005 Minero Aoki <aamine@loveruby.net>
+ * win32/mkexports.rb (each_export): skip garbage generated by VS2012's
+ nmake.
+ reported and patched by Yoshida Masato at [Bug #7333] [ruby-dev:46484]
- * test/fileutils/test_fileutils.rb: backported from trunk (1.36).
- (again) [ruby-dev:27145]
+Sun Nov 11 18:58:55 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Mon Sep 19 07:45:37 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/date/test_date_{parse,strptime}.rb: changed the format of
+ some extra messages.
- * ext/openssl/ossl_pkey.h, ossl_pkey_rsa.c, ossl_pkey_dsa.c:
- an instance variable "private" is added to OpenSSL::PKey class.
- this ivar is a flag that shows whether there is a private key
- in the instance.
+Sun Nov 11 18:41:34 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/openssl/ossl_engine.c: (ossl_engine_load_privkey): set private
- key flag.
+ * ext/date/date_parse.c (date__parse): revised the tight parser
+ (about handling of apostrophes).
-Mon Sep 19 06:41:32 2005 Minero Aoki <aamine@loveruby.net>
+Sun Nov 11 15:39:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/fileutils.rb: backported from trunk (rev 1.65):
+ * hash.c (rb_hash_s_create): just warn for wrong elements now.
+ [ruby-dev:46440] [Bug #7300]
- * lib/fileutils.rb (rm_r): new option :secure.
+ * hash.c (rb_hash_s_create): refine error messages.
- * lib/fileutils.rb (rm_rf): new option :secure.
+ * error.c (rb_builtin_class_name): share for above.
- * lib/fileutils.rb: new method #remove_entry_secure.
+Sun Nov 11 15:12:18 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/fileutils.rb (cd): remove option :noop.
+ * eval.c (top_using): remove Kernel#using, and add main.using instead.
- * lib/fileutils.rb (cp_r): new option :dereference_root.
+ * test/ruby/test_refinement.rb: related test.
- * lib/fileutils.rb (cp_r): new option :dereference_root.
+Sun Nov 11 13:41:01 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/fileutils.rb: new method #remove_entry.
+ * eval.c (rb_using_refinement, rb_mod_using, f_using): clear method
+ cache only when using is called explicitly.
- * lib/fileutils.rb: new method #chmod_R.
+ * test/ruby/test_refinement.rb: related test.
- * lib/fileutils.rb: new method #chown.
+Sun Nov 11 12:56:34 2012 Masaki Matsushita <glass.saga@gmail.com>
- * lib/fileutils.rb: new method #chown_R.
+ * lib/pstore.rb (PStore): fix not to replace ThreadError raised in
+ #transaction block with PStore::Error.
+ [ruby-core:39238] [Bug #5269]
- * lib/fileutils.rb: new method .commands.
+Sun Nov 11 11:36:19 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/fileutils.rb: new method .options.
+ * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo):
+ add a new field for inline method cache.
- * lib/fileutils.rb: new method .have_option?.
+ * vm_insnhelper.c (vm_search_method): check rb_call_info_t::refinements
+ not to confuse inline method cache when module_eval is used with
+ refinements.
- * lib/fileutils.rb: new method .options_of.
+ * test/ruby/test_refinement.rb: related test.
- * lib/fileutils.rb: new method .collect_method.
+Sun Nov 11 08:45:45 2012 Martin Duerst <duerst@it.aoyama.ac.jp>
- * lib/fileutils.rb: use module_function instead of single extend.
+ * ruby.c: removed a comma before "before"
- * test/fileutils/test_fileutils.rb: backported from trunk (1.36).
+Sat Nov 10 23:02:31 2012 Narihiro Nakamura <authornari@gmail.com>
-Mon Sep 19 03:17:48 2005 Tanaka Akira <akr@m17n.org>
+ * gc.c: move immutable fields from struct heaps_slot and struct
+ sorted_heaps_slot into struct heaps_header.
+ Based on a patch from Sokolov Yura [Feature #6199][ruby-core:43592]
- * file.c (rb_thread_flock): wrap the flock system call by
- TRAP_BEG/TRAP_END to enable signals. [ruby-dev:27122]
+Sat Nov 10 19:28:16 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/socket/socket.c (bsock_send): wrap the sendto and send system
- call by TRAP_BEG/TRAP_END to enable signals when writing to a socket
- which is full. [ruby-dev:27132]
+ * complex.c: modified doc.
+ * rational.c: ditto.
- * io.c (rb_io_syswrite): wrap the write system call by
- TRAP_BEG/TRAP_END to enable signals when writing to a pipe which is
- full. [ruby-dev:27134]
+Sat Nov 10 18:20:10 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Mon Sep 19 03:02:08 2005 Tanaka Akira <akr@m17n.org>
+ * ext/date/date_parse.c: edited about era.
- * io.c (io_fwrite): wrap the write system call by TRAP_BEG/TRAP_END to
- enable signals when writing to a pipe which is full.
+Sat Nov 10 12:13:41 2012 Kouhei Sutou <kou@cozmixng.org>
-Sun Sep 18 02:10:47 2005 why the lucky stiff <why@ruby-lang.org>
+ * tool/rbinstall.rb: Don't install *.gemspec under lib/.
+ [ruby-core:48966] [Bug #7289]
+ Reported by Vit Ondruch. Thanks!!!
- * lib/yaml/rubytypes.rb: remove comments that are bungling up
- the rdoc and ri output. output symbols as plain scalars.
+Sat Nov 10 00:49:26 2012 Naohisa Goto <ngotogenome@gmail.com>
- * ext/syck/rubyext.c (syck_emitter_reset): emit headless
- documents always.
+ * ruby_atomic.h: renamed from atomic.h to avoid header file name
+ conflict on Solaris 10. [ruby-dev:46414] [Bug #7287]
- * ext/syck/emitter.c (syck_scan_scalar): quote scalars with any
- kind of surrounding line space, tabs or spaces alike.
+ * gc.c, signal.c, vm_core.h, common.mk: reflect the rename from
+ atomic.h to ruby_atomic.h.
- * ext/syck/token.c: accept tabs as whitespace, not for indentation,
- but strip from plain scalars.
+Sat Nov 10 00:46:57 2012 Naohisa Goto <ngotogenome@gmail.com>
- * test/yaml/test_yaml.rb: remove outdated tests.
+ * atomic.h: Revert r37491 which is a temporary workaround.
-Sat Sep 17 23:25:04 2005 sheepman <sheepman@sheepman.sakura.ne.jp>
+Sat Nov 10 00:33:31 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/mathn.rb (Rational::inspect): should preserve original
- operand. [ruby-core:05806]
+ * siphash.h: check configure macros before include newer headers.
-Sat Sep 17 23:20:27 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 9 23:33:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/cgi.rb (CGI::Cookie): should handle multiple values for a
- cookie name. [ruby-talk:156140]
+ * lib/erb.rb (ERB#run, ERB#result): eval under isolated bindings for
+ safe concurrent use. [ruby-core:47638] [Bug #7046]
-Sat Sep 17 10:42:13 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri Nov 9 23:05:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/multi-tk.rb: MultiTkIp#eval_string and bg_eval_string
- should call Kernel.eval on caller's safe-level instead of slave's
- safe-level (Of course, the given script should be evaluated on
- slave's safe-level).
+ * random.c (BYTE_ORDER): define using configured WORDS_BIGENDIAN.
-Sat Sep 17 09:45:26 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * siphash.c (sip_init_state): use union to suppress warnings by gcc
+ 4.7.
- * string.c (rb_str_substr): should propagate taintness even for
- empty strings. [ruby-dev:27121]
+Fri Nov 9 19:40:03 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * string.c (rb_str_aref): should infect result if range argument
- is tainted. [ruby-dev:27121]
+ * array.c (rb_ary_splice): fix r37583 doesn't consider the case when
+ beg > array length.
-Sat Sep 17 08:35:39 2005 Kouhei Sutou <kou@cozmixng.org>
+Fri Nov 9 16:11:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/maker/base.rb (RSS::Maker::ItemsBase#normalize): fixed
- strange RSS::Maker::Item#max_size behavior.
- Thanks to Kazuhiko <kazuhiko@fdiary.net>.
+ * random.c (rb_memhash): use siphash.
- * test/rss/test_maker_1.0.rb (RSS::TestMaker10#test_items): ditto.
+Fri Nov 9 16:08:46 2012 Sokolov Yura funny-falcon <funny.falcon@gmail.com>
-Fri Sep 16 23:09:20 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * array.c: speedup Array#unshift by using space in shared array.
+ [Feature #6638]
+ - when array owns its shared array (ARY_SHARED_NUM == 1), and there
+ is enough space then try unshift values directly into shared
+ array.
+ - when resulting array is big (~>64 items) then make it shared with
+ enough room for future #unshifts, and then insert into shared
+ array.
- * ext/win32ole/win32ole.c (ole_search_event_at): bug fix
- in ext/win32ole/sample/ienavi.rb.
+ * array.c (rb_ary_splice): use shared array in rb_ary_slice.
+ [Feature #6638]
+ - use ary_ensure_room_for_push when rb_ary_slice used to add at the
+ end of array, cause rb_ary_concat use rb_ary_slice.
- * ext/win32ole/win32ole/tests/testOLEEVENT.rb: ditto.
+ * array.c (ary_ensure_room_for_push): make array really suitable for
+ queue. [Feature #6638]
+ when array is shared (which happens after Array#shift), and
+ ARY_SHARED_NUM == 1 (which is very often when array used as queue),
+ then make rb_ary_push push directly into shared array.
-Fri Sep 16 22:41:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * array.c (rb_ary_modify): steal shared array's container when
+ ARY_SHARED_NUM == 1. [Feature #6638]
+ - Do not allocate new memory in rb_ary_modify when ARY_SHARED_NUM == 1
+ and length almost same.
+ - Store ARY_CAPA instead of RARRAY_LEN in ary_make_shared, to make
+ it useful.
+ - Fix rb_ary_sort_bang accordantly.
- * file.c (rb_file_s_extname): empty string for path name ending with a
- period. fixed: [ruby-core:05651]
+Fri Nov 9 16:00:00 2012 Zachary Scott <zzak@zacharyscott.net>
- * file.c (rb_file_join): smarter behavior at edge cases.
- fixed: [ruby-core:05706]
+ * ext/bigdecimal/bigdecimal.c: Documentation for BigDecimal
+ Based on a patch from Vincent Batts [ruby-core:49047] [Bug #7305]
-Fri Sep 16 18:34:01 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 9 15:25:42 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/syck/node.c (syck_replace_str): was using return from the
- void function. a patch from MIYAMUKO Katsuyuki
- <miyamuko at mtb.biglobe.ne.jp>. [ruby-dev:27111]
+ * lib/shellwords.rb (Shellwords#shellescape): Add back my original
+ real world example with some enhancement.
-Fri Sep 16 14:48:48 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/shellwords.rb (Shellwords#shelljoin): Undo part of the
+ previous rdoc change. This new example using a string-only
+ array was not in line with the description.
- * ext/tk/lib/multi-tk.rb: fix typo on MultiTkIp#bg_eval_string
+Fri Nov 9 12:58:13 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Sep 16 12:02:12 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * string.c (rb_str_crypt): crypt(3) may return NULL.
+ Latest glibc (2.16?) crypt(3) actually returns NULL. [Bug #7312]
- * ext/syck/rubyext.c (syck_resolver_transfer): remove C++ style
- comment (//). [ruby-core:05793]
+Fri Nov 9 12:07:06 2012 Akinori MUSHA <knu@iDaemons.org>
-Fri Sep 16 00:14:14 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * include/ruby/ruby.h (alloca), eval_intern.h (alloca), gc.c
+ (alloca): Make alloca() globally available by moving the
+ ultimate ifdef's to ruby/ruby.h. Gcc hides its builtin alloca()
+ when compiling with -ansi, and linking thus fails on platforms
+ that lack their own alloca() implementation in libc, which
+ include OpenBSD and some ports of NetBSD. We use alloca()
+ everywhere including from within third party C extensions, so
+ alloca() must be made globally available. [Bug #7307]
- * test/logger/test_logger.rb: unintentionally overwritten changes by
- Usa. reverted.
+ * addr2line.c (alloca): Replace the alloca() part with the
+ ultimate ifdef's. [Bug #7307]
-Fri Sep 16 00:06:18 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Nov 9 09:30:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * lib/webrick/cgi.rb (WEBrick::CGI::Socket#initialize): should set
- $stdout.binmode.
+ * io.c (IO#new):
+ Fix indentation from r37444
+ [ruby-core:48052] [Bug #7179]
-Thu Sep 15 23:25:21 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Fri Nov 9 07:36:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * lib/{soap,wsdl,xsd}, test/{soap,wsdl,xsd}: imported soap4r/1.5.5.
+ * bignum.c (bigmul0): enable big_mul_toom3.
+ [ruby-core:48552] [Bug #7242]
- #nnn is a ticket number at http://dev.ctor.org/soap4r
+ * bignum.c (bigmul1_toom3): fix incorrect calculation.
+ the patch is made by Heesob Park.
+ [ruby-core:48552] [Bug #7242]
- * SOAP
+Fri Nov 9 05:33:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * allow to configure an envelope namespace of SOAP request. (#124)
- TemporaryNamespace = 'http://www.w3.org/2003/05/soap-envelope'
- @client.options["soap.envelope.requestnamespace"] =
- TemporaryNamespace
- @client.options["soap.envelope.responsenamespace"] =
- TemporaryNamespace
- @client.do_proc(...)
+ * bignum.c (bigmul0): disable big_mul_toom3 temporarily.
+ [ruby-core:48552] [Bug #7242]
- * let SOAP request XML indent space configuable. see
- "soap.envelope.no_indent" option. (#130)
+ * test/ruby/test_bignum.rb (test_mul_large_numbers):
+ add a test for bigmul1_toom3 suggested in [Bug #7242].
- * let external CES configuable.
- ex. client["soap.mapping.external_ces"] = 'SJIS'. $KCODE is used
- by default. (#133)
- external CES ::= CES used in Ruby object of client and server
- internal CES ::= CES used in SOAP/OM
+Thu Nov 8 21:57:59 2012 Masaki Matsushita <glass.saga@gmail.com>
- * add iso-8859-1 external CES support. (#106)
+ * re.c (rb_memsearch): performance improvement by using memchr().
+ [ruby-dev:45397] [Feature #6173]
- * fixed illegal 'qualified' handling of elements. it caused
- ASP.NET inteoperability problem. (#144)
+Thu Nov 8 19:02:50 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * added 'soap.envelope.use_numeric_character_reference' (boolean)
- option to let query XML use numeric character reference in XML,
- not plain UTF-8 character. !GoogleSearch server seems to not
- allow plain UTF-8 character since 2005-08-15 update. (#147)
+ * lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line):
+ treat \r as newline as mame pointed. [ruby-dev:46425] [Bug #7278]
- * SOAP::Header::SimpleHeader (de)serialization throws an exception
- on !SimpleHeader.on_(in|out)bound when header is a String. so we
- could not use a simple single element headerItem. fixed. thanks
- to emil. (#129)
+Thu Nov 8 11:32:11 2012 Akinori MUSHA <knu@iDaemons.org>
- * out parameter of rpc operation did not work. (#132)
+ * configure.in (--with-opt-dir): Avoid nesting of double quotes
+ inside backquotes, since some traditional shells like PD KSH
+ (which OpenBSD's /bin/sh bases on) fail to parse them.
- * follow HTTP redirect only if using http-access2. (#125) (#145)
+Thu Nov 8 09:34:00 2012 Kenta Murata <mrkn@cookpad.com>
- * add a workaround for importing an WSDL whose path begins with
- drive letter. (#115)
+ * numeric.c: Add a caution that the results of the comparing
+ operations of two NaNs are undefined.
+ [#1720] [ruby-dev:38725] [ruby-core:36966]
- * WSDL
+Thu Nov 8 04:45:21 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * SOAP Data which is defined as a simpletype was not mapped
- correctly to Ruby obj when using wsdl2ruby.rb generated classdef
- file. (#123)
+ * include/ruby/intern.h: Restore rb_enumeratorize as it was before
+ r37497 and introduce rb_enumeratorize_with_size instead. [#7302]
- * rpc/literal support. (#118)
+ * enumerator.c: ditto.
- * re-implemented local element qualify/unqualify control. handles
- elementFormDefault and form in WSDL. (#119)
+Wed Nov 7 15:22:37 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * Array of an element which has simpleType causes a crash. (#128)
+ * numeric.c (ruby_float_step): fix r37514: it yielded with NaN
+ if the unit is infinity.
- * prarmeterOrder may not contain return part so it can be shorter
- than parts size. Thanks to Hugh. (#139)
+Wed Nov 7 15:46:12 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * Samples
+ * lib/webrick.rb: fix typo. reported by Rohit Arondekar.
+ https://github.com/ruby/ruby/pull/211
- * added !BasicAuth client sample. (#117)
+Wed Nov 7 15:34:12 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
- * added Base64 client/server sample.
+ * lib/cgi/core.rb: alias CGI#http_header to CGI#header.
- * added Flickr SOAP interface client sample. (#122)
+Wed Nov 7 12:49:39 2012 Shugo Maeda <shugo@ruby-lang.org>
- * added !SalesForce client sample. (#135)
+ * eval.c (rb_mod_refine): set RMODULE_IS_REFINEMENT to a created
+ refinement module, and don't override method_added.
- * updated Thawte CA certificate for !GoogleAdWords sample.
+ * vm_method.c (rb_method_entry_make): check redefinition of
+ optimized methods when a method is added to a refinement module.
+ [ruby-core:48970] [Bug #7290]
- * updated a client script with the newer version made by Johan.
- thanks!
+ * test/ruby/test_refinement.rb: related test.
- * shortened long file names. (#120)
+Wed Nov 7 11:48:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * fixed typo in authheader sample. (#129)
+ * misc/ruby-additional.el (ruby-mode-set-encoding): now encoding needs
+ to be set always explicitly actually. [Feature #6679]
- * updated deprecated method usage. (#138)
+Wed Nov 7 09:15:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Sep 15 23:02:57 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * object.c (rb_mod_const_get): avoid inadvertent symbol creation.
- * win32/win32.h (rb_w32_stat): added prototype.
+Wed Nov 7 07:52:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Sep 15 22:35:55 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * enum.c (rb_enum_cycle_size): prefix with rb.
- * test/ruby/test_signal.rb (test_exit_action): skip the test using
- fork on fork-less platforms.
+Wed Nov 7 04:32:15 2012 Luis Lavena <luislavena@gmail.com>
-Thu Sep 15 11:39:18 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/ruby/test_file_exhaustive.rb: Remove FIXME skip on Windows
+ specific test because the test in question was already fixed.
- * ext/tk/lib/tk/dialog.rb: If a dialog does not show up yet,
- TkDialogObj#name raises an exception. [ruby-talk:156109]
+Wed Nov 7 03:45:12 2012 Luis Lavena <luislavena@gmail.com>
-Thu Sep 15 01:39:19 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * ext/zlib/extconf.rb: Recognize zlibwapi as linking library.
+ Patch by Daniel Berger.
- * lib/rinda/tuplespace.rb (Rinda::TemplateEntry::initialize): pull
- up method. Tabs converted to spaces.
+ [ruby-core:44979] [Feature #6421]
-Thu Sep 15 00:18:24 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Nov 7 02:06:40 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * lib/net/telnet.rb (Net::Telnet::waitfor): replace sysread with
- readpartial. [ruby-talk:127641]
+ * enumerator.c: New method #size; constructor accepts size.
+ Have #to_enum accept a block
+ Warn when using deprecated form of constructor
+ Support #size for enumerators created from enumerators
+ Support for lazy.{map|flat_map|...}.size.
-Wed Sep 14 22:40:26 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/intern.h: RETURN_SIZED_ENUMERATOR for support of
+ sized enumerators.
- * dir.c (ruby_glob): glob function not using ruby exception system.
+ * array.c: Support for various enumerator.size.
-Wed Sep 14 01:26:03 2005 Minero Aoki <aamine@loveruby.net>
+ * enum.c: ditto.
- * lib/net/https.rb: backported from trunk, rev 1.3.
- [ruby-dev:25673] (again), [ruby-dev:26617] (again),
- [ruby-dev:27062]
+ * hash.c: ditto.
- * ext/openssl/lib/net/https.rb: removed.
+ * numeric.c: ditto.
- * ext/openssl/lib/net/protocols.rb: removed.
+ * range.c: ditto.
- * lib/net/http.rb: #use_ssl?, #use_ssl are moved from net/https.
+ * string.c: ditto.
-Tue Sep 13 22:09:40 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * struct.c: ditto.
- * lib/logger.rb (Logger): added formatter accessor to logger for
- dictating the way in which the logger should format the messages it
- displays. Thanks to Nicholas Seckar (cf. [ruby-talk:153391]) and
- Daniel Berger.
+ * vm_eval.c: ditto.
- * lib/logger.rb (Logger): added VERSION constant.
+Tue Nov 6 20:40:28 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/logger.rb: removed document for LogDevice. It is an
- implementation detail and is not a public interface.
+ * object.c (rb_mod_const_get): Fix constant missing exception class
+ and message to maintain backwards compatibility. Constant search
+ should start at Object when constant starts with '::'
- * test/logger/test_logger.rb: added tests.
+ * test/ruby/test_module.rb: test for fixes
-Tue Sep 13 21:47:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 6 16:50:00 2012 Masaki Matsushita <glass.saga@gmail.com>
- * eval.c (BEGIN_CALLARGS): pop halfly pushed status.
- fixed: [ruby-dev:26881]
+ * lib/tempfile.rb (Tempfile#inspect): fix confusing #inspect.
+ previous Tempfile#inspect says it is a File, but actually
+ it is not a File.
-Tue Sep 13 16:26:45 2005 Minero Aoki <aamine@loveruby.net>
+ t = Tempfile.new("foo") #=> #<File:/tmp/foo20121106-31970-1ffbum0>
+ t.is_a? File #=> false
- * lib/net/http.rb: backported from trunk, rev 1.128.
- [ruby-dev:25673] [ruby-dev:26617]
+ now Tempfile#inspect returns like:
- * lib/net/protocol.rb: backported from trunk, rev 1.78.
+ t = Tempfile.new("foo")
+ #=> #<Tempfile:/tmp/foo20121106-31970-1ffbum0>
- * lib/net/protocol.rb: new method #old_open to support net/smtp
- and net/pop.
+ [ruby-core:47544] [Bug #7027]
- * lib/net/smtp.rb: use #old_open.
+Tue Nov 6 16:22:30 2012 Naohisa Goto <ngotogenome@gmail.com>
- * lib/net/pop.rb: ditto.
+ * atomic.h: add #include <sys/atomic.h> for the workaround of
+ header file name conflict of atomic.h with /usr/include/atomic.h
+ on Solaris 10. [ruby-dev:46414] [Bug #7287]
-Tue Sep 13 12:33:05 2005 why the lucky stiff <why@ruby-lang.org>
+Tue Nov 6 14:38:00 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/yaml.rb: reworking YAML::Stream to use the new
- emitter.
+ * test/win32ole/test_win32ole.rb: now source encoding is UTF-8, so
+ binary strings in old scripts are dangerous.
- * lib/yaml/stream.rb: ditto.
+Tue Nov 6 14:25:09 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/yaml/rubytypes.rb: added Object#yaml_new.
+ * lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line):
+ don't use /n in universal regexp. [ruby-dev:46394] [Bug #7278]
- * lib/yaml/tag.rb: the tag_subclasses? method now
- shows up in the class. allow taguri to be set using an accessor.
- continue support of Object#to_yaml_type.
+Tue Nov 6 09:42:26 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/syck/rubyext.c: new emitter code. yaml_new and yaml_initialize
- get called, should they be present. consolidated all the diaspora of internal
- node types into the family below YAML::Syck::Node -- Map,
- Seq, Scalar -- all of whom are SyckNode structs pointing to
- Ruby data. moved Object#yaml_new into the node_import and made it the
- default behavior. the target_class is always called wih yaml_new, prepended
- a parameter, which is the klass. loaded nodes through GenericResolver show their style.
- new Resolver#tagurize converts type ids to taguris.
+ * string.c (rb_str_b): Add String#b, returning a copied string
+ whose encoding is ASCII-8BIT. [ruby-dev:45992] [Feature #6767]
- * ext/syck/implicit.re: were 'y' and 'n' seriously omitted??
+Tue Nov 6 09:37:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/syck/emitter.c: renovated emitter, walks the tree in advance.
- consolidated redundant block_styles struct into
- the scalar_style struct. (this means loaded nodes can now
- be sent back to emitter and preserve at least its very basic
- formatting.)
+ * ruby.c (load_file_internal): set default source encoding as
+ UTF-8 instead of US-ASCII. [ruby-core:46021] [Feature #6679]
- * ext/syck/gram.c: headless documents of any kind allowed.
+ * parse.y (parser_initialize): set default parser encoding as
+ UTF-8 instead of US-ASCII.
- * ext/syck/node.c: new syck_replace_str methods and syck_empty_*
- methods for rewriting node contents, while keeping the ID
- and other setup info. added syck_seq_assign.
+Tue Nov 6 05:48:06 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * ext/syck/syck.h: reflect block_styles and new node functions.
+ * test/ruby/test_require.rb
+ (TestRequire#test_require_to_path_redefined_in_load_path,
+ TestRequire#test_require_to_str_redefined_in_load_path):
+ Suppress method redefined warning when test-all with RUBYOPT=-w.
-Mon Sep 12 20:53:06 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Nov 8 00:24:14 2012 Akinori MUSHA <knu@iDaemons.org>
- * test/openssl/test_pkcs7.rb (test_enveloped): skip this test
- to avoid a bug of PKCS7_enctypt() (only if ext/openssl is
- compiled with OpenSSL-0.9.7d or earlier versions).
- http://www.mail-archive.com/openssl-dev@openssl.org/msg17376.html
+ * ext/curses/view.rb: Do not fail if the file to view is shorter
+ than the screen height.
-Mon Sep 12 14:03:33 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Nov 5 11:40:00 2012 Mark Somerville <mark@scottishclmibs.com>
- * test/dbm/test_dbm.rb: remove locking test, which may not be
- supported on some platforms. [ruby-dev:27030]
+ * thread_pthread.c (rb_reserved_fd_p): fix typo in macro check
+ that prevented the ifdef ever being true.
+ [Bug #7281] [ruby-core:48940]
-Mon Sep 12 10:45:58 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Nov 5 23:28:57 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * ext/dl/dl.c (rb_io_to_ptr): merged a patch for DragonFly BSD
- from Takahiro Kambe <taca at back-street.net>. [ruby-dev:27023]
+ * file.c (rb_get_path_check_to_string): extract from
+ rb_get_path_check(). We change the spec not to call to_path of
+ String object.
-Sun Sep 11 22:05:51 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * file.c (rb_get_path_check_convert): extract from rb_get_path_check().
- * bin/erb (ERB::Main#run): set ERB#filename so that it is used
- when reporting syntax/runtime errors. Tabs converted to spaces.
+ * file.c (rb_get_path_check): follow the above change.
-Sat Sep 10 10:17:03 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * file.c (rb_file_expand_path_fast): remove check_expand_path_args().
+ Instead we call it in load.c.
- * ext/openssl/ossl_engine.c (ossl_engine_s_by_id):
- OpenSSL::Engine.by_id calls given block before calling
- ENGINE_init (block parameter is the return value of this method
- itself). this functionality is useful to load dynamic shared
- engines. the following code is a sample of loading a key using
- OpenSC PKCS #11 module.
+ * file.c (rb_find_file_ext_safe): use rb_get_expanded_load_path() to
+ reduce expand cost.
- require "openssl"
- pkcs11 = OpenSSL::Engine.by_id("dynamic"){|e|
- e.ctrl_cmd("SO_PATH", "/usr/lib/opensc/engine_pkcs11.so")
- e.ctrl_cmd("LIST_ADD", "1")
- e.ctrl_cmd("LOAD")
- }
- pkcs11.ctrl_cmd("PIN", "secret")
- key = pkcs11.load_private_key
+ * file.c (rb_find_file_safe): ditto.
- * ext/openssl/ossl_engine.c (ossl_engine_ctrl_cmd): new method
- OpenSSL::Engine#ctrl_cmd. it wraps ENGINE_ctrl_cmd_string.
+ * internal.h (rb_get_expanded_load_path): add a declaration.
- * ext/openssl/ossl_engine.c (ossl_engine_get_cmds): new method
- OpenSSL::Engine#cmds. it returms engine command definitions.
+ * internal.h (rb_get_path_check_to_string, rb_get_path_check_convert):
+ add declarations.
-Sat Sep 10 10:09:47 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * load.c (rb_construct_expanded_load_path): fix for compatibility.
+ Same checks in rb_get_path_check() are added. We don't replace
+ $LOAD_PATH and ensure that String object of $LOAD_PATH are frozen.
+ We don't freeze non String object and expand it every time. We add
+ arguments for expanding load path partially and checking if load path
+ have relative paths or non String objects.
- * ext/openssl/ossl_asn1.c (asn1str_to_str): new function.
+ * load.c (load_path_getcwd): get current working directory for checking
+ if it's changed when getting load path.
- * ext/openssl/ossl_pkcs7.c: new class OpenSSL::PKCS7::RecipientInfo.
- this class wraps PKCS7_RECIP_INFO struct.
+ * load.c (rb_get_expanded_load_path): fix for rebuilding cache properly.
+ We check if current working directory is changed and rebuild expanded
+ load path cache. We expand paths which start with ~ (User HOME) and
+ non String objects every time for compatibility. We make this
+ accessible from other source files.
- * ext/openssl/ossl_pkcs7.c: OpenSSL::PKCS7::Signer is renamed to
- OpenSSL::PKCS7::SignerInfo. ("Signer" remains as an alias of
- SignerInfo.)
+ * load.c (rb_feature_provided): call rb_get_path() since we changed
+ rb_file_expand_path_fast() not to call it.
- * test/openssl/test_pkcs7.rb: new file.
+ * load.c (Init_load): initialize vm->load_path_check_cache.
-Sat Sep 10 10:05:51 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * vm.c (rb_vm_mark): mark vm->load_path_check_cache for GC.
- * ext/openssl/ossl_ns_spki.c (ossl_spki_initialize): assume that
- the argument is a DER string if Base64 decoding failed.
+ * vm_core.h (rb_vm_struct): add vm->load_path_check_cache to store data
+ to check load path cache validity.
- * ext/openssl/ossl_ns_pki.c (ossl_spki_to_der): new method.
+ * test/ruby/test_require.rb (TestRequire): add tests for require
+ compatibility related to cached expanded load path.
+ [ruby-core:47970] [Bug #7158]
- * test/openssl/test_ns_spki.rb: add new file.
+Mon Nov 5 23:26:05 2012 Greg Price <price@mit.edu>
-Sat Sep 10 09:56:24 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * load.c (rb_get_expanded_load_path): cache the expanded load
+ path. This saves 4KB of allocation and some stats for every
+ element of the load path (so nearly a MB in my Rails app)
+ on every require.
- * ext/openssl/lib/digest.rb: added SHA224, SHA256, SHA384 and SHA512.
- these features are enabled if this library is compiled with
- OpenSSL 0.9.8 or later.
+ * load.c (rb_construct_expanded_load_path): ensure that $LOAD_PATH
+ entries are frozen strings. The user must mutate $LOAD_PATH
+ itself rather than its individual entries.
- * test/openssl/test_digest.rb: add test for new digests.
+ * vm_core.h (rb_vm_struct): add fields.
-Sat Sep 10 09:51:30 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * vm.c (rb_vm_mark): mark new fields.
- * ext/openssl/ossl.c (ossl_raise): should use ERR_peek_last_error
- to get last error on the current thread. And should report
- errors on the stack while OpenSSL.debug is true.
+ * ruby.c (process_options): modify $LOAD_PATH directly rather than
+ its elements.
+ Patch by Greg Price.
+ [ruby-core:47970] [Bug #7158]
- * ext/openssl/ossl.c (ossl_get_errors): new method for debugging
- this library.
+Mon Nov 5 23:24:42 2012 Greg Price <price@mit.edu>
- * ext/openssl/ossl_ssl.c (ossl_sslctx_set_ciphers): fix error message.
+ * load.c (rb_feature_p, rb_provide_feature): index $LOADED_FEATURES
+ so that require isn't so slow.
- * ext/openssl/ossl_x509req.c (ossl_x509req_set_attributes): get rid
- of unused variable.
+ * load.c (rb_provide_feature, get_loaded_features_index): ensure
+ that $LOADED_FEATURES entries are frozen strings. The user
+ must mutate $LOADED_FEATURES itself rather than its individual
+ entries.
- * ext/openssl/ossl_x509store.c (ossl_x509store_initialize): should
- set @time to avoid warning.
+ * load.c (reset_loaded_features_snapshot): add a new function to reset
+ vm->loaded_features_snapshot.
- * ext/openssl/ossl_x509store.c (ossl_x509store_set_default_paths,
- X509_STORE_add_cert, X509_STORE_add_crl): should raise error if
- wrapped functions failed.
+ * load.c (get_loaded_features_index_raw): add a new function to get
+ the loaded-features index.
- * test/openssl/test_x509store.rb: add test for errors.
+ * load.c (features_index_add_single): add a new function to add to the
+ loaded-features index a single feature.
-Fri Sep 9 22:13:19 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * load.c (features_index_add): add a new function to add to the
+ loaded-features index all the required entries for `feature`.
- * eval.c (rb_call0): prohibit calling tainted method (>2) when
- $SAFE == 0.
+ * vm_core.h (rb_vm_struct): add fields.
-Fri Sep 9 16:45:25 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (rb_vm_mark): mark new fields.
- * string.c (rb_str_times): make empty strings to keep taintness,
- and a little improvement. [ruby-dev:26900]
+ * include/ruby/intern.h (rb_hash_clear): declare function.
- * ext/iconv/iconv.c (iconv_try), ext/iconv/extconf.rb: get rid of meta
- characters in command line option. fixed: [ruby-talk:155369]
+ * hash.c (rb_hash_clear): make function non-static.
+ Patch by Greg Price.
+ [ruby-core:47970] [Bug #7158]
-Thu Sep 8 14:58:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Nov 5 23:23:51 2012 Greg Price <price@mit.edu>
- * merged a patch from Takahiro Kambe <taca at back-street.net> to
- support DragonFly BSD. [ruby-dev:26984]
+ * array.c (rb_ary_shared_with_p): new function.
+ Expose whether two arrays are shared (read-only, C only).
-Wed Sep 7 12:55:08 2005 Tanaka Akira <akr@m17n.org>
+ * include/ruby/intern.h (rb_ary_shared_with_p): declare.
+ Patch by Greg Price.
+ [ruby-core:47970] [Bug #7158]
- * lib/open-uri.rb: abolish mod === tempfile to avoid a problem
- [ruby-dev:26967].
+Mon Nov 5 23:21:14 2012 Greg Price <price@mit.edu>
-Wed Sep 7 10:45:15 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * load.c (loaded_feature_path): clarify and briefly comment
+ function. These clarifications have no effect on the behavior
+ of the function.
- * eval.c (rb_thread_switch): convert all exceptions to
- SystemExit. fixed: [ruby-core:05724]
+ * load.c (rb_feature_p): explain the search loop. Especially
+ useful because the logic is complicated as described in the
+ second paragraph.
+ Patch by Greg Price.
+ [ruby-core:47970] [Bug #7158]
- * eval.c (rb_thread_terminated): show backtrace before propagate
- exceptions to main thread.
+Mon Nov 5 22:45:03 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Wed Sep 7 08:35:04 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dl/win32/lib/Win32API.rb (Win32API#call): use 64bit pointer for x64
+ Windows. This would fix
+ TestSecureRandom#test_s_random_bytes_without_openssl error.
+ [ruby-core:47451] [Bug #6990]
- * Makefile.in, configure.in (MINIOBJS): miniruby on HP-UX can not load
- extension libraries.
+Mon Nov 5 22:09:26 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * bignum.c (bignew_1, bigadd): K&R style argument actually can't be
- defined as char.
+ * cygwin/GNUmakefile.in (uncommon.mk): link *.res.o.
+ EXTOBJES is defined in uncommon.mk. *.res.o setting should be below
+ uncommon.mk.
+ [ruby-core:48858] [Bug #7277]
- * missing/vsnprintf.c: ANSI compiler supports const keyword.
+Mon Nov 5 11:35:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/digest/sha2/extconf.rb: reject platforms which has inttypes.h
- but no 64bit integer.
+ * thread_pthread.c (native_thread_init, native_thread_destroy):
+ removed HAVE_PTHREAD_CONDATTR_INIT check because this silly
+ #ifdef makes use-uninitialized-var issue and (2) native_cond_initialize()
+ already have a right platform and caller don't need any additional care.
+ [Bug #6825]
- * lib/mkmf.rb (what_type?): guesstimate type.
+Mon Nov 5 10:57:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/etc/etc.c (setup_passwd), ext/etc/extconf.rb: pw_age might be
- char*. fixed: [ruby-core:05470]
+ * lib/cgi/core.rb: check if Tempfile is defined before use it.
-Wed Sep 7 08:32:47 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/cgi/core.rb: remove tempfiles only if tempfiles exist
- * object.c (rb_mod_cvar_get, rb_mod_cvar_set): document fix from
- sheepman <sheepman@sheepman.sakura.ne.jp>; a bug in visibility
- description. [ruby-dev:26965]
+Mon Nov 5 12:17:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * sprintf.c (rb_f_sprintf): warn "too many argument" on verbose
- mode (-v/-w); backported from 1.9. [ruby-dev:26963]
+ * lib/uri/http.rb (URI::HTTP.build): Fix example
+ Patch by Carina C. Zona
+ [Fixes #209 Github]
-Mon Sep 5 17:03:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Nov 5 09:55:05 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
- * lib/ostruct.rb: a patch from Florian Gross <florgro at gmail.com>
- merged to allow recursive inspect (and to_s) for OpenStruct.
- [ruby-core:05532]
+ * lib/cgi/core.rb: remove tempfile more early.
-Mon Sep 5 07:01:12 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Nov 4 20:29:46 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
- * ext/openssl/openssl/lib/openssl/buffering.rb (Buffering#do_write):
- should clear data from the buffer which already been output.
+ * lib/cgi.rb, lib/cgi/*/rb: rename CGI#header to CGI#http_header,
+ add and update HTML5 tag generator. [Bug #7110]
+ Patch provided by Marcus Stollsteimer, thank you !
-Fri Sep 2 23:51:54 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 4 11:47:39 2012 Masaki Matsushita <glass.saga@gmail.com>
- * lib: do not use __send__ to access private methods. [ruby-dev:26935]
+ * lib/fileutils.rb (module FileUtils): repatch [ruby-core:39622]
+ [Feature #5337]. improve performance of FileUtils.compare_stream.
+ [ruby-core:47545] [Feature #7028]
-Fri Sep 2 03:29:00 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
+Sun Nov 4 11:27:54 2012 Masaki Matsushita <glass.saga@gmail.com>
- * lib/irb/init.rb: make IRB -I option that is same befavior for ruby.
- [ruby-dev:26872], [ruby-dev: 26920]
+ * array.c (recursive_equal): fix to return true when self and other
+ are resized to same size and the current index become out of
+ range.
- * lib/irb/locale.rb: support to print help message when OS locale is
- ja_JP.utf-8. [ruby-dev:26872]
+ * test/ruby/test_array.rb: add a test for the above.
-Thu Sep 1 17:11:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Nov 4 10:19:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_call0): wrong condition for $SAFE restoration.
+ * dir.c (file_s_fnmatch): match with expanding braces if FNM_EXTGLOB
+ is set. [ruby-core:40037] [Feature #5422]
-Thu Sep 1 14:12:45 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat Nov 3 23:38:15 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/tk/lib/multi-tk.rb: On Tcl8.5, MultiTkIp#invoke_hidden doesn't
- work (gives wrong order of arguments).
+ * complex.c: modified doc.
+ * rational.c: ditto.
- * ext/tk/lib/multi-tk.rb: add MultiTkIp#invoke_hidden_on_namespace
- to support '-namespace' option of 'interp invokehidden' command
- on Tcl8.5.
+Sat Nov 3 22:38:55 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Wed Aug 31 14:43:15 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/date/date_core.c: modified doc.
- * win32/Makefile.sub (OPTFLAGS): default global optimization to
- disabled for all VC++ versions. fixed: [ruby-dev:26897]
+Sat Nov 3 18:35:55 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Wed Aug 31 11:35:43 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm.c (rb_vm_rewrite_ep_in_errinfo, vm_rewrite_ep_in_errinfo):
+ merge code and remove `rb_vm_rewrite_ep_in_errinfo'.
- * test/gdbm/test_gdbm.rb (teardown): should remove GDBM temporary
- file.
+Sat Nov 3 18:15:24 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Wed Aug 31 10:30:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * vm.c, proc.c: avoid unnecessary `rb_vm_rewrite_ep_in_errinfo'
+ calls.
- * process.c (proc_detach, proc_setmaxgroups): missing argument type
- declaration. (I recommend ANSI-style function)
+Sat Nov 3 17:53:43 2012 Kouhei Sutou <kou@cozmixng.org>
-Tue Aug 30 23:20:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bin/testrb: Use only Test::Unit::AutoRunner in test-unit gem
+ compatible API to be available by both test/unit bundled in Ruby
+ and test-unit gem.
+ * lib/test/unit.rb (Test::Unit::AutoRunner): Move codes from testrb.
- * eval.c (rb_rescue2): initialization miss. fixed: [ruby-dev:26917]
+Sat Nov 3 14:56:21 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/mkmf.rb (xsystem, xpopen): no longer expand by Config.
+ * ext/date/date_parse.c (parse_eu): should capture apostrophe too.
- * lib/mkmf.rb (link_command, cc_command, cpp_command): expand
- variables at once, and quote hdrdir. fixed: [ruby-core:05680]
+Sat Nov 3 14:46:15 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/mkmf.rb (libpathflag): quote paths.
+ * ext/date/date_parse.c (date__parse): revised the tight parser.
-Tue Aug 30 19:34:27 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Nov 3 14:43:42 2012 Kouhei Sutou <kou@cozmixng.org>
- * ext/digest/md5/md5ossl.h, ext/digest/rmd160/rmd160ossl.h,
- ext/digest/sha1/sha1ossl.h: include <stddef.h> to avoid
- error in compilation with OpenSSL-0.9.8. [ruby-list:41068]
+ * lib/rexml/xmldecl.rb (REXML::XMLDecl#content): Add missing \A
+ and \z.
-Mon Aug 29 19:54:21 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat Nov 3 14:42:55 2012 Kouhei Sutou <kou@cozmixng.org>
- * lib/rdoc/usage.rb: improper exceptions. [ruby-dev:26870]
+ * lib/rexml/output.rb (REXML::Output#initialize): Use normalized
+ encoding name.
- * lib/rdoc/usage.rb: support the case when non-ruby code exists before
- shebang. (this is needed when ri.bat is executed on windows)
+Sat Nov 3 14:41:17 2012 Kouhei Sutou <kou@cozmixng.org>
-Mon Aug 29 17:48:17 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rexml/output.rb (REXML::Output): Don't output BOM in middle
+ of the output string.
+ * test/rexml/test_document.rb: Add a test for the above change.
- * eval.c (method_arity): should return proper arity value.
- [ruby-dev:26390]
+Sat Nov 3 14:09:55 2012 Kouhei Sutou <kou@cozmixng.org>
-Mon Aug 29 01:19:57 2005 Tanaka Akira <akr@m17n.org>
+ * NEWS: Add an item about REXML::Document#write.
- * lib/time.rb (Time.parse): extract fractional seconds using
- Date._parse. [ruby-talk:153859]
+Sat Nov 3 13:46:49 2012 Kouhei Sutou <kou@cozmixng.org>
-Sat Aug 27 20:20:01 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/rexml/test_document.rb: Fix tests that expect encoding name
+ isn't normalized.
- * ext/curses/curses.c ({curses,window}_clrtoeol): added. suggested
- by Reyn Vlietstra.
+Sat Nov 3 13:26:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * ext/curses/curses.c: chtype in curses is not `char', rahter `long'.
- [ruby-Bugs:2298]
+ * dir.c (Dir#glob):
+ Documentation for pattern section, backslash subsection
+ Patch by Eric Bouchut
+ [ruby-core:48528] [Bug #7230]
- * ext/curses/view.rb: String =~ String is deprecated.
+Sat Nov 3 13:26:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Wed Aug 24 10:53:28 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * io.c (IO#new):
+ Documentation for IO#open modes and formatting
+ [ruby-core:48052] [Bug #7179]
- * test/logger/test_logger.rb (test_shifting_size): should close log
- device before unlink, since some platform cannot unlink opened
- file.
+Sat Nov 3 13:01:02 2012 Kouhei Sutou <kou@cozmixng.org>
-Sun Aug 21 00:13:27 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * test/rexml/test_encoding.rb (EncodingTester#test_in_different_out):
+ Fix a test that expects encoding in XML declaration is changed by
+ Output's encoding. It is dropped feature.
- * lib/wsdl/xmlSchema/importer.rb (WSDL::XMLSchema::Importer#fetch): add
- a workaround for importing an WSDL whose path begins with drive
- letter. [ruby-dev:26242]
+Sat Nov 3 12:49:45 2012 Kouhei Sutou <kou@cozmixng.org>
-Sat Aug 20 22:37:13 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/rexml/document.rb (REXML::Document#write): Document encoding
+ option. Now different encoding between XML file's encoding and
+ XML declaration's encoding is support.
+ [Feature #4872] (work in progress)
+ * lib/rexml/xmldecl.rb (REXML::XMLDecl#write): Always use XMLDecl's
+ encoding.
+ * test/rexml/test_document.rb: Update tests for the above change.
- * lib/logger.rb (write, shift_log?, shift_log): file shifting race
- condition bug fixed. [ruby-dev:26764]
+Sat Nov 3 12:18:35 2012 Masaki Matsushita <glass.saga@gmail.com>
- * test/logger/test_logger.rb: tests.
+ * array.c (recursive_equal): fix not to make invalid pointers when
+ self and other are resized to same size in #== of their elements.
+ [ruby-dev:46373] [Feature #6177]
-Fri Aug 19 18:13:39 2005 Tanaka Akira <akr@m17n.org>
+Sat Nov 3 12:06:15 2012 Kouhei Sutou <kou@cozmixng.org>
- * lib/time.rb (Time.apply_offset): fix a problem with last day of
- month. reported by Lucas Nussbaum. [ruby-talk:152866]
+ * test/rexml/test_xml_declaration.rb (TestXmlDeclaration#test_*):
+ Remove needless prefix from test names.
-Thu Aug 18 12:46:28 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat Nov 3 12:04:52 2012 Kouhei Sutou <kou@cozmixng.org>
- * bcc32/Makefile.sub (COMMON_HEADERS): reverted 1.42.2.24.
- I misunderstood, bccwin32 on ruby_1_8 uses winsock2 originally.
- [ruby-dev:26806]
+ * test/rexml/test_xml_declaration_parent_child.rb: Rename to ...
+ * test/rexml/test_xml_declaration.rb: ... this.
- * win32/win32.h: include winsock2.h instead of winsock.h. (bcc32)
+Sat Nov 3 11:43:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Wed Aug 17 23:58:05 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c (rb_hash_delete): Correct grammar
+ Patch by Glenn Oppegard
+ [Fixes #208 Github]
- * object.c (rb_to_integer): argument constified.
+Sat Nov 3 11:28:28 2012 Narihiro Nakamura <authornari@gmail.com>
- * eval.c (terminate_process): take String message.
+ * NEWS: add a news about GC::Profiler.raw_data.
- * eval.c (rb_thread_switch): propagate the exception caused thread
- termination directly. fixed: [ruby-core:05552]
+Sat Nov 3 11:01:32 2012 Narihiro Nakamura <authornari@gmail.com>
-Wed Aug 17 00:05:46 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * NEWS: add a news about rb_newobj_of() and NEWOBJ_OF().
- * eval.c (rb_add_method): preserve safe level in the environment
- where a method is defined .
+Sat Nov 3 10:17:41 2012 Narihiro Nakamura <authornari@gmail.com>
- * eval.c (rb_call0): restore preserved safe level in the method
- execution.
+ * eval.c (f_current_dirname): add the new method for Kernel.
+ This method almost same as File.dirname(__FILE__). One
+ different behavior is it returns nil when __FILE__ returns nil.
+ [Feature #3346]
-Mon Aug 15 00:38:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * NEWS: ditto
- * eval.c (rb_rescue2): reduce PUSH_TAG() as well as NODE_RESCUE.
- [ruby-dev:26800]
+ * test/ruby/test_method.rb: related test.
- * range.c (range_check, range_init): reduce useless exceptions.
+Sat Nov 3 09:03:34 2012 Shugo Maeda <shugo@ruby-lang.org>
-Sat Aug 13 18:51:26 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_refinement.rb (test_new_method_by_send,
+ test_new_method_by_method_object): add tests for Kernel#send and
+ Kernel#method with refinements.
- * eval.c (rb_block_pass): distinguish current block from others.
- fixed: [ruby-dev:26274]
+ * test/ruby/test_refinement.rb (test_symbol_to_proc): add a test
+ calling a proc created by Symbol#to_proc outside the scope where
+ a refinement is closed over.
- * ext/stringio/stringio.c (strio_set_string): disallow nil.
- http://www.rubyist.net/~nobu/t/20050811.html#c05
+Sat Nov 3 04:14:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 11 23:29:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (rb_vm_rewrite_ep_in_errinfo): rewrite all catch points in
+ errinfo, not only the topmost frame. based on the patch by
+ ktsj (Kazuki Tsujimoto) in [ruby-dev:45656]. [Bug #6460]
- * ext/stringio/stringio.c: keep holding string after closed.
+Fri Nov 2 20:11:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 11 13:01:48 2005 Kouhei Sutou <kou@cozmixng.org>
+ * lib/mkmf.rb (MakeMakefile#timestamp_file): remove @ which looks like
+ configure variables.
- * lib/rss: fixed sort bug. [ruby-list:41018]
+ * lib/mkmf.rb (MakeMakefile#timestamp_file): use .-. instead of !, a
+ special character of NMAKE and BSD make. [Bug #7265]
- * lib/rss/1.0.rb (RSS::RDF::Channel#setup_maker_attributes):
- removed self.
+Fri Nov 2 17:55:39 2012 Shota Fukumori <sorah@tubusu.net>
- * lib/rss/maker/base.rb (RSS::Maker::ItemsBase#<=>): use #date
- instead of @date.
- (RSS::Maker::Base::self.def_array_element): added #size.
+ * lib/test/unit.rb (_run_parallel): Delete status line before showing
+ results. Patch by Hiroshi Shirosaki. [Bug #6897] [ruby-core:47250]
- * lib/rss/maker/1.0.rb
- (RSS::Maker::RSS10::Channel#to_rss,
- RSS::Maker::RSS10::Items::Item#to_rss): cleared dc_dates set
- upped by using #date.
+ * lib/test/unit.rb (_run_parallel): Fix strange result when disabled retrying.
+ Patch by Hiroshi Shirosaki. [Bug #6897] [ruby-core:47250]
- * lib/rss/maker/dublincore.rb
- (RSS::Maker::ChannelBase, RSS::Maker::ItemsBase::ItemBase):
- fixed opposite alias.
+Fri Nov 2 17:52:12 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test/rss/test_setup_maker_1.0.rb
- (RSS::TestSetupMaker10::test_setup_maker_items_sort): added some
- tests for RSS::Maker::ItemsBase#do_sort.
+ * object.c (rb_mod_to_s): Module#{to_s,inspect}, when invoked on
+ a refinement, returns a string in the format #<refinement:C@M>,
+ where C is a refined class and M is a module at which the refinement
+ is defined.
-Wed Aug 10 10:29:40 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * eval.c (rb_mod_refine): store information on a refinement for the
+ above change.
- * ext/tk/lib/tk.rb: fix bug on handling __ruby2val_optkeys().
+ * test/ruby/test_refinement.rb: related test.
- * ext/tk/lib/tk/itemconfig.rb: fix bug on handling
- __item_ruby2val_optkeys().
+Fri Nov 2 16:57:52 2012 Shota Fukumori <sorah@tubusu.net>
- * ext/tk/lib/tk/canvas.rb: didn't check __item_ruby2val_optkeys().
+ * vm_dump.c (rb_vm_bugreport): Because of many log directories,
+ making directory lists readable.
- * ext/tk/lib/tkextlib/blt/component.rb: ditto.
+Fri Nov 2 16:44:00 2012 Kenta Murata <mrkn@mrkn.jp>
-Tue Aug 9 15:12:04 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm_dump.c (rb_vm_bugreport): add ~/Library/Logs/DiagnosticReports
+ in the locations list of crash reports.
- * ext/tcltklib/tcltklib.c: remove dangerous 'rb_jump_tag's.
+Fri Nov 2 14:52:52 2012 Masaki Matsushita <glass.saga@gmail.com>
- * ext/tk/lib/tk.rb: add __val2ruby_optkeys and __ruby2val_optkeys to
- help to convert option values between ruby and tcl.
+ * array.c (recursive_equal): performance improvement by avoiding
+ overhead to call rb_ary_elt().
+ [ruby-dev:45412] [Feature #6177]
- * ext/tk/lib/tk/itemconfig.rb: add __item_val2ruby_optkeys and
- __item_ruby2val_optkeys to help to convert option values between
- ruby and tcl.
+Fri Nov 2 14:47:53 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/tk/lib/tk/radiobutton.rb: use __ruby2val_optkeys for 'variable'
- option (for the reason of backward compatibility).
+ * string.c (sym_to_proc, sym_call): A Proc created by Symbol#to_proc
+ should close over the current refinements.
+ [ruby-dev:46345] [Bug #7261]
- * ext/tk/lib/tk/composite.rb: clarify the arguments of super().
+ * vm_eval.c (rb_call0, rb_search_method_entry,
+ rb_funcall_passing_block_with_refinements): add a new argument
+ `refinements' for the above changes.
- * ext/tk/lib/tk/spinbox.rb: ditto.
+ * test/ruby/test_refinement.rb: related test.
- * ext/tk/lib/tk/text.rb: ditto.
+Fri Nov 2 08:24:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/validation.rb: ditto.
+ * proc.c (top_define_method): new method, main.define_method.
+ [ruby-core:45715] [Feature #6609]
- * ext/tk/lib/tkextlib/*: support to treat tkvariable-type
- configure options.
+ * eval.c (top_include): fix a warning message, main is not a class or
+ module.
-Tue Aug 9 20:30:19 2005 Tadashi Saito <shiba@mail2.accsnet.ne.jp>
+Fri Nov 2 04:41:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (rb_big_coerce): allow bignum x bignum coercing.
- [ruby-dev:26778]
+ * lib/mkmf.rb (MakeMakefile#timestamp_file): use ! instead of %, a GNU
+ make special character.
-Mon Aug 8 20:43:02 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Fri Nov 2 04:40:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_method.rb: added. [ruby-dev:26761]
+ * test/ruby/test_process.rb (test_execopts_preserve_env_on_exec_failure):
+ use never existing file in the current temporary directory.
-Sun Aug 7 23:50:14 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Fri Nov 2 04:23:20 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/ruby/test_super.rb: added from HEAD. [ruby-dev:26743]
+ * tool/merger.rb: add feature to tag preview/rc.
-Sun Aug 7 01:31:15 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Fri Nov 2 03:23:37 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/win32ole/win32ole.c (WIN32OLE_EVENT#on_event): should set
- only one event handler.
+ * lib/mkmf.rb: fix for if config["libdir"] is nil.
- * ext/win32ole/tests/testOLEEVENT.rb: ditto.
+Thu Nov 1 23:06:01 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/win32ole/tests/testOLEPARAM.rb: remove re-defined
- test_ole_type_detail method.
+ * tool/make-snapshot: fix wrong regexp for releasing preview.
+ patched by mame.
-Sat Aug 6 12:35:24 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Nov 1 22:27:11 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/{tk.rb,tk/itemconfig.rb}: configure creates
- TkVariable if key name is 'variable' or 'textvariable'
- by default. [ruby-dev:26749]
+ * NEWS: add a news about objspace,
+ ObjectSpace.reachable_objects_from.
- * ext/tk/lib/tk/{label,radiobutton}.rb: removed its own
- {variable,textvariable} function.
+Thu Nov 1 21:57:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * ext/tk/lib/tk/variable.rb: retains backward conpatibility.
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_new),
+ test/bigdecimal/test_bigdecimal.rb:
+ Fix exception message of BigDecimal constructor with a Float.
-Fri Aug 5 12:50:32 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Nov 1 21:52:20 2012 Kenta Murata <mrkn@mrkn.jp>
- * ext/tcltklib/tcltklib.c: fixed memory leak when tk_funcall raised
- exception. (copies argv into heap in tk_funcall instead of
- caller)
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_add),
+ test/bigdecimal/test_bigdecimal.rb:
+ need to specify precision for converting Rational and Float.
+ [ruby-core:48045] [Bug #7176]
-Fri Aug 5 12:42:57 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Nov 1 21:42:20 2012 Yusuke Endoh <mame@tsg.ne.jp>
- * lib/mkmf.rb (create_makefile): need to convert path separetor
- before invoking install command.
+ * test/ruby/test_process.rb: Revert r37404. My ubuntu box has
+ actually the directory named "/nonexistent"... Sorry.
-Fri Aug 5 00:27:04 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Nov 1 21:28:28 2012 Yusuke Endoh <mame@tsg.ne.jp>
- * ext/tcltklib/tcltklib.c: refactoring - extract ruby string <->
- tcl object conversion as get_str_from_obj and get_obj_from_str.
+ * test/ruby/test_process.rb: Process.exec raised EACCES on Linux
+ 3.5.0-17-generic. This is a temporal fix to rescue that exception.
+ Needs kosaki's review.
-Fri Aug 5 00:19:33 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 1 21:19:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * extmk.rb (extmake): needs to be wrapped in an Array.
+ * iseq.c (set_relation): parent_iseq need to be set regardless iseq
+ type. fix r37397.
-Thu Aug 4 18:38:36 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Nov 1 19:47:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tcltklib/tcltklib.c: cannot compile for Tcl7.6/Tk4.2.
+ * thread_pthread.c (RUBY_STACK_MIN): may not a compile time constant.
+ fix r37079. [ruby-dev:46322] [Bug #7247]
- * ext/tcltklib/tcltklib.c: add nativethread consistency check.
+Thu Nov 1 16:44:36 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/tcltklib/stubs.c: ditto.
+ * NEWS: add note for Module#refine, Module#refinements,
+ Module#using, and Kernel#using.
- * ext/tk/lib/tk.rb: forgot to define TclTkIp.encoding and encoding=
- when Tcl is 7.6 or 8.0.
+Thu Nov 1 14:41:47 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/tk/lib/tk/wm.rb: support to make some methods as options of
- root or toplevel widget. [ruby-talk:150336]
+ * eval.c (rb_using_module): using should be used indirectly.
+ [ruby-dev:46326] [Feature #7251]
- * ext/tk/lib/tk/root.rb: ditto.
+Wed Oct 31 18:17:38 2012 Narihiro Nakamura <authornari@gmail.com>
- * ext/tk/lib/tk/toplevel.rb: ditto.
+ * gc.c (gc_profile_record): don't define unused variables when
+ GC_PROFILE_MORE_DETAIL is 0.
- * ext/tk/lib/tkextlib/SUPPRT_STATUS: update RELEASE_DATE
+Wed Oct 31 18:10:53 2012 Narihiro Nakamura <authornari@gmail.com>
-Thu Aug 4 08:03:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (gc_prof_mark_timer_stop): count is not initialized.
- * ext/extmk.rb (extmake): should not modify $mflags for each
- extentions.
+Wed Oct 31 09:28:24 2012 Eric Hodel <drbrain@segment7.net>
-Thu Aug 4 00:25:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (rb_thread_call_without_gvl2): Note that ubf() may or may
+ not be called with the GVL. Hinted that rb_thread_call_with_gvl()
+ can be used to access ruby functionality.
- * common.mk, Makefile.in, {bcc32,win32,wince}/Makefile.sub: integrated
- macro definitions.
+Wed Oct 31 09:06:54 2012 Eric Hodel <drbrain@segment7.net>
- * bcc32/Makefile.sub: LIBRUBY_SO should use DLDOBJS, not EXTOBJS.
+ * thread.c (rb_thread_call_without_gvl2): Update documentation to
+ natural English.
+ * thread.c (rb_thread_call_with_gvl): ditto.
- * {win32,wince}/Makefile.sub: separate config.h for compiler versions.
+Wed Oct 31 02:53:07 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Aug 3 21:59:16 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/dl/lib/dl/struct.rb: fix strange require order. [ruby-dev:45702]
- * ext/tk/lib/tk/variable.rb: TkVariable#trace didn't work on
- TkVariable retrived from TkVariable.new_hash.ref. [ruby-dev:26721]
+ * ext/dl/lib/dl/value.rb: ditto
-Wed Aug 3 08:22:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/dl/test_c_struct_entry.rb: remove strange require order from
+ tests.
- * ext/socket/socket.c (ruby_connect): revert [ruby-talk:111654]
- changes at 2004-09-07. [ruby-dev:26656]
+ * test/dl/test_c_union_entity.rb: ditto
-Tue Aug 2 10:20:54 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Oct 30 23:59:32 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/tcltklib/tcltklib.c: use Tcl_[GS]etVar2Ex instead of
- Tcl_Obj[GS]etVar2. (avoid Tcl_NewStringObj on supported platforms)
+ * eval.c (rb_mod_refine): fix the error message when no block is
+ given. [ruby-dev:46319] [Bug #7244]
- * ext/tcltklib/tcltklib.c: use ip_{get,set,unset}_variable2_core from
- ip_{get,set,unset}_variable.
+ * test/ruby/test_refinement.rb: related test.
- * ext/tcltklib/tcltklib.c: replaced Tcl_Panic with rb_bug.
+Tue Oct 30 19:27:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Aug 2 01:41:28 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * process.c (redirect_dup2): set standard handles when new fd is stdio,
+ because if there is no allocated console at the moment Windows does
+ not automatically associate it for child process's standard handle.
+ this is adhoc workaround.
+ reported by Martin Thiede at [ruby-core:48542] [Bug #7239].
- * lib/ping.rb (Ping.pingecho): should rescue StandardError.
- [ruby-dev:26677]
+ * io.c (rb_cloexec_dup2): ditto.
-Mon Aug 1 19:09:41 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Oct 30 03:08:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tcltklib/tcltklib.c: refactoring - replaced rb_ivar_defined &
- rb_ivar_get with single rb_attr_get call.
+ * lib/rbconfig/obsolete.rb (Config): re-introduce warnings for a
+ lame-duck. [ruby-core:46836] [Bug #6809]
-Mon Aug 1 18:45:07 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Oct 30 02:20:10 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/tcltklib/tcltklib.c (Tcl_GetStringResult): refactoring - define
- alternative macro on Tcl7.x or earlier.
+ * thread.c: added Thread#thread_variable_(get|set),
+ Thread#thread_variable?, and Thread#thread_variables for operating
+ on variables that are local to threads. [ruby-core:47790]
-Mon Aug 1 13:57:35 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * vm.c: ditto
- * ext/tcltklib/tcltklib.c (deleted_ip): refactoring - interpreter
- deletion check. [ruby-dev:26664]
+ * test/ruby/test_thread.rb: tests for thread variables.
-Mon Aug 1 01:17:40 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Mon Oct 29 18:22:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/drb/drb.rb (check_insecure_method): use private_methods and
- protected_methods instead of respond_to? to check method visibility.
- [ruby-dev:26616]
+ * ext/stringio/stringio.c (strio_close): close separately per each
+ instances, as well as IO.
- * test/drb/drbtest.rb: ditto.
+Mon Oct 29 10:22:00 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * test/drb/ut_drb.rb: ditto.
+ * ext/psych/lib/psych/handlers/recorder.rb: added a class for
+ recording YAML parse and emit events.
-Mon Aug 1 00:07:32 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
- * lib/irb/context.rb: fix `irb --readline` option. [ruby-list:40955]
+ * ext/psych/lib/psych/handler.rb: adding a list of events so that
+ handler classes can more easily be meta-programmed.
-Fri Jul 29 09:59:38 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/psych/handlers/test_recorder.rb: tests for the change.
- * eval.c (rb_yield_0): push yielded node instead of yielding.
- fixed: [yarv-dev:549]
+Mon Oct 29 05:48:52 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Thu Jul 28 18:09:55 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/ostruct.rb: Add [] and []=, base on a patch by Thomas Sawyer.
+ Also accept {Open}Struct as argument to new.
+ Add #eql?, #hash & #each_pair
+ Protect new_ostruct_member
- * ext/tcltklib/stubs.c: When --enable-tcltk-stubs, the initialize
- routine creates a Tcl/Tk interpreter and deletes it. However,
- init cost of Tk's MainWindow is not so small. And that makes it
- impossible to use libraries written with Tcl functions only on
- an environment without a graphical display. This changes support
- delaying initalization of Tk_Stubs until the script needs Tk.
+Mon Oct 29 03:20:58 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * ext/tcltklib/stubs.h: New file. Define prototypes and return
- codes of functions on stubs.c.
+ * lib/matrix.rb: Fix determinant_e [ruby-dev:46305] [Bug #7228]
- * ext/tcltklib/tcltklib.c: Support delaying initalization of
- Tk_Stubs until the script needs Tk.
+Sun Oct 28 23:52:25 2012 Kouhei Sutou <kou@cozmixng.org>
- * ext/tcltklib/tcltklib.c: Show friendly error messages for errors
- on initialization.
+ * test/rexml/test_document.rb: Add tests for parsing XML encoded
+ by UTF-8 with BOM.
- * ext/tcltklib/tcltklib.c: Avoid SEGV on ip_finalize() when ruby is
- exiting and $DEBUG is true. (Not fix. If you know the reason of
- why, please fix it.)
+Sun Oct 28 23:47:09 2012 Kouhei Sutou <kou@cozmixng.org>
- * ext/tk/tkutil.c (ary2list, ary2list2): bug fix on handling of
- encoding.
+ * lib/rexml/source.rb: Move encoding detection code to base class.
+ * lib/rexml/encoding.rb: Remove needless encoding detection code.
- * ext/tk/lib/multi-tk.rb: MultiTkIp#eval_string and bg_eval_string
- don't work propery.
+Sun Oct 28 21:40:13 2012 Kouhei Sutou <kou@cozmixng.org>
- * ext/tk/lib/tk.rb: Forget extending Tk::Encoding module to Tk.
- * ext/tk/lib/tk/variable.rb: TkVarAccess fails to initialize the
- object for an element of a Tcl's array variable.
+ * lib/rexml/parsers/baseparser.rb: Fix a bug that UTF-8 is used
+ for UTF-16XX encoded XML that doesn't have encoding="UTF-16" in
+ XML declaration.
+ * test/rexml/test_document.rb: Add tests for the above change.
-Wed Jul 27 23:23:54 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Oct 28 21:37:34 2012 Kouhei Sutou <kou@cozmixng.org>
- * gc.c (obj_free): make message format consistent with one from
- gc_mark(). [ruby-talk:149668]
+ * test/rexml/test_document.rb: Group tests that they parse
+ UTF-16XX encoded XML that has encoding="UTF-16" in XML declaration.
-Wed Jul 27 22:11:37 2005 Kouhei Sutou <kou@cozmixng.org>
+Sun Oct 28 21:25:11 2012 Kouhei Sutou <kou@cozmixng.org>
- * sample/rss/tdiary_plugin: removed. because the plugin
- is imported in the tDiary plugin packages.
+ * lib/rexml/source.rb (REXML::IOSource#initialize): Reduce
+ @line_break initialize code. It should be done only in #encoding=.
+ * lib/rexml/parsers/baseparser.rb: Don't set UTF-16 encoding to
+ source by encoding="UTF-16" in XML declaration because UTF-16XX
+ source encoding should be set in Source#initialize or
+ IOSource#initialize. They should handle BOM. Parser should not
+ consider about it.
-Wed Jul 27 10:59:02 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Oct 28 21:18:37 2012 Kouhei Sutou <kou@cozmixng.org>
- * dir.c (dir_each): rewinddir(3) before iteration.
- [ruby-talk:149628]
+ * test/rexml/test_document.rb: Add tests for parsing XML encoded
+ by UTF-16 with BOM.
-Tue Jul 26 12:57:49 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Oct 28 19:12:11 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/openssl/openssl_missin.c: include <openssl/engine.h> before
- <openssl/x509_vfy.h> to avoid compilation error of mswin32.
- suggested by NAKAMURA Usaku.
+ * ext/date/date_parse.c (iso8601_{ext,bas}_time): should not match
+ empty string.
-Mon Jul 25 21:30:46 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Oct 28 18:51:33 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * {bcc32,win32,wince}/Makefile.sub: moved CPPFLAGS only for ruby
- source to XCFLAGS.
+ * ext/date/date_parse.c (date__parse): revised the tight parser.
-Mon Jul 25 13:45:18 2005 NAJIMA Hiroki <najima@mickey.ai.kyutech.ac.jp>
+Sun Oct 28 15:41:50 2012 Kouhei Sutou <kou@cozmixng.org>
- * io.c: check HAVE_SYS_IOCTL_H before including the header.
- [ruby-dev:26610]
+ * lib/rexml/document.rb (REXML::Document#write): Add :encoding option
+ to support custom XML encoding.
+ [Feature #4872] (work in progress)
+ * test/rexml/test_document.rb: Add tests for the above change.
-Mon Jul 25 14:10:02 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sun Oct 28 15:00:19 2012 Kouhei Sutou <kou@cozmixng.org>
- * ext/tk/lib/multi-tk.rb: fix en-bugged part in the last commit.
+ * lib/rexml/document.rb (REXML::Document#write): Remove needless
+ indent in document.
-Sat Jul 23 16:49:04 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Oct 28 14:59:14 2012 Kouhei Sutou <kou@cozmixng.org>
- * ext/openssl/ossl_engine.c (ossl_engine_s_load): should check
- OPENSSL_NO_STATIC_ENGINE.
+ * lib/rexml/document.rb (REXML::Document#write): Accept options
+ Hash as argument.
+ * test/rexml/test_document.rb: Add tests for the above change.
-Fri Jul 22 21:06:08 2005 Tadashi Saito <shiba@mail2.accsnet.ne.jp>
+Sun Oct 28 14:09:44 2012 Kouhei Sutou <kou@cozmixng.org>
- * bignum.c (rb_big_eq): reduce isnan(). [ruby-dev:26600]
+ * lib/rexml/document.rb (REXML::Document#write): Fix wrong usage
+ in document.
- * numeric.c (flo_eq, flo_gt, flo_ge, flo_lt, flo_le): ditto.
+Sun Oct 28 14:03:48 2012 Kouhei Sutou <kou@cozmixng.org>
-Fri Jul 22 15:02:39 2005 Kouhei Sutou <kou@cozmixng.org>
+ * lib/rexml/document.rb (REXML::Document#write): Fix wrong method
+ names in document.
- * lib/rss/rss.rb: moved copyright description to lib/rss.rb.
+Sun Oct 28 10:12:15 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/rss.rb: added for convenience.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: `tree` should return the
+ same thing on every call.
- * sample/rss/re_read.rb: added #to_s sample.
+ * test/psych/visitors/test_yaml_tree.rb: related test.
- * sample/rss/blend.rb: use 'require "rss"' instead of
- 'require "rss/*"'.
- * sample/rss/list_description.rb: ditto.
- * sample/rss/rss_recent.rb: ditto.
- * sample/rss/tdiary-plugin/rss-recent.rb: ditto.
+Sun Oct 28 10:05:03 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * sample/rss/tdiary-plugin/rss-recent.rb: 0.0.6 -> 0.0.7.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: YAML Tree object should
+ be able to take an emitter object as it's output.
-Fri Jul 22 14:37:43 2005 Kouhei Sutou <kou@cozmixng.org>
+ * test/psych/visitors/test_yaml_tree.rb: related test.
- * lib/rss/parser.rb (RSS::Parser#initialize): accept HTTP/FTP
- URI and local file path too.
+Sun Oct 28 08:23:16 2012 Koichi Sasada <ko1@atdot.net>
- * test/rss/test_parser.rb (RSS::TestParser#test_parse): test
- for the above.
+ * bignum.c (bignew_1): Bignum instances are frozen.
+ Feature #3222
-Fri Jul 22 07:01:42 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * include/ruby/ruby.h: Fixnum instances are also frozen.
- * ext/tk/tkutil.c (tk_conv_args): forget to revert thread_critical
- and gc_disable when raise ArgumentError.
+ * class.c (singleton_class_of): check Bignum before
+ singleton checking.
- * ext/tk/lib/remote-tk.rb: RemoteTkIp doesn't need to include TkUtil.
+ * test/ruby/test_bignum.rb: add a test.
- * ext/tcltklib/tcltklib.c: add TclTkIp#has_mainwindow? method.
+ * test/ruby/test_fixnum.rb: ditto.
- * ext/tk/lib/tk.rb: add Tk.has_mainwindow? method.
+ * test/ruby/marshaltestlib.rb, test/ruby/test_eval.rb,
+ test/ruby/test_object.rb: catch up above changes.
- * ext/tk/lib/multi-tk.rb: add MultiTkIp#has_mainwindow? method.
+Sun Oct 28 04:38:06 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/remote-tk.rb: add RemoteTkIp#has_mainwindow? method.
+ * vm.c (vm_define_method): remove type and frozen checking.
+ Checking is done in `rb_singleton_class()'.
- * ext/tk/lib/multi-tk.rb: slave IP fail to exit itself when $SAFE==4.
+Sun Oct 28 00:49:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/multi-tk.rb: remove constants from MultiTkIp module to
- avoid access from external.
+ * parse.y (assign_in_cond): warn for static content object assignments
+ in conditional statements. [ruby-dev:43083] [Feature #4299]
- * ext/tk/lib/multi-tk.rb: check_root flag is ignored on slave IPs'
- mainloop.
+Sat Oct 27 23:33:41 2012 Benoit Daloze <eregontp@gmail.com>
- * ext/tk/lib/multi-tk.rb: hang-up Tk.mainloop called on a slave IP
- with $SAFE==4.
+ * gc.c (gc_profile_result, gc_profile_report): use internal structures
+ to avoid allocations and progressively print the output for #report.
+ [ruby-core:47163] [Bug #6865]
- * ext/tk/lib/multi-tk.rb: MultiTkIp#bg_eval_proc doesn't work
- properly.
+Sat Oct 27 11:01:10 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/multi-tk.rb: add MultiTkIp#set_cb_error(proc) and
- cb_error(exc) to log errors at callbacks on safe slave IPs.
+ * numeric.c (rb_float_new_in_heap), include/ruby/ruby.h:
+ make all Float objects frozen.
+ [ruby-dev:46081] [ruby-trunk - Feature #6936]
+ Most part of patch by NARUSE, Yui <naruse@ruby-lang.org>.
- * ext/tk/lib/multi-tk.rb: fail to get an available slave IP object
- when call Tk.mainloop in the block which is given to new_* method,
- because cannot finish initialize while the root widget is alive.
+ * class.c (singleton_class_of): raise TypeError when
+ trying to define a singleton method on Float objects.
- * ext/tk/lib/multi-tk.rb: fail to control a slave IP when Tk.mainloop
- runs on the IP.
+ * vm.c (vm_define_method): ditto.
-Wed Jul 20 19:20:37 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/ruby/marshaltestlib.rb: catch up above changes.
- * io.c (S_ISREG): need to define S_ISREG before it is used first.
+ * test/ruby/test_class.rb: ditto.
-Wed Jul 20 18:40:50 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/test_pp.rb: ditto.
- * io.c (wsplit_p): patch for the environment where
- fcntl(F_GETFL, O_NONBLOCK) is not supported. in that case,
- set FMODE_WSPLIT without fcntl check. [ruby-dev:26566]
+Sat Oct 27 10:50:53 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Jul 20 18:07:11 2005 Tanaka Akira <akr@m17n.org>
+ * object.c (rb_mod_const_get): make sure the constant name is
+ converted to a string before searching. [ruby-core:48405]
- * io.c (rb_io_ctl): update FMODE_WSPLIT_INITIALIZED and FMODE_WSPLIT
- by F_SETFL.
+Sat Oct 27 10:12:13 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Wed Jul 20 10:04:51 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * iseq.c (rb_iseq_compile_with_option): Instead of testing
+ respond_to, just check if the argument is actually a file,
+ because by calling user-defined gets something weired can
+ happen. Patch by Glass_saga. [ruby-dev:40202] [Bug #2861]
- * variable.c (rb_class_path): need to adjust snprintf() len for
- teminating NUL. [ruby-dev:26581]
+ * parse.y (ripper_initialize): ditto.
-Wed Jul 20 04:01:55 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat Oct 27 10:07:57 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c: sorry, BeOS also uses HAVE_CLOSESOCKET,
- so reverted.
+ * parse.y (enum lex_state_e): [EXPERIMENTAL] lex_state as bit field /
+ IS_lex_state() macro. based on the patch by Dave B in
+ [ruby-core:23503]. [Feature #1493]
- * ext/socket/extconf.rb: should not define HAVE_CLOSESOCKET
- on windows.
+Sat Oct 27 10:05:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 20 03:16:43 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * include/ruby/win32.h (fstat): use _fstati64() instead of fstati64()
+ on mingw32.
- * ext/socket/socket.c: should not undef close() on win32.
- it's defined to rb_w32_close(), otherwise handle leaks.
- [ruby-Bugs-2131]
+Sat Oct 27 06:28:33 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Jul 20 00:48:16 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * object.c (rb_mod_const_get): const_get accepts qualified constant
+ strings. e.g. Object.const_get("Foo::Bar::Baz") [ruby-core:41404]
- * error.c (syserr_initialize): don't use str before StringValue()
- check. [ruby-dev:26579]
+ * test/ruby/test_module.rb: tests for new behavior
-Tue Jul 19 22:47:29 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Oct 26 13:24:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * error.c (syserr_initialize): add 1 byte for snprintf() size for
- NUL at the end. [ruby-dev:26574]
+ * parse.y (literal_concat_gen): merge fixed strings across
+ concatenated literals, after an interpolation.
-Tue Jul 19 16:39:46 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Oct 25 17:48:54 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * io.c (rb_io_inspect): replace sprintf() with "%s" format all
- over the place by snprintf() to avoid integer overflow.
+ * win32/win32.c (has_redirection): should use shell (cmd.exe) when
+ the commandline contains '&'.
+ reported by Roger Pack at [ruby-core:47912] [Bug #7143], and
+ patched by Heesob Park at [ruby-core:47931].
-Tue Jul 19 14:08:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Oct 25 15:00:08 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tcltklib/tcltklib.c: rbtk_eventloop_depth is used as int.
+ * include/ruby/ruby.h, class.c: remove (revert)
+ `rb_add_method_cfunc_frameless()' API.
+ This API is not mature to become an official API.
+ For example, we can not use this API with
+ `rb_define_private_method()'.
- * ext/tcltklib/tcltklib.c: rbtk_pending_exception is tested with
- NIL_P, so should assign Qnil instead of 0 (Qfalse).
+ * method.h, vm_method.c (rb_add_method_cfunc_frameless): removed.
- * ext/tcltklib/tcltklib.c (ip_invoke_real): fixed memory leak when
- ip is deleted.
+Thu Oct 25 13:35:07 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Jul 19 13:19:46 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * tool/mkconfig.rb: remove string literal concatenation.
- * ext/tk/lib/tk/variable.rb: For symmetry, add TkVariable#string. It
- returns a string even if the default value type of the TkVariable
- object is not "string".
+Wed Oct 24 18:49:16 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jul 18 21:40:20 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * ext/objspace/objspace.c (type2sym, count_objects_size): use enum
+ instead of size_t which may be larger than actual values.
- * eval.c (rb_call0): make the pointer to NODE volatile
- instead of NODE itself.
+Wed Oct 24 17:41:24 2012 Koichi Sasada <ko1@atdot.net>
-Mon Jul 18 14:32:21 2005 Tanaka Akira <akr@m17n.org>
+ * benchmark/driver.rb: add `-x' or `--exclude' option
+ to specify exclude benchmark name pattern.
+ You can specify "-x foo" if you want to exclude the benchmarks
+ if the name of benchmark contains `foo'.
- * eval.c (rb_call0): make body volatile to avoid optimization problem.
- [ruby-dev:26195]
+Wed Oct 24 11:57:24 2012 Narihiro Nakamura <authornari@gmail.com>
-Mon Jul 18 12:23:27 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * gc.c (gc_prepare_free_objects): rename to match the behavior of
+ this function.
- * ext/io/wait/wait.c: wrong backport from trunk. fixed: [ruby-dev:26562]
+Wed Oct 24 11:55:19 2012 Koichi Sasada <ko1@atdot.net>
-Mon Jul 18 09:36:25 2005 Tanaka Akira <akr@m17n.org>
+ * ext/objspace/objspace.c (reachable_object_from_i): change data
+ structure of the result of reachable objects. Keys of table
+ contains object_id of each reachable objects. Value of table
+ is an object itself or an instance of InternalObjectWrapper.
+ To avoid duplication, we use st_table and object_id keys.
- * rubyio.h (FMODE_WSPLIT, FMODE_WSPLIT_INITIALIZED): new constant.
+ * ext/objspace/objspace.c (type2sym): bug fix.
+ Should use `i' instead of `type'.
- * io.c (wsplit_p): new function.
- (io_fwrite): split writing data by PIPE_BUF if wsplit_p is true in
- multi-threaded mode.
- [ruby-dev:26540]
+Wed Oct 24 10:33:09 2012 Koichi Sasada <ko1@atdot.net>
-Sun Jul 17 13:46:54 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (garbage_collect, gc_marks): move the location of
+ clear and restore rb_objspace_t::mark_func_data
+ from garbage_collect() to gc_marks().
- * ext/io/wait/extconf.rb, ext/io/wait/wait.c: Win32 platforms support.
+Wed Oct 24 10:17:45 2012 Koichi Sasada <ko1@atdot.net>
-Fri Jul 15 23:59:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/objspace/objspace.c (Init_objspace): add a new method
+ `ObjectSpace::InternalObjectWrapper#internal_object_id' which returns
+ an object id of a wrapped internal object.
- * lib/rdoc/parsers/parse_c.rb (handle_class_module): handle a
- module enclosed in a built-in module. fixed: [ruby-talk:148239]
+Wed Oct 24 08:55:04 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rdoc/parsers/parse_c.rb (find_body): allow macros as methods.
+ * ext/objspace/objspace.c (ObjectSpace.reachable_objects_from):
+ internal object support.
+ If given object `obj' has references to internal objects
+ (such as T_NODE objects), then this method returns instances of
+ `ObjectSpace::InternalObjectWrapper' instead of that internal objects.
+ This instance contains a reference to an internal object and you can
+ check the type of internal object using
+ `ObjectSpace::InternalObjectWrapper#type' method.
+ Rdoc of `InternalObjectWrapper' is not prepared yet.
- * lib/rdoc/parsers/parse_c.rb (find_call_seq): allow :nodoc: modifier
- in C. [ruby-core:04572]
+ * gc.c (rb_objspace_reachable_objects_from), gc.h: change
+ an interface of 'rb_objspace_reachable_objects_from()'
-Fri Jul 15 18:00:01 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * gc.c, gc.h: add two APIs
+ - rb_objspace_markable_object_p(obj): check markable or not.
+ - rb_objspace_internal_object_p(obj): check internal or not.
- * bcc32/Makefile.sub (COMMON_HEADERS): ruby_1_8 is using winsock.h.
- failed to compile ext/socket on bcc5.6.4. [ruby-dev:26193]
+Wed Oct 24 05:52:36 2012 Koichi Sasada <ko1@atdot.net>
-Fri Jul 15 07:58:56 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * vm_insnhelper.c (vm_call_method): remove `default' and
+ add a case for `VM_METHOD_TYPE_UNDEF'.
- * lib/webrick/server.rb (WEBrick::GenericServer#accept_client):
- sockets should be non-blocking mode. [ruby-dev:26405]
+Wed Oct 24 05:41:18 2012 Koichi Sasada <ko1@atdot.net>
- * lib/webrick/utils.rb (WEBrick::Utils.set_non_blocking): new method.
+ * eval_error.c (error_print), vm_eval.c (eval_string_with_cref),
+ vm_trace.c (rb_suppress_tracing): use TH_PUSH_TAG() instead of
+ PUSH_TAG().
- * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#read_chunked):
- should call sock.read repeatedly until the preferred size data
- is obtained.
+Wed Oct 24 05:17:52 2012 Koichi Sasada <ko1@atdot.net>
-Thu Jul 14 18:27:16 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * vm_eval.c (vm_call0_body): remove RUBY_VM_CHECK_INTS()
+ after method invocation using rb_call0().
- * win32/win32.c (rb_w32_strerror): should return correct message
- for ENAMETOOLONG and ENOTEMPTY. (bcc32) [ruby-dev:26533]
+ * vm_eval.c (vm_call0_body): remove default section on top of
+ switch statement and add cases for `VM_METHOD_TYPE_CFUNC_FRAMELESS'
+ and `VM_METHOD_TYPE_UNDEF'.
- * win32/win32.c (rb_w32_strerror): stripped CR LF on the tail.
- (bcc32) [ruby-dev:26533]
+ * vm_eval.c (vm_call0_body): remove useless brackets.
-Thu Jul 14 00:45:42 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 23 22:34:49 2012 Koichi Sasada <ko1@atdot.net>
- * LEGAL (ext/nkf/nkf-utf8): updated from nkf1.7 to nkf-utf8.
+ * thread.c (thread_raise_m): check interrupts after Thread#raise
+ if a target thread is the current thread because the behavior
+ of Thread.current.raise is expected to perform same as
+ Kernel.raise (by rubyspec).
-Wed Jul 13 19:37:47 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Oct 23 17:08:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_mkdir): should set EEXIST (not EACCES)
- if file or directory already exists. (bcc32) [ruby-dev:26508]
+ * ruby.c (usage, process_options): show more info in --help.
+ [EXPERIMENTAL] [ruby-core:48072] [Bug #7184]
- * win32/win32.c (rb_w32_rmdir): should set ENOTDIR (not EINVAL)
- if it is not directory. (bcc32, win32)
+Tue Oct 23 14:20:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_rmdir, rb_w32_unlink): restore
- FILE_ATTRIBUTE_READONLY flag on function failure.
+ * misc/ruby-electric.el using variable `last-command-event' instead of
+ obsolete `last-command-char', so that work with Emacs trunk.
+ a patch by Victor Deryagin <vderyagin AT gmail.com>.
-Wed Jul 13 12:40:00 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Oct 23 14:06:47 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tcltklib/tcltklib.c: TclTkLib.do_one_event doesn't work.
+ * configure.in (visibility_option): visibility attribute is not
+ available before GCC 4, so do not use -fvisibility option in that
+ case. [ruby-core:48147] [Bug #7205]
- * ext/tk/lib/tk.rb: Tk.thread_update is available.
+Tue Oct 23 12:57:29 2012 Koichi Sasada <ko1@atdot.net>
-Tue Jul 12 23:32:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h, vm_insnhelper.c, vm_eval.c (OPT_CALL_CFUNC_WITHOUT_FRAME):
+ add a new optimization and its macro `OPT_CALL_CFUNC_WITHOUT_FRAME'.
+ This optimization makes all cfunc method calls `frameless', which
+ is faster than ordinal cfunc method call.
+ If `frame' is needed (for example, it calls another method with
+ `rb_funcall()'), then build a frame. In other words, this
+ optimization delays frame building.
+ However, to delay the frame building, we need additional overheads:
+ (1) Store the last call information.
+ (2) Check the delayed frame building before the frame is needed.
+ (3) Overhead to build a delayed frame.
+ rb_thread_t::passed_ci is storage of delayed cfunc call information.
+ (1) is lightweight because it is only 1 assignment to `passed_ci'.
+ To achieve (2), we modify GET_THREAD() to check `passed_ci' every
+ time. It causes 10% overhead on my environment.
+ This optimization only works for cfunc methods which do not need
+ their `frame'.
+ After evaluation on my environment, this optimization does not
+ effective every time. Because of this evaluation results, this
+ optimization is disabled at default.
- * lib/mkmf.rb: keep curdir unexpanded.
+ * vm_insnhelper.c, vm.c: add VM_PROFILE* macros to measure behaviour
+ of VM internals. I will extend this feature.
-Mon Jul 11 08:31:29 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_method.c, method.h: change parameters of the `invoker' function.
+ Receive `func' pointer as the first parameter.
- * regex.c (read_special): fix parsing backslashes following \c in
- regexp. fixed: [ruby-dev:26500]
+Tue Oct 23 06:21:05 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Mon Jul 11 02:53:00 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ext/psych/parser.c: just get the constant defined in Ruby.
- * lib/webrick/cgi.rb (WEBrick::CGI::Socket#request_line):
- mistook in merging the patch of [ruby-dev:26235] at
- revision 1.4.2.6.
+ * ext/psych/lib/psych/syntax_error.rb: Psych::SyntaxError now inherits
+ from StandardError rather than SyntaxError. Thanks Eric Hodel!
-Sun Jul 10 23:58:04 2005 Tanaka Akira <akr@m17n.org>
+ * test/psych/test_exception.rb: tests for change.
- * lib/pathname.rb (Pathname#unlink): try Dir.unlink first to
- avoid unlink a directory by root.
- cf. [ruby-dev:26237]
+Tue Oct 23 06:17:36 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun Jul 11 05:18:17 2005 Michael Neumann <mneumann@ruby-lang.org>
+ * ext/psych/lib/psych/scalar_scanner.rb: Cache symbols while
+ tokenizing. Thanks Kevin Menard!
- * lib/xmlrpc/server.rb (XMLRPC::Server): Switch from GServer over to
- WEBrick. This makes file lib/xmlrpc/httpserver.rb obsolete (at least it is
- no further used by the XML-RPC library).
+Tue Oct 23 06:15:40 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun Jul 10 12:47:01 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/lib/psych/scalar_scanner.rb: Updated the RegExp to catch
+ Strings earlier in the tokenization process. Thanks Kevin Menard!
- * lib/debug.rb (debug_command): added a deficient format specifier.
- fixed: [ruby-core:05419]
+Tue Oct 23 06:12:39 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sat Jul 9 21:28:46 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Handle nil tags specially
+ to avoid slow method_missing calls. Thanks Kevin Menard!
- * ext/win32ole/win32ole.c (ole_method_dispid): convert dispid
- in Ruby and C by INT2NUM and NUM2INT.
+Tue Oct 23 06:07:57 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/win32ole/win32ole.c (ole_invoke2): ditto.
+ * ext/psych/lib/psych/scalar_scanner.rb: Ignore bad timestamps. If
+ something looks like a timestamp but has an invalid component, treat
+ it as a string instead of throwing an ArgumentError.
+ Thanks Rhett Sutphin!
- * ext/win32ole/test/testWIN32OLE.rb: ditto.
+ * test/psych/test_scalar_scanner.rb: appropriate tests.
- * ext/win32ole/test/testOLEMETHOD.rb: ditto.
+Tue Oct 23 06:04:07 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Jul 8 15:45:04 2005 Kouhei Sutou <kou@cozmixng.org>
+ * ext/psych/lib/psych/scalar_scanner.rb: Fix scalar_scanner to
+ understand strings starting with an underscore and containing only
+ digits. Thanks Kelley Reynolds.
- * lib/rss/rss.rb (RSS::VERSION): 0.1.4 -> 0.1.5.
+ * test/psych/test_scalar_scanner.rb: test for fix
- * test/rss/test_version.rb (RSS::TestVersion#test_version):
- ditto.
+Tue Oct 23 06:00:41 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/rss/0.9.rb (RSS::Rss::Channel::Item::Category):
- domain attribute of <category> is optional. Thanks to
- Chris Lee <clee@kde.org>.
+ * ext/psych/lib/psych.rb: Changed comment in psych.rb to update new
+ home page for libyaml. Thanks to Carolyn Ann.
- * test/rss/test_parser.rb (RSS::TestParser#test_category20):
- adjusted test case.
+Sun Oct 21 19:12:59 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Tue Jul 5 23:44:06 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h (rb_vm_t::trace_running): add a new field
+ `trace_running' to store vm global tracing status.
- * instruby.rb: expand source library path.
+ * vm_trace.c: fix SEGV bug. event_hook was free'd
+ even when the hook is still used in another thread.
+ [ruby-dev:46141] [Bug #7032]
-Tue Jul 5 23:27:14 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Oct 21 19:12:42 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * array.c (sort_2): get rid of yet another bcc's bug.
- fixed: [ruby-core:05152]
+ * vm_core.h (rb_vm_t::trace_flag): remove `trace_flag'
+ which is no longer used.
- * eval.c (rb_thread_save_context): must not switch contexts during
- re-allocating stack. fixed: [ruby-core:05219]
+Sun Oct 21 18:34:27 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Tue Jul 5 15:15:10 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/date/date_parse.c (date__parse): uses more tight parser if
+ defined TIGHT_PARSER. now inactivated; because it introduces
+ incompatibilities and it is a bit slow.
- * ext/tk/tkutil.c: fix typo.
+Sat Oct 20 15:35:06 2012 Narihiro Nakamura <authornari@gmail.com>
-Tue Jul 5 14:51:35 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * include/ruby/ruby.h: add C APIs.
+ VALUE rb_newobj_of(VALUE klass, VALUE flags)
+ #define NEWOBJ_OF(obj,type,klass,flags)
+ These allow to change a allocation strategy depending on klass
+ or flags.
- * ext/tcltklib/tcltklib.c: bug fix on treating Unicode strings.
+ * gc.c: ditto
- * ext/tcltklib/tcltklib.c: add methods to treat encoding mode.
+ * array.c: use new C API.
+ * bignum.c: ditto
+ * class.c: ditto
+ * complex.c: ditto
+ * ext/socket/ancdata.c: ditto
+ * ext/socket/option.c: ditto
+ * hash.c: ditto
+ * io.c: ditto
+ * marshal.c: ditto
+ * numeric.c: ditto
+ * object.c: ditto
+ * random.c: ditto
+ * range.c: ditto
+ * rational.c: ditto
+ * re.c: ditto
+ * string.c: ditto
+ * struct.c: ditto
+ [Feature #7177][Feature #7047]
- * ext/tcltklib/MANUAL.eng: add description of TclTkLib#encoding,
- encoding_system, and so on.
+Sat Oct 20 12:50:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * ext/tcltklib/MANUAL.euc: ditto.
+ * ext/socket/socket.c: Documentation for Socket
+ Based on a patch by David Albert
+ [Bug #7105] [ruby-core:47828]
- * ext/tk/tkutil.c: fail to create a Tcl's list string from an
- array including multiple kind of encoded strings.
+Sat Oct 20 11:00:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * ext/tk/lib/tk.rb: ditto.
+ * lib/open-uri.rb: Documentation for OpenURI
- * ext/tk/lib/multi-tk.rb: 2nd arg of _{to|from}UTF8 is omissible.
+Sat Oct 20 06:18:34 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/tk/lib/remote-tk.rb: ditto.
+ * hash.c (initialize_copy): unset the default proc if there isn't one
+ for the target hash, call to_hash, check frozen status.
- * ext/tk/lib/tk.rb: override TclTkLib#encoding and encoding= to
- use TkCore::INTERP.encoding and encoding=.
+Fri Oct 19 22:22:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk.rb: when "require 'tk'" and $KCODE=='NONE', check
- DEFAULT_TK_ENCODING to decide Ruby/Tk's system encoding mode.
+ * vm.c (rb_vm_jump_tag_but_local_jump): pass through thrown objects.
+ [ruby-dev:46234] [Bug #7185]
- * ext/tk/lib/tk/encodedstr.rb: check both of Tk.encoding and
- Tk.encoding_system. Tk.encoding has higher priority.
+ * vm_eval.c (rb_eval_cmd): if state is non-zero, val should be nil and
+ rb_vm_jump_tag_but_local_jump() just jump tag.
- * ext/tk/lib/tk/optiondb.rb: ditto.
+Fri Oct 19 22:11:55 2012 Benoit Daloze <eregontp@gmail.com>
- * ext/tk/lib/tk/spinbox.rb: ditto.
+ * pack.c (pack_unpack): set encoding of the
+ 'H','h','B' and 'B' modifiers to US-ASCII.
- * ext/tk/lib/tk/validation.rb: ditto.
+ * test/ruby/test_pack.rb: tests for the above.
+ [ruby-core:47653][Bug #7050]
- * ext/tk/lib/tk/namespace.rb: arguemnts for TclTkIp#_merge_tklist
- should be UTF-8 strings.
+ * test/test_securerandom.rb: tests for SecureRandom.hex
+ from tenderlove. [ruby-core:46792][Bug #6799]
-Mon Jul 4 14:35:52 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Oct 19 19:29:11 2012 Koichi Sasada <ko1@atdot.net>
- * sample/svr.rb: service can be stopped by ill-behaved client; use
- tsvr.rb instead.
+ * method.h (rb_method_cfunc_t::invoker): add new field (func ptr)
+ `invoker'. `invoker' function invoke cfunc body
+ (rb_method_cfunc_t::func).
+ `invoker' is set at method definition timing.
+ With this change, the big `switch' (branch) in `call_cfunc()'
+ is no longer needed.
+ However, the performance benefit is only a bit.
-Mon Jul 4 13:25:21 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_core.h (rb_call_info_t::aux::func): add a new field to store
+ cfunc body function pointer.
- * missing/erf.c: original erf.c by prof. Okumura is confirmed to
- be public domain. reverted BSD implementation.
+ * vm_method.c (call_cfunc_invoker_func): add a new function which
+ returns a suitable invoke function.
-Mon Jul 4 11:15:37 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_method.c (setup_method_cfunc_struct): added.
- * test/{dbm,gdbm,sdbm}/test_{dbm,gdbm,sdbm}.rb: skip some tests
- which using fork on fork-less platforms.
+ * vm_method.c (rb_add_method): fix to set `invoker'.
-Sun Jul 3 23:26:30 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * vm_eval.c (vm_call0_body): catch up above changes.
- * test/wsdl/document/test_rpc.rb: compare formatted time string of
- Time objects instead of comparing Time objects itself to avoid
- unintended conflict of usec part. [ruby-dev:26220]
+ * vm_insnhelper.c (call_cfunc): removed.
-Sat Jul 2 22:41:04 2005 Tanaka Akira <akr@m17n.org>
+ * vm_insnhelper.c (vm_call_cfunc): fix to call cfunc body
+ with `invoker' function.
- * ext/socket/socket.c (unix_send_io, unix_recv_io): support x86-64 and
- IA64.
+Fri Oct 19 16:55:58 2012 Koichi Sasada <ko1@atdot.net>
-Sat Jul 2 17:06:23 2005 Tanaka Akira <akr@m17n.org>
+ * eval.c, vm_eval.c: use TH_PUSH_TAG() instead of PUSH_TAG().
- * defines.h (FLUSH_REGISTER_WINDOWS): defined for IA64.
- (flush_register_windows): declare flush_register_windows.
+Fri Oct 19 11:13:55 2012 Koichi Sasada <ko1@atdot.net>
- * eval.c (flush_register_windows): new function.
+ * benchmark/driver.rb: remove unexpected `output'.
+ (commit miss)
-Fri Jul 1 17:48:52 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Oct 19 10:24:03 2012 Koichi Sasada <ko1@atdot.net>
- * bignum.c (get2comp): revert all prior changes, and calculate
- proper 2's complement for negative numbers. backported from
- HEAD.
+ * vm_insnhelper.c (vm_search_method): remove needless local variable.
-Fri Jul 1 15:50:12 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Oct 19 10:22:26 2012 Koichi Sasada <ko1@atdot.net>
- * missing/erf.c: need to include some headers for some platforms.
+ * benchmark/bmx_temp.rb: removed.
+ This file should not be in repository.
- * win32/win32.h (copysign, scalb): define for compatibility with
- other platforms. [ruby-dev:26430]
+Fri Oct 19 10:20:10 2012 Koichi Sasada <ko1@atdot.net>
-Fri Jul 1 15:37:42 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * benchmark/driver.rb: add new option `--ruby-arg [ARG]'
+ which is passed as a launch parameter for each ruby's execution.
+ ($ ruby [ARG] [File])
- * missing/crypt.c: modified to make it compilable on platforms
- other than BSD. [ruby-dev:26430]
+Thu Oct 18 18:42:35 2012 Koichi Sasada <ko1@atdot.net>
- * missing/erf.c: ditto. code from <exp.c> merged.
+ * insns.def (opt_send_simple): move the location of
+ `opt_send_simple' to the place near `send' definition.
+ (to take care about icache locality).
-Fri Jul 1 12:44:56 2005 Tanaka Akira <akr@m17n.org>
+Thu Oct 18 18:29:25 2012 Koichi Sasada <ko1@atdot.net>
- * lib/open-uri.rb (OpenURI.open_http): refine post_connection_check
- call.
+ * insns.def (send): remove unused condition.
+ This condition will be true after r37258.
-Fri Jul 1 11:34:08 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_insnhelper.c (vm_caller_setup_args): remove `UNLIKELY' on
+ checking blockiseq (it seems `LIKELY').
- * missing/crypt.c: replaced with 4.4BSD version.
+Thu Oct 18 17:31:58 2012 Koichi Sasada <ko1@atdot.net>
- * missing/erf.c: ditto.
+ * insns.def (opt_send_simple): introduce new instruction used
+ when no need to care about block and splat.
- * missing/vsnprintf.c: removed the third provision from the old
- BSD license. [ruby-core:05177]
+ * compile.c: use the `opt_send_simple' instruction.
-Fri Jul 1 01:45:21 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Oct 18 16:44:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enum.c (enum_min, enum_max): must not return Qundef.
- fixed: [ruby-core:05299]
+ * vm_method.c (rb_add_method_cfunc, rb_add_method_cfunc_frameless):
+ check arity earlier at definition time.
-Fri Jul 1 00:18:40 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Oct 18 15:11:31 2012 Koichi Sasada <ko1@atdot.net>
- * lib/delegate.rb (Delegator::respond_to): respond_to? must check
- destination object. [ruby-talk:146894]
+ * vm_insnhelper.c: add `inline' keyword to several functions.
+ Compilers (gcc) are conservative than I expected.
-Thu Jun 30 19:00:21 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
- * lib/irb/ruby-lex.rb (RubyLex::identify_number): alternative implements
- for [ruby-dev:26410]. And support a numeric form of 0d99999.
+Thu Oct 18 15:01:15 2012 Koichi Sasada <ko1@atdot.net>
-Thu Jun 30 17:28:10 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/ruby.h: add a decl. of
+ `rb_define_frameless_method()'.
- * lib/irb/ruby-lex.rb (RubyLex::identify_number): should not treat
- plain zero as an octal number. [ruby-dev:26410]
+Thu Oct 18 14:31:17 2012 Koichi Sasada <ko1@atdot.net>
-Thu Jun 30 15:13:16 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * compile.c (new_callinfo): set a temporary index of callinfo
+ (used in `iseq_set_sequence()') to rb_call_info_t::aux::index.
+ rb_call_info_t::argc is initialized by same value of
+ rb_call_info_t::orig_argc.
- * eval.c (rb_eval): pre-evaluate argument for unambiguous
- evaluation order. [ruby-dev:26383]
+Thu Oct 18 14:11:08 2012 Koichi Sasada <ko1@atdot.net>
-Thu Jun 30 09:53:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * class.c (rb_define_frameless_method): rename from
+ rb_define_method_fast(). Defined method with this C API
+ does not make a method frame. It is bit lightweight than
+ ordinal C functions. Now only 0 or 1 argc are permitted.
- * lib/delegate.rb (Delegator::method_missing): forward unknown
- method to the destination. suggested by
- <christophe.poucet@gmail.com>. [ruby-talk:146776]
+ * method.h (VM_METHOD_TYPE_CFUNC_FRAMELESS): rename macro name
+ from VM_METHOD_TYPE_CFUNC_FAST.
-Tue Jun 28 21:59:29 2005 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * vm_insnhelper.c, vm_method.c: rename related functions.
- * dir.c, eval.c, hash.c, process.c, ruby.c: avoid warning "unused
- variable" [ruby-dev:26387]
+ * proc.c (rb_method_entry_arity): catch up above changes.
-Sat Jun 25 17:15:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Oct 18 10:30:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_query): should
- discard if key=val pair is empty. patch from Gary Wright.
+ * parse.y (assignable_gen): fail if yyerror occurred. fix a bug in
+ r36973.
-Sat Jun 25 23:30:51 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Oct 18 09:23:03 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * process.c (detach_process_watcher): terminate process watcher
- thread right after rb_waitpid() succeed. [ruby-talk:146430]
+ * hash.c (initialize_copy): duping should rehash the hash.
-Sat Jun 25 15:49:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_hash.rb: added a test to ensure rehash.
- * enum.c (enum_min, enum_max): do not ignore nil as the first element.
+Wed Oct 17 21:16:47 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Sat Jun 25 14:40:17 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * common.mk (WPROGRAM): need same dependencies as PROGRAM.
- * ext/sdbm/init.c (fsdbm_select): SDBM#select had returned the array
- which contained each elements twice. [ruby-dev:26358]
+ * cygwin/GNUmakefile.in (uncommon.mk): move include position
+ below WPROGRAM definition to be defined in uncommon.mk.
-Fri Jun 25 05:06:47 2005 Michael Neumann <mneumann@ruby-lang.org>
+ * ext/extmk.rb (all, static): fix make rubyw.exe failure with make -jN.
+ If make of ruby.exe and rubyw.exe run in parallel, link dll and link
+ exe run in parallel, which causes link failure on mingw. To fix this,
+ we make ruby.exe and rubyw.exe in one make process.
+ [ruby-core:48007] [Bug #7165]
- * lib/xmlrpc/*, test/xmlrpc/*: backported changes from HEAD into 1.8
+Wed Oct 17 16:25:34 2012 Koichi Sasada <ko1@atdot.net>
-Fri Jun 24 17:00:00 2005 Shigeo Kobayashi <shigeo@tinyforest.jp>
+ * benchmark/bm_vm2_method_missing.rb: add a benchmark to measure
+ performance of invoking `method_missing'.
- * ext/bigdecimal/bigdecimal.c: patch from "NATORI Shin"
- (u-tokyo.ac.jp) applied to fix rounding bug.
+Wed Oct 17 16:23:17 2012 Koichi Sasada <ko1@atdot.net>
-Fri Jun 24 13:06:45 2005 akira yamada <akira@ruby-lang.org>
+ * vm_insnhelper.c (vm_getivar): fix to use `aux.index' instead of
+ `aux.opt_pc'.
- * lib/uri/common.rb, lib/uri/generic.rb: fixed typo in documents and
- replaced some existent domain name with "example.com".
+Wed Oct 17 16:03:54 2012 Koichi Sasada <ko1@atdot.net>
-Fri Jun 24 12:23:19 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm_insnhelper.c (vm_call_method_missing): make a refactoring
+ about method_missing process. Use `vm_call_method()' to invoke
+ `method_missing' method instead of `rb_funcall2()'.
+ In `vm_call_method()', set fastpath to `vm_call_method_missing()'
+ if it can be cached.
- * ext/tk/lib/tk.rb: fix typo on Tk.grid_propagate.
+ * vm_core.h (rb_call_info_t): add new field
+ `rb_call_info_t::aux::missing_reason' to pass the reason to
+ `vm_call_method_missing()'.
- * ext/tk/lib/tk.rb: Tk.event_generate and TkWindow#event_generate
- accept TkEvent::Event object as context argument.
+Wed Oct 17 15:33:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/event.rb: add TkEvent::Event#valid_fields and
- valid_for_generate to get field parameters of event_generate.
+ * configure.in (opt-dir): allow multiple directories separated by
+ $PATH_SEPARATOR as well as dir_config in mkmf.rb. [ruby-core:47868]
+ [Bug #7120]
-Thu Jun 23 23:55:59 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Oct 17 15:08:13 2012 Shugo Maeda <shugo@ruby-lang.org>
- * runruby.rb: should load built rbconfig.rb.
+ * lib/net/imap.rb: fix Net::IMAP::ResponseParser to accept
+ message/delivery-status ([ruby-core:47920] [Bug #7146]),
+ message/rfc822 attachments ([ruby-core:47921] [Bug #7147]), and
+ (BODY ("MIXED")) ([ruby-core:47951] [Bug #7153]).
+ patched by Tony Arkles.
-Thu Jun 23 16:53:15 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/net/imap/test_imap_response_parser.rb: related test.
- * ext/tk/lib/tk/canvastag.rb: TkcGroup.new cannot include given items.
- TkcGroup#exclude calls wrong method.
- Add alias TkcGroup#add [ruby-talk:146049].
+Wed Oct 17 11:04:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/lib/tk/canvas.rb: TkCanvas#dtag and some subcommands of
- TkCanvas#addtag fail to treat a TkcTag argument.
+ * test/ruby/test_hash.rb (TestHash#test_dup_equality): added a new test
+ to show the problem of r37232.
- * ext/tk/lib/tk/event.rb: add TkEvent::Event#generate to help to send
- current event to other widgets.
+Wed Oct 17 10:48:40 2012 Shugo Maeda <shugo@ruby-lang.org>
-Mon Jun 20 18:44:04 2005 Tanaka Akira <akr@m17n.org>
+ * vm_insnhelper.c (vm_search_method): fix a build error that occurs
+ when OPT_INLINE_METHOD_CACHE is 0.
- * eval.c (FUNCTION_CALL_MAY_RETURN_TWICE): DUMMY_SETJMP is replaced
- because setjmp is not enough to fix getcontext and SPARC register
- window problem.
+Wed Oct 17 08:46:47 2012 Koichi Sasada <ko1@atdot.net>
-Mon Jun 20 16:48:36 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * benchmark/bm_vm2_dstr.rb: add a benchmark to measure
+ performance of dynamic generated string ("foo#{bar}baz").
- * ext/dbm/dbm.c (fdbm_closed): new method DBM#closed?
+Wed Oct 17 08:32:46 2012 Koichi Sasada <ko1@atdot.net>
- * ext/gdbm/gdbm.c (fgdbm_closed): new method GDBM#closed?
+ * compile.c (compile_dstr_fragments): use `putobject' instead of
+ `putstring' for all of strings used by NODE_DSTR because
+ ruby users can not grab this string.
+ For example, the string object of "baz" in "foo#{bar}baz"
+ is located by `putobject' (users can not touch "baz" object
+ directly). This change reduces GC pressure.
+ This improvement is suggested by Aaron Patterson.
- * ext/sdbm/init.c (fsdbm_closed): new method SDBM#closed?
+Wed Oct 17 08:02:57 2012 Koichi Sasada <ko1@atdot.net>
- * test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb, test/sdbm/test_sdbm.rb
- (teardown): close all db objects before deleting data files.
+ * thread.c (rb_threadptr_interrupt_mask): fix to check interrupt
+ after interrupt_mask changed.
- * win32/win32.{ch} (unlink): hook runtime function to change
- file attribute before unlinking.
- fixed: [ruby-dev:26360]
+Wed Oct 17 06:42:47 2012 Koichi Sasada <ko1@atdot.net>
-Mon Jun 20 02:15:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_method): fix to return value immediately.
+ Remove CHECK_INTS() after that method dispatch.
- * gc.c (define_final): document fix: finalizers never get called
- before target object is destroyed.
+Wed Oct 17 06:25:56 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Mon Jun 20 01:26:49 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * hash.c (initialize_copy): copy the underlying st_table on dup,
+ rather than copying the hash key by key. [ruby-core:48009]
- * ext/openssl/openssl_missing.c, ext/openssl/ossl.h,
- ext/openssl/ossl_asn1.c, ext/openssl/ossl_bio.c,
- ext/openssl/ossl_pkcs12.h, ext/openssl/ossl_x509req.c: avoid
- compiler warnings. suggested by Michal Rokos.
+ * test/ruby/test_hash.rb: relevant tests for initialize_copy
-Sun Jun 19 14:09:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Oct 17 06:17:44 2012 Koichi Sasada <ko1@atdot.net>
- * gc.c (run_final): reduce unnecessary object allocation during
- finalization.
+ * vm_insnhelper.c (vm_call_iseq_setup_2): separate tailcall and normal
+ method frame setup functions.
+ Add checking interrupts at the tailcall setup function.
- * gc.c (rb_gc_call_finalizer_at_exit): deferred finalizers list should
- be cleared before calling them. fixed: [ruby-talk:145790]
+Wed Oct 17 05:35:37 2012 Koichi Sasada <ko1@atdot.net>
-Fri Jun 17 13:01:40 2005 Tanaka Akira <akr@m17n.org>
+ * benchmark/bm_vm1_yield.rb: add a benchmark to measure `yield'
+ (invoke empty block) performance.
- * lib/time.rb (Time.parse): fix previous leap seconds support.
- (Time.rfc2822): ditto.
- (Time.xmlschema): ditto.
+ * benchmark/bm_vm2_method_with_block.rb: add a benchmark to measure
+ method invocation with empty block.
-Thu Jun 16 15:06:55 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Oct 17 05:05:07 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tcltklib/tcltklib.c (ip_rb_threadVwaitCommand): Tcl_Release
- was missing.
+ * vm_insnhelper.c (vm_invoke_block): vm_caller_setup_args() can skip
+ when splat flag is not set.
-Thu Jun 16 13:34:48 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Oct 17 01:53:47 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk.rb: add Tk.getMultiple{Open|Save}File() which return
- an Array of selected files.
+ * vm_insnhelper.c (vm_getivar, vm_setivar): support index inline cache
+ with rb_call_info_t to speedup `attr' getter and setter.
+ Cached index is stored in rb_call_info_t::aux::index.
+ `index' == 0 means not cached. `index' > 0 means cached and cached
+ index is `index - 1'.
-Thu Jun 16 12:53:24 2005 Tanaka Akira <akr@m17n.org>
+ * insns.def ((get|set)instancevariable): use new wrapper functions
+ vm_(get|set)instancevariable() defined in vm_insnhelper.c.
- * lib/time.rb (Time.parse): "Fri Jan 1 08:59:60 +0900 1999" was
- parsed as "Fri Jan 01 09:00:00 JST 1999" even on an environment
- which supports leap seconds.
- (Time.rfc2822): ditto.
- (Time.xmlschema): ditto.
+ * vm_core.h (rb_call_info_t::aux): introduce new union data because
+ opt_pc can share with index.
-Thu Jun 16 08:29:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Oct 16 22:24:44 2012 Koichi Sasada <ko1@atdot.net>
- * ext/dl/sym.c (rb_dlsym_call): needs FREE_ARGS before return.
- fixed memory leak. [ruby-Bugs-2034]
+ * benchmark/driver.rb (show_results): Show speedup ratio
+ with first executables score at last of results
+ if two or more executables are given.
-Wed Jun 15 18:26:39 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Oct 16 21:59:01 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk.rb: support "tk inactive" sub-command [for Tcl/Tk8.5a3]
+ * benchmark/driver.rb: some refactoring.
+ (1) Remove `average differential'.
+ In this benchmark driver, We should not care about `average'.
+ We use fastest score because this score should not include
+ any disturbances (affections of background process, etc).
+ If you care about timing affect, I recommend `median'
+ score with more than 5 examinations rather than simple
+ `average' score (`average' score was affected by error scores).
+ (2) Show log file name.
+ (3) Change default directory from './' to driver's directory.
- * ext/tk/lib/tk/namespace.rb: support "namespace path" sub-command and
- 'namespace ensemble' sub-command [for Tcl/Tk8.5a3]
+Tue Oct 16 14:56:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jun 14 02:02:43 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * file.c (rb_file_join): need to check again after any conversion run.
+ [ruby-core:48012] [Bug #7168]
- * ext/tk/tkutil.c: add TkUtil::CallbackSubst.subst_arg(m, ...) &
- _define_attribute_aliases(hash) to get substitution-argument from
- attributes (e.g. subst_arg(:x,:y,:num,:button) --> "%x %y %b %b ").
+Tue Oct 16 12:52:14 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * ext/tk/lib/tk/event.rb: use _define_attribute_aliases().
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_file):
+ rename from file_assertion.
-Mon Jun 13 13:01:05 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Oct 16 11:30:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * hash.c (ruby_setenv): fixed SEGV. [ruby-dev:26186]
+ * file.c (rb_file_join): hide the result under construction until
+ return.
-Mon Jun 13 01:54:20 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * file.c (rb_file_join): check nul-byte only for strings, since
+ FilePathStringValue() does it. [ruby-core:48012] [Bug #7168]
- * signal.c (sigexit): call rb_thread_signal_exit() instead of
- rb_exit(). [ruby-dev:26347]
+ * file.c (rb_file_join): path names must be ASCII-compatible.
+ [ruby-core:48012] [Bug #7168]
- * eval.c (rb_thread_signal_exit): a new function to exit on main
- thread.
+ * file.c (check_path_encoding): new function to ensure path name
+ encoding to be ASCII-compatible.
- * eval.c (rb_thread_switch): exit status should be retrieved from
- ruby_errinfo.
+Tue Oct 16 09:40:04 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (rb_f_exit): ensure exit(0) should call
- exit(EXIT_SUCCESS).
+ * test/ruby/test_regexp.rb
+ (TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): use
+ Regexp.new instead of literal to ignore a parser warning.
-Mon Jun 13 01:20:02 2005 Tanaka Akira <akr@m17n.org>
+Tue Oct 16 09:30:30 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (rb_gc_mark_threads): curr_thread may not be part of the
- thread list. [ruby-dev:26312]
+ * test/ruby/test_regexp.rb
+ (TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): ignoring
+ warnings are already set in setup method.
-Fri Jun 10 23:35:34 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Oct 16 06:44:06 2012 Koichi Sasada <ko1@atdot.net>
- * missing/mkdir.c: remove. [ruby-core:05177]
+ * vm_insnhelper.c (VM_CALLEE_SETUP_ARG): fix wrong condition.
-Fri Jun 10 22:54:26 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 16 06:29:18 2012 Koichi Sasada <ko1@atdot.net>
- * missing.h: fd_set stuffs need sys/types.h. fixed: [ruby-core:05179]
+ * vm_insnhelper.c (vm_call_method): disable CI_SET_FASTPATH() if
+ this method call needs splat argument because cached functions
+ (vm_call_attrset, vm_call_ivar, vm_call_cfunc_fast_(unary|binary))
+ do not check an arity.
-Thu Jun 9 23:58:12 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bootstraptest/test_method.rb: add a test to check an above issue.
- * ext/Win32API/Win32API.c (Win32API_Call): disable global
- optimization. fixed: [ruby-core:05143]
+Tue Oct 16 06:15:44 2012 Koichi Sasada <ko1@atdot.net>
-Thu Jun 9 23:35:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * method.h: introduce new method type VM_METHOD_TYPE_CFUNC_FAST.
+ This method is similar to VM_METHOD_TYPE_CFUNC methods, but
+ called cfunc without building new frame (does not push new control
+ frame). If error is occurred in cfunc, the backtrace only shows
+ caller frame and upper.
+ This kind of methods can be added by rb_define_method_fast().
+ This feature is similar to specialized instructions (opt_plus, etc),
+ but more flexible (but a bit slower).
- * enum.c (enum_inject): default the result value to Qundef to use
- first element as initial value if not given.
+ * class.c (rb_define_method_fast): added.
+ Maybe it will be renamed soon.
-Thu Jun 9 19:55:41 2005 Tanaka Akira <akr@m17n.org>
+ * vm_insnhelper.c (vm_call_method): support method type
+ VM_METHOD_TYPE_CFUNC_FAST.
- * eval.c (ruby_longjmp): new macro to call longjmp, setcontext, etc.
- (ruby_setjmp): new macro to call setjmp, getcontext, etc.
- (ruby_setjmp): call setjmp before getcontext to avoid IA64 register
- stack problem.
- [ruby-talk:144939]
+ * proc.c (rb_method_entry_arity): catch up new method type.
- * gc.c (Init_stack): remove IA64_MAGIC_STACK_LIMIT.
+ * vm_method.c (rb_add_method_cfunc_fast): added.
-Thu Jun 9 11:55:34 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Oct 16 02:32:29 2012 Koichi Sasada <ko1@atdot.net>
- * lib/delegate.rb (SimpleDelegator::__setobj__): need check for
- recursive delegation. [ruby-core:04940]
+ * vm_insnhelper.h (CI_SET_FASTPATH): add new parameter `enabled'.
+ If `enable' is 0 then CI_SET_FASTPATH() doesn't work.
+ And add new configuration option OPT_CALL_FASTPATH. If this macro
+ was defined by 0, then CI_SET_FASTPATH() doesn't work any more.
-Wed Jun 8 18:47:10 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_method): Pass `0' for `enabled' parameter
+ of CI_SET_FASTPATH if this method is protected.
- * misc/ruby-mode.el (ruby-expr-beg): fix looking point drift.
+Tue Oct 16 02:17:35 2012 Koichi Sasada <ko1@atdot.net>
-Wed Jun 8 11:11:34 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_core.h (VM_CALL_*): rename VM_CALL_*_BIT
+ to VM_CALL_* (remove `_BIT' suffix).
+ Add comments on each macros.
+ Remove unused macro VM_CALL_TAILRECURSION_BIT.
- * bignum.c (get2comp): calculate proper 2's complement for
- negative numbers. a bug in normalizing negative numbers
- reported from Honda Hiroki <hhonda@ipflex.com>.
+ * compile.c, iseq.c, insns.def, vm_insnhelper.c: ditto.
-Wed Jun 8 08:33:10 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Oct 15 22:14:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enum.c (enum_min_by, enum_max_by): return nil if no iteration.
- fixed: [ruby-dev:26245]
+ * test/ruby/envutil.rb (Test::Unit::Assertions#file_assertion):
+ rewrite file assertions.
- * eval.c (rb_need_block): ensure a block is given.
+Mon Oct 15 09:41:17 2012 Koichi Sasada <ko1@atdot.net>
- * eval.c (backtrace): skip successive frames sharing same node.
+ * vm_insnhelper.c (VM_CALLEE_SETUP_ARG): skip CI_SET_FASTPATH() if
+ it was called from vm_yield_setup_args().
-Wed Jun 8 00:15:08 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Oct 15 05:20:13 2012 Koichi Sasada <ko1@atdot.net>
- * ext/socket/socket.c (ruby_getaddrinfo__aix): merged a patch from
- KUBO Takehiro <kubo at jiubao.org> to support AIX. [ruby-list:40832]
+ * vm_insnhelper.h CI_SET_FASTPATH: introduce new macro
+ `CI_SET_FASTPATH(ci, func)'. This macro set `ci->call' as `func'.
+ `func' (ci->call) is called at the last of `send'
+ (and `invokesuper') instruction.
+ `CI_SET_FASTPATH' does not set `ci->call' when the method
+ (stored in `ci->me') is `protected'.
-Wed Jun 8 00:09:01 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_method): use `CI_SET_FASTPATH'.
+ After several checking (visibility, argc checking), the result of
+ checking can be reused until re-definition of this method
+ with inline method cache.
- * lib/yaml/rubytypes.rb (Array::to_yaml): merged a patch from
- Tilman Sauerbeck <tilman at code-monkey.de>. [ruby-core:05055]
+ Note that this optimization is now experimental.
+ If you find any problem about it, please tell us.
- * lib/yaml/rubytypes.rb (Hash::to_yaml): ditto.
+Mon Oct 15 04:51:55 2012 Koichi Sasada <ko1@atdot.net>
-Wed Jun 8 00:00:01 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_insnhelper.c: refactoring.
+ - move all `call' related functions to the last of file.
+ - make functions for respective method types in vm_call_method().
+ (all functions have same function parameters)
- * ext/curses/curses.c (curses_insertln): merged a patch from
- TAKAHASHI Tamotsu <ttakah at lapis.plala.or.jp>. [ruby-ext:02305]
+ * vm_core.h: add `opt_pc' field in `rb_call_info_t'
+ as temporal variable.
-Tue Jun 7 19:34:15 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_eval.c (vm_call0_body): catch up above changes.
- * lib/irb/init.rb (IRB::IRB.rc_file_generators): more flexible
- IRB.rc_file_generators. [ruby-core:05163]
+Mon Oct 15 03:51:46 2012 Koichi Sasada <ko1@atdot.net>
-Tue Jun 7 18:39:31 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * benchmark/bm_vm1_attr_ivar(_set).rb: added (for method dispatch speed).
- * lib/thread.rb: RDoc documentation from Eric Hodel
- <drbrain at segment7.net> added. [ruby-core:05148]
+ * benchmark/bm_vm1_float_simple.rb: added (for flonum/float).
-Tue Jun 7 18:30:04 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Oct 15 02:51:16 2012 Koichi Sasada <ko1@atdot.net>
- * lib/mkmf.rb (create_makefile): add .SUFFIXES from depend file.
- fixed: [ruby-dev:26294]
+ * vm_eval.c (vm_call0_body): add new function.
+ `vm_call0()' makes call_info struct and calls `vm_call0_body()'
+ with this struct. In near future, `vm_call0()' will be removed
+ because all of `vm_call0()' users setup call_info struct by itself.
-Tue Jun 7 17:39:54 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Oct 15 01:38:06 2012 Koichi Sasada <ko1@atdot.net>
- * object.c (rb_mod_cvar_get): Module#class_variable_get(): back
- ported from CVS HEAD. [ruby-talk:144741]
+ * insns.def (send, invokesuper, invokeblock, opt_*), vm_core.h:
+ use only a `ci' (rb_call_info_t) parameter instead of using
+ parameters such as `op_id', 'op_argc', `blockiseq' and flag.
+ These information are stored in rb_call_info_t at the compile
+ time.
+ This technique simplifies parameter passing at related
+ function calls (~10% speedups for simple method invocation at
+ my machine).
+ `rb_call_info_t' also has new function pointer variable `call'.
+ This `call' variable enables to customize method (block)
+ invocation process for each place. However, it always call
+ `vm_call_general()' at this changes.
+ `rb_call_info_t' also has temporary variables for method
+ (block) invocation.
- * object.c (rb_mod_cvar_set): Module#class_variable_set().
- [ruby-talk:144741]
+ * vm_core.h, compile.c, insns.def: introduce VM_CALL_ARGS_SKIP_SETUP
+ VM_CALL macro. This flag indicates that this call can skip
+ caller_setup (block arg and splat arg).
-Tue Jun 7 16:32:53 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * compile.c: catch up above changes.
- * sprintf.c (rb_f_sprintf): raise exception on debug mode (-d),
- not verbose mode (-v/-w). [ruby-core:05123]
+ * iseq.c: catch up above changes (especially for TS_CALLINFO).
-Tue Jun 7 10:30:49 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * tool/instruction.rb: catch up above changes.
- * ext/tk/lib/multi-tk.rb: slave-ip fails to call procedures
- delegated by master-ip.
+ * vm_insnhelper.c, vm_insnhelper.h: ditto. Macros and functions
+ parameters are changed.
-Sun Jun 5 23:00:35 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm_eval.c (vm_call0): ditto (it will be rewritten soon).
- * ext/tk/lib/tk/console.rb: create console when required
+Sun Oct 14 12:30:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/sample/tkextlib/tile/demo.rb: fix TypeError & create Console
+ * ruby.c (rb_f_sub, rb_f_gsub): pass the given block.
+ [ruby-core:47967] [Bug #7157]
-Sat Jun 4 14:55:18 2005 Tanaka Akira <akr@m17n.org>
+Sat Oct 13 23:15:39 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/dbm/test_dbm.rb: merged from ext/dbm/testdbm.rb.
+ * regparse.c (parse_char_class): should match with a hyphen after a
+ range in a character class.
- * test/gdbm/test_gdbm.rb: merged from ext/gdbm/testgdbm.rb.
+ * test/ruby/test_regexp.rb (TestRegexp#test_char_class): fixed wrong
+ test.
- * test/sdbm/test_sdbm.rb: renamed from ext/sdbm/testsdbm.rb with
- modification to use test/unit.
+ * test/ruby/test_regexp.rb (TestRegexp#check): now can accept the
+ error message.
-Fri Jun 3 14:06:12 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/ruby/test_regexp.rb
+ (TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): renamed
+ because the previous name was wrong.
- * ext/tk/lib/multi-tk.rb: fix typo.
+ * test/ruby/test_regexp.rb
+ (TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): added
+ more test pattern.
-Wed Jun 1 11:32:42 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat Oct 13 03:01:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bcc32/Makefile.sub: can use single quote character in DESTDIR.
- [ruby-dev:26205]
+ * file.c (realpath_rec): prevent link from GC while link_names refers
+ the content.
-Mon May 30 23:48:29 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat Oct 13 01:37:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/lib/tk/macpkg.rb: add PACKAGE_NAME information of Tcl/Tk
- Extension.
+ * test/ruby/test_regexp.rb
+ (TestRegexp#test_raw_hyphen_and_type_char_after_range): added new
+ test. ref [ruby-core:47115] [Backport #6853]
- * ext/tk/lib/tk/msgcat.rb: ditto.
+Fri Oct 12 21:55:08 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * ext/tk/lib/tk/winpkg.rb: ditto.
+ * include/ruby/win32.h (rb_w32_pow): set floating point precision
+ for mingw-w64 x86 pow(). This improves the precision of pow() on
+ Windows XP for TestFloat#test_round_with_precision failure.
+ [ruby-core:47911] [Bug #7142]
- * ext/tk/lib/tkextlib/*: ditto.
+Fri Oct 12 21:37:25 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Sat May 28 16:40:15 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/webrick/test_cgi.rb (TestWEBrickCGI#test_cgi): skip a test
+ depending on locale on Windows. ENV[] doesn't work properly if
+ console code page is not equal to file system encoding.
+ [ruby-core:47910] [Bug #7140]
- * test/openssl/test_x509store.rb: add test for expired CRL
- and refine some assertions.
+Fri Oct 12 20:40:29 2012 Tanaka Akira <akr@fsij.org>
-Sat May 28 05:15:51 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * process.c (posix_sh_cmds): the command name of colon is ":".
- * ext/openssl/ossl_x509store.c (ossl_x509stctx_set_time): should
- not set internal flag directry.
+Fri Oct 12 18:18:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat May 28 02:00:11 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * file.c (rb_get_path_check): path name must not contain NUL bytes.
- * lib/webrick/cgi.rb (WEBrick::CGI::Socket#request_line):
- ENV["REQUEST_URI"] is better to get correct Request-URI
- than ENV["SCRIPT_NAME"] + ENV["PATH_INFO"]. [ruby-dev:26235]
+Fri Oct 12 16:06:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri May 27 16:32:04 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+ * tool/merger.rb: now can merge revision(s) without --ticket again.
- * lib/mkmf.rb: use the semicolon as the path separator
- in the environment of MSYS. fixed: [ruby-dev:26232]
+Fri Oct 12 14:10:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu May 26 06:08:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/mkmf.rb (dir_config, init_mkmf): use configured libdir value as
+ default library path. [ruby-core:43726] [Bug #6207]
- * ext/tk/lib/tk.rb: add shortcut-methods of tk_call + tk_split_list
+Fri Oct 12 05:25:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Wed May 25 22:52:42 2005 Shugo Maeda <shugo@ruby-lang.org>
+ * lib/timeout.rb (timeout):
+ Remove paragraph on wrong implementation detail.
+ [ruby-core:47739] [Bug #7088]
- * lib/irb/input-method.rb: do not use Readline::HISTORY.pop.
- (backported from HEAD)
+Thu Oct 11 23:09:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed May 25 21:55:40 2005 Shugo Maeda <shugo@ruby-lang.org>
+ * string.c (rb_str_sub{seq,pos,str}, rb_str_each_{line,codepoint}):
+ prevent String copies from GC. [ruby-core:47881] [Bug #7135]
- * ext/readline/readline.c: supported libedit. (backported from HEAD)
+Thu Oct 11 07:40:50 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/readline/extconf.rb: ditto.
+ * iseq.c (insn_operand_intern): cast op to rb_call_info_t* before
+ compare with iseq->callinfo_entries whose type is rb_call_info_t*.
- * test/readline/test_readline.rb: ditto.
+Thu Oct 11 03:37:08 2012 Koichi Sasada <ko1@atdot.net>
-Wed May 25 20:06:27 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * bootstraptest/test_block.rb: add tests for block with super.
- * ext/tk/lib/tk.rb: TkComm#tk_split_*list fail to split a kind of SJIS
- strings. To avoid the trouble, add arguments to control converting
- encoding, and do split on a UTF8 string.
+Thu Oct 11 02:54:07 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/multi-tk.rb: modify to attend encoding.
+ * vm_dump.c: fix debug prints to catch up recent changes
+ such as VM data structures.
- * ext/tk/lib/remote-tk.rb: ditto.
+Thu Oct 11 02:50:34 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk/itemconfig.rb: ditto.
+ * iseq.c (insn_operand_intern): add support disasm TS_CALLINFO
+ operands.
- * ext/tk/lib/tk/listbox.rb: ditto.
+Wed Oct 10 15:12:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/lib/tk/namespace.rb: ditto.
+ * test/ruby/test_process.rb (TestProcess#test_execopts_gid): skip on
+ windows because the platform does not have Process.group method.
+ patched by Jon Forums in [ruby-core:47878] [Bug #7133].
- * ext/tk/lib/tk/panedwindow.rb: ditto.
+Tue Oct 9 23:18:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/text.rb: ditto.
+ * test/ruby/envutil.rb (assert_file, assert_file_not): more
+ descriptive assertions for File predicates.
- * ext/tk/lib/tk/textmark.rb: ditto.
+Tue Oct 9 18:01:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/texttag.rb: ditto.
+ * array.c (rb_ary_sample): use rb_random_ulong_limited, since
+ precision of long may be larger than double.
- * ext/tk/lib/tk/variable.rb: ditto.
+ * random.c (rb_random_ulong_limited): new function to return a random
+ value from 0 upto limit as unsigned long, similarly to
+ rb_genrand_ulong_limited but with arbitrary RNG object.
- * ext/tk/lib/tk/winfo.rb: ditto.
+Tue Oct 9 17:13:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb: ditto.
+ * process.c (rb_execarg_addopt, rb_execarg_run_options): add :uid and
+ :gid options. [ruby-core:47414] [Feature #6975]
- * ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb: ditto.
+Tue Oct 9 14:36:11 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk.rb: add TkWindow#lower_window/raise_window and
- Tk#lower_window/raise_window by reason of method-name conflict
+ * iseq.c (iseq_free): fix memory leak.
+ rb_iseq_t::callinfo_entries should be freed.
- * ext/tk/lib/tk/canvas.rb: bug fix on TkCanvas#delete when given
- non-TkcItem arguments.
+Tue Oct 9 14:28:18 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb: ditto.
+ * vm_core.h (rb_call_info_t): add new type `rb_call_info_t'.
+ This data structure contains information including inline method
+ cache. After that, `struct iseq_inline_cache_entry' does not
+ need to contain inline cache for method invocation.
+ Other information will be added to this data structure.
-Wed May 25 12:59:48 2005 Tanaka Akira <akr@m17n.org>
+ * vm_core.h (rb_iseq_t): add `callinfo_entries' and `callinfo_size'
+ members to `rb_iseq_t'.
- * lib/open-uri.rb (OpenURI::Meta::RE_QUOTED_STRING): a content of
- quoted-string should be zero or more characters.
+ * insns.def, compile.c: Use CALL_INFO instead of IC.
-Tue May 24 23:42:16 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * tool/instruction.rb: support CALL_INFO as operand type.
- * numeric.c (fix_pow): support Fixnum ** Float case directly
- without coercing. [ruby-talk:142697] [ruby-talk:143054]
+ * vm_insnhelper.c, vm_insnhelper.h: ditto.
-Tue May 24 16:57:24 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Oct 7 23:54:33 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * ruby.c (require_libraries): caused SEGV when continuation jumped
- in to the required library code.
+ * ext/zlib/zlib.c (zstream_run_func): don't call inflate() when
+ z->stream.avail_in == 0. it return Z_BUF_ERROR.
+ but deflate() could be called with z->stream->avail_in == 0 because
+ it has hidden buffer in z->stream->state (opaque structure).
+ fix for gem install error. [ruby-dev:46149] [Bug #7040]
-Tue May 24 11:56:25 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+Mon Oct 8 23:55:41 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/getopts.rb: should warn only if verbose mode.
- fixed: [ruby-dev:26201]
+ * eval.c (rb_mod_refinements): new method Module#refinements.
-Tue May 24 06:45:31 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_refinement.rb: add new tests for the above changes.
- * misc/ruby-mode.el (ruby-font-lock-syntactic-keywords): string
- literals to be matched non-greedy.
+Mon Oct 8 23:02:19 2012 Shugo Maeda <shugo@ruby-lang.org>
-Tue May 24 00:34:32 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * eval.c, gc.c, iseq.c, node.h, vm_insnhelper.c, vm_insnhelper.h,
+ vm_method.c: rename omod and overlaid modules to refinements.
- * test/soap/calc: method name 'set' was able to crash with a class Set.
- [ruby-dev:26210]
+ * eval.c (hidden_identity_hash_new): renamed from identity_hash_new.
- * test/wsdl/document/test_rpc.rb: dateTime comparison failed under
- TZ=right/Asia/Tokyo (with leap second.) [ruby-dev:26208]
+Sun Oct 7 04:50:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Mon May 23 16:24:05 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/abbrev.rb: Documentation examples for Abbrev.
+ [ruby-core:47442] [Bug #6985]
- * ext/tcltklib/extconf.rb: Framework support on MacOS X Tiger.
+Sun Oct 7 04:50:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * ext/tcltklib/README.1st: add description of Framework support options.
+ * thread.c (rb_thread_aref):
+ Grammar in Thread documentation.
+ Patch by Steve Klabnik [ruby-core:47799] [Bug #7099]
-Mon May 23 12:21:37 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Oct 7 04:37:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * re.c (make_regexp): should not return junk address during
- compile time. [ruby-dev:26206]
+ * string.c (rb_str_match):
+ Clarify behavior for captured strings and local variable assignment
+ Patch by Marcus Stollsteimer [ruby-core:47668] [Bug #7062]
-Sun May 22 21:54:06 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sat Oct 6 18:31:36 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/{soap,wsdl,xsd}, test/{soap,wsdl,xsd}: imported soap4r/1.5.4.
+ * vm_opts.h (OPT_GLOBAL_METHOD_CACHE): new build option to
+ enable/disable global method caching. [ruby-dev:46203] [Bug #7111]
- == SOAP client and server ==
+ * vm_method.c (rb_method_entry_get_with_omod): don't use global
+ method cache if OPT_GLOBAL_METHOD_CACHE is 0.
- === for both client side and server side ===
+Sat Oct 6 16:32:04 2012 Shugo Maeda <shugo@ruby-lang.org>
- * improved document/literal service support.
- style(rpc,document)/use(encoding, literal) combination are all
- supported. for the detail about combination, see
- test/soap/test_style.rb.
+ * vm_method.c (search_method): check omod only once for performance.
- * let WSDLEncodedRegistry#soap2obj map SOAP/OM to Ruby according to
- WSDL as well as obj2soap. closes #70.
+Sat Oct 6 09:42:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * let SOAP::Mapping::Object handle XML attribute for doc/lit service.
- you can set/get XML attribute via accessor methods which as a name
- 'xmlattr_' prefixed (<foo name="bar"/> -> Foo#xmlattr_name).
+ * enc/encdb.c, enc/utf_16_32.h (ENC_DUMMY_UNICODE): endian-less wide
+ UTF encodings are dummy but Unicode.
- === client side ===
+ * encoding.c (rb_encdb_set_unicode): set Unicode flag.
- * WSDLDriver capitalized name operation bug fixed. from
- 1.5.3-ruby1.8.2, operation which has capitalized name (such as
- KeywordSearchRequest in AWS) is defined as a method having
- uncapitalized name. (converted with GenSupport.safemethodname
- to handle operation name 'foo-bar'). it introduced serious
- incompatibility; in the past, it was defined as a capitalized.
- define capitalized method as well under that circumstance.
+ * template/encdb.h.tmpl: allow ENC_DUMMY variants.
- * added new factory interface 'WSDLDriverFactory#create_rpc_driver'
- to create RPC::Driver, not WSDLDriver (RPC::Driver and WSDLDriver
- are merged). 'WSDLDriverFactory#create_driver' still creates
- WSDLDriver for compatibility but it warns that the method is
- deprecated. please use create_rpc_driver instead of create_driver.
+ * encoding.c (rb_enc_unicode_p): oniguruma provides Unicode flag.
- * allow to use an URI object as an endpoint_url even with net/http,
- not http-access2.
+Fri Oct 5 17:18:42 JST 2012 TAKANO Mitsuhiro <tak@no32.tk>
- === server side ===
+ * template/Doxyfile.tmpl: remove SHOW_DIRECTORIES and
+ HTML_ALIGN_MEMBERS lines. They have been obsolete in
+ Doxygen version 1.8.2.
- * added mod_ruby support to SOAP::CGIStub. rename a CGI script
- server.cgi to server.rb and let mod_ruby's RubyHandler handles the
- script. CGIStub detects if it's running under mod_ruby environment
- or not.
+Fri Oct 5 15:26:18 2012 Koichi Sasada <ko1@atdot.net>
- * added fcgi support to SOAP::CGIStub. see the sample at
- sample/soap/calc/server.fcgi. (almost same as server.cgi but has
- fcgi handler at the bottom.)
+ * ext/objspace/objspace.c: add ObjectSpace#reachable_objects_from.
+ This method returns an array of objects referenced by given object.
+ If given object is special objects such as true/false/nil/Fixnum etc
+ then it returns nil. See rdoc for details.
+ [ruby-core:39772]
- * allow to return a SOAPFault object to respond customized SOAP fault.
+ * test/objspace/test_objspace.rb: add a test for this method.
- * added the interface 'generate_explicit_type' for server side
- (CGIStub, HTTPServer). call 'self.generate_explicit_type = true'
- if you want to return simplified XML even if it's rpc/encoded
- service.
+ * gc.c: add rb_objspace_reachable_objects_from().
+ To make this function, add several member `mark_func_data'
+ to rb_objspace_t. If mark_func_data is not null, then
+ gc_mark() calls mark_func_data::mark_func.
- == WSDL ==
+ * gc.h: export rb_objspace_reachable_objects_from().
- === WSDL definition ===
+Thu Oct 4 23:40:04 2012 Narihiro Nakamura <authornari@gmail.com>
- * improved XML Schema support such as extension, restriction,
- simpleType, complexType + simpleContent, ref, length, import,
- include.
+ * gc.c (init_heap): call init_mark_stack before to allocate
+ altstack. This change avoid the stack overflow at the signal
+ handler on 32bit, but I don't understand reason... [Feature #7095]
- * reduced "unknown element/attribute" warnings (warn only 1 time for
- each QName).
+Thu Oct 4 22:39:27 2012 Koichi Sasada <ko1@atdot.net>
- * importing XSD file at schemaLocation with xsd:import.
+ * insns.def (getlocal, setlocal): remove old getlocal/setlocal
+ instructions and rename getdaynmic/setdynamic instructions
+ to getlocal/setlocal.
- === code generation from WSDL ===
+ * compile.c: ditto.
- * generator crashed when there's '-' in defined element/attribute
- name.
+ * iseq.c: remove TS_DINDEX.
- * added ApacheMap WSDL definition.
+ * vm_exec.h (dindex_t): remove type definition of `dindex_t'.
- * sample/{soap,wsdl}: removed.
+ * tool/instruction.rb: ditto.
-Sun May 22 19:11:35 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Oct 4 21:44:17 2012 Koichi Sasada <ko1@atdot.net>
- * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLServer#intialize):
- should initialize session id context. [ruby-core:4663]
+ * vm.c (vm_analysis_insn|operand|register): use st_insert
+ instead of using rb_hash_aset() because rb_hash_aset()
+ check $SAFE.
- * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): add session id support.
+Thu Oct 4 21:15:26 2012 Koichi Sasada <ko1@atdot.net>
-Sat May 21 10:24:21 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * vm.c (VM_COLLECT_USAGE_DETAILS): make new VM usage analysis
+ hooks (old macro name is COLLECT_USAGE_ANALYSIS).
+ This feature is only for VM developers. (I'm not sure I can use
+ `VM developers' (the plural form) in this sentence).
+ If VM_COLLECT_USAGE_DETAILS is not 0, VM enables the following
+ usage collection features:
+ (1) instruction: collect instruction usages.
+ (2) operand: collect operand usages.
+ (3) register: collect register usages.
+ The results are stored in
+ RubyVM::USAGE_ANALYSIS_INSN for (1, 2),
+ RubyVM::USAGE_ANALYSIS_INSN_BIGRAM for (1) and
+ RubyVM::USAGE_ANALYSIS_REGS for (3).
+ You can stop collecting usages with
+ RubyVM::USAGE_ANALYSIS_INSN_STOP(),
+ RubyVM::USAGE_ANALYSIS_OPERAND_STOP(),
+ RubyVM::USAGE_ANALYSIS_REGISTER_STOP()
+ for (1), (2), (3) respectively.
+ You can also change the hook functions by setting
+ C level global variables
+ `ruby_vm_collect_usage_func_(insn|operand|register)'
+ for (1), (2), (3) respectively.
+ See codes for more details.
- * bcc32/Makefile.sub: tds files were not deleted when DESTDIR
- included '\' path delimiter. [ruby-dev:26193]
+ * tool/instruction.rb: fix macro names.
-Thu May 19 19:04:29 2005 speakillof <speakillof@yahoo.co.jp>
+ * iseq.c (insn_operand_intern): make it export (used in vm.c).
+ fix to skip several processes if not needed (pointer is 0).
- * lib/rexml/encodings/SHIFT-JIS.rb: encoding and decoding were
- swapped. [ruby-core:4772]
+ * vm_dump.c: move codes for collection features to vm.c.
-Wed May 18 23:42:25 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_exec.h: rename macro and function names.
- * error.c (exc_exception): reverted to call Exception#initialize
- directly. fixed: [ruby-dev:26177]
+ * vm_insnhelper.h: ditto.
-Wed May 18 23:39:09 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Oct 4 18:59:14 2012 Koichi Sasada <ko1@atdot.net>
- * dir.c (glob_helper): get rid of using String. [ruby-dev:26180]
+ * test/ruby/test_settracefunc.rb (test_tracepoint):
+ remove unused test case.
+ (this test case is redefined by newer tests)
- * dir.c (push_braces): should skip balanced braces.
+Thu Oct 4 17:24:51 2012 Narihiro Nakamura <authornari@gmail.com>
- * eval.c (ruby_options), win32/win32.c (NtInitialize): move argument
- intialization back. [ruby-dev:26180]
+ * gc.c (rb_objspace_call_finalizer): call gc_mark_stacked_objects
+ at suitable point.
-Tue May 17 15:31:31 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Oct 4 16:31:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): should
- break the loop if the socket reached to EOF. [ruby-talk:142285]
+ * gc.c (rb_objspace_call_finalizer): mark self-referencing finalizers
+ before run finalizers, to fix SEGV from btest on 32bit.
-Tue May 17 11:52:18 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * gc.c (gc_mark_stacked_objects): extract from gc_marks().
- * win32/win32.c (unixtime_to_filetime): use localtime() instead of
- gmtime() when using FileLocalTimeToFileTime().
+Thu Oct 4 11:43:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon May 16 22:28:43 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread_pthread.c (ruby_init_stack): round stack limit to page size
+ boundary to calculate stack size more precisely. [ruby-dev:46174]
+ [Bug #7084]
- * win32/win32.h, {bcc32,win32,wince}/Makefile.sub: moved rb_[ugp]id_t
- to get rid of redefinition warnings on mingw.
+Wed Oct 3 19:51:57 2012 Narihiro Nakamura <authornari@gmail.com>
- * class.c (rb_class_init_copy): singleton class is disallowed to copy,
- from its definition. fixed: [ruby-talk:142749]
+ * gc.c: Use the non-recursive marking instead of recursion. The
+ recursion marking of CRuby needs checking stack overflow and the
+ fail-safe system, but these systems not good at partial points,
+ for example, marking deep tree structures. [ruby-dev:46184]
+ [Feature #7095]
-Mon May 16 08:52:29 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * configure.in (GC_MARK_STACKFRAME_WORD): removed. It's used by
+ checking stack overflow of marking.
- * win32/win32.{h,c}: define rb_[pgu]id_t.
+ * win32/Makefile.sub (GC_MARK_STACKFRAME_WORD): ditto.
-Mon May 16 00:21:02 2005 Tanaka Akira <akr@m17n.org>
+Wed Oct 3 15:33:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/pathname.rb (Pathname#unlink): use SystemCallError instead of
- Errno::EISDIR because EISDIR is not portable.
- [ruby-core:5001]
+ * thread_pthread.c (ruby_init_stack): use getrlimit() for the main
+ thread on Mac OS X, since pthread_get_stack{addr,size}_np()
+ return the default value always, but not the ulimit value.
+ [ruby-dev:46174] [Bug #7084]
-Sun May 15 22:11:33 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed Oct 3 11:43:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/drb/drb.rb (DRbObject#method_missing): use raise(exception).
- [ruby-dev:26164]
+ * io.c (rb_io_reopen): improvement to accept optional arguments.
+ a patch by Glass_saga (Masaki Matsushita) in [ruby-core:47806].
+ [Feature #7103]
-Sun May 15 18:56:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Oct 3 04:36:11 2012 Eric Hodel <drbrain@segment7.net>
- * configure.in, ruby.h: define rb_[pgu]id_t macros instead of typedefs
- to get rid of types which might not be defined yet. [ruby-dev:26165]
+ * ext/openssl/ossl_x509store.c (ossl_x509store_add_file): Added
+ documentation
+ * ext/openssl/ossl_x509store.c (ossl_x509store_set_default_paths):
+ ditto
+ * ext/openssl/ossl_x509store.c (ossl_x509store_add_cert): ditto
-Sun May 15 14:35:46 2005 Tanaka Akira <akr@m17n.org>
+Wed Oct 3 02:23:37 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/pathname.rb (Pathname#unlink): unlink a symlink to a directory
- was failed. [ruby-core:4992]
+ * error.c (exc_to_s, name_err_to_s, name_err_mesg_to_str): do not
+ taint messages.
-Sun May 15 09:57:30 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 2 16:47:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (unixtime_to_filetime): deal with DST.
- [ruby-talk:141817]
+ * eval.c (identity_hash_new): hide internal hashes for refinements.
-Sat May 14 23:59:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (rb_mod_refine): no default value.
- * error.c (exc_exception, {exit,name_err,syserr}_initialize): call
- Execption#initialize. fixed: [ruby-talk:142593]
+Mon Oct 1 22:54:02 2012 Shugo Maeda <shugo@ruby-lang.org>
-Sat May 14 23:57:26 2005 Erik Huelsmann <ehuels@gmail.com>
+ * eval.c (identity_hash_new): new function to create a new identity
+ hash.
- * configure.in: Check for the availability of pid_t, gid_t and uid_t and
- remove AC_TYPE_UID_T. fixed: [ruby-core:04745]
+ * eval.c (rb_overlay_module, rb_mod_using, rb_mod_refine): use
+ identity_hash_new().
- * defines.h: Remove pid_t typedef.
+Mon Oct 1 02:34:53 2012 Akinori MUSHA <knu@iDaemons.org>
- * ruby.h: Define rb_pid_t, rb_gid_t and rb_uid_t in accordance with
- the available system types.
+ * configure.in (--with-opt-dir): Make this also work on DLDFLAGS
+ so LIBRUBY_SO links fine with libexecinfo installed in a
+ non-system directory.
- * process.c: Change instances of pid_t and gid_t to their rb_*
- counterparts.
+Sun Sep 30 23:32:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * ext/pty/pty.c: Change pid_t to rb_pid_t.
+ * vm_dump.c (rb_vm_bugreport): add /Library/Logs/DiagnosticReports
+ in the list of locations of crash reports.
- * vms/config.h: Define HAVE_{P,G,U}ID_T to 1.
+Sun Sep 30 21:18:03 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/Makefile.sub: Remove #define for {g,u}id_t.
+ * string.c (rb_str_concat): use memcpy to copy a string which contains
+ NUL characters. [ruby-core:47751] [Bug #7090]
- * win32/win32.c: Change pid_t to rb_pid_t.
+Sat Sep 29 19:41:53 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * wince/Makefile.sub: Remove #define for {g,u}id_t.
+ * test/ruby/envutil.rb (EnvUtil#invoke_ruby): kill child process
+ before Timeout::Error is raised. rmdir of mktmpdir fails with
+ EACCES if child process is alive on Windows.
- * wince/sys/types.h: Remove definitions of {p,g,u}id_t.
+ * test/thread/test_queue.rb (TestQueue): increase timeout.
+ This test takes long time on Windows XP.
-Fri May 13 23:44:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Sep 29 19:41:33 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * ext/extmk.rb: keep srcdir unexpanded.
+ * test/net/http/test_http.rb (TestNetHTTP#test_proxy_address):
+ clear environment variables. If http_proxy environment variable was
+ set, the test failed.
- * lib/mkmf.rb (create_makefile): quote topdir and hdrdir if necessary.
- fixed: [ruby-core:04932]
+ * test/net/http/test_http.rb (TestNetHTTP#test_proxy_port): ditto.
- * lib/mkmf.rb (configuration), {bcc32,win32,wince}/Makefile.sub: make
- also INSTALL_PROG and INSTALL_DATA system dependent.
- fixed: [ruby-core:04931]
+Sat Sep 29 19:41:11 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Fri May 13 17:54:39 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/drb/drbtest.rb (DRbCore#teardown):
+ Use Process.kill :KILL on Windows because Process.kill :INT silently
+ fails on Windows 7 and raises EINVAL on Windows XP for spawned
+ process with new_pgroup: false.
- * variable.c (generic_ivar_get): rb_attr_get should not warn.
- [ruby-dev:26010]
+ * test/drb/drbtest.rb (DRbAry#teardown): ditto.
-Fri May 13 12:28:43 2005 Daniel Berger <djberge@qwest.com>
+Sat Sep 29 19:40:32 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * array.c (rb_ary_select): can remove argc check. [ruby-core:4911]
+ * test/ruby/test_unicode_escape.rb (TestUnicodeEscape#test_basic):
+ set script encoding to work with LANG=C. It would work on both
+ Windows and Unix. Refix of r37051.
- * test/ruby/test_array.rb: add test for find_all.
+Sat Sep 29 11:21:06 2012 Shugo Maeda <shugo@ruby-lang.org>
-Fri May 13 11:29:00 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_insnhelper.c (rb_vm_using_modules): use using_modules before
+ klass to fix method lookup order, and use klass even if klass is
+ not a module to make refinements in class_eval invoked on classes
+ work.
- * eval.c (unknown_node): add volatile directive to prototype.
+ * eval.c (rb_using_module): accept a class as the second argument.
-Thu May 12 17:08:48 2005 Tanaka Akira <akr@m17n.org>
+ * eval.c (rb_mod_using, f_using): raise a TypeError if the argument
+ is not a module.
- * io.c (rb_io_eof, remain_size, read_all, io_read, appendline)
- (swallow, rb_io_each_byte, rb_io_getc): revert previous change.
+ * test/ruby/test_refinement.rb: add new tests for the above changes.
- * io.c (rb_io_eof, io_fread, appendline, swallow, rb_io_each_byte)
- (rb_io_getc, rb_getc): call clearerr before getc to avoid
- stdio incompatibility.
+Sat Sep 29 02:18:57 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Thu May 12 16:52:20 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/ruby/test_unicode_escape.rb (TestUnicodeEscape#test_basic):
+ Use ruby only on Windows since the test fails on Unix with LANG=C.
+ [ruby-core:47709] [Bug #7076]
- * lib/rdoc/parsers/parse_c.rb: more readability for mixing
- progress "c..." and warning message.
+Fri Sep 28 22:19:31 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Thu May 12 16:31:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_unicode_escape.rb (TestUnicodeEscape#test_basic):
+ echo command doesn't work properly against non-ascii character on
+ Windows with chcp 437. Instead we use ruby.
+ [ruby-core:47709] [Bug #7076]
- * ext/nkf/nkf-utf8/nkf.c: follow nkf 2.0.5
+Fri Sep 28 17:54:31 2012 Koichi Sasada <ko1@atdot.net>
-Thu May 12 16:15:01 2005 Tanaka Akira <akr@m17n.org>
+ * vm_insnhelper.c (vm_setup_method): refactoring.
+ Remove src_argc and use iseq->arg_size directly.
- * io.c (rb_io_eof, remain_size, read_all, io_read, appendline)
- (swallow, rb_io_each_byte, rb_io_getc): don't rely EOF flag.
- [ruby-talk:141527]
+Fri Sep 28 17:26:27 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu May 12 15:56:20 2005 Tilman Sauerbeck <tilman@code-monkey.de>
+ * lib/rubygems/installer.rb (check_that_user_bin_dir_is_in_path):
+ test_generate_bin_bindir_with_user_install_warning(TestGemInstaller)
+ fails on Windows with msys bash. It makes comparing paths
+ case-insensitive.
+ pick from upstream to fix a failure of test-all [ruby-core:47711]
+ https://github.com/rubygems/rubygems/commit/c474edb2f3704206f04da1c8c6cf9fb079d84abe
- * lib/rdoc/parsers/parse_c.rb: show parsing progress for C files.
- [ruby-core:4341]
+Fri Sep 28 15:44:45 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu May 12 13:47:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * vm_method.c (search_method): copy refinement iclasses to search
+ superclasses correctly.
- * test/drb/test_drb{ssl,unix}.rb: can test drb
- before install. (backported from HEAD) [ruby-dev:26146]
+ * test/ruby/test_refinement.rb: related test.
-Thu May 12 09:53:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Sep 28 15:15:41 2012 Koichi Sasada <ko1@atdot.net>
- * version.c (ruby_show_version): flush for non-tty stdout.
+ * insns.def (opt_checkenv): remove unused instruction `opt_checkenv'.
-Thu May 12 09:07:07 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * compile.c (iseq_compile_each): ditto.
- * test/ruby/envutil.rb, test/drb/drbtest.rb: can test drb
- before install. (backported from HEAD) [ruby-Bugs-1672]
+ * node.h: remove unused node `NODE_OPTBLOCK'.
-Thu May 12 01:23:55 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/objspace/objspace.c, gc.c (gc_mark_children): ditto.
- * eval.c (rb_eval), parse.y (arg): reduce fixnum range literal at
- parser. fixed: [ruby-dev:26113]
+Fri Sep 28 13:14:34 2012 Koichi Sasada <ko1@atdot.net>
- * eval.c (unknown_node): ignore broken NODE to get rid of accessing
- possibly inaccessible address. fixed: [ruby-dev:26122]
- should emit more useful information like [ruby-dev:26126], though.
+ * vm_core.h: now VM_DEBUG_BP_CHECK should be 1.
-Wed May 11 16:20:01 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Sep 28 12:51:54 2012 Koichi Sasada <ko1@atdot.net>
- * lib/webrick/cgi.rb: new methods WEBrick::CGI#[], WEBrick::CGI#logger
- and WEBrick::CGI#config. (backported from HEAD)
+ * vm_core.h: remove rb_control_frame_t::bp (bp: base pointer).
+ `bp' can be calculate by `sp' (stack pointer) of previous frame.
+ Now, `bp_check' field is remained for debug. You can eliminate
+ this field by setting VM_DEBUG_BP_CHECK as 0.
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.escape_path): should
- not use String#split("/"). (backported from HEAD)
+ * vm_insnhelper.c (vm_base_ptr): add `vm_base_ptr(cfp).
+ This function calculates base pointer from cfp.
-Wed May 11 15:58:39 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_insnhelper.c (vm_setup_method): push `recv' value on top of
+ value stack (before method parameters).
+ This change is for keeping consistency with normal method dispatch.
- * eval.c (break_jump): break should not cross functions.
- [ruby-list:40818]
+ * insns.def: fix to use vm_base_ptr().
-Wed May 11 10:39:37 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * vm.c (vm_exec): ditto.
- * lib/tempfile.rb (Tempfile#unlink): fixed typo.
+ * vm_dump.c: remove `bp' related dumps.
-Wed May 11 01:03:36 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * cont.c (fiber_init): fix to check VM_DEBUG_BP_CHECK.
- * eval.c (TMP_ALLOC): use macro NEW_NODE() to get rid of warnings on
- platforms which have no alloca(). fixed: [ruby-talk:141301]
+Fri Sep 28 10:40:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun May 8 23:17:47 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * io.c (rb_io_reopen): accept File::Constants as well as mode string.
+ based on the patch by Glass_saga (Masaki Matsushita) in
+ [ruby-core:47694]. [Feature #7067]
- * ext/tk/lib/tk/timer.rb: fix typo.
+Thu Sep 27 18:36:51 2012 Shugo Maeda <shugo@ruby-lang.org>
-Sun May 8 16:52:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * eval.c (rb_overlay_module, rb_mod_refine): accept a module as the
+ argument of Module#refine.
- * lib/profiler.rb: fixed "undefined method `[]' for nil:NilClass"
- [ruby-core:4775] [ruby-talk:140401] [ruby-dev:26118]
+ * vm_method.c (search_method): if klass is an iclass, lookup the
+ original module of the iclass in omod in order to allow
+ refinements of modules.
-Sat May 7 22:58:00 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_refinement.rb: add tests for the above changes.
- * lib/mkmf.rb (have_var): no libs argument is given.
+Thu Sep 27 18:12:20 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun May 1 09:58:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/syslog/lib/syslog/logger.rb: add a formatter to the
+ Syslog::Logger object. [Bug #7065]
+ * test/syslog/test_syslog_logger.rb: ditto.
- * ruby.c (process_sflag): replace '-' in variable names with '_'.
- [ruby-dev:26107]
+Wed Sep 26 16:39:57 2012 Koichi Sasada <ko1@atdot.net>
- * ruby.c (set_arg0): use also environment variable space for setting
- $0. [ruby-core:04774]
+ * insns.def: add new instruction `opt_empty_p' for optimize `empty?'
+ method. Apply a patch proposed at [ruby-dev:46120]
+ [ruby-trunk - Feature #6972] by Glass_saga (Masaki Matsushita).
-Wed Apr 27 23:42:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * compile.c (iseq_specialized_instruction), vm.c, vm_insnhelper.h:
+ ditto.
- * win32/Makefile.sub (OPTFLAGS): default global optimization to
- disabled only for VC++6.
+ * id.c, template/id.h.tmpl: ditto.
-Tue Apr 26 22:58:00 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/ruby/test_optimization.rb: test for this changes.
- * ext/tcltklib/tcltklib.c (ip_invoke_core): call Tcl's "::unknown"
- command when can't get information of target command.
+Tue Sep 25 09:59:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 25 01:18:43 2005 Tanaka Akira <akr@m17n.org>
+ * insns.def (invokesuper): klass in cfp is not valid in at_exit and
+ END blocks. [ruby-core:47680] [Bug #7064]
- * regex.c: declare rb_warn to have variadic argument. [ruby-core:4751]
+Tue Sep 25 08:11:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Apr 23 19:45:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * iseq.c (rb_iseq_defined_string): the index of defined_strings must
+ be the value of type - 1.
- * ext/tcltklib/tcltklib.c (ip_RubyExitCommand): exit with status code
- via TclTkIp#_eval didn't work. [ruby-talk:139390]
+Mon Sep 24 17:36:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Apr 22 16:41:50 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * compile.c (defined_expr), insns.def (defined): share single frozen
+ strings. [EXPERIMENTAL] [ruby-core:47558][Feature #7035]
- * ext/tcltklib/tcltklib.c (ip_set_exc_message): fixed memory leak.
+ * iseq.c (rb_iseq_defined_string): make expression strings.
- * ext/tcltklib/tcltklib.c: eTkCallbackReturn was not initialized.
+Mon Sep 24 11:22:36 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Apr 21 00:07:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/merger.rb: add --ticket option to add ticket number.
- * lib/mkmf.rb (create_makefile): support platforms have file separator
- other than /.
+Sun Sep 23 21:51:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * {bcc32,win32,wince}/Makefile.sub (BUILD_FILE_SEPARATOR): separator
- of building platform.
+ * lib/mkmf.rb (String#unspace): unescape with backslashes. normal
+ makes need to escape spaces with backslashes. nmake is not the
+ case. [Bug #7036]
- * {bcc32,win32,wince}/Makefile.sub (CP, INSTALL): use COPY command.
+ * lib/mkmf.rb (create_makefile): use timestamp file dependencies for
+ directories.
-Wed Apr 20 23:22:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb: unexpand macros.
- * Makefile.in, common.mk: miniruby depens on MINIOBJS.
+ * lib/mkmf.rb (LIBPATHFLAG): no needs to escape library path here.
- * dmydln.c (dln_load): dummy function to raise LoadError.
+ * lib/mkmf.rb (MakeMakefile#configuration): make prefix paths
+ internal to deal with in Makefile.
- * cygwin/GNUmakefile.in, {bcc32,win32,wince}/Makefile.sub: miniruby
- can't load extensions on Windows.
+ * lib/mkmf.rb (MakeMakefile#mkintpath): not a global function now.
-Wed Apr 20 23:01:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Sep 23 02:33:37 2012 Benoit Daloze <eregontp@gmail.com>
- * win32/ifchange.bat: delete testing files.
+ * complex.c: Fix examples of r36993.
+ Keep the simple definition, mathematics define the result.
+ Based on patch by Robin Dupret. Fixes #188 on github.
-Wed Apr 20 07:27:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Sep 22 07:15:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * {bcc32,win32,wince}/configure.bat, {bcc32,win32,wince}/setup.mak:
- add extout option.
+ * ext/ripper/lib/ripper.rb:
+ Match sample output to Ripper.sexp from current trunk version.
+ [Bug #6929]
- * bcc32/setup.mak: make configuration variables overridable.
+Thu Sep 20 23:05:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Apr 20 04:15:27 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
+ * thread_pthread.c (native_cond_initialize): destroy condattr
+ after using it. Patch by Stanislav Sedov. Thank you.
+ [Bug #7041] [ruby-core:47619]
- * lib/irb.rb lib/irb/* doc/irb: IRB 0.9.5
+Thu Sep 20 22:53:02 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Apr 19 23:37:09 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+ * thread_pthread.c (native_cond_initialize): clean up #ifdef condition.
- * lib/ftools.rb (File.safe_unlink): do not modify a symlinked file.
+Thu Sep 20 16:42:44 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Apr 19 00:06:20 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/drb/ssl.rb (DRb::DRbSSLSocket::SSLConfig::DEFAULT): add
+ SSLTmpDhCallback for configuration option.
- * ext/extmk.rb: expand path for ext/**/extconf.rb.
+ * lib/drb/ssl.rb (setup_ssl_context): copy the value of tmp_dh_callback.
-Mon Apr 18 11:25:14 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/drb/ut_array_drbssl.rb: set tmp_dh_callback to suppress warning.
- * ext/zlib/zlib.c (zstream_run): fixed SEGV. [ruby-core:4712]
+ * test/drb/ut_drb_drbssl.rb: ditto.
-Sun Apr 17 23:57:49 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 20 10:56:08 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/extmk.rb (extmake, parse_args): do not expand destdir.
+ * test/drb/ut_drb.rb: revert a part of r36987, and get rid of a warning
+ with another method. if the substitution is removed, the ExtSrv
+ object will be GC'ed and some tests will be blocked.
- * ext/extmk.rb (relative_from): treat mere drive letter as an absolute
- path.
+Thu Sep 20 07:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Sat Apr 16 17:01:16 2005 Kouhei Sutou <kou@cozmixng.org>
+ * complex.c: Examples for Complex Documentation.
+ Patch by Robin Dupret.
+ Fixes #184 on github.
- * sample/rss/tdiary_plugin/rss-recent.rb (rss_recent_cache_rss):
- use the first date information of items as site date information
- if channel doesn't have date information.
+Thu Sep 20 07:15:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Sat Apr 16 15:27:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/ripper/lib/ripper.rb: Documentation for Ripper.
+ +:void_stmt+ is meaningless
+ [Bug #6929] [ruby-core:47507]
- * configure.in (RUBY_PROG_INSTALL): not add -p option to INSTALL.
- files need timestamps to be kept are only ar-archive on a few
- platforms, and be installed by instruby.rb but not INSTALL.
- fixed: [ruby-core:04721]
+Thu Sep 20 07:05:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * mkconfig.rb: purge autoconf value variables.
+ * lib/csv.rb (Object#CSV, Array#to_csv, String#parse_csv):
+ Examples and documentation for CSV.
+ [Bug #6880] [ruby-core:47218]
-Sat Apr 16 10:36:01 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Sep 20 00:42:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bcc32/Makefile.sub: quick hack... prepend DESTDIR.
- still have restriction on DESTDIR ("", "/", "e:")
+ * array.c (take_items), enum.c (enum_zip): raise TypeError at
+ non-enumerable objects, not NoMethodError. [ruby-dev:46145]
+ [Bug #7038]
-Sat Apr 16 03:59:42 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * vm_eval.c (rb_check_block_call): check_funcall variant with block
+ function.
- * ext/openssl/extconf.rb: check for OPENSSL_cleanse.
+Tue Sep 18 17:51:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/openssl_missing.h: ditto.
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_attrs): add npn_select_db to
+ suppress warning: instance variable @npn_select_cb not initialized
-Thu Apr 14 19:18:30 2005 Minero Aoki <aamine@loveruby.net>
+Sun Sep 16 17:47:00 2012 Eric Hodel <drbrain@segment7.net>
- * lib/fileutils.rb (remove_file): ignore exceptions caused by
- chmod.
+ * tool/change_maker.rb: Update svn detection for subversion 1.7's
+ single .svn directory.
- * lib/fileutils.rb (remove_dir): try to get rights to rmdir.
- [ruby-Bugs:1502] (2 items backportted from HEAD, rev 1.53-54)
+Sun Sep 16 11:39:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Apr 14 16:57:40 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (io_set_read_length): if the read length equals to the buffer
+ string size then nothing to do. or ensure the string modifiable
+ before setting the length only when the former is shorter. based on
+ the patch in [ruby-core:47541] by Hiroshi Shirosaki.
+ [ruby-core:46586] [Bug #6764]
- * bcc32/Makefile.sub: failed to remove debug information files.
- fixed: [ruby-dev:26034]
+Sun Sep 16 08:57:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Apr 13 23:40:21 2005 Kouhei Sutou <kou@cozmixng.org>
+ * configure.in (strict_warnflags): separate strict flags from
+ warnflags only for core. [ruby-dev:46105]
- * lib/rss/rss.rb (RSS::VERSION): 0.1.3 -> 0.1.4.
+Sun Sep 16 08:16:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/rss.rb (RSS::Element#converter): fixed converter
- transmission bug.
+ * .editorconfig: add. [ruby-core:47548] [Feature #7030]
-Wed Apr 13 21:20:35 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+Sat Sep 15 01:56:40 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in (mingw32): extract msvcr*.dll from objdump result.
+ * ext/nkf/nkf-utf8/nkf.c: Merge upstream: 50a383c84.
+ [ruby-dev:46128] [Bug #7005]
-Wed Apr 13 20:24:30 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Sep 15 00:20:04 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in (mingw32): use actual runtime DLL name as ruby DLL
- name and default load path.
+ * ext/nkf/nkf.c (rb_nkf_convert): suppress warning.
- * win32/Makefile.sub, win32/setup.mak: ditto.
+Fri Sep 14 04:05:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Tue Apr 12 15:33:09 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * array.c (rb_ary_diff, rb_ary_uniq):
+ Enhance documentation for array uniqueness
+ Based on a patch by Robin Dupret
+ [Bug #6872] [ruby-core:47209]
- * ext/tcltklib/tcltklib.c (ip_finalize): better modification than the
- previous commit [ruby-dev:26029].
+Fri Sep 14 03:30:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Tue Apr 12 12:38:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * array.c (rb_ary_select):
+ Update documentation for Array#select
+ * enum.c (enum_find_all, enum_reject):
+ Update documentation for Enumerable#find_all and Enumerable#reject
+ Based on a patch by Jeff Saracco
+ [Bug #6908] [ruby-core:47285] [Fixes #166 on github]
- * ext/tcltklib/tcltklib.c (ip_finalize): fix SEGV when Tcl_GlobalEval()
- modifies the argument string to eval.
+Fri Sep 14 00:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Tue Apr 12 02:21:55 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * signal.c (rb_f_kill):
+ Update documentation for Process.kill to reflect kill(2)
+ Patch by Richo Healey
- * ext/tcltklib/tcltklib.c (ip_finalize): add existence check of
- Tcl commands before calling Tcl_GlobalEval().
+Thu Sep 13 21:40:49 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Mon Apr 11 23:47:21 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/securerandom.rb (SecureRandom.random_bytes):
+ Use 64bit value as pointer for Windows x64 to fix SystemCallError.
- * lib/drb/drb.rb: [druby-ja:123] fix: When reference of my object is
- loaded, the object is tainted.
+ * lib/securerandom.rb (SecureRandom.lastWin32ErrorMessage):
+ Set proper encoding to avoid invalid byte sequence error.
+ [ruby-core:47451] [Bug #6990]
- * test/drb/test_drb.rb: ditto.
+Thu Sep 13 11:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Mon Apr 11 22:18:23 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+ * lib/optparse.rb: Remove unreachable email address from documentation
+ [Bug #6996] [ruby-core:47459]
- * dir.c, file.c (lstat): avoid warnings for mingw.
+Thu Sep 13 11:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Mon Apr 11 20:11:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/xmlrpc.rb: Documentation for XMLRPC
+ * lib/xmlrpc/datetime.rb: ditto.
+ * lib/xmlrpc/parser.rb: ditto.
+ * lib/xmlrpc/client.rb: ditto.
+ * lib/xmlrpc/utils.rb: ditto.
+ * lib/xmlrpc/README.rdoc: ditto.
+ * lib/xmlrpc/create.rb: ditto.
+ * lib/xmlrpc/base64.rb: ditto.
+ * lib/xmlrpc/config.rb: ditto.
+ * lib/xmlrpc/httpserver.rb: ditto.
+ * lib/xmlrpc/server.rb: ditto.
+ * lib/xmlrpc/marshal.rb: ditto.
+ * lib/xmlrpc/README.txt: ditto.
+ [Bug #6909] [ruby-core:47286]
- * ext/tcltklib/tcltklib.c (ip_finalize): adhoc patch to avoid SEGV
- when exit on Tcl/Tk8.3.x.
+Thu Sep 13 10:22:11 2012 Takashi Toyoshima <toyoshim@gmail.com>
-Mon Apr 11 15:26:25 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * configure.in: Don't use PIE on Haiku because loader support is not
+ enough.
- * lib/mkmf.rb (configuration): shouldn't output hdrdir twice.
+Thu Sep 13 08:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Mon Apr 11 12:09:05 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/shellwords.rb: Documentation for Shellwords.
- * {bcc32,win32,wince}/Makefile.sub: ri data was not installed
- into correct path. [ruby-dev:26011]
+Thu Sep 13 08:00:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * bcc32/Makefile.sub: defaulted install-nodoc. [ruby-dev:26011]
+ * ext/ripper/lib/ripper.rb: Documentation for Ripper.
+ * ext/ripper/lib/ripper/lexer.rb: ditto.
+ * ext/ripper/lib/ripper/sexp.rb: ditto.
+ * ext/ripper/lib/ripper/filter.rb: ditto.
+ * ext/ripper/lib/ripper/core.rb: ditto.
+ [Bug #6929] [ruby-core:47309]
-Sun Apr 10 10:12:42 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Wed Sep 12 22:59:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/win32ole/win32ole.c(ole_invoke): retry after converting Qnil
- to VT_EMPTY.
+ * vm_insnhelper.c (vm_method_missing, vm_call_method): reuse arguments
+ on the VM stack and get rid of ALLOCA.
- * ext/win32ole/win32ole/tests/testWIN32OLE.rb: correct error
- message string "Unknown" => "unknown".
+Wed Sep 12 22:45::00 2012 Zachary Scott <zzak@ruby-lang.org>
-Sat Apr 9 18:20:31 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/pathname/lib/pathname.rb: Documentation for Pathname.
+ * ext/pathname/pathname.c: ditto.
+ [Bug #6947] [ruby-core:47354]
- * ext/tk/lib/tk/image.rb: support to create TkImage object without
- creating a new image object on Tk.
+Mon Sep 10 10:19:34 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/lib/tk/menu.rb: use TkCommandNames on create_self()
+ * enc/depend: fixed wrong change in a part of r34802.
- * ext/tk/lib/tk/root.rb: TkRoot.to_eval() returns '.'.
+Sun Sep 9 22:02:50 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/tk/lib/tk/text.rb: add methods to create a TkText::IndexString
- from (x, y) coords.
+ * ext/socket/basicsocket.c (rsock_bsock_send):
+ avoid unnecessary select() calls before doing I/O
+ Patch by Eric Wong. [Feature #4538] [ruby-core:35586]
+ * ext/socket/init.c (rsock_s_recvfrom): ditto.
+ * ext/socket/init.c (rsock_s_accept): ditto.
+ * ext/socket/udpsocket.c (udp_send): ditto.
+ * io.c (io_fflush): ditto.
+ * io.c (io_binwrite): ditto.
+ * io.c (rb_io_syswrite): ditto.
- * ext/tk/lib/tkextlib/tile/: add demo and update support status.
+Mon Sep 10 01:38:51 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Apr 9 14:42:29 2005 Kouhei Sutou <kou@cozmixng.org>
+ * io.c (nogvl_close, maygvl_close, nogvl_fclose, maygvl_fclose):
+ suppress integer <-> pointer cast warnings.
+ [Feature #4570] [ruby-core:35711]
- * sample/rss/tdiary_plugin/rss-recent.rb: supported configuration
- via Web browser.
+Mon Sep 10 01:36:00 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Apr 9 11:59:57 2005 Kouhei Sutou <kou@cozmixng.org>
+ * io.c (rb_io_close): notify fd close before releasing gvl.
+ * io.c (fptr_finalize): modify fptr->mode before releasing gvl.
+ remove unnecessary rb_thread_fd_close().
+ [Feature #4570] [ruby-core:35711]
- * lib/rss: backoported from HEAD.
+Mon Sep 10 00:16:34 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rss: refactored.
- - gave a name to 'x'.
- - undef_method -> remove_method for avoiding a warning in ruby 1.6.
+ * process.c: exec() requires to be single threaded also on Haiku.
+ by Takashi Toyoshima <toyoshim@gmail.com>
+ https://github.com/ruby/ruby/pull/178
+Sun Sep 9 21:21:15 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rss/parser.rb: @@setter -> @@setters.
+ * lib/thread.rb (Queue#pop): Fixed double registration issue when
+ mutex.sleep is interrupted. [Bug #5258] [ruby-dev:44448]
+ * lib/thread.rb (SizedQueue#push): ditto.
- * lib/rss/parser.rb
- (RSS::BaseListener.register_uri)
- (RSS::BaseListener.uri_registered?)
- (RSS::BaseListener.install_get_text_element):
- swapped the first argument and the second argument.
+ * test/thread/test_queue.rb (test_sized_queue_and_wakeup,
+ test_queue_pop_interrupt, test_sized_queue_pop_interrupt,
+ test_sized_queue_push_interrupt): new tests.
- * lib/rss/taxonomy.rb: swapped the first argument and the second
- argument for RSS::BaseListener.install_get_text_element.
- * lib/rss/image.rb: ditto.
- * lib/rss/syndication.rb: ditto.
- * lib/rss/dublincore.rb: ditto.
- * lib/rss/parser.rb: ditto.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/0.9.rb: ditto.
- * lib/rss/content.rb: ditto.
+Sun Sep 9 20:20:31 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rss/parser.rb
- (RSS::BaseListener.install_setter)
- (RSS::BaseListener.register_uri): changed fallback way.
+ * lib/sync.rb (Sync_m#sync_lock): Fixed wakeup/raise unsafe code.
+ Patched by Masaki Matsushita. [Bug #5355] [ruby-dev:44521]
- * lib/rss/parser.rb: added class name registry for complex model
- elements. (ex. have childlen elements, have some attributes and
- a child element and so on.)
+ * test/thread/test_sync.rb (test_sync_lock_and_wakeup,
+ test_sync_upgrade_and_wakeup, test_sync_lock_and_raise):
+ new test.
+Sun Sep 9 18:39:46 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rss/dublincore.rb: supported multiple Dublin Core items.
- * lib/rss/maker/dublincore.rb: ditto.
+ * include/ruby/intern.h (rb_thread_blocking_region): Added
+ a comment of recommended alternative way.
- * lib/rss/maker/image.rb: supproted new Dublin Core API.
+Sun Sep 9 18:37:05 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/sync.rb (Sync_m): Removed RCS_ID.
- * lib/rss/maker/base.rb: added default current_element implementation.
+Sun Sep 9 18:21:03 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_io.rb (test_advise_pipe): new test to check
+ io.advise() against anonymous io object don't make crash.
+ made by Eric Wong. [Bug #6081] [ruby-core:42880]
- * lib/rss/trackback.rb (RSS::TrackBackUtils.new_with_value_if_need):
- moved to RSS::Utils.
+Sun Sep 9 16:47:12 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rss/utils.rb (RSS::Utils.new_with_value_if_need):
- moved from RSS::TrackBackUtils.
+ * io.c (nogvl_close, maygvl_close, nogvl_fclose, maygvl_fclose):
+ new functions.
+ * io.c (fptr_finalize): release GVL if possible.
+ Patched by Eric Wong. [Feature #4570] [ruby-core:35711]
+Sun Sep 9 16:08:48 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rss/maker/image.rb: fixed invalid argument of
- add_need_initialize_variable bug.
- * lib/rss/maker/trackback.rb: ditto.
+ * io.c (io_bufread): removed unnecessary rb_thread_wait_fd().
+ Patch by Eric Wong. [Bug #6629] [ruby-core:45789]
+ * io.c (rb_io_sysread): ditto.
+ * io.c (copy_stream_fallback_body): ditto.
+Sun Sep 9 15:21:52 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rss/rss.rb (Hash#merge): added for ruby 1.6.
+ * thread.c (rb_mutex_lock): stop multiple threads use
+ pthread_cond_timedwait() concurrently. [Bug #6278] [ruby-core:44275]
- * lib/rss/rss.rb (RSS::BaseModel.date_writer): changed to accept nil
- for date value.
+Sat Sep 8 18:52:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h (struct rb_classext_struct): move allocator function into
+ rb_classext_t from ordinary method table. [ruby-dev:46121]
+ [Feature #6993]
- * test/test_dublincore.rb: added tests for plural accessor and
- multiple Dublin Core items.
+ * object.c (rb_obj_alloc): call allocator function directly.
- * test/test_setup_maker_1.0.rb: fixed swapped actual and expected
- values.
+ * vm_method.c (rb_define_alloc_func, rb_undef_alloc_func)
+ (rb_get_alloc_func): use allocator function in rb_classext_t.
- * test/rss/rss-assertions.rb (assert_multiple_dublin_core): added
- an assertion for testing multiple Dublin Core items.
+Fri Sep 7 01:21:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/rss/test_maker_dc.rb (test_rss10_multiple): added a test
- for making multiple Dublin Core items.
+ * ext/extmk.rb (extmake), lib/mkmf.rb (have_framework): fix splitting
+ options with an argument, not using NUL as special character.
+ [ruby-core:47447] [Bug #6987]
- * test/rss/test_maker_dc.rb (test_date): added a test for #date=
- and #dc_date=.
+Thu Sep 6 14:49:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * .gdbinit (rp): FLONUM support.
- * sample/rss/tdiary_plugin/rss-recent.rb:
- new option: @options['rss-recent.use-image-link']:
- use image as link instread of text if available.
+ * include/ruby/ruby.h (ruby_special_consts): define FLONUM constants
+ always, so that they are available from gdb.
- * sample/rss/tdiary_plugin/rss-recent.rb (RSS_RECENT_VERSION):
- 0.0.5 -> 0.0.6.
+ * include/ruby/ruby.h (RB_FLOAT_TYPE_P): merge FLONUM and non-FLONUM
+ versions. inline TYPE() comparison and FLONUM_P() should be
+ optimized away on non-FLONUM.
-Fri Apr 8 20:17:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 6 08:20:55 2012 Ryan Davis <ryand-ruby@zenspider.com>
- * ext/extmk.rb (extmake): hdrdir needs to be defined also in
- Config::CONFIG.
+ * lib/minitest/*: Imported minitest 3.4.0 (r7762)
+ * test/minitest/*: ditto
- * lib/mkmf.rb (configuration, create_makefile): get rid of recursive
- macro reference.
+Wed Sep 5 19:20:53 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Apr 8 18:26:56 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * parse.y (rb_warn4S): renamed from rb_warn4(), because the case in
+ r36911 takes a string.
- * ext/openssl/ossl_ssl.c: add callbacks to OpenSSL::SSL::SSLContexts.
- - SSLContext#client_cert_cb=(aProc). it is called when a client
- certificate is requested by a server and no certificate was not
- set for the SSLContext. it must return an Array which includes
- OpenSSL::X509::Certificate and OpenSSL::PKey::RSA/DSA objects.
- - SSLContext#tmp_dh_callback=(aProc). it is called in key
- exchange with DH algorithm. it must return an OpenSSL::PKey::DH
- object.
+ * parse.y (rb_warn4S): use ripper_warnS() for ripper.
- * ext/openssl/ossl_ssl.c (ossl_sslctx_set_ciphers): ignore the
- argument if it's nil.
+ * parse.y (ripper_warnS): now it is used.
- * ext/openssl/ossl_pkey.c
- (GetPrivPKeyPtr, ossl_pkey_sign): should call rb_funcall first.
- (DupPrivPKeyPtr): new function.
+Wed Sep 5 15:51:52 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/openssl/ossl_pkey_dh.c: add default DH parameters.
+ * .travis.yml (notifications): [experimental] update notification
+ template.
- * ext/openssl/ossl_pkey.h: ditto.
+Wed Sep 5 15:21:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Apr 8 01:55:20 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * parse.y (rb_warn4): added as a rb_warn variant to warn with explicit
+ source file name and line in parse.y.
- * ext/tk/sample/demos-{en,jp}/goldberg.rb: reduced window size.
- [ruby-dev:25992]
+ * parse.y (warn_unused_var): use rb_warn4 to suppress warning on ripper.
-Thu Apr 7 23:58:40 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Sep 5 13:30:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/extmk.rb (extmake): keep directory names in Makefile as macros.
+ * dir.c (glob_make_pattern): names under recursive need to be single
+ basenames to match for each name. [ruby-core:47418] [Bug #6977]
- * lib/mkmf.rb (configuration, create_makefile): ditto.
+Tue Sep 4 20:55:17 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * lib/mkmf.rb (CXX_EXT): separate C++ extensions.
+ * test/ruby/envutil.rb (EnvUtil#invoke_ruby): show Timeout::Error
+ instead of IOError if the timeout has expired.
-Thu Apr 7 17:43:25 2005 Shugo Maeda <shugo@ruby-lang.org>
+ * test/test_pstore.rb
+ (PStoreTest#test_pstore_files_are_accessed_as_binary_files):
+ increase timeout because this test is slow on Windows.
+ [ruby-core:47402] [Bug #6965]
- * eval.c (rb_call0): "return" event hook should be always executed
- if event_hooks is set. fixed: [ruby-core:04662]
- (backported from HEAD)
+Tue Sep 4 11:28:57 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Mon Apr 4 23:17:52 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm_eval.c (ruby_eval_string_from_file_protect): initializer
+ element is not computable at load time.
- * ext/tk/lib/tk.rb (TkComm#array2tk_list): accept enc-mode argument to
- decide whether convert encoding of each element or not.
+Tue Sep 4 07:48:35 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/tk/lib/tk/variable.rb (TkVariable#value=): fail to convert the
- encoding of array elements when assign an array to an TkVariable
- object.
+ * test/openssl/test_asn1_rb:
+ test/openssl/test_ssl_session.rb:
+ test/openssl/test_x509name.rb:
+ test/openssl/test_buffering.rb:
+ test/openssl/test_x509cert.rb:
+ test/openssl/test_ssl.rb: Refactor code that leads to warnings on
+ Ruby CI.
-Mon Apr 4 10:26:48 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Sep 4 07:02:56 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/tk/lib/tk/dialog.rb: fixed typo.
+ * test/openssl/utils.rb: Use DSS1 as DSA signature digest for all
+ OpenSSL versions < 1.0.0.
+ [Feature #6946] [ruby-core:47405]
-Sun Apr 3 17:16:33 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Sep 3 21:22:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.{h,c} (rb_w32_fdopen): avoid warning on bcc32.
- (backported from HEAD)
+ * include/ruby/ruby.h (rb_float_value): suppress warnings.
+ [ruby-core:47406][Bug #6971]
-Sat Apr 2 23:38:54 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Sep 3 14:49:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (CP, INSTALL): get rid of less portable options.
+ * lib/matrix.rb (Vector#magnitude): accumulate squares of absolute
+ values to fix for complex vector. [ruby-dev:46100] [Bug #6966]
- * lib/mkmf.rb (configuration, create_makefile): correct configuration
- variable.
+Mon Sep 3 10:09:36 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * {bcc32,win32,wince}/{Makefile.sub,setup.mak}: leave prefix empty in
- config.status for backward compatibility. fixed: [ruby-core:04649]
+ * ext/openssl/extconf.rb: Detect OpenSSL_FIPS macro
+ ext/openssl/ossl.c: Expose OpenSSL::OPENSSL_FIPS constant to
+ indicate whether OpenSSL runs in FIPS mode.
+ test/openssl/test_pkey_dh.rb: Generate 256 bit keys for
+ non-FIPS installations to improve test performance (e.g. for
+ rubyci).
+ test/openssl/utils.rb: Replace DSS1 as certificate signature
+ digest with SHA1 for FIPS installations when using DSA by
+ introducing TestUtils::DSA_SIGNATURE_DIGEST.
+ test/openssl/test_x509cert.rb:
+ test/openssl/test_x509crl.rb:
+ test/openssl/test_x509req.rb: Use DSA_SIGNATURE_DIGEST
+ NEWS: Introduce OpenSSL::OPENSSL_FIPS
- * lib/mkmf.rb (create_makefile): ensure library directories get made
- before copying libraries there.
+ These changes allow running the OpenSSL tests in FIPS mode
+ while keeping a high performance for non-FIPS installations.
+ Introduction of OpenSSL::OPENSSL_FIPS allows for applications
+ to react to special requirements when using OpenSSL in FIPS mode.
+ [Feature #6946] [ruby-core:47345]
-Sat Apr 2 16:59:46 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sun Sep 2 21:46:28 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/tk/lib/tk.rb: forgot to update RELEASE_DATE
+ * test/openssl/utils.rb: Use a cached DH key instead of generating a
+ new one each time.
- * ext/tk/lib/tk/variable.rb: fix namespace trouble when autoloading
+Sun Sep 2 05:41:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/lib/tk/palette.rb: define Tcl variable 'tkPalette' as global
+ * lib/webrick/ssl.rb (WEBrick::Config::SSL): add new key
+ SSLTmpDhCallback to set SSLContext#tmp_dh_callback.
- * ext/tk/lib/tk/dialog.rb: use array2tk_list method when calling
- Tk.ip_eval.
+ * lib/webrick/ssl.rb (WEBrick::GenericServer#setup_ssl_context):
+ follow above.
- * ext/tk/lib/tk/autoload.rb: add autoload entry 'TkDialogObj' and
- 'TkWarningObj'
+Sat Sep 1 18:50:50 2012 Akinori MUSHA <knu@iDaemons.org>
-Sat Apr 2 02:19:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/set.rb (#initialize_copy, #eql): Use instance_variable_get
+ instead of instance_eval.
- * ext/tk/lib/tk.rb (TkWindow.initialize): accept 'without_creating'
- option without 'widgetname' option to allow creating a widget object
- which is used as an argument of Tcl/Tk's widget allocation commands.
+Fri Aug 31 21:47:56 2012 Kouhei Sutou <kou@cozmixng.org>
- * ext/tk/lib/tk/image.rb (TkImage.initialize): accept 'imagename'
- option to create a image object by the given name.
+ * lib/test/unit/test-unit.gemspec: Make test/unit default gem.
+ [Feature #6875] [ruby-dev:46051]
-Thu Mar 31 22:23:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Aug 31 18:35:02 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * lib/mkmf.rb (SRC_EXT): exclude just case different suffixes on case
- insensitive file system platforms.
+ * ext/openssl/extconf.rb: Check existence of OPENSSL_NPN_NEGOTIATED.
+ ext/ossl_ssl.c: Support Next Protocol Negotiation. Protocols to be
+ advertised by the server can be set in the SSLContext by using
+ SSLContext#npn_protocols=, protocol selection on the client is
+ supported by providing a selection callback with
+ SSLContext#npn_select_cb. The protocol that was finally negotiated
+ is available through SSL#npn_protocol.
+ test/openssl/test_ssl.rb: Add tests for Next Protocol Negotiation.
+ NEWS: add news about NPN support.
+ [Feature #6503] [ruby-core:45272]
- * README.EXT, README.EXT.ja (Appendix C): utility functions.
+Fri Aug 31 17:38:43 2012 Akinori MUSHA <knu@iDaemons.org>
-Thu Mar 31 14:15:44 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/set.rb (Set#{each,reject!,select!}, SortedSet#each): Pass
+ the original block through instead of creating one that only
+ yields the passed argument.
- * ext/openssl/ossl_engine.c (ossl_engine_s_load): should return
- value. [ruby-dev:25971]
+Fri Aug 31 16:23:20 2012 Akinori MUSHA <knu@iDaemons.org>
-Thu Mar 31 08:25:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/ipaddr.rb: Introduce several new error classes where only
+ ArgumentError and StandardError were used. IPAddr::Error is
+ their common ancestor class that inherits from ArgumentError for
+ backward compatibility. Submitted by Jon Daniel. Fixes #173 on
+ GitHub.
- * common.mk (RUBYOPT): clear for the environment RubyGems installed.
+Fri Aug 31 14:51:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * common.mk (clean-local): keep $(PREP) files till distclean.
+ * test/bigdecimal/test_bigdecimal.rb (TestBigDecimal#test_to_f): added
+ for previous commit.
- * common.mk (check): do all tests.
+Fri Aug 31 14:32:05 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Mar 31 06:00:20 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): use self's sign to
+ determine 0.0 and Inf's sign instead of internal double value's.
+ Reported by phasis68 (Heesob Park) at [ruby-core:47381] [Bug #6955]
- * ext/openssl/ossl_engine.c (ossl_engine_s_load): should not raise
- error even if the specified engine could not be loaded. (Dynamic
- engines don't have fixed name to load.)
+Fri Aug 31 14:31:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Mar 31 00:18:27 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * template/id.h.tmpl, tool/id2token.rb: make id.h independent from
+ parse.h, and make parse.c dependent on it instead.
- * win32/ifchange.bat, win32/rm.bat: backported from HEAD.
+Fri Aug 31 14:27:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 30 23:44:50 2005 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+ * lib/mkmf.rb (create_makefile): fix race conditions at install-ext.
+ target files need to depend on destination directory timestamp
+ files, not phony targets.
- * Makefile.in, */Makefile.sub, */configure.bat,
- cygwin/GNUmakefile.in, common.mk, configure.in, ext/extmk.rb,
- lib/mkmf.rb, instruby.rb, runruby.rb: backport extout.
- [ruby-dev:25963]
+Fri Aug 31 14:03:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 30 17:41:48 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm_trace.c (clean_hooks): do not access freed memory.
- * ext/tcltklib/tcltklib.c: add TclTkIp#_create_console() method to
- create a Tcl/Tk's console window.
+ * vm_trace.c (rb_threadptr_exec_event_hooks): fix uninitialized state
+ when no events is executed.
- * ext/tk/lib/multi-tk.rb: support TclTkIp#_create_console() method.
+Thu Aug 30 18:21:51 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/remote-tk.rb: ditto.
+ * io.c (rb_io_close): call rb_last_status_clear.
- * ext/tk/lib/tk/console.rb: ditto.
+Thu Aug 30 16:17:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk.rb: update RELEASE_DATE
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): check underflow since
+ strtod() sets errno to ERANGE at underflow too. [ruby-core:47342]
+ [Bug #6944]
- * ext/tk/sample/demo-*/check2.rb: use 'return' in the Proc object.
+Thu Aug 30 12:44:43 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/tk/sample/tkextlib/**: ditto.
+ * lib/set.rb (Set#{<,>,<=,>=}): Define comparison operators as
+ shorthand for the {proper_}{subset?,superset?} methods (finally).
+ Given a push by Alexander E. Fischer.
-Tue Mar 29 22:11:56 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Thu Aug 30 09:21:01 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/rinda/test_rinda.rb: use DRbObject.new_with instead of reinit.
- [ruby-dev:25961]
+ * lib/uri/ftp.rb (URI::FTP#initialize): raise InvalidURIError if "//"
+ is not present [ruby-core:47344] [Bug #6945]
-Mon Mar 28 23:40:40 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Thu Aug 30 07:45:12 2012 Luis Lavena <luislavena@gmail.com>
- * lib/drb/drb.rb: move method DRbObject#reinit to DRbObject.new_with.
- extract method DRbObject.prepare_backtrace. add DRb.regist_server,
- remove_server, fetch_server. change server in thread variable if
- in-proc server. [druby-ja:113]
+ * test/ruby/test_file_exhaustive.rb: fix test introduced in r36811 for
+ posix environments where HOME is not defined. [ruby-core:47322]
- * lib/drb/gw.rb: ditto.
+Wed Aug 29 23:42:59 2012 Tanaka Akira <akr@fsij.org>
-Mon Mar 28 20:43:34 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h (rb_last_status_clear): declared.
- * ext/syck/rubyext.c: get rid of warnings caused by a bug of VC.
+ * process.c (rb_last_status_clear): exported.
+ (rb_f_system): call rb_last_status_clear.
-Mon Mar 28 08:39:49 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_f_backquote): call rb_last_status_clear.
- * ext/iconv/iconv.c (iconv_create): Iconv::Failure requires 3
- arguments. (pointed out by NaHi)
+Wed Aug 29 22:01:15 2012 Tanaka Akira <akr@fsij.org>
-Sat Mar 26 22:51:33 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * process.c (rb_f_system): check failures of waitpid.
+ [ruby-talk:398687]
- * ext/tk/lib/tk.rb (_callback_entry_class?): add for checking whether
- a class is available for a callback entry.
+Wed Aug 29 15:03:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk.rb (after_cancel): add Tk.after_cancel(afterID) method.
+ * configure.in (LIBDIR_BASENAME): use configured libdir value to fix
+ --enable-load-relative on systems where libdir is not default value,
+ overridden in config.site files. [ruby-core:47267] [Bug #6903]
- * ext/tk/lib/tk.rb (array2tk_list): change from private module method
- of TkComm to public module method.
+ * ruby.c (ruby_init_loadpath_safe): ditto.
- * ext/tk/lib/tk.rb (cget): add check that slot argument is not
- empty string.
+Wed Aug 29 14:34:41 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/lib/tk.rb (configinfo): ditto.
+ * addr2line.c: SIZE_MAX is defined in stdint.h, so r36755 breaks
+ 32bit FreeBSD. [ruby-core:47360] [Bug #6948]
- * ext/tk/lib/tk/itemconfig.rb (itemcget): add check that slot argument
- is not empty string.
+Wed Aug 29 04:50:04 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/tk/lib/tk/itemconfig.rb (itemconfiginfo): ditto.
+ * test/openssl/utils.rb
+ test/openssl/test_pair.rb
+ test/openssl/test_pkey_dh.rb: Use 1024 bit DH parameters to satisfy
+ OpenSSL FIPS requirements. Patch by Vit Ondruch.
+ [Bug #6938] [ruby-core:47326]
- * ext/tk/lib/tk/entry.rb: add TkEntry#icursor and icursor= (alias of
- cursor and cursor= method).
+Tue Aug 28 22:31:49 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * ext/tk/lib/tk/font.rb: improve font treatment when the font name is
- empty string.
+ * insns.def (checkmatch): suppress warnings. [ruby-core:47339]
+ [Bug #6930]
- * ext/tk/lib/tk/variable.rb: add :variable, :window and :procedure
- type.
+Tue Aug 28 20:03:54 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/lib/tk/variable.rb: improve treatment of array-type
- tkvariable.
+ * configure.in: Fixing Haiku R1/alpha3 build with gcc-4.4.4.
+ - omit ANSI standard flags to compile socket extension where
+ anonymous union is required.
+ - remove redundant -be flags.
+ by Takashi Toyoshima <toyoshim@gmail.com>
+ https://github.com/ruby/ruby/pull/168
- * ext/tk/lib/tkextlib/blt.rb: add commands for zooming.
+Tue Aug 28 11:32:37 2012 Yuki Yugui Sonoda <yugui@google.com>
- * ext/tk/lib/tkextlib/blt/*: bug fix.
+ * nacl/GNUmakefile.in (.rbconfig.time): r36828 was incomplete.
+ It did not run correctly on clean build.
- * ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: bug fix and add methods
- to call TreeCtrl commands for bindings.
+Tue Aug 28 09:25:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/sample/tkextlib/blt/*: new sample scripts.
+ * win32/Makefile.sub (Makefile): make to depend on common.mk, to
+ stop and force to re-run make process when common.mk is changed.
- * ext/tk/sample/tkextlib/treectrl/*: ditto.
+Mon Aug 27 20:19:49 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Fri Mar 25 10:53:16 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+ * test/etc/test_etc.rb (TestEtc#test_getgrgid): fix for non unique GID.
+ No unixen systems guarantee that GID is unique. Etc.getgrgid would
+ not return the first entry in the order of Etc.group for shared GID.
+ [ruby-core:47312] [Bug #6935]
- * configure.in (WIN32_LEAN_AND_MEAN): removed because a lot of
- troubles. [ruby-list:40721]
+Mon Aug 27 18:19:36 2012 Koichi Sasada <ko1@atdot.net>
-Thu Mar 24 23:10:44 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/ruby.h (rb_float_value): optimize it.
+ This technique was pointed by shinichiro.hamaji
+ <http://shinh.skr.jp/m/?date=20120825#p02>.
- * lib/mkmf.rb (macro_defined?): try to compile for an old compiler
- which doesn't bail out at #error directive. [ruby-dev:25818]
+Mon Aug 27 15:08:25 2012 Yuki Yugui Sonoda <yugui@google.com>
- * lib/mkmf.rb (check_sizeof): refine logging messages.
+ * common.mk (vm_trace.o): Added a missing dependency.
-Thu Mar 24 03:57:48 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Aug 26 09:29:32 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * lib/webrick/utils.rb (WEBrick::Utils.create_listeners):
- - should raise ArgumentError if no port is specified.
- - even if the specified port is 0, all TCPServers should be
- initialized with the port given to the first one.
+ * nacl/GNUmakefile.in (package): make package should install
+ example.html for nacl build
- * lib/webrick/server.rb (WEBrick::GenericServer#initialize): if :Port
- parameter is 0, it should be updated with the port number which
- actually listened.
+ Patch by Takashi Toyoshima <toyoshim AT gmail.com>.
-Wed Mar 23 00:35:10 2005 Shugo Maeda <shugo@ruby-lang.org>
+Sun Aug 26 09:22:33 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * test/ruby/test_settracefunc.rb (test_event): added tests for
- "class" and "end" and "raise".
+ * nacl/GNUmakefile.in (CC, LD, NM, AR, AS, RANLIB, OBJDUMP, OBJCOPY)
+ Rewrites these variables instead of PATH.
+ NaCl port uses a toolchain which is specified by NACL_SDK_ROOT
+ environment variable. Originally, NaCl build added the toolchain
+ under the NACL_SDK_ROOT to the PATH. But updating PATH doesn't work
+ on Mac.
+ (RBCONFIG): Replaces configs with the variable updates above.
-Tue Mar 22 22:40:18 2005 Shugo Maeda <shugo@ruby-lang.org>
+ * configure.in: Thus it is no longer necessary to check $PATH.
- * eval.c (rb_call0): check event_hooks instead of trace_func.
+ Based on a patch by Takashi Toyoshima <toyoshim AT gmail.com>.
-Tue Mar 22 17:30:44 2005 Shugo Maeda <shugo@ruby-lang.org>
+Sun Aug 26 16:53:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_add_event_hook): new function to add a hook function for
- interpreter events. (backported form HEAD)
+ * insns.def (checkmatch): suppress warnings. [ruby-core:47310]
+ [Bug #6930]
-Sun Mar 20 22:51:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h (VM_FRAME_TYPE_FINISH_P): ditto.
- * lib/mkmf.rb (mkmf_failed): check if Makefile is created without
- create_makefile.
+Fri Aug 24 15:42:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Mar 19 23:48:10 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb (create_makefile): use timestamp for destination
+ directories to make them before making or copying files there.
+ [ruby-dev:46067] [Bug #6904]
- * misc/ruby-mode.el (ruby-expr-beg): returned true always.
- fixed: [ruby-list:40683]
+Fri Aug 24 12:40:15 2012 Luis Lavena <luislavena@gmail.com>
-Sat Mar 19 00:41:02 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * configure.in (mingw): add shlwapi to the list of dependency
+ libs for Windows.
+ * win32/Makefile.sub (EXTSOLIBS): ditto.
- * ext/tk/lib/tk/font.rb: add some TkFont class methods to get font
- information without creating a TkFont object.
+ * internal.h: declare internal functions rb_w32_init_file,
+ rb_file_expand_path_internal and rb_file_expand_path_fast.
- * ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: bug fix and define some
- classes for components of Tk::TreeCtrl
+ * file.c (Init_File): invoke Windows initialization rb_w32_init_file
-Thu Mar 17 17:42:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * win32/file.c (rb_file_load_path_internal): new function.
+ Windows-specific implementation that replaces file_expand_path.
+ [Bug #6836][ruby-core:46996]
- * struct.c (make_struct): allow non local-id field
- names. [ruby-core:04575]
+ * win32/file.c (rb_w32_init_file): new function. Initialize codepage
+ cache for faster conversion encodings lookup.
- * struct.c (inspect_struct): ditto.
+ * file.c (file_expand_path): rename to rb_file_expand_path_internal.
+ Conditionally exclude from Windows.
-Wed Mar 16 23:36:02 2005 Shugo Maeda <shugo@ruby-lang.org>
+ * file.c (rb_file_expand_path_fast): new function. delegates to
+ rb_file_expand_path_internal without performing a hit to the
+ filesystem.
- * eval.c (rb_call0): call_cfunc() should be protected.
+ * file.c (file_expand_path_1): use rb_file_expand_path_internal without
+ path expansion (used by require).
+ * file.c (rb_find_file_ext_safe): ditto.
+ * file.c (rb_find_file_safe): ditto.
- * test/ruby/test_settracefunc.rb: added test for c-return.
+ * load.c (rb_get_expanded_load_path): use rb_file_expand_path_fast.
+ * load.c (rb_feature_provided): ditto.
-Wed Mar 16 22:20:25 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * file.c (rb_file_expand_path): use rb_file_expand_path_internal with
+ path expansion.
+ * file.c (rb_file_absolute_path): ditto.
- * object.c (str_to_id): fixed typo.
+ * test/ruby/test_file_exhaustive.rb: new tests to exercise
+ rb_file_expand_path_internal implementation and compliance with
+ existing behaviors.
-Wed Mar 16 18:08:32 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Aug 24 07:35:24 2012 Eric Hodel <drbrain@segment7.net>
- * eval.c (rb_call0): reorganize "return" event post.
+ * lib/net/http/backward.rb (class Net): Restored Net::HTTPSession to
+ fix backwards-compatibility with ancient Net::HTTP. [Bug #6889]
-Tue Mar 15 23:49:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Aug 23 20:58:55 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * ext/iconv/iconv.c (Init_iconv): InvalidEncoding also should include
- Iconv::Failure.
+ * common.mk: support `make id.h` without `rm .id.h.time` after
+ `rm id.h`.
-Tue Mar 15 16:38:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Aug 23 20:48:45 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/tkutil.c (ary2list): give wrong arguments to hash2kv()
+ * test/ruby/test_fixnum.rb (TestFixnum#test_singleton_method): new test.
-Mon Mar 14 19:39:33 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/ruby/test_bignum.rb (TestBignum#test_singleton_method): ditto.
- * ext/tk/lib/tk/timer.rb (TkTimer): forgot to clear @return_value
- when restarting
+ * test/ruby/test_float.rb (TestFloat#test_singleton_method): ditto.
- * ext/tk/lib/tk/sample/cd_timer.rb: new sample of TkRTTimer
+ * test/ruby/test_symbol.rb (TestSymbol#test_singleton_method): ditto.
-Mon Mar 14 12:21:03 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Aug 23 20:34:32 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/lib/tk/timer.rb (TkRTTimer): forgot to reset the callback
- time. So, 'continue' do all callbacks between 'stop' and 'continue'.
+ * class.c (singleton_class_of): flonum can't have singleton class.
-Mon Mar 14 08:14:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm.c (vm_define_method): flonum can't have singleton method.
- * object.c (str_to_id): warn for NUL containing strings.
+Thu Aug 23 19:18:33 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Mar 14 00:13:49 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * common.mk (win32/*): macro RUBY_H_INCLUDES is not defined there,
+ so need to move dependency rules under the definition of it.
- * ext/tk/lib/tk/timer.rb (TkRTTimer): correct calculation of offset
- value. get a little better accuracy.
+Thu Aug 23 19:16:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/sample/demos-en/widget: use a binding with no local variables
- when eval a sample script.
+ * win32/Makefile.sub: refactoring. remove unused rules, and update
+ some rules which are not used usually to fit current macros.
- * ext/tk/sample/demos-en/bind.rb: ditto.
+Thu Aug 23 16:46:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/sample/demos-en/tcolor: ditto.
+ * file.c (rb_find_file_ext_safe, rb_find_file_safe): default to
+ US-ASCII for encdb and transdb.
- * ext/tk/sample/demos-jp/widget: ditto.
+ * load.c (search_required): keep encoding of feature name. set
+ loading path to filesystem encoding. [Bug #6377][ruby-core:44750]
- * ext/tk/sample/demos-jp/bind.rb: ditto.
+ * ruby.c (add_modules, require_libraries): assume default external
+ encoding as well as ARGV.
- * ext/tk/sample/demos-jp/tcolor: ditto.
+Thu Aug 23 16:20:04 2012 Koichi Sasada <ko1@atdot.net>
-Sun Mar 13 10:04:17 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * include/ruby/ruby.h: introduce flonum technique for
+ 64bit CPU environment (sizeof(double) == sizeof(VALUE)).
+ flonum technique enables to avoid double object creation
+ if the double value d is in range about between
+ 1.72723e-77 < |d| <= 1.15792e+77 or 0.0.
+ flonum Float value is immediate and their lowest two bits
+ are b10.
+ If flonum is activated, then USE_FLONUM macro is 1.
+ I'll write detailed in this technique on
+ https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/Flonum_tech
- * test/rinda/test_rinda.rb: remove test_gc. [ruby-dev:25871]
+ * benchmark/bmx_temp.rb: add an benchmark for simple
+ Float calculation.
-Thu Mar 10 19:12:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * gc.c (id2ref, rb_obj_id): add flonum Float support.
- * ext/tcltklib/tcltklib.c (lib_eventloop_ensure): mis-delete a timer
- handler when exit from a recursive called eventloop
+ * include/ruby/intern.h: move decl of rb_float_new(double)
+ to include/ruby/ruby.h.
- * ext/tk/lib/tk/timer.rb: new TkRTTimer class, which can works for a
- realtime operation
+ * insns.def, vm.c, vm_insnhelper.c: add flonum optimization
+ and simplify source code.
- * ext/tk/sample/tkrttimer.rb: sample of TkRTTimer class
+ * vm_insnhelper.h (FLONUM_2_P): added.
- * ext/tk/lib/tk/textmark.rb: move TkTextMark#+ and TkTextMark#- to
- TkText::IndexModMethods
+ * marshal.c: support flonum output.
- * ext/tk/lib/tk/text.rb: improve TkTextMark#+ and TkTextMark#-, and
- add them to TkText::IndexModMethods module
+ * numeric.c (rb_float_new_in_heap): added.
- * ext/tk/sample/tktextio.rb: add test part of "seek by text index
- modifiers"
+ * parse.y: support flonum.
-Thu Mar 10 08:10:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * random.c: ditto.
- * re.c (make_regexp): need to free internal regexp structure when
- compilation fails. [ruby-talk:133228]
+Thu Aug 23 16:12:40 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Mar 9 20:25:58 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/mkmf.rb (create_makefile): add dependency to header files when
+ depend files don't exist. now we can remove simple (and often
+ wrong) depend files in most cases.
- * ext/openssl/ossl_ssl.c (ossl_start_ssl, ossl_ssl_write): call
- rb_sys_fail if errno isn't 0. [ruby-dev:25831]
+Thu Aug 23 16:02:20 2012 Koichi Sasada <ko1@atdot.net>
- * ext/openssl/lib/openssl/cipher.rb: fix typo. [ruby-dev:24285]
+ * ext/date/depend: add dependency to $(ruby_headers).
-Wed Mar 9 15:46:35 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Aug 23 12:51:39 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/webrick/server.rb (WEBrick::GenericServer#start): should
- restore @token if accept failure. suggested by Dominique Brezinski.
- [ruby-core:04518]
+ * insns.def (invokesuper): reverted r36640 partially to make super
+ in a thread work correctly. [ruby-core:47284] [Bug #6907]
-Wed Mar 9 13:37:57 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/ruby/test_super.rb: related test.
- * ext/tk/sample/tktextio.rb: fix bug of handling 'end' position.
- support initial text, overwrite setting and pos_gravity control.
+Thu Aug 23 12:30:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Mar 8 18:16:55 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * win32/configure.bat: support --with(out)?-ext(ensions) options.
- * ext/tk/sample/tktextio.rb: New sample script. TkTextIO class in this
- sample supports to use a text widget as if it is a I/O stream (such
- like as StringIO class).
+Thu Aug 23 11:52:04 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Mar 8 13:54:40 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * configure.in: Fixing Haiku build.
+ - -lbe is not required for linking
+ - stack protector doesn't work for now because of the default gcc's
+ bug
+ by Takashi Toyoshima <toyoshim@gmail.com>
+ https://github.com/ruby/ruby/pull/167
- * ext/socket/socket.c: workaround for some of 4.4BSD-Lite derived OSs.
+ * signal.c (ruby_signal): haiku doesn't have SIGBUS.
-Tue Mar 8 12:36:17 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Aug 23 11:32:44 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/socket/socket.c: document from Sam Roberts
- <sroberts@uniserve.com> for getsockopt and setsockopt is merged.
- [ruby-doc:824]
+ * test/open-uri/test_open-uri.rb (TestOpenURI#test_read_timeout): this
+ test expects that the server thread will be killed in sleep, but 0.01
+ sec is too short to reach there.
-Tue Mar 8 01:27:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Aug 23 10:49:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/nkf/nkf-utf8/nkf.c: follow nkf 1.66
- fixed: [ruby-dev:25828]
+ * configure.in: use the value of --with-opt-dir on building ruby
+ itself. [ruby-dev:46064] [Bug #6900]
-Mon Mar 7 21:35:02 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Aug 23 10:36:35 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * sample/webrick/httpsd.rb: fix typo in comment. suggested by
- Kazuhiko Shiozaki.
+ * common.mk (ID_H_TARGET): revert a part of r36724 and r36751. they
+ break mswin build from clean source.
-Mon Mar 7 14:55:43 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Aug 23 02:37:35 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * eval.c (block_pass): should not push unique number if a block is
- not an orphan. [ruby-dev:25808]
+ * ext/syck: removed. Fixes [ruby-core:43360]
-Wed Feb 16 02:55:21 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/syck: removed.
- * ext/openssl/ossl_ssl.c (ossl_start_ssl, ossl_ssl_read,
- ossl_ssl_write):
- - need to set errno on Win32 platform.
- - should call rb_sys_fail instead of rasing SSLError if
- SSL_ERROR_SYSCALL occured.
- - should wait for that the underlying IO become readable or
- writable if the error was SSL_ERROR_WANT_READ or
- SSL_ERROR_WANT_WRITE. [ruby-dev:25795]
+ * lib/yaml.rb: only require psych, show a warning if people try to set
+ the engine to syck.
- * ext/openssl/lib/openssl/buffering.rb
- (Buffering#initialize): should set @eof and @rbuffer.
- (Buffering#fill_rbuff): should rescue Errno::EAGAIN.
- (Buffering#consume_rbuf): pointless eof flag resetting is deleted.
- (Buffering#read): should return an empty string if the specified
- size is zero.
- (Buffering#readpartial): new method.
- (Buffering#readline): fix typo.
- (Buffering#getc): return the first character of string correctly.
- (Buffering#each): fix typo. suggested by Brian Ollenberger.
- (Buffering#readchar): fix typo.
- (Buffering#eof?): should read again it the input buffer is empty.
- (Buffering#do_write): should rescue Errno::EAGAIN.
- (Buffering#puts): use "\n" as the output field separator.
+Thu Aug 23 01:46:53 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/openssl/lib/openssl/ssl.rb: set non-blocking flag to the
- underlying IO.
+ * insns.def: search up the cf stack for an object that is an instance
+ of the recipient class. Fixes [ruby-core:47186]
- * ext/openssl/extconf.rb: get rid of GNUmakefile generation.
+ * test/ruby/test_super.rb: related test.
- * text/openssl/test_pair.rb: test for IO like methods.
+Wed Aug 22 19:46:24 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * test/ruby/ut_eof.rb: test about empty file.
+ * ext/date/date_core.c: [ruby-core:47266].
-Mon Mar 7 10:22:06 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+Wed Aug 22 19:41:19 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/un.rb: should use OptionParser. (backported form HEAD)
+ * ext/date/date_core.c: [ruby-core:47226].
-Mon Mar 7 09:18:42 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Aug 22 16:57:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_cmp_m): should not return false but nil.
- fixed: [ruby-dev:25811]
+ * lib/mkmf.rb (configuration): extract least ruby headers list as
+ ruby_headers, so depend files can use default dependency
+ explicitly.
-Mon Mar 7 01:22:14 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Aug 22 15:27:50 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/tkutil.c: remove the some codes which depend on the
- difference between Ruby1.8 and 1.9, because st.c on Ruby1.9
- was changed.
+ * vm_insnhelper.c (vm_setup_method): fix last commit of
+ vm_insnhelper.c (r36771). [ruby-dev:46065] [Bug #6901]
+ Should not disable tail call opt on FINISH_FRAME.
+ This flag should be propagated correctly.
-Mon Mar 7 00:01:04 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Aug 22 14:05:23 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tcltklib/tcltklib.c: fail to call TclTkLib.mainloop when $SAFE==4
+ * vm_trace.c: support TracePoint. [ruby-trunk - Feature #6895]
-Sun Mar 6 16:41:33 2005 Minero Aoki <aamine@loveruby.net>
+ * test/ruby/test_settracefunc.rb: add tests for above.
- * lib/net/http.rb: HTTPHeader holds its header fields as an array
- (backport from CVS HEAD rev 1.112-1.123). [ruby-list:40629]
+ * proc.c (rb_binding_new_with_cfp): add an internal function.
- * test/net/http/test_httpheader.rb: new file.
+ * vm.c (rb_vm_control_frame_id_and_class): add an internal function.
-Sun Mar 6 11:47:10 2005 Sam Roberts <sroberts@uniserve.com>
+ * vm_trace.c: add rb_add_event_hook2() and rb_thread_add_event_hook2().
+ Give us the good name for them!
- * lib/pp.rb: rdoced. [ruby-core:4490]
+Wed Aug 22 11:38:16 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Sun Mar 6 11:36:37 2005 Tanaka Akira <akr@m17n.org>
+ * .travis.yml (before_script): Turned out that make -j is broken.
- * lib/pp.rb (File::Stat#pretty_print): Etc.getpwuid and Etc.getgrgid
- may return nil. [ruby-talk:129826]
- reported by Daniel Berger.
+Wed Aug 22 11:23:35 2012 Shugo Maeda <shugo@ruby-lang.org>
-Sat Mar 5 18:06:21 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * vm_insnhelper.c (vm_setup_method): should not enable tail call
+ optimization for frames with VM_FRAME_FLAG_FINISH.
+ [ruby-dev:46065] [Bug #6901]
- * dir.c (fnmatch): removed unnecessary code. (ruby_1_8 didn't have
- String#clear, so [ruby-dev:24749] didn't affect it)
+Wed Aug 22 11:20:47 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/win32.c (NtInitialize): ditto. (by numeric.c 1.101.2.14)
+ * lib/rubygems/test_case.rb: run test with psych if exist.
-Sat Mar 5 16:29:26 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Aug 16 12:09:51 2012 Yuki Yugui Sonoda <yugui@google.com>
- * ext/tk/lib/multi-tk.rb: freeze callback-entry objects
+ * nacl/pepper_main.c (init_loadpath): Pushes the correct load path on
+ other architectures than x86_64. Fixes #6873.
- * ext/tk/lib/tkextlib/tile.rb: support tile-0.6
+Wed Aug 15 19:37:33 2012 Yuki Yugui Sonoda <yugui@google.com>
-Fri Mar 4 19:39:28 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (ac_cv_func_shutdown): shutdown(2) has a dummy
+ implementation but has no declaration and does not work in
+ NativeClient SDK pepper_20.
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#do_includes): replace
- also locally defined modules.
+Wed Aug 15 19:29:29 2012 Yuki Yugui Sonoda <yugui@google.com>
- * ext/iconv/iconv.c: backport Iconv::InvalidEncoding from CVS HEAD.
+ * common.mk (vm_backtrace.o): Added missing dependencies.
- * ext/strscan/strscan.c: moved misplaced rdoc.
+ * ext/nkf/depend (nkf.o): ditto.
-Fri Mar 4 15:58:12 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/ripper/depend (ripper.o) ditto.
- * lib/cgi-lib.rb: add deprecation warning. [ruby-dev:25499]
- getopts.rb, parsearg.rb, importenv.rb as well.
+Wed Aug 22 07:27:00 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Mar 4 11:17:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/cgi/util.rb (CGI.escapeHTML): use &#39;
+ [ruby-core:47221] [Bug #6861]
- * ext/tcltklib/tcltklib.c (ip_rbUpdateCommand): get rid of
- warnings with Tcl/Tk 8.3 or former (backport from CVS_HEAD).
+Tue Aug 21 21:59:22 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * ext/tcltklib/tcltklib.c (ip_rb_threadUpdateCommand): ditto.
+ * lib/observer.rb: fix typo. https://github.com/ruby/ruby/pull/162 by
+ unsymbol (Philip Cunningham).
-Fri Mar 4 10:15:30 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Aug 21 20:30:06 2012 Benoit Daloze <eregontp@gmail.com>
- * lib/set.rb (SortedSet::setup): a hack to shut up warning.
- [ruby-talk:132866]
+ * test/fileutils/test_fileutils.rb (TestFileUtils#teardown):
+ do not assume cwd is TMPROOT and never remove current directory.
+ [ruby-core:47224][Bug #6884]
-Fri Mar 4 07:07:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Aug 21 17:29:56 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/nkf/nkf-utf8/nkf.c: follow nkf 1.63
+ * addr2line.c (fill_lines): need check and cast of the file size of
+ target binary because there are some platforms which off_t > size_t.
-Thu Mar 3 23:49:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Aug 21 17:07:58 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/nkf/nkf-utf8/nkf.c: follow nkf 1.62
+ * .travis.yml (compiler): [experimental] clang support.
-Thu Mar 3 11:49:51 2005 Kouhei Sutou <kou@cozmixng.org>
+Tue Aug 21 15:44:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * sample/rss/tdiary_plugin/rss-recent.rb: added site information.
+ * ext/dl/lib/dl/func.rb (DL::Function#bind): fixes an error in
+ test/dl/test_import.rb (DL::TestImport#test_carried_function)
+ introduced by r36718.
+ the instance of the anonymous class which wraps the block should have
+ same methods and instance variables of self.
-Wed Mar 2 19:53:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 21 14:29:22 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/extmk.rb (parse_args): add DESTDIR only when not directed
- already. fixed: [ruby-dev:25781]
+ * win32/Makefile.sub (scriptbin.mk): no need to include twice.
-Wed Mar 2 17:14:18 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Aug 21 10:52:08 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tcltklib/tcltklib.c (lib_eventloop_core): fix typo
+ * test/unit/test.rb (Test::Unit::ProxyError): new exception class to
+ wrap exceptions raised in workers in parallel test mode.
-Wed Mar 2 16:00:02 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/unit/parallel.rb (Test::Unit::Worker#puke): use above wrapper
+ exception.
+ [Bug #6882] [ruby-dev:46054]
- * ext/tcltklib/tcltklib.c: enforce thread-check and exception-handling
- to avoid SEGV trouble.
- [KNOWN BUG] When supports pthread and running multiple Tk
- interpreters, an interrupt signal causes SEGV frequently. That
- may be a trouble of Ruby's signal handler.
+Tue Aug 21 10:40:06 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/tkutil/tkutil.c; fix a bug on converting a SJIS string array
- to a Tcl's list string.
+ * test_continuation.rb (tracing_with_thread_set_trace_func):
+ fix to use Thread#set_trace_func(nil), not set_trace_func(nil).
- * ext/tk/tcltklib.c: wrap Tcl's original "namespace" command to
- protect from namespace crash.
+Tue Aug 21 09:32:41 2012 Ryan Davis <ryand-ruby@zenspider.com>
- * ext/tk/lib/multi-tk.rb: enforce exception-handling.
+ * lib/minitest/*: Imported minitest 3.3.0 (r7676)
+ * test/minitest/*: ditto
- * ext/tk/lib/multi-tk.rb: catch IRB_EXIT to work on irb.
+Tue Aug 21 09:05:32 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/lib/tk.rb: ditto.
+ * test/testunit/tests_for_parallel/ptest_forth.rb: added a test case
+ which causes an error.
- * ext/tk/tcltklib.c: add TclTkLib.mainloop_thread?
+ * test/testunit/test_parallel.rb: follow above change.
+ see [Bug #6882]
- * ext/tk/lib/multi-tk.rb: (bug fix) callback returns a value.
+Tue Aug 21 05:43:00 2012 James Edward Gray II <james@graysoftinc.com>
- * ext/tk/lib/tk/canvas.rb (delete): bug fix when multiple arguments.
+ * lib/csv.rb: Fixes #161 on github
+ * lib/csv.rb: You can now specify a pattern for :skip_lines.
+ Matching lines will not be passed to the CSV parser.
+ * lib/csv.rb: Patch by Christian Schwartz.
- * ext/tk/lib/clock.rb: fix 'no method error'.
+Tue Aug 21 05:25:41 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/lib/clock.rb (self.clicks): accept a Symbol argument.
+ * re.c (rb_reg_initialize_m): Forgot to update output for or'd-options
+ example.
- * ext/tk/lib/variable.rb: be able to set default_value_type; :numeric,
- :bool, :string, :symbol, :list, :numlist or nil (default; same to
- :string). If set a type, TkVariable#value returns a value of the
- type.
+Tue Aug 21 05:18:03 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/lib/tkextlib/tclx/tclx.rb: add Tk::TclX.signal to warn the
- risk of using TclX extension's 'signal' command.
+ * re.c (rb_reg_initialize_m): Update example to show that regexp
+ options use | an not || to avoid confusion.
- * ext/tk/sample/irbtk.rb: irb with Ruby/Tk.
+Mon Aug 20 23:02:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/sample/demos-*/anilabel.rb: bug fix on 'show code'
+ * parse.y: more descriptive token names in syntax error messages.
- * ext/tk/sample/demos-*/aniwave.rb: new Ruby/Tk animation demo.
+Mon Aug 20 20:36:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/sample/demos-*/pendulum.rb: ditto.
+ * vm_insnhelper.c (vm_call_method): follow iclasses as klass in cfp
+ but not included modules. [ruby-core:47241] [Bug #6891]
- * ext/tk/sample/demos-*/goldberg.rb: ditto.
+ * vm_insnhelper.c (vm_call_bmethod): pass defined_class to follow
+ proper ancestors. [ruby-core:47241] [Bug #6891]
- * ext/tk/sample/demos-*/widget: add entries of animation demos.
+Mon Aug 20 11:40:27 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Tue Mar 1 00:47:43 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * common.mk: fix failed to make with -j2.
+ https://gist.github.com/3397935
- * test/rinda/test_rinda.rb: backport from CVS_HEAD. use
- MockClock.sleep instead of Kernel.sleep [ruby-dev:25387]
+Mon Aug 20 10:51:01 2012 Shota Fukumori <sorah@tubusu.net>
-Tue Mar 1 00:34:24 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/test/unit.rb, lib/test/unit/parallel.rb:
+ generate error message (String) in parallel.rb instead of
+ marshalling Exception. Fixes [Bug #6882] [ruby-dev:46054]
- * lib/rinda/tuplespace.rb (Rinda::TupleSpace): improved keeper thread.
+Sun Aug 19 01:24:32 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * test/rinda/test_rinda.rb: ditto.
+ * enum.c: fix docs. https://github.com/ruby/ruby/pull/129 by
+ richardkmichael (Richard Michael).
-Mon Feb 28 11:42:23 2005 Ian Macdonald <ian@caliban.org>
+Sun Aug 19 00:47:26 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * exception error messages updated. [ruby-core:04497]
+ * lib/fileutils.rb: fix typo.
+ https://github.com/ruby/ruby/pull/155 by simonc (Simon COURTOIS).
-Mon Feb 28 09:03:09 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Aug 18 09:57:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c (Init_socket): add bunch of Socket
- constants. Patch from Sam Roberts <sroberts@uniserve.com>.
- [ruby-core:04409]
+ * enc/depend: fix inplace-build condition. enc.mk is generated with
+ setting $srcdir to enc, but pwd is still top build directory.
+ [ruby-core:47236] [Bug #6888]
-Wed Feb 23 15:04:32 2005 akira yamada <akira@ruby-lang.org>
+Fri Aug 17 23:28:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/uri/generic.rb (split_userinfo): should split ":pass" into ""
- and "pass". [ruby-dev:25667]
+ * object.c (rb_any_to_s, rb_obj_inspect): preserve encodings of class
+ name and instance variable names.
-Wed Feb 23 08:00:18 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Aug 17 12:39:33 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * array.c (rb_ary_s_create): no need for negative argc check.
- [ruby-core:04463]
+ * ext/dl/lib/dl/func.rb (DL::Function#bind): allow to return/break from
+ the callback method. (Fiddle already allows it.)
+ [Bug #6389] [ruby-dev:45604]
- * array.c (rb_ary_unshift_m): ditto.
+Thu Aug 16 19:54:24 2012 Koichi Sasada <ko1@atdot.net>
-Wed Feb 23 01:57:46 2005 Shugo Maeda <shugo@ruby-lang.org>
+ * vm_trace.c, vm_core.h: simplify tracing mechanism.
- * lib/net/imap.rb (initialize): handle certs correctly. Thanks,
- NABEYA Kenichi. (backported from CVS HEAD)
+ (1) add rb_hook_list_t data structure which includes
+ hooks, events (flag) and `need_clean' flag.
+ If the last flag is true, then clean the hooks list.
+ In other words, deleted hooks are contained by `hooks'.
+ Cleanup process should run before traversing the list.
+ (2) Change check mechanism
+ See EXEC_EVENT_HOOK() in vm_core.h.
+ (3) Add `raw' hooks APIs
+ Normal hooks are guarded from exception by rb_protect().
+ However, this protection is overhead for too simple
+ functions which never cause exceptions. `raw' hooks
+ are executed without protection and faster.
+ Now, we only provide registration APIs. All `raw'
+ hooks are kicked under protection (same as normal hooks).
-Tue Feb 22 07:25:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/ruby.h: remove internal data definition and
+ macros.
- * parse.y (parser_yylex): identfier after dot must not be a variable.
+ * internal.h (ruby_suppress_tracing), vm_trace.c: rename
+ ruby_suppress_tracing() to rb_suppress_tracing()
+ and remove unused function parameter.
-Mon Feb 21 10:04:49 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * parse.y: fix to use renamed rb_suppress_tracing().
- * {bcc32,win32,wince}/Makefile.sub (config.h): add fcntl.
+ * thread.c (thread_create_core): no need to set RUBY_VM_VM.
- * win32/win32.[ch] (fcntl): ditto.
+ * vm.c (mark_event_hooks): move definition to vm_trace.c.
- * win32/win32.c (rb_w32_connect): support nonblocking mode.
+ * vm.c (ruby_vm_event_flags): add a global variable.
+ This global variable represents all of Threads and VM's
+ event masks (T1#events | T2#events | ... | VM#events).
+ You can check the possibility kick trace func or not
+ with ruby_vm_event_flags.
+ ruby_vm_event_flags is maintained by vm_trace.c.
- * ext/socket/socket.c (wait_connectable, ruby_connect): support
- nonblocking connect on various platforms.
- all changes are backported from CVS HEAD. [ruby-core:3154],
- [ruby-core:4364].
+ * cont.c (fiber_switch, rb_cont_call): restore tracing status.
+ [Feature #4347]
-Sun Feb 20 00:48:48 2005 Tanaka Akira <akr@m17n.org>
+ * test/ruby/test_continuation.rb: ditto.
- * lib/open-uri.rb (URI::FTP#buffer_open): access mechanism
- re-implemented according to RFC 1738.
- reported by Guillaume Marcais. [ruby-talk:131650]
+Thu Aug 16 19:15:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Feb 19 18:11:47 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * object.c (rb_class_initialize): forbid inheriting uninitialized
+ class. another class tree not based on BasicObject cannot exist.
+ [ruby-core:47148][Bug #6863]
- * lib/drb/drb.rb (DRbObject#respond_to?): take two arguments.
- [ruby-dev:25722]
+Thu Aug 16 11:52:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/drb/drbtest.rb: ditto.
+ * test/-ext-/test_printf.rb (Test_SPrintf#test_{taint,untrust}): use
+ plain object so that the results of to_s and inspect are infected.
+ [ruby-dev:46053] [Bug #6881]
-Sat Feb 19 13:52:02 2005 Tanaka Akira <akr@m17n.org>
+Thu Aug 16 09:46:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/open-uri.rb: call OpenSSL::SSL::SSLSocket#post_connection_check
- after connection is made.
+ * strftime.c: remove unnecessary macros to check traditional C.
+ https://github.com/ruby/ruby/pull/46 by lateau (Daehyub Kim).
-Sat Feb 19 01:32:03 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * vsnprintf.c: remove K&R.
- * ext/bigdecimal/lib/bigdecimal/newton.rb: resolved LoadError.
- [ruby-dev:25685]
+Wed Aug 15 20:47:49 2012 Benoit Daloze <eregontp@gmail.com>
- * ext/bigdecimal/sample/linear.rb: ditto.
+ * object.c (rb_obj_inspect): Kernel#inspect: do not call #to_s. A class
+ can now benefit from the nice default #inspect even if it defines #to_s.
+ Also, there is no more unexpected change in #inspect result.
- * ext/bigdecimal/sample/nlsolve.rb: ditto.
+ * NEWS: Add note about the change.
- * ext/bigdecimal/lib/bigdecimal/nlsolve.rb: removed because this file
- is sample script and same file exists in ext/bigdecimal/sample.
+ * bignum.c, io.c, numeric.c, object.c, proc.c, vm.c (Init_*):
+ Adapt internal structures (by aliasing #inspect to #to_s) so they
+ don't rely on the removed behavior (#inspect calling overridden #to_s).
-Fri Feb 18 17:14:00 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_object.rb (test_inspect): add tests for Kernel#inspect.
- * lib/xmlrpc/parser.rb (XMLRPC::FaultException): make it subclass
- of StandardError class, not Exception class. [ruby-core:04429]
+ * lib/pp.rb (class PP): do not call #to_s anymore, as #inspect
+ no more does (mame).
-Thu Feb 17 20:11:18 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/test_pp.rb (class PPInspectTest): remove related assertion (mame).
+ [ruby-core:43238][Feature #6130]
- * lib/drb/drb.rb (DRbServer.default_safe_level): fix typo.
+ * test/drb/drbtest.rb (DRbCore#teardown, DRbAry#teardown):
+ adapt DRb tests with the new change (shirosaki).
+ [ruby-core:47182][Bug #6866]
-Thu Feb 17 20:11:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Aug 15 18:05:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/digest/test_digest.rb: separate test case for each algorithms.
- [ruby-dev:25412]
+ * lib/test/unit.rb (Test::Unit::Runner#failed): need to delete the
+ status line if the status is skipped and -q is specified.
-Thu Feb 17 11:54:00 2005 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Wed Aug 15 16:26:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/collector.rb (collect_file): now deletes paths added
- to $LOAD_PATH instead of restoring it verbatim.
+ * sprintf.c (ruby__sfvextra): the result should be infected by the
+ given strings.
- * lib/test/unit/autorunner.rb (AutoRunner.run): fixed so that
- 'ruby -rtest/unit -rtest1 -rtest2 -e0' will use the objectspace
- collector again. Also tried to simplify the calling convention.
+ * sprintf.c (ruby__sfvwrite): set buffer length and exclude
+ uninitialized garbage to get correct coderange.
- * test/runner.rb: adjusted for new AutoRunner semantics.
+Wed Aug 15 16:20:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit.rb: ditto.
+ * common.mk (ID_H_TARGET): make timestamp file of id.h so that the
+ header will not be remade repetitively.
-Thu Feb 17 04:21:47 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Aug 15 11:39:53 2012 Koichi Sasada <ko1@atdot.net>
- * lib/open3.rb (Open3::popen3): $? should not be EXIT_FAILURE.
- fixed: [ruby-core:04444]
+ * vm_trace.c: separate trace_func related functions from
+ thread.c.
-Thu Feb 17 00:09:45 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * thread.c: ditto.
- * test/drb/ignore_test_drb.rb: move TestDRbReusePort to new file
- [ruby-dev:25238]
+ * common.mk: add vm_trace.o.
- * test/drb/test_drb.rb: add method DRbService.ext_service, move
- TestDRbReusePort to new file [ruby-dev:25238]
+ * inits.c: call Init_vm_trace().
- * test/drb/test_drb.rb: ditto.
+Tue Aug 14 16:25:46 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test/drb/test_drbssl.rb: ditto.
+ * test/erb/test_erb.rb (test_html_escape): add assertions for the
+ cases where the argument is not a String.
- * test/drb/test_drbunix.rb: ditto.
+Tue Aug 14 16:03:31 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/drb/ut_drb.rb: reduce sleep.
+ * win32/win32.c (check_valid_dir): reject "..." as directory name.
+ [Bug #6851]
-Thu Feb 17 00:02:27 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Aug 14 16:02:51 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (is_defined): NODE_IASGN is an assignment.
+ * test/ruby/test_file_exhaustive.rb
+ (TestFileExhaustive#test_stat_dotted_prefix): added.
-Wed Feb 16 23:34:30 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Aug 14 15:39:09 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/drb/drb.rb: add lazy stop_service. ([druby-ja:109])
+ * test/ruby/test_file_exhaustive.rb
+ (TestFileExhaustive#test_stat_drive_root): added.
- * lib/drb/extserv.rb: ditto.
+Tue Aug 14 10:38:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Feb 16 17:07:57 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/erb.rb (ERB::Util.html_escape): fix r36687: call to_s before
+ passing it to CGI.escapeHTML.
- * ext/tk/tkutil.c: Follow the change of st.c (st_foreach)
- [ruby-list:40623].
- Sometimes mis-convert from a Ruby's Array of SJIS Strings, which
- includes some kind of SJIS characters, to a Tcl's UTF8 list string.
+Mon Aug 13 13:13:19 2012 Shugo Maeda <shugo@ruby-lang.org>
-Mon Feb 14 23:58:17 2005 Kouhei Sutou <kou@cozmixng.org>
+ * lib/erb.rb (ERB::Util.html_escape): use CGI.escapeHTML to escape
+ single quotes. [ruby-core:47138] [Bug #6861]
- * lib/rss/parser.rb (RSS::ListenerMixin::tag_end):
- fixed invalid namespace handling bug.
+Sun Aug 12 11:57:20 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Mon Feb 14 13:12:38 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * vm.c (invoke_block_from_c): fix unintentional block passing.
+ [ruby-dev:45071] [Bug #5832]
- * ext/openssl/lib/openssl/ssl.rb
- (OpenSSL::SSL::SSLSocket#post_connection_check): new method.
+Fri Aug 10 08:41:28 2012 Eric Hodel <drbrain@segment7.net>
-Mon Feb 14 00:40:49 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * gc.c (gc_malloc_allocated_size): RDoc does not process macros, so
+ mention this method is only available when ruby is built with
+ CALC_EXACT_MALLOC_SIZE
+ * gc.c (gc_malloc_allocations): ditto
- * lib/drb/drb.rb (InvokeMethod.perform): pass DRb info to sub thread.
+Thu Aug 9 23:46:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/drb/test_drb.rb (test_01_safe1_safe4_eval): fix test case.
+ * tool/mkrunnable.rb: see build_os instead of target arch for
+ cross-compiling.
-Sun Feb 13 23:13:46 2005 Kouhei Sutou <kou@cozmixng.org>
+ * configure.in (MINIRUBY): use real path for include path.
- * lib/rss/dublincore.rb (RSS::DublicCoreModel#date{,=}): added
- convenient methods.
+ * template/fake.rb.in (builddir): remove duplications
- * lib/rss/0.9.rb (RSS::Rss::Channel#date{,=}): ditto.
+Thu Aug 9 20:03:11 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * lib/rss/2.0.rb (RSS::Rss::Channel::Item#date{,=}): ditto.
+ * test/ruby/test_file_exhaustive.rb
+ (TestFileExhaustive#test_stat_special_file): add a test.
+ GetFileAttributesExW fails to get attributes of special files
+ such as pagefile.sys.
- * test/rss/: added tests for the convenient methods.
+ * win32/win32.c (check_valid_dir): for performance, check the path
+ by FindFirstFileW only if the path contains "..."
-Sun Feb 13 22:43:03 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * win32/win32.c (winnt_stat): use GetFileAttributesExW instead of
+ FindFirstFileW since GetFileAttributesExW is faster.
+ Based on the patch by Dusan D. Majkic.
+ [ruby-core:47083] [Feature #6845]
- * lib/drb/drb.rb (DRbServer): add default_safe_level, safe_level,
- config[:safe_level] ([druby-ja:120])
+Thu Aug 9 18:33:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/drb/test_drb.rb, ut_eval.rb, ut_safe1.rb: ditto.
+ * ruby.c (proc_options): show version only once even if -v and
+ --version are given together.
+ http://twitter.com/d6rkaiz/status/233491797085671424
-Sun Feb 13 16:56:52 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Aug 9 12:37:22 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/webrick/cgi.rb (WEBrick::CGI.start): should set reason-phrase
- to the value of status header field. ([ruby-dev:40617])
+ * test/openssl/test_config.rb (OpenSSL#test_constants): skip this
+ test if platform is Mac OS X or Windows. [Bug #6830]
-Sun Feb 13 00:52:33 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed Aug 8 22:51:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/erb.rb (ERB::Util.h, u): make it module_function.
+ * vm_eval.c (eval_under): singletons other than special constants
+ don't need cref-scope hack.
-Sat Feb 12 17:29:19 2005 Tanaka Akira <akr@m17n.org>
+Wed Aug 8 22:45:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/open-uri.rb (OpenURI.open_loop): send authentication only for
- the URI directly specified.
+ * common.mk (.y.h): split from .y.c rule to manage dependency on
+ parse.h. [ruby-core:46741] [Bug #6789]
-Sat Feb 12 15:07:23 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk (id.h): keep old file unless changed.
- * random.c (rand_init): suppress warning.
+Wed Aug 8 17:11:20 2012 Koichi Sasada <ko1@atdot.net>
-Sat Feb 12 13:54:03 2005 Tanaka Akira <akr@m17n.org>
+ * compile.c (ADD_INSNL): make ADD_INSNL as alias of ADD_INSN1.
- * lib/open-uri.rb: support https if the platform provides CA
- certificates.
+Wed Aug 8 17:08:14 2012 Koichi Sasada <ko1@atdot.net>
-Sat Feb 12 06:18:28 2005 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
+ * bootstrap/test_exception.rb: fix a last committed test.
- * ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check.
- [ruby-dev:25675]
+Wed Aug 8 16:27:58 2012 Koichi Sasada <ko1@atdot.net>
-Fri Feb 11 17:40:42 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * compile.c, insns.def (checkmatch):
+ remove checkincludearray instruction and
+ add new instruction checkmatch.
+ This change is to solve
+ [Bug #4438] "rescue args type check omitted".
- * ext/openssl/ossl_x509store.c (ossl_x509store_set_default_paths):
- new method OpenSSL::X509::Store#set_default_paths.
+ * iseq.c: increment ISEQ_MAJOR_VERSION because removal of
+ checkincludearray instruction.
-Fri Feb 11 11:33:53 2005 Tanaka Akira <akr@m17n.org>
+ * vm_core.h: add several definitions for
+ the checkmatch instruction.
- * lib/open-uri.rb (URI::HTTP#proxy_open): new option supported:
- :http_basic_authentication.
- suggested by Kent Sibilev. [ruby-core:4392]
+ * vm_insnhelper.c (check_match): added.
-Fri Feb 11 06:30:07 2005 George Ogata <g_ogata@optushome.com.au>
+ * bootstraptest/test_exception.rb: add a test.
- * misc/ruby-mode.el: ignore parenthesis inside heredoc.
- [ruby-core:04415]
+ * test/ruby/test_exception.rb: ditto.
-Fri Feb 11 04:54:13 2005 Tilman Sauerbeck <tilman@code-monkey.de>
+Wed Aug 8 05:51:20 2012 Eric Hodel <drbrain@segment7.net>
- * lib/rdoc/generators/html_generator.rb: [ruby-core:04412]
+ * proc.c (method_clone): Added documentation. Patch by Robin Dupret.
+ Fixes #152 on github.
- * lib/rdoc/generators/ri_generator.rb: ditto.
+Tue Aug 7 20:19:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Feb 10 11:14:17 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/readline/readline.c (Init_readline): rl_catch_signals=0 returns
+ back. Without this, on FreeBSD9 and readline 6.2 irb can't catch ^C.
+ [Bug #5423]
- * win32/Makefile.sub (COMMON_HEADERS): shouldn't include winsock2.h.
+Tue Aug 7 20:12:39 2012 Koichi Sasada <ko1@atdot.net>
- * ext/socket/extconf.rb (sockaddr_storage): remove workaround for
- mswin32.
+ * vm_exec.c, insns.def (leave): solve problems on
+ OPT_CALL_THREADED_CODE.
+ Catch up finish frame structure on OPT_CALL_THREADED_CODE.
-Thu Feb 10 10:29:16 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_core.h: add rb_thread_t#retval for temporary space on
+ OPT_CALL_THREADED_CODE.
- * ext/curses/curses.c: don't need to check HAVE_WCOLOR_SET excluding
- window_color_set().
+ * vm.c (th_init): clear rb_thread_t#retval as Qundef.
-Thu Feb 10 00:47:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_dump.c (rb_vmdebug_debug_print_pre): fix debug print format.
- * struct.c (make_struct): fixed: [ruby-core:04402]
+Tue Aug 7 11:58:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Feb 9 08:07:08 2005 Paul Duncan <pabs@pablotron.org>
+ * test/ruby/test_require.rb (TestRequire#test_require_twice): added.
- * ext/curses/curses.c (window_color_set): [ruby-core:04393]
+Tue Aug 7 11:35:37 2012 Shugo Maeda <shugo@ruby-lang.org>
-Tue Feb 8 23:51:47 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * vm_method.c (rb_redefine_opt_method): use RCLASS_ORIGIN to avoid
+ SEGV when a module-prepended class is refined.
- * lib/drb/drb.rb: reject :instance_eval, :class_eval, :module_eval
- [druby-ja:117]
+Tue Aug 7 10:46:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Feb 8 13:06:12 2005 Sam Roberts <sroberts@uniserve.com>
+ * test/ruby/test_file_exhaustive.rb
+ (TestFileExhaustive#test_expand_path*): refactoring. split the method
+ into some chunks of the same kind of tests.
- * ext/socket/socket.c (Init_socket): SO_REUSEPORT added.
- [ruby-talk:130092]
+Tue Aug 7 00:31:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Feb 8 09:30:01 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * class.c (rb_special_singleton_class_of): utility function.
- * lib/cgi.rb (CGI::Cookie): [ruby-talk:130040]
+ * vm_eval.c (eval_under): special deal for class variable scope with
+ instance_eval.
-Tue Feb 8 00:19:02 2005 Tanaka Akira <akr@m17n.org>
+ * vm_eval.c (rb_obj_instance_eval, rb_obj_instance_exec): allow method
+ definition in instance_eval of special constants. [ruby-core:28324]
+ [Bug #2788]
- * lib/resolv.rb (Resolv::DNS::Name#subdomain_of?): new method.
- (Resolv::DNS::Name#inspect): ditto.
- Suggested by Sam Roberts. [ruby-talk:129086]
+Tue Aug 7 00:23:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Feb 7 10:06:30 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * variable.c (CVAR_LOOKUP): split into helper functions.
- * object.c: [ruby-doc:818]
+Mon Aug 6 19:15:11 2012 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Mon Feb 7 01:56:20 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/win32ole/test_win32ole_variant.rb: setting WIN32OLE.locale
+ to pass some assertion. Thanks to Hiroshi Shirosaki.
+ [ruby-core:46873][Bug #6814]
- * instruby.rb, rubytest.rb (srcdir): no longer embed srcdir into
- rbconfig.rb. (backported from CVS HEAD)
+Mon Aug 6 15:54:50 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/socket/extconf.rb (sockaddr_storage): winsock2.h have the
- definition of struct sockaddr_storage, but socket.c doesn't
- include it because this version of ruby still has binary level
- compatibility with winsock1.
+ * internal.h, class.c, eval.c, insns.def: find the appropriate
+ receiver for super called in instance_eval. If such a receiver is
+ not found, raise NoMethodError. [ruby-dev:39772] [Bug #2402]
- * lib/mkmf.rb (create_makefile): should support header files in
- depend file.
+Mon Aug 6 14:54:38 2012 Shugo Maeda <shugo@ruby-lang.org>
-Mon Feb 7 01:21:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/ruby.h, eval.c, vm_insnhelper.c: fix typo.
- * ext/socket/extconf.rb: check if getaddrinfo() works fine only when
- wide-getaddrinfo option is not given. fixed: [ruby-dev:25422]
+Mon Aug 6 13:13:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb ($extmk): check if under ext directory.
+ * vm_eval.c (vm_call_super): since cfp->klass is always class or
+ iclass, no search from method entry.
- * lib/mkmf.rb (Logging.postpone): allow recursive operation.
+ * insns.def (defined): now should use klass in the current control
+ frame to search superclass, not me->klass. reported by naruse.
- * lib/mkmf.rb (try_constant): make sure if really a constant, reduce
- the number of times of compile.
+Mon Aug 6 11:19:19 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/mkmf.rb (have_macro, have_var, byte_order): new functions.
+ * test/etc/test_etc.rb (TestEtc#test_getpwuid): `s' is never set to nil.
- * lib/mkmf.rb (find_library): allow directory list with separators.
+Mon Aug 6 11:08:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/mkmf.rb (arg_config): manage provided configuration options.
+ * test/syslog/test_syslog_logger.rb: skip unless Syslog module is
+ available.
- * lib/mkmf.rb (dir_config): accept arrays of directory names as
- default values.
+Mon Aug 6 00:40:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * mkconfig.rb: no longer embed srcdir and compile_dir into
- rbconfig.rb.
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_log): fix format specifier.
- * lib/mkmf.rb (create_makefile): fix unbalanced parens.
+Mon Aug 6 00:39:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Feb 6 19:23:01 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * include/ruby/ruby.h (NUM2ULONG): optimize by inline as well as
+ NUM2LONG, and cast to unsigned long explicitly for the platforms
+ where SIZEOF_VALUE is larger than SIZEOF_LONG.
- * eval.c (stack_extend): add prototype because VC++8 doesn't
- accept __declspec(noinline) with K&R style function definitions.
- (backported from CVS HEAD)
+ * include/ruby/ruby.h (NUM2SSIZET): fix type to cast.
-Sun Feb 6 14:14:26 2005 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Aug 5 21:10:36 2012 Narihiro Nakamura <authornari@gmail.com>
- * lib/date.rb (new_with_hash): changed messages of exception.
+ * gc.c : if ENABLE_VM_OBJSPACE is 1, rest_sweep is not defined.
+ remove unused declarations. [ruby-core:47004] [Bug #6837]
- * lib/date/format.rb (str[fp]time): undocumented conversion
- specifications %[1-3] are now deprecated.
+Sun Aug 5 19:31:57 2012 Narihiro Nakamura <authornari@gmail.com>
-Sun Feb 6 12:20:11 2005 Akinori MUSHA <knu@iDaemons.org>
+ * gc.c: just move functions and so on. I don't touch any internal
+ implementation.
- * bignum.c (rb_big2ulong_pack): One too many arguments are passed
- to big2ulong().
+Sun Aug 5 13:22:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * re.c (rb_reg_init_copy, rb_reg_initialize_m): One too many
- arguments are passed to rb_reg_initialize().
+ * configure.in: use gcc-4.2 prior to clang, gcc, and cc if exist for
+ the use of Snow Leopard's old clang. see also r36594, r36610, r36611.
-Sun Feb 6 03:24:20 2005 Tanaka Akira <akr@m17n.org>
+Sun Aug 5 06:55:10 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/resolv.rb (Resolv::DNS::Resource::TXT): multiple strings was not
- handled.
- (Resolv::DNS::Resource::TXT#strings): new method to return all
- strings.
- (Resolv::DNS::Message::MessageEncoder#put_string_list): new method.
- (Resolv::DNS::Message::MessageDecoder#get_string_list): ditto.
- based on [ruby-talk:129732] by Sam Roberts.
+ * ext/date/date_{core,strftime}.c: [ruby-core:46990].
-Fri Feb 4 00:30:45 2005 Kouhei Sutou <kou@cozmixng.org>
+Sat Aug 4 22:56:20 2012 Narihiro Nakamura <authornari@gmail.com>
- * lib/rss: supported Image module.
- http://web.resource.org/rss/1.0/modules/image/
+ * gc.c: use inline functions instead of macros, and close up
+ related codes for the profiler.
-Thu Feb 3 23:42:36 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Aug 4 20:37:56 2012 Narihiro Nakamura <authornari@gmail.com>
- * ext/stringio/stringio.c (strio_close, strio_close_read, strio_close_write):
- should return nil instead of self as well as IO. [ruby-dev:25623]
+ * gc.c (gc_mark_children): use gc_mark_ptr instead of marking
+ a object directly.
- * ext/stringio/stringio.c (strio_extend, strio_putc): fill with zero
- extended portion. [ruby-dev:25626]
+Sat Aug 4 10:02:03 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed Feb 2 23:52:53 2005 sheepman <sheepman@tcn.zaq.ne.jp>
+ * test/ruby/test_alias.rb (test_super_in_aliased_module_method):
+ add a test case for [ruby-dev:46028], which fails in 1.8.
- * ext/stringio/stringio.c (strio_truncate): should MEMZERO an extended
- part. [ruby-dev:25618]
+Sat Aug 4 01:56:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Feb 2 21:56:01 2005 Kouhei Sutou <kou@cozmixng.org>
+ * vm_insnhelper.c (vm_search_normal_superclass): no longer needs
+ receiver, klass is always unique in the ancestors now.
- * lib/rss/rss.rb (RSS::Element#convert): added.
+Sat Aug 4 01:27:40 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/rss/rss.rb: convert -> need_convert.
+ * insns.def (invokesuper): reverted r36612 so that super in an
+ aliased method will not call the same method.
- * lib/rss/1.0.rb: ditto.
+Fri Aug 3 19:26:10 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/rss/0.9.rb: ditto.
+ * insns.def (invokesuper): don't skip the same class. instead, use
+ rb_method_entry_get_with_omod() to avoid infinite loop when
+ super is used with refinements. [ruby-core:30450] [Bug #3351]
- * lib/rss/2.0.rb: ditto.
+Fri Aug 3 19:21:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/trackback.rb: ditto.
+ * configure.in: use clang prior to gcc only when self-compiling on
+ darwin. search default compilers on other platforms. [Bug #6816]
-Tue Feb 1 22:48:48 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Fri Aug 3 17:25:49 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/drb/drb.rb (DRb::DRbObject#respond_to?): check marshal_dump and
- _dump.
+ * configure.in: move RUBY_MINGW32 after AC_PROG_CC.
+ RUBY_MINGW32 uses AC_TRY_CPP and it sets CC and CPP. [Bug #6816]
-Tue Feb 1 00:20:23 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: don't use AC_PROG_CC in AS_CASE.
- * configure.in (aix): fix linker flags on AIX. [ruby-talk:125460]
+Fri Aug 3 17:21:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jan 31 13:33:21 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/runner.rb: get rid of loading previously installed gems.
+ [ruby-dev:46025]
- * ext/tcltklib/tcltklib.c: add invalid namespace check
+Fri Aug 3 16:40:01 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/tk/lib/multi-tk.rb: add invalid_namespace? method
+ * .travis.yml (notifications): [experimental] IRC notifications.
- * ext/tk/lib/remote-tk.rb: ditto
+Thu Aug 2 20:32:29 2012 Shugo Maeda <shugo@ruby-lang.org>
-Mon Jan 31 10:29:18 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * eval.c (rb_mod_using): new method Module#using. [experimental]
- * lib/irb/context.rb (IRB::Context::initialize): [ruby-core:04330]
+ * eval.c (rb_mod_refine): new method Module#refine. [experimental]
-Sat Jan 29 09:42:12 2005 Sam Roberts <sroberts@uniserve.com>
+ * eval.c (f_using): new method Kernel#using. [experimental]
- * lib/resolv.rb (Resolv::DNS::Resource::IN::SRV): Added RFC2782 SRV
- resource record for specifying location of services.
+Thu Aug 2 20:08:02 2012 Shugo Maeda <shugo@ruby-lang.org>
-Fri Jan 28 17:16:55 2005 Tanaka Akira <akr@m17n.org>
+ * class.c, insns.def, method.h, proc.c, vm.c, vm_core.h, vm_eval.c,
+ vm_insnhelper.c, vm_insnhelper.h, vm_method.c: add klass to
+ rb_control_frame_t to implement super correctly.
- * lib/resolv.rb (Resolv::DNS::Config.parse_resolv_conf):
- parse options line for ndots option.
- (Resolv::Hosts#lazy_initialize): return self.
- (Resolv::DNS#lazy_initialize): ditto.
- (Resolv::DNS::Config#lazy_initialize): ditto.
- Suggested by Sam Roberts.
+Thu Aug 2 13:23:08 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Jan 27 13:18:03 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in (AC_PROG_CC): AC_PROG_CC tries clang at first on
+ darwin. [Bug #6816]
- * st.c (st_foreach): report success/failure by return value.
- [ruby-Bugs-1396]
+Thu Aug 2 11:39:25 2012 Narihiro Nakamura <authornari@gmail.com>
-Thu Jan 27 00:15:29 2005 Minero Aoki <aamine@loveruby.net>
+ * gc.c: return true or false. Patch by Dirkjan Bussink. [Bug #6821]
- * test/fileutils/test_fileutils.rb (setup): support BSD-style
- directory group inheritance. (backport from HEAD, rev 1.32)
+ * test/ruby/test_gc.rb: add test-case for this bug.
- * test/fileutils/fileasserts.rb (assert_same_entry): show entry
- difference. (backport from HEAD, rev 1.4)
+Thu Aug 2 10:51:12 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
-Wed Jan 26 23:09:11 2005 Minero Aoki <aamine@loveruby.net>
+ * ext/openssl/lib/openssl/digest.rb
+ test/openssl/test_digest.rb: Add Digest module function to OpenSSL
+ module and test it. Patch provided by Eric Hodel.
+ [ruby-core:46908][Feature #6819]
- * lib/net/protocol.rb (WriteAdapter#puts): should append \n, not
- prepend. [ruby-talk:128302] (backport from HEAD, rev 1.75)
+Wed Aug 1 22:29:12 2012 Benoit Daloze <eregontp@gmail.com>
-Wed Jan 26 10:51:50 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/digest/digest.c (hexencode_str_new): return an ASCII string
- * win32/win32.c (flock_winnt, flock_win95): unlock file even if
- LOCK_NB is specified. (backported from CVS HEAD)
+ * test/digest: tests for all kind of digests encodings
+ [ruby-core:46792][Bug #6799]
-Tue Jan 25 17:11:51 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Aug 1 05:50:53 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * ruby.c (proc_options): correct -T option in RUBYOPT. (backported
- from CVS HEAD)
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_encoding):
+ Fix test_encoding failure on Windows.
+ With chcp 65001, 1252 and 437, test_encoding failed. Test result
+ depends on locale because LANG environment variable doesn't affect
+ locale on Windows.
+ [ruby-core:46872] [Bug #6813]
-Tue Jan 25 14:05:52 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Aug 1 00:33:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tcltklib/tcltklib.c: fix SEGV bug; trouble on canceling remained
- after scripts [ruby-dev:25479]: NULL current namespace when deleting
- Tk interpreter [ruby-talk:126225]
+ * class.c (include_class_new): fix duplication of prepended module.
+ since m_tbl of prepended module is always zero, copy from its
+ copy iclass of original.
- * ext/tcltklib/extconf.rb: bug fix; TCL_ENABLE_THREAD flag is inverted
- [ruby-talk:126360]
+Tue Jul 31 18:22:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tcltklib/extconf.rb: add yet another native-thread check
+ * variable.c (classname): tell if found name is permanent. search
+ tmp_classpath only if class id is set. [ruby-core:42865][Bug #6078]
- * ext/tk/tkutil.c: fix SEGV bug; NULL string pointer when finalize
- Ruby interpreter
+ * variable.c (rb_class_path): duplicate found temporary path.
- * ext/tk/lib/multi-tk.rb: avoid warning for deleted safeTk ip frame
+ * variable.c (rb_set_class_path_string, rb_set_class_path): set class
+ id to find classpath.
- * ext/tk/lib/tk/bindtag.rb: bug fix; new method of named bindtag
- doesn't return the created object [ruby-dev:25479]
+Tue Jul 31 10:36:12 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/tk/lib/tk/menu.rb: bug on treating arguments [ruby-dev:25479]
+ * ext/psych/lib/psych.rb: updated to released version.
- * ext/tk/lib/tk.rb: bug fix; cannot accept a callback ID string for
- a command argument [ruby-dev:25479]
+ * ext/psych/psych.gemspec: ditto
- * ext/tk/lib/multi-tk.rb: ditto
+Tue Jul 31 06:18:06 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/lib/tk/*.rb: ditto
+ * time.c (time_sec): Remove extra wording about leap seconds and refer
+ directly to Wikipedia's leap second page for further information.
+ [Bug #6749]
- * ext/tk/lib/tkextlib/*.rb: ditto
+Mon Jul 30 23:01:47 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/sample/demos-jp/anilabel.rb: new demo script
+ * lib/rubygems/platform.rb (Gem::Platform#initialize): Support pattern
+ like x86_64-netbsd6.99.7.
- * ext/tk/sample/demos-en/anilabel.rb: ditto
+Mon Jul 30 21:00:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/sample/tkHTML/ss.rb: local variable scope bug fix
- [ruby-dev:25479]
+ * variable.c (find_class_path): no retry when preferred is given.
-Mon Jan 24 15:44:25 2005 Tilman Sauerbeck <tilman@code-monkey.de>
+ * variable.c (classname): if classid is set try it to find full
+ qualified class path, and then try arbitrary class path. try
+ tmp_classpath at last even if enclosing namespace is anonymous.
+ fix r36574. [ruby-core:42865][Bug #6078]
- * lib/rdoc/parsers/parse_c.rb: allow whitespace after function names.
- [ruby-core:4296]
+ * variable.c (rb_set_class_path_string, rb_set_class_path): set
+ tmp_classpath instead of classpath if the name is not permanent.
- * lib/rdoc/parsers/parse_simple.rb: adds support for private comments
- in the "simple" parser. [ruby-core:4301]
+Mon Jul 30 14:24:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jan 24 15:44:25 2005 Charles Mills <cmills@freeshell.org>
+ * variable.c: store anonymous class path in tmp_classpath but not in
+ classpath. [ruby-core:42865][Bug #6078]
- * lib/rdoc/parsers/parse_c.rb: adds support for constants
- (rb_define_const), accessors (rb_define_attr), and makes a
- couple fixes. [ruby-core:4307]
+Mon Jul 30 13:11:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jan 24 15:44:25 2005 Florian Gro <florgro@gmail.com>
+ * configure.in (DLDFLAGS): on Darwin, deprecate -flat_namespace to get
+ rid of huge imported symbols table.
- * lib/rdoc/parsers/parse_rb.rb: Logic for def Builtin.method() end
- [ruby-core:4302]
+ * configure.in (LIBRUBY_RELATIVE): libruby_so is not made when
+ disable-shared, so no absolute path is used for it and executable
+ file is runnable anywhere.
-Mon Jan 24 15:44:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jul 30 01:30:10 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * document updates - [ruby-core:04296], [ruby-core:04301],
- [ruby-core:04302], [ruby-core:04307]
+ * common.mk: add a dependency. [ruby-core:46741] [Bug #6789]
-Sun Jan 23 12:41:16 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sun Jul 29 15:44:47 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * lib/soap/wsdlDriver.rb: from 1.5.3-ruby1.8.2, operation which has
- capitalized name (such as KeywordSearchRequest in AWS) is defined as
- a method having uncapitalized name. (converted with
- GenSupport.safemethodname to handle operation name 'foo-bar'). it
- introduced serious incompatibility; in the past, it was defined as a
- capitalized.
+ * thread.c (thread_create_core): hide th->async_errinfo_mask_stack from
+ ObjectSpace.each_object. refix of r36539.
- define capitalized method as well under that circumstance.
+Sun Jul 29 23:57:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jan 23 05:24:42 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ext/socket/option.c (inet_ntop): use rb_w32_inet_ntop, instead of
+ inet_ntop directly, which is unavailable on older version Windows.
- * ext/openssl/ossl_ocsp.c (ossl_ocspreq_to_der): should call
- GetOCSPReq at first.
+ * win32/win32.c (rb_w32_inet_ntop): type should be const.
-Sat Jan 22 23:09:47 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sun Jul 29 14:20:34 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * lib/drb/ssl.rb (accept): rescue SSLError. [druby-ja:110]
+ * thread.c (Init_Thread): does not need to set klass
+ explicitly.
-Sat Jan 22 22:35:03 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sun Jul 29 06:21:04 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * lib/drb/unix.rb: fail if UNIXFileOwner is set. [druby-ja:111]
+ * win32/win32.c: suppress warning redeclared on mingw64.
+ *_s functions are declared if MINGW_HAS_SECURE_API is defined.
+ Follow up r36556.
-Fri Jan 21 23:58:42 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Jul 29 00:28:46 2012 Narihiro Nakamura <authornari@gmail.com>
- * ext/stringio/stringio.c (strio_set_pos): clear EOF flag.
- [ruby-talk:127511]
+ * gc.c: remove unused initialization.
-Fri Jan 21 20:07:02 2005 Tanaka Akira <akr@m17n.org>
+Sat Jul 28 16:26:09 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * lib/resolv.rb (Resolv::DNS::Config.resolv): don't raise ResolvError.
- reported by Sam Roberts. [ruby-talk:127133]
+ * win32/win32.c (gmtime_r): use _gmtime64_s() with x86_64-w64-mingw32.
-Fri Jan 21 16:58:10 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * win32/win32.c (localtime_r): use _localtime64_s() with
+ x86_64-w64-mingw32. Since FileTimeToSystemTime() seems not work with
+ large value under x64. Mingw-w64 doesn't have these declaration.
+ [ruby-core:46780] [Bug #6794]
- * dir.c (rb_push_glob): should work for NUL delimited patterns.
+Fri Jul 27 18:25:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jan 21 13:58:37 2005 Shugo Maeda <shugo@ruby-lang.org>
+ * io.c (rb_io_check_io): make public.
- * lib/net/imap.rb (u8tou16): fixed typo. fixed: [ruby-list:40546]
- (backported from CVS HEAD)
+ * process.c (check_exec_redirect): try conversion to IO on redirect
+ parameters. [ruby-core:44181] [Bug #6269]
-Fri Jan 21 09:30:16 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Jul 27 17:58:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * rubyio.h (rb_eof_error): should mark as NORETURN. (backported
- from CVS HEAD)
+ * configure.in (RUBY_CPPOUTFILE): get rid of variable conflict so
+ CPPFLAGS is not duplicated. [ruby-core:43097] [Bug #6119]
-Fri Jan 21 00:31:36 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Jul 27 12:12:36 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/syck/rubyext.c (syck_parser_bufsize_set): avoid VC++ warning
- "local variable 'size' used without having been initialized".
+ * win32/mkexports.rb: should not export DllMain().
+ reported by luis at [ruby-core:46743] [Bug #6790], solved by
+ Heesob Park, and confirmed by nobu.
-Thu Jan 20 19:03:24 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Jul 26 14:51:29 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/extmk.rb (extmake): shouldn't set $extflags on mswin32.
+ * test/net/http/test_https.rb (TestNetHTTPS#test_session_reuse):
+ localhost is not (always) 127.0.0.1. Don't expect that.
- * win32/Makefile.sub (LIBRUBY_SO): should use $DLDOBJS instead of
- $EXTOBJS.
- fixed: [ruby-core:04290] (backported from CVS HEAD)
+Thu Jul 26 07:18:38 2012 <kanemoto@ruby-lang.org>
-Thu Jan 20 11:42:02 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/json/fbuffer/fbuffer.h: avoid compilation error on AIX by
+ -ansi -std=iso9899:199409 (r36038). [ruby-core:46744] [Bug #6791].
- * string.c (rb_str_new4): should propagate taintedness.
+Thu Jul 26 00:42:23 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * struct.c (rb_struct_set): use original method name, not callee
- name, to retrieve member slot. [ruby-core:04268]
+ * thread.c (thread_create_core, Init_Thread): hide
+ th->async_errinfo_queue and th->async_errinfo_mask_stack from
+ ObjectSpace.each_object.
- * time.c (time_strftime): protect from format modification from GC
- finalizers.
+Wed Jul 25 17:41:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jan 19 18:06:40 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * complex.c, rational.c: compatible marshal loader for compatibilities
+ with 1.8. [ruby-core:45775] [Bug #6625]
- * lib/ipaddr.rb (to_s, test_to_s): too many colons with some cases.
- (backported from CVS HEAD)
+Wed Jul 25 17:17:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jan 19 01:16:30 2005 Tanaka Akira <akr@m17n.org>
+ * atomic.h: prefer GCC atomic builtins than Windows APIs, if possible,
+ since they are generic.
- * lib/resolv.rb (Resolv::DNS::Config.parse_resolv_conf): ignore
- domain and search directive without an argument.
- reported by Sam Roberts. [ruby-talk:126781]
+Wed Jul 25 11:16:57 2012 Eric Hodel <drbrain@segment7.net>
-Tue Jan 18 15:03:05 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/net/.document: Removed. All files in net/ should be included in
+ RDoc.
- * lib/webrick/ssl.rb (WEBrick::Config::SSL): the default value
- of :SSLEnable is false.
+Wed Jul 25 10:00:23 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/webrick/server.rb (WEBrick::Daemon.start): prepared stdio
- don't allow changing its mode.
+ * test/testunit/test_redefinition.rb: broken class/method names.
- * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_service):
- should delete trailing LF from the result of pack("m*").
+Wed Jul 25 09:26:32 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_connect):
- - should delete trailing LF from the result of pack("m*").
- - clear Request-Line not to send the response by HTTPServer#run.
+ * lib/cgi/html.rb: Use << instead of +=.
+ `a += b` is syntax sugar of `a = a + b`; it creates a new string
+ object. `a << b` is concatenation and doesn't create new object.
- * lib/webrick/httputils (WEBrick::HTTPUtils.parse_qvalues):
- refine regexp (and change the name of a local variable).
+Wed Jul 25 09:16:26 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils#escape_path): add
- new method to escape URI path component.
+ * lib/cgi/html.rb (element_init): suppress redefine warning.
+ Don't define methods if they are already defined.
- * lib/webrick/cgi.rb (WEBrick::CGI::Socket#request_line): should
- escape SCRIPT_NAME and PATH_INFO before being parsed as a URI.
+Wed Jul 25 09:05:38 2012 Eric Hodel <drbrain@segment7.net>
- * test/webrick/*, sample/webrick/httpproxy.rb: add new file.
+ * lib/net/http.rb: Added SSL session reuse across connections for a
+ single instance to speed up connection. [Feature #5341]
+ * NEWS: ditto
+ * test/net/http/test_https.rb: Tests for #5341
-Mon Jan 17 23:33:46 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 25 06:54:24 2012 Eric Hodel <drbrain@segment7.net>
- * configure.in (aix): fix typo. [ruby-talk:126401]
+ * doc/re.rdoc: Fix spelling
-Mon Jan 17 07:08:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 25 06:49:12 2012 Eric Hodel <drbrain@segment7.net>
- * ext/readline/readline.c: suppress warnings.
+ * re.c (rb_reg_s_last_match): Update $~ to reference Regexp
+ documentation about "special global variables". [Bug #6723]
- * lib/irb/extend-command.rb (IRB::ContextExtender.def_extend_command):
- ditto.
+Wed Jul 25 06:28:56 2012 Eric Hodel <drbrain@segment7.net>
- * lib/irb/ext/history.rb (IRB::Context::set_last_value): ditto.
+ * iseq.c: Added documentation. Patch by David Albert. [Bug #6785]
- * lib/irb/ext/history.rb (IRB::Context::eval_history): ditto.
+Wed Jul 25 03:05:06 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/irb/locale.rb (IRB::Locale::real_load): ditto.
+ * parse.y: added symbols and qsymbols productions for %i and %I
+ support. %i{ .. } returns a list of symbols without interpolation,
+ %I{ .. } returns a list of symbols with interpolation. Thanks to
+ Josh Susser for inspiration of this feature. [Feature #4985]
- * lib/irb/slex.rb (SLex::Node::create_subnode): remove garbage.
+ * ext/ripper/eventids2.c: added ripper events for %i and %I.
-Mon Jan 17 00:09:42 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+ * test/ripper/test_parser_events.rb: ripper tests
- * lib/uri/common.rb (PORT): typo fix. fixed: [ruby-core:04256]
+ * test/ripper/test_scanner_events.rb: ditto
-Sat Jan 15 14:57:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_array.rb: test for %i and %I behavior
- * ruby.c (proc_options): ignore trailing CRs at the end of short
- options as well as long options. fixed: [ruby-core:04232]
+Tue Jul 24 23:34:43 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Sat Jan 15 13:35:16 2005 Kouhei Sutou <kou@cozmixng.org>
+ * include/ruby/win32.h (rb_w32_pow): add new function.
+ We use powl() instead of broken pow() for x64-mingw32. This workaround
+ fixes test failures related to floating point numeric.
+ [ruby-core:46686] [Bug #6784]
- * lib/rss/rss.rb (RSS::VERSION): 0.1.2 -> 0.1.3.
+Tue Jul 24 15:01:24 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/rss/rss.rb: accept inheritance. [ruby-talk:126104]
+ * win32/win32.c (rb_w32_socket, rb_w32_socketpair): remember the family
+ in the high word of socklist value.
-Thu Jan 13 04:48:53 2005 Tanaka Akira <akr@m17n.org>
+ * win32/win32.c (overlapped_socket_io, recvmsg, sendmsg, setfl): follow
+ above changes.
- * io.c (io_fread): don't warn nonblocking behavior by default.
+ * win32/win32.c (rb_w32_getsockname): set remembered family to the
+ argument when OS's function fails.
-Wed Jan 12 00:36:29 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jul 24 12:35:13 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * object.c (rb_class_superclass): superclass of singleton class also
- should be a singleton class. fixed: [ruby-list:40519]
+ * test/ruby/test_dir_m17n.rb: remove a garbage.
-Tue Jan 11 09:44:40 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/ruby/test_dir_m17n.rb: convert from ascii-8bit to other encoding
+ with 8bit bytes always fails.
- * numeric.c (Init_Numeric): turn off floating point exceptions
- on bcc32. "1e300".to_f had crashed by overflow.
+Tue Jul 24 12:32:18 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Jan 11 03:10:10 2005 Minero Aoki <aamine@loveruby.net>
+ * test/ruby/test_dir_m17n.rb: sorry, typo.
- * lib/fileutils.rb (copy_entry): could not copy symbolic link.
- [ruby-talk:125733]
+Tue Jul 24 12:13:26 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/fileutils.rb (copy_stream): use read/write instead of
- sysread/syswrite.
+ * test/ruby/test_dir_m17n.rb: refactoring. RE should be in the left side
+ of the =~ operator, and compare the result with nil is meaningless.
-Mon Jan 10 23:08:15 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jul 24 11:35:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * variable.c (rb_autoload): hide internal data from ruby level.
- fixed: [ruby-dev:25435], [ruby-list:40498]
+ * test/ruby/test_pack.rb (test_pack_unpack_M): was redefined
+ accidentally.
-Mon Jan 10 01:22:55 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Jul 24 09:31:18 2012 Eric Hodel <drbrain@segment7.net>
- * gc.c (rb_data_object_alloc): klass may be NULL.
- [ruby-list:40498]
+ * lib/rubygems: Updated to RubyGems 1.8.24, a bugfix release.
-Sun Jan 9 03:12:58 2005 Tanaka Akira <akr@m17n.org>
+Tue Jul 24 08:30:15 2012 Luis Lavena <luislavena@gmail.com>
- * io.c (io_fread): warn nonblocking behavior.
- (io_readpartial): new method IO#readpartial.
+ * test/ruby/test_dir_m17n.rb (create_and_check_raw_file_name): add new
+ helper method to ease encoding testing. Patch by Oleg Sukhodolsky.
+ [ruby-core:46589][Bug #6765]
-Sat Jan 8 04:38:47 2005 why the lucky stiff <why@ruby-lang.org>
+ * test/ruby/test_dir_m17n.rb (test_filename_extutf8): use filesystem
+ encoding when reading entries and comparing.
- * lib/yaml.rb: Kernel#y requires an argument.
+ * test/ruby/test_dir_m17n.rb (test_filename_utf8_raw_name): removed.
-Fri Jan 7 21:12:29 2005 TAMURA Takashi <sheepman@tcn.zaq.ne.jp>
+ * test/ruby/test_dir_m17n.rb (test_filename_utf8_raw_jp_name): split test.
- * random.c (rand_init): use ALLOC_N instead of ALLOCA_N
- [ruby-dev:25426]
+Tue Jul 24 08:09:30 2012 Luis Lavena <luislavena@gmail.com>
-Fri Jan 7 18:03:35 2005 Tanaka Akira <akr@m17n.org>
+ * test/win32ole/test_win32ole_method.rb (is_ruby64?): Correct platform
+ used to identify mingw-w64 (x64-mingw32). Patch by Hiroshi Shirosaki.
+ [ruby-core:46651][Bug #6782]
- * gc.c (mark_locations_array): avoid core dump with -O3.
- [ruby-dev:25424]
+Tue Jul 24 07:22:58 2012 Eric Hodel <drbrain@segment7.net>
-Thu Jan 6 20:31:07 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * time.c (time_sec): Updated description of leap seconds for accuracy.
+ Based on patch by Marcus Stollsteimer. [Bug #6749]
- * ext/zlib/zlib.c (zstream_end): should return value. (backported
- from CVS HEAD)
+Tue Jul 24 07:03:11 2012 Eric Hodel <drbrain@segment7.net>
-Thu Jan 6 19:55:13 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * string.c (rb_str_sub): Fixed wording of documentation to match the
+ replacement operation. Minor cleanup of markup. [Bug #6719]
+ * string.c (rb_str_sub_bang): Minor wording change for clarity, minor
+ cleanup of markup.
- * win32/win32.c (rb_w32_close): didn't close socket handle.
- [ruby-dev:25414]
+Mon Jul 23 23:58:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_open_osfhandle): bcc32's _open_osfhandle
- never set EMFILE.
+ * enc/Makefile.in (TARGET_NAME, TARGET_ENTRY): needed for EXTDLDFLAGS
+ on some platforms. [ruby-core:46600] [Bug #6768]
-Thu Jan 6 17:14:31 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * enc/depend: no longer needs tweaking DLDFLAGS for TARGET names.
- * random.c (random_seed): O_NONBLOCK isn't defined on some
- platforms. [ruby-dev:25417]
+Mon Jul 23 22:48:19 2012 Tanaka Akira <akr@fsij.org>
-Thu Jan 6 13:45:35 2005 Tanaka Akira <akr@m17n.org>
+ * lib/open-uri.rb: use respond_to? to test Tempfile.
+ [ruby-dev:45995] [Bug #6781] reported by hsbt (Hiroshi SHIBATA).
- * lib/time.rb: recognize +00:00 and GMT as a localtime.
+Mon Jul 23 14:43:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jan 6 07:58:28 2005 Dave Thomas <dave@pragprog.com>
+ * configure.in (LIBPATHENV): LIBPATH is used on AIX, but not
+ SHLIB_PATH which was carelessly copied from HP/UX. suggested by
+ Perry Smith at [ruby-core:46397]. [Bug #6728]
- * lib/rdoc/usage.rb (RDoc::RDoc.usage_no_exit): Allow for colons
- in path names on DOS machines. (thanks to Johan Nilsson)
+Mon Jul 23 01:55:08 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Wed Jan 5 20:16:32 2005 Tanaka Akira <akr@m17n.org>
+ * test/uri/test_generic.rb (URI#test_find_proxy): add tests with
+ empty *_proxy env variables.
- * random.c (limited_big_rand): didn't work if SIZEOF_BDIGITS == 2.
- [ruby-dev:25408]
+Mon Jul 23 01:47:26 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * random.c (random_seed): refined.
+ * test/uri/test_generic.rb (URI#with_env): unset proxy related env
+ variables. [Bug #6774]
-Wed Jan 5 12:49:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/uri/test_generic.rb (URI#test_find_proxy): fix failures
+ when proxy related env variables already set. [Bug #6774]
- * eval.c (rb_thread_initialize): Thread objects cannot be initialized
- again. fixed: [ruby-core:04067]
+Sun Jul 22 23:58:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Jan 5 10:48:16 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * thread.c (rb_threadptr_execute_interrupts_common): increase
+ running_time_us on THREAD_TO_KILL like on THREAD_RUNNABLE.
+ This cause not to switch from a thread which is to be killed
+ on FreeBSD and Mac OS X. see also the test.
+ This issue maybe exist for long time but happens after r36430.
- * dir.c (dir_s_mkdir): win32 special processing doesn't need any
- longer. (backported from CVS HEAD)
+Sat Jul 21 06:21:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/win32.[ch] (rb_w32_mkdir): new function. POSIX.1 compatible
- interface. (backported from CVS HEAD)
+ * lib/net/http.rb: fixes for r36476. [Feature #6546]
+ http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20120720T030101Z.diff.html.gz
- * win32/win32.[ch] (rb_w32_rmdir): new function. (backported from CVS
- HEAD)
+ * lib/net/http.rb (Net::HTTP.newobj): return back for compatibility.
-Wed Jan 5 02:30:11 2005 Tanaka Akira <akr@m17n.org>
+ * lib/net/http.rb (Net::HTTP.new): set default_port if proxy port is
+ not given.
- * random.c (init_by_array): imported from mt19937ar-cok.tgz.
- (genrand_int32): ditto.
- (genrand_real): replaced with genrand_res53 in mt19937ar-cok.
- (rand_init): support bignum for longer seed.
- (random_seed): generate longer seed.
- (make_mask): new function.
- (limited_rand): ditto.
- (limited_big_rand): ditto.
- (rb_f_rand): call limited_rand and limited_big_rand.
- [ruby-dev:25403]
+ * lib/net/http.rb (Net::HTTP#initialize): ditto.
-Tue Jan 4 23:25:29 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/net/http.rb (Net::HTTP#proxy?): return true or false.
- * bignum.c (rb_big_rand): should return positive random number.
- [ruby-dev:25401]
+ * lib/net/http.rb (Net::HTTP#proxy_address): check proxy_uri is not nil.
-Tue Jan 4 11:15:29 2005 TAMURA Takashi <sheepman@tcn.zaq.ne.jp>
+ * lib/net/http.rb (Net::HTTP#proxy_port): ditto.
- * bignum.c (rb_big_rand): do not use rb_big_modulo to generate
- random bignums. [ruby-dev:25396]
+Sat Jul 21 23:12:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jan 3 14:01:54 2005 Tanaka Akira <akr@m17n.org>
+ * thread_pthread.c (ruby_init_stack): STACK_GROW_DIR_DETECTION is
+ necessary on platforms with unknown stack direction. [Bug #6761]
- * random.c (random_seed): don't use /dev/urandom if it is not
- character device.
+Sat Jul 21 15:13:42 2012 Shota Fukumori <sorah@tubusu.net>
-Mon Jan 3 11:37:42 2005 Tanaka Akira <akr@m17n.org>
+ * lib/test/unit/testcase.rb (method_added): refactoring.
- * random.c (random_seed): use /dev/urandom if available.
- [ruby-dev:25392]
+Sat Jul 21 14:06:41 2012 Shota Fukumori <sorah@tubusu.net>
-Mon Jan 3 07:46:42 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/test/unit/testcase.rb: warn when test_* method is redefined.
+ Patch by mame (Yusuke Endoh). [Feature #2643] [ruby-core:27790]
- * lib/webrick/httpauth/htpasswd.rb (WEBrick::Htpasswd#reload):
- raise NotImplementedError if password is encrypted by digest
- algorithms. This patch is contributed by sheepman. [ruby-list:40467]
+ * test/testunit/test_redefinition.rb: Test for above.
- * lib/webrick/httpauth/digestauth.rb
- (WEBrick::HTTPAuth::DigestAuth#_authenticate): fix digest calculation.
- This patch is contributed by sheepman. [ruby-list:40482]
+ * test/testunit/test4test_redefinition.rb: Ditto.
- * lib/webrick/{httpauth.rb,httpauth/basicauth.rb,httpproxy.rb}: use
- pack/unpack-template char "m" instead of lib/base64.rb to do base64
- encoding/decoding. fixed: [ruby-dev:25336]
+Sat Jul 21 08:41:14 2012 Eric Hodel <drbrain@segment7.net>
- * test/webrick/test_httpauth.rb: new file.
+ * lib/logger.rb: Updated example in Logger comment to match other
+ examples and fixed a bug. Patch by Marcus Stollsteimer.
+ [Bug #6759]
-Sat Jan 1 04:20:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Jul 20 17:20:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_ns_spki.c (ossl_spki_set_challenge): should call
- StringValue before GetSPKI. fixed: [ruby-dev:25359].
+ * random.c (rb_random_real): refine error message.
-Sat Jan 1 01:13:28 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Jul 20 11:03:17 2012 Eric Hodel <drbrain@segment7.net>
- * variable.c (rb_autoload): [ruby-dev:25373]
+ * NEWS: Updated net/http for automatic proxy detection (#6546) and
+ automatic gzip and deflate compression (#6492, #6494).
-Fri Dec 31 14:10:43 2004 Dave Thomas <dave@pragprog.com>
+Fri Jul 20 10:55:38 2012 Eric Hodel <drbrain@segment7.net>
- * lib/rdoc/ri/ri_formatter.rb (RI::TextFormatter::display_flow_item): Fix problem
- if heading contains formatting.
+ * lib/net/http.rb: Net::HTTP now automatically detects and uses
+ proxies from the environment. A proxy may also be specified as
+ before.
-Thu Dec 30 00:41:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ Net::HTTP::Proxy still creates anonymous classes, but these classes
+ are only used to store configuration information. When an HTTP
+ instance is created the configuration is now copied.
- * eval.c (svalue_to_avalue): [ruby-dev:25366]
+ Additionally, Net::HTTP::ProxyDelta is no longer used by Net::HTTP
- * string.c (rb_str_justify): [ruby-dev:25367]
+ [Feature #6546]
+ * lib/open-uri.rb: Moved URI::Generic#find_proxy to uri/generic.
+ * lib/uri/generic.rb: Imported find_proxy from open-uri.
+ * test/open-uri/test_open-uri.rb: Moved proxy-discovery tests to URI.
+ * test/uri/test_generic.rb: Imported proxy-discovery tests from
+ open-uri.
+ * test/net/http/test_http.rb: Added tests for proxy behavior.
-Wed Dec 29 11:07:07 2004 Dave Thomas <dave@pragprog.com>
+Fri Jul 20 09:34:11 2012 Eric Hodel <drbrain@segment7.net>
- * lib/rdoc/generators/template/html/kilmer.rb: Update to use new
- sections.
+ * test/socket/test_socket.rb: Ignore IPv6 unique local addresses on OS
+ X (iCloud Back to my Mac addresses) for test_udp_socket since they do
+ not act as loopback addresses. [Bug #6692]
-Tue Dec 28 22:31:46 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jul 20 09:32:14 2012 Eric Hodel <drbrain@segment7.net>
- * string.c (rb_str_justify): create buffer string after argument type
- conversion. fixed: [ruby-dev:25341]
+ * ext/socket/raddrinfo.c (addrinfo_ipv6_unique_local_p): Added
+ Addrinfo#ipv6_unique_local? to detect RFC 4193 unique local
+ addresses. Part of #6692
+ * ext/socket/rubysocket.h: Add IN6_IS_ADDR_UNIQUE_LOCAL macro if
+ missing.
+ * test/socket/test_addrinfo.rb: Test for ipv6_unique_local?
-Tue Dec 28 15:41:48 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jul 20 07:40:32 2012 Eric Hodel <drbrain@segment7.net>
- * ext/nkf/nkf-utf8/nkf.c (reinit): should initialize all static
- variables. fixed: [ruby-list:40445]
+ * lib/net/http/response.rb: Automatically inflate gzip and
+ deflate-encoded response bodies. [Feature #6942]
+ * lib/net/http/generic_request.rb: Automatically accept gzip and
+ deflate content-encoding for requests. [Feature #6494]
+ * lib/net/http/request.rb: Updated documentation for #6494.
+ * lib/net/http.rb: Updated documentation for #6492 and #6494, removed
+ Content-Encoding handling now present in Net::HTTPResponse.
+ * test/net/http/test_httpresponse.rb: Tests for #6492
+ * test/net/http/test_http_request.rb: Tests for #6494
+ * test/open-uri/test_open-uri.rb (test_content_encoding): Updated test
+ for automatic content-encoding handling.
-Tue Dec 28 15:25:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jul 20 03:42:54 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/nkf/lib/kconv.rb (Kconv::RegexpEucjp): second byte is up to
- 0xfe.
+ * thread_pthread.c: use #ifdef, not #if.
- * ext/nkf/lib/kconv.rb (Kconv#kconv): should handle UTF8 and UTF16
- properly.
+Thu Jul 19 15:08:40 2012 Koichi Sasada <ko1@atdot.net>
-Tue Dec 28 13:35:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (rb_thread_s_control_interrupt,
+ rb_thread_s_check_interrupt): added for
+ Thread.control_interrupt and Thread.check_interrupt.
+ See details on rdoc.
+ I'll make an ticket for this feature.
- * ext/zlib/zlib.c (rb_deflate_s_deflate, rb_inflate_s_inflate): ensure
- freeing internal zstreams. fixed: [ruby-dev:25309]
+ * test/ruby/test_thread.rb: add a test for Thread.control_interrupt.
- * ext/zlib/zlib.c (rb_deflate_init_copy): replace rb_deflate_clone.
+ * thread.c (rb_threadptr_raise): make a new exception object
+ even if argc is 0.
-Tue Dec 28 12:26:45 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * thread.c (rb_thread_kill): kill thread immediately if target thread
+ is current thread.
- * win32/Makefile.sub, win32/setup.mak (RDOCTARGET, install,
- install-nodoc, install-doc): rdoc support for mswin32.
+ * vm_core.h (RUBY_VM_CHECK_INTS_BLOCKING): added.
+ CHECK_INTS while/after blocking operation.
- * win32/configure.bat (--enable-install-doc, --disable-install-doc):
- ditto.
+ * vm_core.h (RUBY_VM_CHECK_INTS): require rb_thread_t ptr.
-Mon Dec 27 20:02:14 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * cont.c (fiber_switch): use replaced RUBY_VM_CHECK_INTS().
- * ext/tcltklib/tcltklib.c: fix SEGV bug when deleting Tk interp
+ * eval.c (ruby_cleanup): ditto.
- * ext/tk/lib/multi-tk.rb: ditto
+ * insns.def: ditto.
-Mon Dec 27 16:55:17 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * process.c (rb_waitpid): ditto.
- * ext/openssl/ossl_x509name.c (Init_ossl_x509name): should use
- rb_hash_new to get exactly a Hash. fix [ruby-dev:25325].
+ * vm_eval.c (vm_call0): ditto.
-Mon Dec 27 16:29:56 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_method): ditto.
- * string.c (rb_str_justify): [ruby-dev:25341]
+Thu Jul 19 22:46:48 2012 Tanaka Akira <akr@fsij.org>
-Mon Dec 27 15:47:48 2004 Minero Aoki <aamine@loveruby.net>
+ * test/ruby/test_io.rb: remove temporally files early.
- * test/fileutils/fileasserts.rb: sync with HEAD.
+Thu Jul 19 15:38:35 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test/fileutils/test_fileutils.rb: ditto.
+ * variable.c (rb_mod_class_variables): return inherited variables
+ except when the optional argument is set to false.
+ [ruby-dev:44034] [Bug #4971]
- * test/fileutils/test_nowrite.rb: ditto.
+ * variable.c (rb_mod_constants): fix typo in documentation.
-Mon Dec 27 15:21:07 2004 Minero Aoki <aamine@loveruby.net>
+Thu Jul 19 14:30:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/fileutils.rb (mv): should raise error when moving a
- directory to the (empty) directory. [ruby-talk:124368]
- (backport from HEAD 1.48)
+ * internal.h: move mark function declarations that should be private.
- * lib/fileutils.rb (mv): wrongly did not overwrite file on Win32
- platforms. (backport from HEAD 1.48)
+Thu Jul 19 14:18:22 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Dec 25 11:11:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/socket/init.c (rsock_init_sock): need to update max fd on all
+ platforms.
- * stable version 1.8.2 released.
+Thu Jul 19 14:15:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 25 04:23:49 2004 Minero Aoki <aamine@loveruby.net>
+ * thread.c (rb_gc_mark_threads): remove deprecated function.
- * lib/fileutils.rb (mkdir, mkdir_p): should ensure directory
- permission. (backportted from HEAD, 1.47)
+Thu Jul 19 13:28:03 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/fileutils.rb (traverse, remove_dir): untaint trasted
- objects. (backportted from HEAD, 1.46)
+ * test/net/http/test_http.rb (TestNetHTTPLocalBind#test_bind_to_local*):
+ re-enable the tests because now it's OK on windows.
-Sat Dec 25 01:28:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Jul 19 13:26:25 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * io.c: cancel io_reopen() change on Dec. 24th.
+ * ext/socket/extconf.rb: now enable IPv6 by default on mswin.
- * dln.c: use <dlfcn.h> for NetBSD. [ruby-dev:25313]
+Thu Jul 19 09:33:46 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * io.c (rb_f_select): IO list could be altered. [ruby-dev:25312]
+ * ext/psych/emitter.c (initialize): allow a configuration object to be
+ passed to the constructor so that mutation isn't required after
+ instantiation.
-Fri Dec 24 23:51:48 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * ext/psych/lib/psych/handler.rb: add configuration object
- * bcc32/Makefile.sub: bcc32 should use RTL dll (backport from HEAD)
- [ruby-dev:25306]
+ * ext/psych/lib/psych/visitors/emitter.rb: use configuration object if
+ extra configuration is present.
- * win32/win32.[ch]: ditto.
+Thu Jul 19 08:20:25 2012 Tanaka Akira <akr@fsij.org>
-Fri Dec 24 23:27:18 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/ruby/test_file.rb: remove temporally files early.
- * ext/tk/lib/tk/image.rb: TkPhotoImage#cget bug fix
+Thu Jul 19 07:37:41 2012 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Fri Dec 24 18:39:25 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/drb/drbtest.rb: fixed: can't delete unix domain sockets problem.
- * win32/win32.[ch]: failed to compile on bcc32 (and probably wince)
- [ruby-dev:25306]
+Thu Jul 19 03:41:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Dec 24 02:52:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bignum.c: Added #include <strings.h> for ffs(). Patch by Perry
+ Smith. Thank you. [Bug #6748]
- * io.c (io_reopen, rb_io_reopen): prohibit to change access mode for
- special IO ports. [ruby-dev:25225]
+Thu Jul 19 01:56:02 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Dec 24 02:22:53 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/intern.h (rb_num_zerodiv): Added NORETURN.
+ Patched by Xi Wang. [Bug #6736]
- * ext/syck/rubyext.c (rb_syck_io_str_read): [ruby-core:03973]
+Wed Jul 18 23:57:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/syck/rubyext.c (syck_loader_transfer): check type conversion.
+ * pack.c (pack_pack): round down too long uuencode width. folding
+ width in uuencode format cannot be longer than 63 bytes.
- * ext/syck/rubyext.c (syck_parser_assign_io, rb_new_syck_node): duck
- typing.
+Wed Jul 18 23:04:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/syck/rubyext.c (syck_parser_s_alloc, syck_parser_initialize):
- allocation framework.
+ * ext/dbm/dbm.c (fdbm_empty_p): fix wrong condition introduced in r36438.
- * ext/syck/rubyext.c (syck_emitter_s_alloc, syck_emitter_initialize):
- ditto.
+ * ext/sdbm/init.c (fsdbm_empty_p): ditto.
-Fri Dec 24 01:21:00 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Jul 18 23:08:57 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tkextlib/blt.rb: add BLT extension support
+ * test/ruby/test_beginendblock.rb: remove temporally files early.
- * ext/tk/lib/tkextlib/blt/*.rb: ditto
+Wed Jul 18 22:43:02 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tkextlib/blt/tile/*.rb: ditto
+ * test/ruby/test_autoload.rb: remove temporally files early.
-Thu Dec 23 23:36:28 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 18 21:59:46 2012 Tanaka Akira <akr@fsij.org>
- * process.c (proc_setgroups): check if the argument lenght is
- modified. fixed: [ruby-dev:25285]
+ * test/ruby/test_argf.rb: use temporally directory.
-Thu Dec 23 13:13:33 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Jul 18 19:41:19 2012 Tanaka Akira <akr@fsij.org>
- * ext/tcltklib/tcltklib.c: define TclTkLib::COMPILE_INFO and
- RELEASE_DATE
+ * test/openssl/test_config.rb: remove temporally files early.
- * ext/tcltklib/extconf.rb: ditto
+Wed Jul 18 17:45:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/tkutil.c: define TkUtil::RELEASE_DATE
+ * error.c (rb_builtin_type_name): map by index.
- * ext/tk/lib/tk.rb: define Tk::RELEASE_DATE
+Wed Jul 18 16:17:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 23 09:38:31 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb (have_framework): get rid of separating -framework
+ option and its argument and dealing with the argument as a library
+ or an object name. if $LDFLAGS were an array...
- * io.c (io_reopen): restore exact mode. fixed: [ruby-core:04003]
+Wed Jul 18 16:09:10 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Dec 23 00:16:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/curses/extconf.rb: support PDCurses. patched by Luis Lavena.
+ [ruby-core:46485] [Feature #6735]
- * configure.in (bsdi): use $(CC) for LDSHARED. fixed [ruby-dev:25270]
+Wed Jul 18 15:50:25 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed Dec 22 11:14:55 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (primary): allow an empty grouped expression as the
+ operand of the not operator (e.g., not ()).
+ [ruby-core:45976] [Bug #6674]
- * io.c (rb_io_mode_modenum): replace O_ACCMODE with O_RDWR.
- fixed: [ruby-dev:25273]
+ * parse.y (parser_yylex): show no warning for a grouped expression
+ as the operand of the not operator (e.g., not (a)) or as an
+ argument of a method call without parentheses (e.g., foo (a)).
+ [ruby-core:39050] [Bug #5214]
-Wed Dec 22 08:34:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 18 15:33:21 2012 Koichi Sasada <ko1@atdot.net>
- * ext/dl/sym.c (rb_dlsym_initialize): extract internal pointers after
- all argument conversion. fixed: [ruby-dev:25271]
+ * thread.c (rb_thread_call_without_gvl2): added.
+ it can skip last CHECK_INTS. See document for more details.
+ Document about it was updated a bit.
-Wed Dec 22 00:08:01 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * include/ruby/thread.h (decl. of rb_thread_call_without_gvl2): added.
- * lib/soap/*, test/soap/*, sample/soap/authheader/*: eval cleanup.
+ * thread.c (rb_thread_call_with_gvl): remove "EXPERIMENTAL!"
+ warning from a document.
-Tue Dec 21 22:07:33 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Wed Jul 18 14:53:21 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode,
- ossl_asn1_decode_all): temporary value should be marked volatile.
+ * configure.in (EXTDLDFLAGS): split options for each extension
+ libraries, and unused in ruby.pc. [Bug #6734]
-Tue Dec 21 14:40:02 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/mkmf.rb (MakeMakefile#configuration): add EXTDLDFLAGS.
- * ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode,
- ossl_asn1_decode_all): use rb_str_new4 to avoid SEGV.
- fix [ruby-dev:25261]
+Wed Jul 18 14:47:23 2012 Koichi Sasada <ko1@atdot.net>
- * test/openssl/test_asn1.rb: add tests for OpenSSL::ASN1.
+ * thread.c: fix last commit miss.
-Tue Dec 21 12:22:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 18 14:16:51 2012 Koichi Sasada <ko1@atdot.net>
- * io.c (io_reopen): keep duplex pipe in correct mode for exception
- safeness. fixed: [ruby-dev:25152]
+ * thread.c (rb_threadptr_async_errinfo_*): manage async errors queue.
+ Async events such as an exception throwed by Thread#raise,
+ Thread#kill and thread termination (after main thread termination)
+ will be queued to th->async_errinfo_queue.
+ - clear: clear the queue.
+ - enque: enque err object into queue.
+ - deque: deque err object from queue.
+ - active_p: return 1 if the queue should be checked.
+ rb_thread_t#thrown_errinfo was removed.
-Tue Dec 21 12:10:04 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm_core.h: add declarations of rb_threadptr_async_errinfo_*.
+ remove rb_thread_t#thrown_errinfo field and
+ add rb_thread_t#async_errinfo_queue (queue body: Array),
+ rb_thread_t#async_errinfo_queue_checked (flag),
+ rb_thread_t#async_errinfo_mask_stack(Array, not used yet).
- * ext/tk/lib/tk/grid.rb: rescue bug of 'grid configure' on Tcl/Tk8.3-
+ * vm.c (rb_thread_mark): fix a mark function.
-Tue Dec 21 00:53:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * cont.c (rb_fiber_start): enque an error.
- * ext/openssl/ossl_asn1.c (ossl_asn1_traverse): [ruby-dev:25261]
+ * process.c (after_fork): clear async errinfo queue.
- * ext/openssl/ossl_asn1.c (ossl_asn1_decode): ditto.
+Wed Jul 18 14:25:55 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/openssl/ossl_asn1.c (ossl_asn1_decode_all): ditto.
+ * pack.c: (ditto) bitwise operations are not char. Apply explicit
+ casts on them.
-Mon Dec 20 23:22:26 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Wed Jul 18 12:59:50 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * added files:
- * lib/soap/mapping/wsdl*.rb
- * lib/wsdl/soap/element.rb
- * lib/wsdl/xmlSchema/simpleContent.rb
+ * encoding.c (load_encoding): explicit cast to suppress warning.
+ Though the cast truncates some bits, from heuristic analysis I
+ believe it is OK to do so here.
- * modified files:
- * lib/soap/*
- * lib/wsdl/*
- * lib/xsd/*
- * test/soap/*
- * test/wsdl/*
- * test/xsd/*
- * sample/soap/*
- * sample/sdl/*
+ * bignum.c (rb_cstr_to_inum): ditto.
- * summary
- * imported from the soap4r repository. Version: 1.5.3-ruby1.8.2
+Wed Jul 18 12:55:54 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * added several XSD basetype support: nonPositiveInteger,
- negativeInteger, nonNegativeInteger, unsignedLong, unsignedInt,
- unsignedShort, unsignedByte, positiveInteger
+ * lib/benchmark.rb: Fix Benchmark.benchmark output with an empty
+ caption. patched by Benoit Daloze. [ruby-core:45719] [Bug #6610]
- * HTTP client connection/send/receive timeout support.
+Wed Jul 18 10:00:54 2012 Eric Hodel <drbrain@segment7.net>
- * HTTP client/server gzipped content encoding support.
+ * lib/debug.rb: Added toplevel documentation. Based on patch by Oscar
+ Del Ben. [Bug #6743], fixes #146 on github.
- * improved WSDL schema definition support; still is far from
- complete, but is making step by step improovement.
+Wed Jul 18 09:33:59 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Dec 20 22:56:39 2004 Tanaka Akira <akr@m17n.org>
+ * test/win32ole/test_win32ole_event.rb (TestWIN32OLE_EVENT): use
+ standard skip method to skip tests.
- * gc.c (stack_end_address): gcc noinline attribute is available since
- gcc-3.1.
+Wed Jul 18 09:26:45 2012 Eric Hodel <drbrain@segment7.net>
-Mon Dec 20 14:07:02 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/logger.rb: Updated typos and output to match modern Logger
+ output. Patch by Marcus Stollsteimer. [Bug #6738]
- * ext/tk/lib/multi-tk.rb: supports new features of Tcl/Tk8.5a2
+Wed Jul 18 07:59:29 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
- * ext/tk/lib/tk/clock.rb: ditto
+ * lib/cgi/util.rb (CGI.escapeHTML,unescapeHTML): Add &apos; for HTML5
+ escaping.
+ [Feature #6620]
- * ext/tk/lib/tk/text.rb: ditto
+Tue Jul 17 22:17:13 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/panedwindow.rb: ditto
+ * lib/open-uri.rb: call io.close! for Tempfile.
-Mon Dec 20 12:47:13 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Jul 17 16:41:32 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/lib/net/https.rb,protocols.rb,telnets.rb: delete
- doc and code about SSLContext#{key_file,cert_file}.
- fixed: [ruby-dev:25243]
+ * proc.c (rb_proc_arity): return normal value (not -n-1) if it is not
+ a labmda, or it is a labmda and no arg_opts. [Bug #5694]
-Mon Dec 20 12:42:17 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Jul 17 03:56:34 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * io.c (io_fwrite): workaround for MSVCRT's bug.
- fixed: [ruby-core:03982]
+ * ext/psych/lib/psych/visitors/to_ruby.rb: strings with YAML anchors
+ are properly referenced. Patched by Joe Rafaniello via Github:
+ https://github.com/tenderlove/psych/pull/69
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
+ * test/psych/test_alias_and_anchor.rb: test for change
-Mon Dec 20 11:21:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jul 16 23:20:24 2012 Tanaka Akira <akr@fsij.org>
- * io.c (rb_io_eof): check if closed before clearerr().
- fixed: [ruby-dev:25251]
+ * bignum.c (rb_integer_float_cmp): use FIXNUM_MIN and FIXNUM_MAX,
+ instead of LONG_MIN and LONG_MAX.
-Mon Dec 20 03:30:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jul 16 22:50:41 2012 Tanaka Akira <akr@fsij.org>
- * lib/cgi/session.rb (CGI::Session#initialize): empty session id was
- used if request had no session key. fixed: [ruby-core:03981]
+ * numeric.c (flo_to_s): use the exponential form if the integer part
+ is longer than or equal DBL_DIG.
+ [ruby-dev:45960] [ruby-trunk - Bug #6741]
-Mon Dec 20 01:51:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jul 16 22:01:00 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * struct.c (make_struct): [ruby-dev:25249]
+ * ext/readline/readline.c: fixed docs. [Bug #6740][ruby-core:46501]
+ patched by Nobuhiro IMAI.
-Mon Dec 20 00:28:20 2004 Kouhei Sutou <kou@cozmixng.org>
+Mon Jul 16 19:24:01 2012 Tanaka Akira <akr@fsij.org>
- * lib/rexml/encodings/SHIFT-JIS.rb: backported from CVS HEAD.
+ * bignum.c (rb_integer_float_eq): new function.
+ (rb_big_eq): use rb_integer_float_eq.
- * lib/rexml/encodings/SHIFT_JIS.rb: ditto.
+ * internal.h (rb_integer_float_eq): declared.
-Sun Dec 19 17:19:48 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * numeric.c (flo_eq): use rb_integer_float_eq.
+ (fix_equal): ditto.
- * ext/openssl/ossl_x509store.c
- (ossl_x509store_set_time): add OpenSSL::X509::Store#time=.
- (ossl_x509stctx_set_time): add OpenSSL::X509::StoreContext#time=.
+Mon Jul 16 19:02:31 2012 Tanaka Akira <akr@fsij.org>
- * test/openssl/ossl_x509store.rb: test certificate validity times.
+ * bignum.c (rb_integer_float_cmp): rename a local variable.
- * ext/openssl/ossl_x509name.c (ossl_x509name_to_s): add optional
- second argument to specify the output format (see also
- X509_NAME_print_ex).
+Mon Jul 16 18:40:26 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_x509name.c (ossl_x509name_init): new constants:
- OpenSSL::X509::Name::COMPAT, OpenSSL::X509::Name::RFC2253,
- OpenSSL::X509::ONELINE, OpenSSL::X509::MULTILINE.
+ * bignum.c (rb_integer_float_cmp): renamed from rb_big_float_cmp.
- * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name::RFC2253DN):
- new module to provide the parse for RFC2253 DN format.
+ * internal.h: follow the above change.
- * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name.parse_rfc2253):
- new method to parse RFC2253 DN format.
+ * numeric.c: ditto.
- * test/openssl/ossl_x509name.rb: add tests about RFC2253 DN.
+Mon Jul 16 17:57:54 2012 Tanaka Akira <akr@fsij.org>
- * text/openssl/ssl_server.rb: try to listen ports from 20443 to 20542
- while EADDRINUSE is raised.
+ * bignum.c (rb_big_float_cmp): compare an integer and float precisely.
+ [ruby-core:31376] [Bug #3589] reported by Tomasz Wegrzanowski.
- * all changes in this entry are backport from 1.9.
+Mon Jul 16 17:29:45 2012 Tanaka Akira <akr@fsij.org>
-Sun Dec 19 17:24:59 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bignum.c (rb_big_float_cmp): support fixnum for argument x.
- * configure.in (enable_rpath): use rpath flag to embed the library
- path into extensions on ELF environment. [ruby-dev:25035]
+ * numeric.c (fix_equal): use rb_big_float_cmp.
+ (fix_cmp): ditto.
+ (fix_gt): ditto.
+ (fix_ge): ditto.
+ (fix_lt): ditto.
+ (fix_le): ditto.
+ (flo_eq): ditto.
+ (flo_cmp): use rb_big_float_cmp for fixnum argument.
+ (flo_gt): ditto.
+ (flo_ge): ditto.
+ (flo_lt): ditto.
+ (flo_le): ditto.
-Sun Dec 19 11:01:25 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jul 16 17:05:53 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/test/unit.rb: use standalone runner for -e.
+ * test/fileutils/test_fileutils.rb: add test for FileUtils#uptodate?
- * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner#options): accept
- multiple -p and -x options.
+Mon Jul 16 16:56:12 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir#recursive_collect):
- ditto.
+ * lib/fileutils.rb (FileUtils.uptodate?): remove useless parameter.
+ patched by Oscar Del Ben.[Bug #6708][ruby-core:46256]
-Sat Dec 18 16:36:23 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jul 16 15:37:56 2012 Tanaka Akira <akr@fsij.org>
- * ext/zlib/zlib.c (rb_deflate_s_deflate, rb_inflate_s_inflate):
- disallow interrupt by type conversion. fixed: [ruby-dev:25226]
+ * bignum.c (rb_big_eq): use rb_big_float_cmp.
-Sat Dec 18 15:16:41 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Mon Jul 16 15:00:45 2012 Tanaka Akira <akr@fsij.org>
- * lib/webrick/httpauth.rb,
- lib/webrick/httpauth/{basicauth.rb,digestauth.rb}: use
- pack/unpack-template char "m" instead of lib/base64.rb to do base64
- encoding/decoding.
+ * internal.h (rb_big_float_cmp): declared.
-Sat Dec 18 10:51:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * bignum.c (rb_big_float_cmp): extracted from rb_big_cmp and big_op.
+ (rb_big_cmp): use rb_big_float_cmp.
+ (big_op): ditto.
- * dir.c (dir_open_dir): new function. [ruby-dev:25242]
+ * numeric.c (flo_cmp): use rb_big_float_cmp.
+ (flo_gt): ditto.
+ (flo_ge): ditto.
+ (flo_lt): ditto.
+ (flo_le): ditto.
-Fri Dec 17 18:07:01 2004 Shugo Maeda <shugo@ruby-lang.org>
+Mon Jul 16 14:14:21 2012 Tanaka Akira <akr@fsij.org>
- * test/readline/test_readline.rb: fix for BSD. Thanks, GOTOU Yuuzou.
- fixed: [ruby-dev:25218]
+ * bignum.c (enum big_op_t): new type.
+ (big_op): use enum big_op_t.
+ (big_gt): ditto.
+ (big_ge): ditto.
+ (big_lt): ditto.
+ (big_le): ditto.
-Fri Dec 17 16:28:12 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat Jul 14 18:18:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk.rb: fix bug on setting up system encoding
+ * array.c (rb_get_values_at): fill with nil out of range.
+ [ruby-core:43678] [Bug #6203]
- * ext/tk/lib/tk/event.rb: fix error on require process
+Sat Jul 14 17:17:55 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * ext/tk/lib/tk/font.rb: fix abnormal termination error on Windows
+ * cont.c (cont_restore_0): improve docs. [Bug #6706][ruby-core:46243]
+ patched by Oscar Del Ben via https://github.com/ruby/ruby/pull/140
- * ext/tk/lib/tk/virtevent.rb: TkVirtualEvent::PreDefVirtEvent.new()
- accepts event-sequence arguments
+Sat Jul 14 17:08:13 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/text.rb: fail to dump embedded images
+ * hash.c (rb_hash_s_create): raise an exception, when input elements
+ are not one or two elements arrays. [ruby-core:39945] [Bug #5406]
- * ext/tk/lib/tk/text.rb: tag_nextrange and tag_prevrange returns wrong
- types of values
+Sat Jul 14 16:16:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/texttag.rb: nextrange and prevrange returns wrong
- types of values
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): use
+ Array#uniq!.
- * ext/tk/lib/tk/text.rb: add TkText::IndexModMethods module and
- TkText::IndexString class to treat text index modifiers
+ * lib/test/unit.rb (Test::Unit::Runner#deal): deal tasks to workers.
- * ext/tk/lib/tk/texttag.rb: use TkText::IndexModMethods module
+ * lib/test/unit.rb (Test::Unit::Runner#quit_workers): close and kill
+ all workers.
- * ext/tk/lib/tk/textmark.rb: ditto
+ * lib/test/unit.rb (Test::Unit::Runner#delete_worker): delete dead
+ worker from working set.
- * ext/tk/lib/tk/textimage.rb: ditto
+ * lib/test/unit.rb (Test::Unit::Runner#launch_worker): add new worker
+ to working set.
- * ext/tk/lib/tk/textwindow.rb: ditto
+ * lib/test/unit.rb (Test::Unit::Runner#launch_worker): extract.
- * ext/tk/lib/tk/textimage.rb: wrong gravity of text mark for embedded
- image
+ * lib/test/unit.rb (Test::Unit::Runner#start_watchdog): extract.
- * ext/tk/lib/tk/textwindow.rb: wrong gravity of text mark for
- embedded window
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): move
+ initializations with nothing to release outside begin/ensure.
-Fri Dec 17 13:50:00 2004 Akiyoshi, Masamichi <akiyoshi@hp.com>
+Sat Jul 14 16:04:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vms/vmsruby_private.c, vms/vmsruby_private.h: private routines
- for VMS port are added.
+ * array.c (rb_ary_join): should not infected by separator if it is not
+ used. [ruby-core:42161][Bug #5902]
- * eval.c (ruby_init): change to call VMS private intialization routine.
+Sat Jul 14 02:31:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Dec 17 13:33:58 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/intern.h (rb_thread_blocking_region): fix declarations
+ prototypes without arguments in C++ have different meanings than C.
- * lib/cgi/session.rb (CGI::Session#initialize): control adding
- session_id hidden fields. fixed: [ruby-talk:123850]
+Thu Jul 12 12:32:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 16 23:25:25 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * test/runner.rb: skip default gems to get rid of loading old versions
+ before installation.
- * lib/drb/drb.rb, lib/drb/ssl.rb: backported from CVS HEAD.
- [druby-ja:101]
+Thu Jul 12 11:44:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/drb/test_drb.rb: adjust and reduce sleep (backported from
- CVS HEAD.)
+ * string.c (rb_str_new_frozen): since the result object should have
+ same tainted/untrusted bits with the original object, return new
+ object if the shared object unmatch. [ruby-core:39745][Bug #5374]
-Thu Dec 16 18:44:58 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Jul 12 10:46:39 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): should wait
- for reading request till data arrive. [ruby-talk:121068]
+ * test/net/http/test_http.rb (TestNetHTTPLocalBind#test_bind_to_local*):
+ cannot cross between network interfaces on Windows, so skip this test
+ until we find better test.
- * lib/webrick/server.rb (WEBrick::GenericServer#start_thread):
- should log about all accepted socket. [ruby-core:03962]
+Thu Jul 12 08:48:33 2012 Ryan Davis <ryand-ruby@zenspider.com>
- * lib/webrick/accesslog.rb (WEBrick::AccessLog#setup_params):
- "%%" and "%u" are supported. [webricken:135]
+ * lib/minitest/*: Imported minitest 3.2.0 (r7598)
+ * test/minitest/*: ditto
- * lib/webrick/httpservlet/filehandler.rb
- (WEBrick::HTTPServlet::FileHandler#check_filename):
- :NondisclosureName is acceptable if it is Enumerable.
+Thu Jul 12 05:11:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/config.rb (WEBrick::Config::FileHandler):
- default value of :NondisclosureName is [".ht*", "*~"].
+ * insns.def (defined): use method entry and id in cfp for proper
+ superclass, since klass in iseq is shared by dynamically defined
+ methods from the same block. [ruby-core:45831][Bug #6644]
-Thu Dec 16 18:36:52 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Jul 12 01:49:07 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl.c (ossl_raise): refine message format.
+ * lib/net/http.rb (Net::HTTP#connect): use local_host and local_port
+ if specified. patched by Ricardo Amorim [Feature #6617]
-Thu Dec 16 16:29:44 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Jul 11 17:36:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/sample/demos-en/widget: modify version check for
- supporting features
+ * ext/extmk.rb: append ENCOBJS to DLDOBJS but not EXTSOLIBS which is
+ not a target, to compile enc/encinit.c.
-Thu Dec 16 16:03:50 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Jul 11 12:38:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/lib/tk/bindtag.rb: bug fix [ruby-talk: 123667]
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_mul): nonstatic initializer
+ of an aggregate type is a C99ism.
- * ext/tk/lib/tk/timer.rb: accept :idle for the interval argument
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_mul): get rid of VC++
+ warnings.
- * ext/tk/lib/tk.rb: add TkComm._callback_entry?()
+Mon Jul 9 16:11:30 2012 Yuki Yugui Sonoda <yugui@google.com>
- * ext/tk/lib/multi-tk.rb: add MultiTkIp.cb_entry_class
+ * vm_eval.c (rb_eval_string_from_file,
+ rb_eval_string_from_file_protect): new functions to replace
+ rb_compile_main_from_string() and ruby_eval_main().
- * ext/tk/lib/tk/canvas.rb: use TkComm._callback_entry?()
+ * nacl/pepper_ruby.c: Follows the change in vm_eval.c
- * ext/tk/lib/tk/canvastag.rb: ditto
+Mon Jul 9 14:05:42 2012 Yuki Yugui Sonoda <yugui@google.com>
- * ext/tk/lib/tk/dialog.rb: ditto
+ Reverts a half of r36079. As we discussed on ruby-dev@ and IRC,
+ we do not need to disclose intermediate representation of program.
+ The program embedding CRuby should use rb_eval_string family.
+ * include/ruby/ruby.h (ruby_opaque_t): removed.
+ (ruby_compile_main_from_file, ruby_compile_main_from_string,
+ ruby_eval_main): removed.
- * ext/tk/lib/tk/optiondb.rb: ditto
+ * eval.c (ruby_eval_main_internal): became ruby_exec_internal() again.
+ (ruby_eval_main): removed.
- * ext/tk/lib/tk/text.rb: ditto
+ * ruby.c (PREPARE_PARSE_MAIN) reverted.
+ (parse_and_compile_main, ruby_compile_main_from_file,
+ ruby_compile_main_from_string): removed
- * ext/tk/lib/tk/texttag.rb: ditto
+Wed Jul 11 10:16:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/textwindow.rb: ditto
+ * include/ruby.h (HAVE_RUBY_THREAD_H): to show ruby/thread.h to be
+ available. fixup of r36355.
- * ext/tk/lib/tk/timer.rb: ditto
+Wed Jul 11 03:26:47 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/lib/tk/validation.rb: ditto
+ * ext/zlib/zlib.c: Added streaming support to inflate processing.
+ This allows zlib streams to be processed without huge memory growth.
+ [Feature #6612]
+ * NEWS: ditto
+ * ext/zlib/zlib.c (zstream_expand_buffer): Uses rb_yield when a block
+ is given for streaming support. Refactored to use
+ zstream_expand_buffer_into to remove duplicate code.
+ * ext/zlib/zlib.c (zstream_expand_buffer_protect): Added wrapper
+ function to pass jump state back through GVL-free section to allow
+ zstream clean-up before terminating the ruby call.
+ * ext/zlib/zlib.c (zstream_expand_buffer_without_gvl): Acquire GVL to
+ yield processed chunk of output stream.
+ * ext/zlib/zlib.c (zstream_detach_buffer): When a block is given,
+ returns Qnil mid-stream and yields the output buffer at the end of
+ the stream.
+ * test/zlib/test_zlib.rb: Updated tests
- * ext/tk/lib/tkextlib/*: ditto
+Tue Jul 10 22:57:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 16 03:14:28 2004 Minero Aoki <aamine@loveruby.net>
+ * include/ruby/thread.h: new header file for thread stuff.
- * lib/net/http.rb (basic_encode): return value of pack('m') may
- include multiple CR/LFs. Backported from main trunk (rev 1.112).
- [ruby-dev:25212]
+ * thread.c (rb_thread_call_without_gvl): export. [Feature#4328]
+ returns void* instead of VALUE. [Feature #5543]
-Thu Dec 16 00:33:37 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread.c (rb_thread_blocking_region): deprecate. [ruby-core:46295]
- * hash.c (Init_Hash): remove custom "hash" and "eql?".
+Tue Jul 10 10:48:59 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Dec 15 18:57:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/win32.h (NT, NtInitialize): removed unused old macros.
- * lib/set.rb (Set::eql): wrong definition. [ruby-dev:25207]
+Tue Jul 10 10:43:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Dec 15 18:48:42 2004 Shugo Maeda <shugo@ruby-lang.org>
+ * configure.in: removed --enable/disable-win95 options. (see r36342)
- * ext/curses/curses.c (window_subwin): call NUM2INT() before
- GetWINDOW(). (backported from CVS HEAD)
+Tue Jul 10 00:44:41 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Dec 15 17:03:50 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * include/ruby/ruby.h: Removed RUBY_GLOBAL_SETUP completely. It is
+ no meaning definition since r24894.
+ * main.c: ditto.
+ * nacl/pepper_main.c: ditto.
- * win32/win32.[ch] (rb_w32_isatty): new function to replace MSVCRT's
- isatty because it never sets errno. (backported from CVS HEAD)
+Mon Jul 9 23:59:36 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Dec 15 15:39:32 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * dln.c: Simplify and make consistent an ifdef for Mac OS X.
+ * ext/socket/rubysocket.h: ditto.
+ * ext/tk/stubs.c: ditto.
+ * io.c: ditto.
+ * process.c: ditto.
+ * signal.c: ditto.
+ * vm_dump.c: ditto.
- * ext/openssl/ossl_x509name.c (ossl_x509name_to_a): avoid SEGV
- (rollback the previous commit).
+Mon Jul 9 17:37:35 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Dec 15 16:10:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * win32/win32.c (win95_stat): removed unnecessary macro.
- * object.c (rb_obj_id_obsolete): warn always.
+Mon Jul 9 17:22:16 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (rb_enable_super): ditto.
+ * win32/configure.bat, win32/setup.mak, win32/Makefile.sub: omitted
+ Win9x support. removed --enable/disable-win95 options.
-Wed Dec 15 15:31:02 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/win32.h, file.c, win32/win32.c: ditto.
- * lib/set.rb (Set#==): [ruby-dev:25206]
+ * win32/README.win32: ditto.
-Wed Dec 15 14:22:10 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jul 9 13:28:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_fdisset): check whether the handle is valid.
- fixed: [ruby-core:03959]
+ * configure.in (DLDFLAGS): use TARGET_ENTRY to specify an entry point
+ instead of TARGET which may contain non-identifier characters.
-Wed Dec 15 10:30:37 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/mkmf.rb (create_makefile): add TARGET_NAME which is the first
+ part consists of only word characters. [ruby-core:46248][Bug #6709]
- * ext/openssl/ossl_digest.c (ossl_digest_initialize): [ruby-dev:25198]
+Sun Jul 8 07:36:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Dec 14 17:10:09 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * parse.y (shadowing_lvar_gen, warn_unused_var): no warnings for
+ variables starting with _. [ruby-core:46160][Feature #6693]
- * win32/win32.c (rb_w32_close): need to reset osfhnd().
+Sat Jul 7 23:07:30 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Tue Dec 14 14:03:57 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/csv/test_features.rb: add require for Tempfile.
+ * test/csv/test_serialization.rb: ditto.
- * ext/openssl/ossl.c (ossl_raise): avoid buffer overrun.
- [ruby-dev:25187]
+Fri Jul 6 06:49:50 2012 Eric Hodel <drbrain@segment7.net>
-Tue Dec 14 12:36:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * array.c (rb_ary_aref): Added a description of the behavior of
+ index positioning. [Bug #6680]
+ * array.c (rb_ary_aset): ditto. Reordered sentences for clarity.
+ * string.c (rb_str_aref_m): Added a description of the behavior of
+ index positioning
- * lib/cgi/session.rb (CGI::Session::initialize): generate new
- session if given session_id does not exist. [ruby-list:40368]
+Fri Jul 6 05:38:44 2012 Eric Hodel <drbrain@segment7.net>
-Mon Dec 13 18:13:52 2004 Tanaka Akira <akr@m17n.org>
+ * string.c (rb_str_bytesize): Improve documentation. Patch by Oscar
+ Del Ben from github issue #138.
+ * string.c (rb_str_empty): ditto.
+ * string.c (rb_str_times): ditto.
+ * string.c (rb_str_dump): ditto.
+ * string.c (rb_str_center): ditto.
- * gc.c (stack_end_address): new function to obtain stack end address.
- stack_end_address calls __builtin_frame_address(0) to obtain the
- frame pointer of a stack frame of stack_end_address. The address
- is the stack pointer of the caller's stack frame.
- (SET_STACK_END): use stack_end_address.
- This makes the conservative garbage collector to scan a stack frame
- of the garbage_collect function itself. This is required because
- callee-save registers may be stored in the frame.
- [ruby-dev:25158]
+Fri Jul 6 04:05:59 2012 Eric Hodel <drbrain@segment7.net>
-Mon Dec 13 00:58:02 2004 Tanaka Akira <akr@m17n.org>
+ * ext/zlib/zlib.c (zstream_expand_buffer_without_gvl): Use
+ ruby_xrealloc() to avoid crash with CALC_EXACT_MALLOC_SIZE.
- * lib/pathname.rb (cleanpath_aggressive): make it private.
- (cleanpath_conservative): ditto.
- Suggested by Daniel Berger. [ruby-core:3914]
+Thu Jul 5 17:32:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 12 20:06:38 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * internal.h: move ThreadShield declarations from intern.h.
- * lib/drb/drb.rb: backported from CVS HEAD.
+Thu Jul 5 16:00:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 12 10:35:10 2004 Dave Thomas <dave@pragprog.com>
+ * thread.c (ThreadShield): rename from Barrier.
- * lib/rdoc/generators/template/html/html.rb (RDoc::Page): Don't
- show an accessor's r/w flag if none was specified
+Thu Jul 5 15:14:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 12 10:14:03 2004 Dave Thomas <dave@pragprog.com>
+ * bootstraptest/runner.rb (show_progress): refine error output. do not
+ count non-empty error message, but just warn.
- * lib/rdoc/rdoc.rb (RDoc::RDoc::parse_files): Never exclude files
- explicitly given on the command line.
+ * bootstraptest/runner.rb (error): show errors immediately if tty.
-Sun Dec 11 23:54:07 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Jul 5 12:28:11 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/tk/*: update to support libraries in ActiveTcl8.4.12.0
- (see ext/tk/ChangeLog.tkextlib).
+ * test/net/http/test_httpresponses.rb: Add a test file for
+ Net::HTTPResponses and put a test case for the previous bug.
- * ext/tk/sample/scrollframe.rb: add a new sample.
+Thu Jul 5 06:33:52 2012 Mark Dodwell <mark@mkdynamic.co.uk>
-Sat Dec 11 20:12:21 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/net/http/responses.rb: Fix 4xx classes to inherit correctly
+ from Net::HTTPClientError. [Bug #6700]
- * lib/drb/drb.rb: add DRbRemoteError. [ruby-list:40348],
- [ruby-list:40390]
+Wed Jul 4 21:55:35 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/drb/drbtest.rb: ditto.
+ * ruby.c (proc_options): warn only if -K and -w option is specified.
+ see also r36274 [Feature #5206]
- * test/drb/ut_drb.rb: ditto.
+Wed Jul 4 21:41:44 2012 Naohisa Goto <ngotogenome@gmail.com>
-Sat Dec 11 15:38:14 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c, atomic.h (ATOMIC_SIZE_*): moved from gc.c to atomic.h
+ [ruby-dev:45909]
- * lib/jcode.rb (String::succ): [ruby-dev:25156]
+Wed Jul 4 19:13:15 2012 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Sat Dec 11 12:41:55 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/win32ole/test_win32ole.rb (test_s_codepage_changed):
+ FileSystemObject only supports ANSI or UTF-16LE encoding.
+ Patch by h.shirosaki (Hiroshi Shirosaki) [ruby-trunk - Bug #6650]
- * eval.c (run_trap_eval): prototype; avoid VC++ warnings.
+Wed Jul 4 11:52:12 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/socket/getaddrinfo.c: fix typo. fixed: [ruby-core:03947]
+ * gc.c (ATOMIC_SIZE_*): 64bit Windows support.
- * win32/win32.c: need to include dln.h.
+Wed Jul 4 11:11:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 11 00:10:18 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * eval.c (rb_frame_callee, rb_f_callee_name): fix to return the
+ called id. this longstanding bug has been caused and blocked by
+ the structure of old rb_control_frame_t and rb_iseq_t.
- * io.c (io_reopen): [ruby-dev:25150]
+ * vm_insnhelper.c (vm_push_frame): set proper method entry.
-Fri Dec 10 08:39:27 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 4 08:29:31 2012 Eric Hodel <drbrain@segment7.net>
- * ext/socket/socket.c (sock_listen): get OpenFile just before calling
- listen(2). fixed: [ruby-dev:25149]
+ * array.c (rb_ary_aref): Updated documentation to indicate the
+ starting index is an index into the array or string. Updated
+ examples to show behavior of indexes at the end of an array or
+ string. Based on patch by Marcus Stollsteimer. [Bug #6680]
+ * array.c (rb_ary_aset): ditto.
+ * string.c (rb_str_aref): ditto. Also added descriptive argument
+ names to call-seq section.
-Thu Dec 9 17:00:00 2004 Akiyoshi, Masamichi <akiyoshi@hp.com>
+Wed Jul 4 07:05:59 2012 Eric Hodel <drbrain@segment7.net>
- * ext/socket/socket.c, ext/socket/getaddrinfo.c: port to VMS
+ * test/zlib/test_zlib.rb (test_inflate_partial_input): Added test for
+ inflating incomplete zlib streams.
-Thu Dec 9 16:31:02 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Jul 3 23:14:16 2012 Naohisa Goto <ngotogenome@gmail.com>
- * ext/sdbm/init.c (GetDBM): typo.
+ * gc.c (ATOMIC_SIZE_EXCHANGE): fix function name on Solaris [Bug #6689]
+ [ruby-dev:45904]
-Thu Dec 9 16:05:00 2004 Akiyoshi, Masamichi <akiyoshi@hp.com>
+Tue Jul 3 16:07:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * defines.h: change path of vms.h
- * vms/vms.h: delete reference for snprintf()
- * vms/config.h: new file
- * vms/config.h_in: deleted
+ * gc.c (vm_malloc_fixup, vm_xrealloc, vm_xfree, after_gc_sweep): use
+ atomic operations to update malloc_params.
-Thu Dec 9 14:38:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jul 3 14:50:16 2012 Eric Hodel <drbrain@segment7.net>
- * string.c (rb_str_inspect): escape # which starts an expression
- substitution. fixed: [ruby-core:03922]
+ * ext/zlib/zlib.c (zstream_run_func): Don't exit run loop for buffer
+ error. [Feature #6615]
+ * ext/zlib/zlib.c: Fix style to match existing functions.
- * string.c (rb_str_dump): not escape # which isn't a substitution.
+Tue Jul 3 12:05:51 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Dec 9 10:54:36 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/dl/cfunc.c (rb_dlcfunc_call): also needed the workaround for VC8
+ for x64. [ruby-dev:45875] [Bug #6676]
+ reported by aves_ramphastos (Seigo Ishigane)
- * ext/dbm/dbm.c (fdbm_select): [ruby-dev:25132]
+Tue Jul 3 11:56:46 2012 Eric Hodel <drbrain@segment7.net>
- * ext/sdbm/init.c: ditto.
+ * ext/zlib/zlib.c (zstream_detach_buffer): Refactored tainting of
+ output string, moving it from the callee to zstream_detach_buffer.
+ * ext/zlib/zlib.c (rb_zstream_finish): ditto
+ * ext/zlib/zlib.c (rb_zstream_flush_next_out): ditto
+ * ext/zlib/zlib.c (rb_deflate_deflate): ditto
+ * ext/zlib/zlib.c (rb_deflate_flush): ditto
+ * ext/zlib/zlib.c (rb_inflate_inflate): ditto
- * ext/gdbm/gdbm.c: ditto.
+Tue Jul 3 11:16:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 9 03:08:36 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * common.mk (runnable): make symbolic links to run in build directory.
- * ext/tcltklib/tcltklib.c (ip_init): set root-win title to "ruby" when
- the running script is '-e one-liner' or '-' (stdin).
+Tue Jul 3 10:46:06 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tcltklib/extconf.rb: add find_library("#{lib}#{ver}",..) for
- stub libs
+ * ruby.c (proc_options): warn if -K option is specified. [Feature #5206]
- * ext/tk/lib/tk/textmark.rb: TkTextMarkCurrent and TkTextMarkAnchor
- have a wrong parent class.
+Tue Jul 3 06:12:13 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/lib/tk/dialog.rb: rename TkDialog2 --> TkDialogObj and
- TkWarning2 --> TkWarningObj (old names are changed to alias names)
+ * object.c (Init_Object): Added RDoc location pointers for
+ Kernel#methods, Kernel#protected_methods, Kernel#private_methods and
+ Kernel#public_methods. [Bug #6666]
- * ext/tk/lib/tk/dialog.rb: bug fix of treatment of 'prev_command'
- option and hashes for configuration
+Tue Jul 3 06:02:54 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/lib/tk/dialog.rb: add TkDialogObj#name to return the
- button name
+ * ext/zlib/zlib.c (zstream_run): Process zlib streams without GVL.
+ [Feature #6615]
+ * NEWS: ditto.
- * ext/tk/lib/tk/radiobutton.rb: rename enbugged method value() ==>
- get_value() and value=(val) ==> set_value(val).
+Mon Jul 2 22:13:04 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/menu.rb: add TkMenu.new_menuspec
+ * thread.c (rb_thread_aref): add explanation for why Thread#[] and
+ Thread#[]= are fiber-local and not thread-local.
+ reported by Julien A. [ruby-core:41606] [ruby-trunk - Bug #5750]
- * ext/tk/lib/tk/menu.rb: add alias (TkMenuButton = TkMenubutton,
- TkOptionMenuButton = TkOptionMenubutton)
+Mon Jul 2 21:25:55 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/event.rb: new method aliases (same as option keys of
- event_generate) for Event object
+ * time.c (timew_out_of_timet_range): specialization for
+ SIZEOF_TIME_T == SIZEOF_INT64_T.
- * ext/tk/lib/tk/font.rb: configinfo returns proper types of values
+Mon Jul 2 17:06:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk.rb: bind methods accept subst_args + block
+ * class.c (rb_include_module): include modules after the origin.
- * ext/tk/lib/tk/canvas.rb: ditto
+ * class.c (include_modules_at): skip prepended modules.
- * ext/tk/lib/tk/canvastag.rb: ditto
+ * class.c (rb_prepend_module): now basic.klass in ICLASS refers the
+ old original class/module. [ruby-dev:45868][Bug #6662]
- * ext/tk/lib/tk/frame.rb: ditto
+ * class.c (rb_mod_ancestors): ditto.
- * ext/tk/lib/tk/text.rb: ditto
+ * vm_method.c (search_method): search method entry from the origin
+ iclass.
- * ext/tk/lib/tk/texttag.rb: ditto
+Mon Jul 2 05:54:58 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/tk/lib/tk/toplevel.rb: ditto
+ * ext/date/date_core.c: [ruby-core:46058].
- * ext/tk/lib/tkextlib/*: ditto and bug fix
+Mon Jul 2 05:35:43 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Wed Dec 8 23:54:29 2004 Dave Thomas <dave@pragprog.com>
+ * ext/date/date_core.c (d_lite_marshal_load): accepts old dump.
- * lib/rdoc/generators/template/html/html.rb (RDoc::Page): Typo
- meant that h2 tag was invisible.
+Mon Jul 2 03:21:53 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Wed Dec 8 21:56:31 2004 Kouhei Sutou <kou@cozmixng.org>
+ * README.EXT.ja: fixed args of have_struct_member() ,
+ create_makefile() same as r35977. however, mkmf.rb include
+ no Japanese-docs, so Appendix C was not removed. [Bug #6597]
- * lib/rss, test/rss, sample/rss: backported from CVS HEAD.
+Fri Jun 29 05:08:41 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Dec 8 14:31:36 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/test/unit/parallel.rb: workaround fix for rubygems.
+ RubyGems can't find rake if the source directory is not equal to
+ the directory which is running the test. [Bug #6604]
- * io.c (io_fwrite): change dereference for cosmetic reason.
+Thu Jun 28 20:33:15 2012 Luis Lavena <luislavena@gmail.com>
- * sprintf.c (rb_f_sprintf): [ruby-dev:25104]
+ * test/win32ole/test_win32ole.rb (test_s_codepage_changed):
+ FileSystemObject only supports ANSI or UTF-16LE encoding.
+ Patch by bosko (Bosko Ivanisevic) [ruby-trunk - Bug #6650]
-Tue Dec 7 19:08:00 2004 Akiyoshi, Masamichi <akiyoshi@hp.com>
+Thu Jun 28 09:27:09 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * io.c (io_fwrite): fix offset incrementation (for VMS and Human68k)
+ * class.c (class_instance_method_list): consider prepended Class/Module
+ when recur != 0. [ruby-dev:45863] [Bug #6660]
-Tue Dec 7 00:27:37 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_module.rb (test_prepend_instance_methods_false): add
+ a test for it.
- * process.c (proc_setgroups): [ruby-dev:25081]
-Mon Dec 6 18:08:10 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Jun 28 06:12:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * re.c (rb_reg_eqq): document fix. [ruby-talk:122541]
+ * class.c (rb_mod_ancestors): fix ancestors order.
+ [ruby-core:45919][Bug #6658] [ruby-dev:45861][Bug #6659]
-Mon Dec 6 17:19:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jun 27 21:28:59 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * rubysig.h (TRAP_BEG, TRAP_END): safe errno around CHECK_INTS.
- (backported from CVS HEAD) [ruby-dev:24993]
+ * lib/racc/parser.rb: NotImplementError is not exist.
-Mon Dec 6 10:18:17 2004 Dave Thomas <dave@pragprog.com>
+ * lib/irb/output-method.rb (IRB::OutputMethod#print): ditto.
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::look_for_directives_in):
- Oops - 1.8 doesn't have String#clear
+Wed Jun 27 21:31:13 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 6 09:59:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * class.c (rb_prepend_module): ancestors of prepending module also
+ should be included. [ruby-core:45914][Bug #6654]
- * ext/socket/socket.c (sock_connect): use rb_str_new4().
- [ruby-dev:25052]
+Wed Jun 27 21:01:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 6 01:42:08 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * class.c (class_instance_method_list): m_tbl in prepended
+ class/module is NULL. [ruby-core:45915][Bug #6655]
- * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_public_encrypt,
- ossl_rsa_public_decrypt, ossl_rsa_private_encrypt,
- ossl_rsa_private_decrypt): should take an optional argument
- to specify padding mode. [ruby-talk:122539]
+Wed Jun 27 16:48:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_pkey_rsa.c (Init_ossl_rsa): add new constants
- PKCS1_PADDING, SSLV23_PADDING, NO_PADDING and PKCS1_OAEP_PADDING
- under OpenSSL::PKey::RSA.
+ * class.c (rb_prepend_module): prepend module into another module.
- * test/openssl/test_pkey_rsa.rb: new file.
+ * eval.c (rb_mod_prepend): new method Module#prepend. [Feature #1102]
-Sun Dec 5 19:39:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jun 27 09:15:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/optparse.rb (OptionParser::Completion#complete): new parameter
- to direct case insensitiveness.
+ * io.c (is_popen_fork): check if fork and raise NotImplementedError if
+ unavailable.
- * lib/optparse.rb (OptionParser#order!): ignore case only for long
- option. [ruby-dev:25048]
+ * io.c (rb_io_s_popen): allow environment variables hash and exec
+ options as flat parameters, not in an array arguments.
+ [Feature#6651] [EXPERIMENTAL]
-Sat Dec 4 22:54:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (rb_execarg_extract_options): extract exec options, but no
+ exceptions on non-exec options and returns them as a Hash.
- * io.c (io_write): remove rb_str_locktmp(). [ruby-dev:25050]
+ * process.c (rb_execarg_setenv): set environment variables.
- * io.c (io_fwrite): takes VALUE string as an argument.
- [ruby-dev:25050]
+Tue Jun 26 16:57:14 2012 Koichi Sasada <ko1@atdot.net>
- * ext/socket/socket.c (sock_connect): remove rb_str_locktmp().
- [ruby-dev:25050]
+ * thread_pthread.c (register_cached_thread_and_wait):
+ return immediately if malloc() failed.
+ [ruby-core:43960] [ruby-trunk - Bug #6235]
- * ext/socket/socket.c (udp_connect): [ruby-dev:25045]
+ * thread_pthread.c (USE_THREAD_CACHE): check already defined or not.
- * ext/socket/socket.c (udp_bind): ditto.
+Tue Jun 26 10:01:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c (udp_send): ditto.
+ * io.c (rb_io_s_popen): revert r36213 "popen: shell commands with
+ envvar" because it disabled to let single command bypass shell.
- * ext/socket/socket.c (bsock_send): ditto.
+Mon Jun 25 17:49:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c (s_recvfrom): ditto.
+ * class.c (rb_mix_module): revert Module#mix.
- * hash.c (rb_hash_hash): should provide "hash" method where "eql?"
- is redefined. [ruby-talk:122482]
+Mon Jun 25 16:57:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 4 14:54:52 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * proc.c (rb_mod_define_method): allow method transplanting from a
+ module to either class or module. [ruby-core:34267][Feature #4254]
- * eval.c (proc_invoke): use volatile `tmp' rather than `args'.
- [ruby-core:03882]
+Mon Jun 25 11:34:45 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Dec 4 14:28:56 2004 Dave Thomas <dave@pragprog.com>
+ * internal.h: use rb_pid_t instead of pid_t because of there is no
+ definition of pid_t here on Windows.
- * lib/rdoc/code_objects.rb (RDoc::Context::Section::set_comment):
- Section comments may now be bracketed by lines which are
- ignored. You can now write
- # -----------
- # :section: Dave's Section
- # comment material
- # -----------
- The lines before :section: are removed, and identical lines at the end are
- also removed if present.
+Mon Jun 25 00:25:01 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Dec 4 03:33:45 2004 Shugo Maeda <shugo@ruby-lang.org>
+ * configure.in (for stack end address): remove human68k specific
+ check. It is no longer supported.
- * ext/readline/readline.c: check $SAFE. (backported from CVS HEAD)
+Sun Jun 24 23:02:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/readline/test_readline.rb: added tests for readline.
- (backported from CVS HEAD)
+ * io.c (pipe_open): merge win32 code using spawnv().
-Sat Dec 4 02:24:00 2004 NARUSE, Yui <naruse@ruby-lang.org>
+Sun Jun 24 22:53:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/nkf/nkf.c: add constant NKF::VERSION
+ * process.c (check_exec_fds): separate check_exec_fds_1() since
+ nonstatic initializer of an aggregate type is not allowed by C89.
- * ext/nkf/nkf.c(guess): this becomes an alias of guess2
+Sun Jun 24 07:47:17 2012 Tanaka Akira <akr@fsij.org>
- * ext/nkf/test.rb(mime_out2): add --no-cp932
+ * internal.h (rb_execarg): options field removed.
- * ext/nkf/nkf-utf8/nkf.c: original nkf2 revision 1.47
+ * process.c: follow the rb_execarg change.
-Sat Dec 4 00:35:08 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Jun 23 23:48:21 2012 Tanaka Akira <akr@fsij.org>
- * ext/socket/socket.c (bsock_setsockopt): [ruby-dev:25039]
+ * process.c (proc_spawn_cmd): unused variable removed to suppress a
+ warning.
+ (save_env): ditto.
-Fri Dec 3 18:57:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ [ruby-core:45797] reported by Luis Lavena.
- * lib/ostruct.rb: 1.9 marshaling support back-ported.
- [ruby-core:03871]
+Sat Jun 23 23:19:31 2012 Tanaka Akira <akr@fsij.org>
-Fri Dec 3 13:45:20 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h (rb_execarg): add new_pgroup_given and new_pgroup_flag
+ fields.
- * eval.c (proc_invoke): copy arguments to frame.argv.
- [ruby-core:03861]
+ * process.c (EXEC_OPTION_NEW_PGROUP): removed.
+ (proc_spawn_cmd): take a struct rb_execarg argument.
+ use the new fields.
+ (rb_execarg_addopt): use the new fields.
+ (rb_spawn_process): follow the proc_spawn_cmd change.
-Fri Dec 3 12:25:41 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ [ruby-core:45794] [ruby-trunk - Bug #6633] reported by Luis Lavena.
- * st.h: fix prototypes.
+Sat Jun 23 20:26:36 2012 Tanaka Akira <akr@fsij.org>
-Fri Dec 3 00:21:05 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h (rb_execarg): add fd_dup2, fd_close, fd_open,
+ fd_dup2_child fields.
- * object.c (convert_type): use rb_respond_to() again.
- [ruby-dev:25021]
+ * process.c (EXEC_OPTION_DUP2): removed.
+ (EXEC_OPTION_CLOSE): removed.
+ (EXEC_OPTION_OPEN): removed.
+ (EXEC_OPTION_DUP2_CHILD): removed.
+ (mark_exec_arg): mark the new fields.
+ (check_exec_redirect1): change condition for default option.
+ (check_exec_redirect): take a struct rb_execarg argument.
+ use the new fields.
+ (rb_execarg_addopt): follow the check_exec_redirect change.
+ (check_exec_fds): use the new fields.
+ (save_redirect_fd): ditto.
- * eval.c (rb_respond_to): funcall respond_to? if it's redefined.
- [ruby-dev:25021]
+Sat Jun 23 19:01:18 2012 Tanaka Akira <akr@fsij.org>
-Fri Dec 3 01:55:24 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * process.c (rb_execarg_fixup): fix envopts condition.
- * ext/tk/lib/tk.rb: widget configuration by TkWindow#method_missing
- returns proper object. "widget.option = val" returns val, and
- "widget.option(val)" returns self.
+Sat Jun 23 18:44:13 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/font.rb: TkFont#replace accepts only one font argument.
+ * process.c (check_exec_redirect1): extracted from
+ check_exec_redirect.
- * ext/tk/lib/tk/radiobutton.rb: add TkRadiobutton#value and
- TkRadiobutton#value=(val).
+Sat Jun 23 17:22:02 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/spinbox.rb: callback substitution support on
- command option.
+ * process.c (save_env): don't use EXEC_OPTION_UNSETENV_OTHERS.
+ (rb_execarg_run_options): ditto.
- * ext/tk/sample/demos-en/widget: bug fix (wrong image height)
+Sat Jun 23 17:04:08 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/sample/demos-jp/widget: ditto.
+ * internal.h (rb_execarg): add env_modification field.
-Fri Dec 3 00:11:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (EXEC_OPTION_ENV): removed.
+ (mark_exec_arg): mark env_modification field.
+ (rb_exec_fillarg): update the new field, instead of options array.
+ (rb_execarg_fixup): use the new field.
+ (save_env): ditto.
+ (rb_execarg_run_options): ditto.
- * io.c (rb_file_initialize): [ruby-dev:25032]
+Sat Jun 23 16:27:01 2012 Tanaka Akira <akr@fsij.org>
-Thu Dec 2 16:41:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h (rb_execarg): add rlimit_limits field.
- * eval.c (rb_protect): prevent continuations created inside from being
- called from the outside. [ruby-dev:25003]
+ * process.c (EXEC_OPTION_RLIMIT): removed.
+ (mark_exec_arg): mark rlimit_limits field.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (run_exec_rlimit): use the new field.
+ (rb_execarg_run_options): clear sarg using MEMZERO. use the new
+ field.
- * eval.c (rb_callcc, rb_cont_call): prohibit calling from different
- signal contexts. [ruby-dev:25022]
+Sat Jun 23 14:29:25 2012 Tanaka Akira <akr@fsij.org>
-Thu Dec 2 09:57:24 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h (rb_execarg): add chdir_given and chdir_dir fields.
- * lib/ostruct.rb (OpenStruct::Marshaler): OpenStruct can be
- marshaled again. [ruby-core:03862]
+ * process.c (EXEC_OPTION_CHDIR): removed.
+ (mark_exec_arg): mark chdir_dir field.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (rb_execarg_run_options): use the new fields.
-Thu Dec 2 09:30:06 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jun 23 13:20:47 2012 Tanaka Akira <akr@fsij.org>
- * eval.c (thread_mark): mark thread group. [ruby-dev:25020]
+ * internal.h (rb_execarg): add close_others_given, close_others_do and
+ close_others_maxhint fields.
- * eval.c (thgroup_add): check whether the argument is really a Thread.
+ * process.c (EXEC_OPTION_CLOSE_OTHERS): removed.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (check_exec_fds): take eargp as an argument. update the
+ close_others_maxhint field.
+ (rb_execarg_fixup): follow the argument change of check_exec_fds.
+ (rb_execarg_run_options): use the new fields.
-Thu Dec 2 07:57:16 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Jun 23 10:41:59 2012 Tanaka Akira <akr@fsij.org>
- * io.c (rb_io_ctl): [ruby-dev:25019]
+ * internal.h (rb_execarg): add unsetenv_others_given and
+ unsetenv_others_do fields.
-Wed Dec 1 02:21:02 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (EXEC_OPTION_UNSETENV_OTHERS): removed.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (rb_execarg_fixup): use the new fields.
- * signal.c (sighandler): call handler immediately only for default
- handlers. [ruby-dev:25003]
+Sat Jun 23 09:35:47 2012 Tanaka Akira <akr@fsij.org>
-Tue Nov 30 23:38:18 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c: use the variable name "soptions" for sargp->options.
- * io.c (io_fread): need not to null terminate. [ruby-dev:24998]
+Sat Jun 23 09:17:49 2012 Tanaka Akira <akr@fsij.org>
- * io.c (read_all): remove unnecessary rb_str_resize().
- [ruby-dev:24996] (backported from CVS HEAD)
+ * process.c: use the name "sargp" for struct rb_execarg variables
+ consistently for saving process attributes.
- * io.c (io_readpartial): ditto.
+ * io.c: ditto.
- * io.c (io_read): ditto.
+Sat Jun 23 07:59:57 2012 Tanaka Akira <akr@fsij.org>
-Tue Nov 30 16:18:50 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c: use the name "eargp" for struct rb_execarg variables
+ consistently except for saving process attributes.
- * io.c (io_fread): need not to null terminate. [ruby-dev:24998]
+ * io.c: ditto.
- * io.c (read_all): remove unnecessary rb_str_resize().
- [ruby-dev:24996]
+ * ext/pty/pty.c: ditto.
- * io.c (io_read): ditto.
+Wed Jun 20 18:27:03 2012 Yuki Yugui Sonoda <yugui@google.com>
-Tue Nov 30 00:49:08 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * common.mk: Add missing dependencies.
- * io.c (rb_io_sysread): use temporary lock. [ruby-dev:24992]
+Fri Jun 22 20:27:39 2012 Tanaka Akira <akr@fsij.org>
-Mon Nov 29 16:06:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h (rb_execarg): add pgroup_given and pgroup_pgid fields.
- * ext/stringio/stringio.c (strio_write): insufficiently filled string
- being extended when overwriting. [ruby-core:03836]
+ * process.c (EXEC_OPTION_PGROUP): removed.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (run_exec_pgroup): take a struct rb_execarg argument. refer the new
+ fields.
+ (rb_execarg_run_options): follow run_exec_pgroup change.
-Mon Nov 29 15:59:05 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Jun 22 18:48:51 2012 Kouhei Sutou <kou@cozmixng.org>
- * lib/ostruct.rb (OpenStruct::method_missing): check method
- duplication for -d.
+ * README.EXT, README.EXT.ja: use "sval" for the third argument
+ name of Data_Wrap_Struct().
+ Suggested by @satoh_fumiyasu. Thanks!!!
- * lib/ostruct.rb (OpenStruct::initialize): ditto.
+Fri Jun 22 18:04:26 2012 Koichi Sasada <ko1@atdot.net>
-Mon Nov 29 15:22:28 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * iseq.c, vm_eval.c: set th->base_block properly.
+ th->base_block is information for (a) parsing, (b) compiling
+ and (c) setting up the frame to execute the program passed by
+ `eval' method. For example, (1) parser need to know up-level
+ variables to detect it is variable or method without paren.
+ Befor (a), (b) and (c), VM set th->base_block by passed bindng
+ (or previous frame information). After execute (a), (b) and (c),
+ VM should clear th->base_block. However, if (a), (b) or (c)
+ raises an exception, then th->base_block is not cleared.
+ Problem is that the uncleared value th->balo_block is used for
+ irrelevant iseq compilation. It causes SEGV or critical error.
+ I tried to solve this problem: to clear them before exception,
+ but finally I found out that it is difficult to do it (Ruby
+ program can be run in many places).
+ Because of this background, I set th->base_block before
+ compiling iseq and restore it after compiling.
+ Basically, th->base_block is dirty hack (similar to global
+ variable) and this patch is also dirty.
- * test/io/nonblock/test_flush.rb: abandon tests when io/nonblock is
- not supported.
+ * bootstraptest/test_eval.rb: add a test for above.
-Mon Nov 29 03:08:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h: remove unused decl.
- * object.c (convert_type): direct call conversion methods for the
- performance. [ruby-core:03845]
+ * iseq.c (rb_iseq_compile_with_option): add base_block parameter.
+ set th->base_block before compilation and restore it after
+ compilation.
- * eval.c (rb_funcall_rescue): new function.
+ * ruby.c (require_libraries): pass 0 as base_block instead of
+ setting th->base_block
- * object.c (rb_Array): avoid using rb_respond_to().
+ * tool/compile_prelude.rb (prelude_eval): apply above changes.
- * object.c (rb_Integer): ditto.
+ * vm.c, vm_eval.c: ditto.
- * parse.y (reduce_nodes): empty body should return nil.
+ * vm_core.h: add comments.
- * string.c (rb_str_aset): the original string should not be
- affected by modifying duplicated string. [ruby-dev:24981]
+Fri Jun 22 18:19:38 2012 Tanaka Akira <akr@fsij.org>
-Mon Nov 29 13:57:38 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * process.c: pass struct rb_execarg value instead of its options
+ field for saving process attribute changing functions.
+ (save_redirect_fd): take a struct rb_execarg argument.
+ (run_exec_dup2): ditto.
+ (run_exec_close): ditto.
+ (run_exec_open): ditto.
+ (run_exec_dup2_child): ditto.
+ (run_exec_pgroup): ditto.
+ (run_exec_rlimit): ditto.
+ (save_env): ditto.
+ (rb_execarg_run_options): follow the above functions change.
- * win32/win32.c (CreateChild): search executable file if no program
- name given. (backported from CVS HEAD)
+Fri Jun 22 17:55:48 2012 Koichi Sasada <ko1@atdot.net>
-Mon Nov 29 13:37:54 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_backtrace.rb: decrease recursion depth
+ to reduce consuming stack size.
- * io.c (fptr_finalize): must not use FILE after fclose().
- [ruby-dev:24985]
+Fri Jun 22 13:36:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Nov 29 13:16:31 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * random.c (random_init, random_load): cannot initialize frozen object
+ again, nor with tainted/untrusted object. [Bug #6540]
- * win32/win32.c (CreateChild): push back the last space before next
- loop because CharNext() eats it.
+Fri Jun 22 13:32:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Nov 29 01:18:18 2004 Tanaka Akira <akr@m17n.org>
+ * error.c (rb_check_copyable): new function, to ensure the target is
+ not frozen and the source is not tainted nor untrusted.
- * io.c (rb_io_check_writable): call io_seek regardless of
- NEED_IO_SEEK_BETWEEN_RW. [ruby-dev:24986]
+Fri Jun 22 05:55:20 2012 Eric Hodel <drbrain@segment7.net>
-Sat Nov 27 21:43:39 2004 Tanaka Akira <akr@m17n.org>
+ * eval.c (ruby_cleanup): Fixed typo. Patch by Trever Dawe.
+ Fixes #131 (github). [ruby-trunk - Bug #6619]
- * io.c: avoid data lost with nonblocking fd and
- stdio buffering in sync mode. [ruby-dev:24966]
- based on matz's patch [ruby-dev:24967]
- (io_fwrite): new primitive writing function which writes
- directly if sync mode.
- (rb_io_fwrite): wrapper for io_fwrite now.
- (io_write): call io_fwrite instead of rb_io_fwrite.
+Thu Jun 21 21:16:58 2012 Tanaka Akira <akr@fsij.org>
-Sat Nov 27 14:44:15 2004 Kent Sibilev <ksibilev@bellsouth.net>
+ * process.c (rb_execarg_addopt): take a VALUE argument instead of
+ struct rb_execarg.
+ (rb_exec_arg_addopt): follow the rb_execarg_addopt change.
+ (check_exec_options_i): ditto.
- * lib/cgi/session.rb (CGI::Session::initialize): create_new_id is
- now a instance method. [ruby-core:03832]
+ * io.c (pipe_open): follow the rb_execarg_addopt change.
-Sat Nov 27 09:41:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h (rb_execarg_addopt): follow the definition change.
- * io.c (io_fread): old rb_io_fread with file closing checking.
- (rb_io_fread): wrapper for io_fread now.
- [ruby-dev:24964]
+Thu Jun 21 20:34:19 2012 Tanaka Akira <akr@fsij.org>
-Fri Nov 26 18:02:44 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * process.c (rb_exec_fillarg): take a VALUE argument instead of
+ struct rb_execarg.
+ (rb_check_exec_options): ditto.
+ (check_exec_options_i): ditto.
- * ext/tk/lib/tk.rb: Tk.destroy uses TkWindow#epath
+Thu Jun 21 19:48:05 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/image.rb: bug fix
+ * process.c (rb_exec_async_signal_safe): use rb_execarg_run_options
+ instead of rb_run_exec_options_err.
+ (rb_spawn_process): ditto.
- * ext/tk/lib/tk/wm.rb: add 'iconphoto' method(Windows only)
+Thu Jun 21 19:02:43 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tkextlib/*: some methods uses TkWindow#epath
+ * process.c (rb_exec_fillarg): take a VALUE argument instead of
+ struct rb_execarg.
+ (rb_execarg_init): follow the rb_exec_fillarg change.
-Fri Nov 26 13:49:06 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Jun 21 18:36:43 2012 Tanaka Akira <akr@fsij.org>
- * eval.c (method_missing): raise TypeError for classes do not
- have allocators. [ruby-core:03752]
+ * process.c (rb_execarg_init): take a VALUE argument instead of
+ struct rb_execarg.
+ (rb_execarg_new): follow the rb_execarg_init change.
+ (rb_exec_arg_init): ditto.
- * lib/erb.rb: add RDoc by James Edward Gray II. [ruby-core:03786]
+ * internal.h (rb_execarg_init): follow the definition change.
-Fri Nov 26 13:29:02 2004 Dave Thomas <dave@pragprog.com>
+Thu Jun 21 17:20:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::look_for_directives_in): Break
- out of preprocessing when we find a :section: directive (previously cleared out the
- comment, but this apparently now generates an error in gsub!)
+ * parse.y (new_args_tail_gen): fix GC problem of keyword rest
+ argument. the wrapped struct should be bound to the wrapping node
+ before assignment of child nodes, to get rid of the case the
+ children are referred by only the struct pointer which is not a
+ subject of GC. [ruby-core:45744]
-Fri Nov 26 00:17:40 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Jun 21 07:06:52 2012 Koichi Sasada <ko1@atdot.net>
- * io.c (io_read): move StringValue() check before GetOpenFile().
- [ruby-dev:24959]
+ * error.c (err_append): rename err_append() to compile_err_append()
+ and move definition body. err_append() is used only by compiling.
-Thu Nov 25 20:14:57 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jun 21 06:21:54 2012 Tanaka Akira <akr@fsij.org>
- * lib/thwait.rb (ThreadsWait#join_nowait): abnormally terminated
- threads should be also processed. [ruby-talk:121320]
+ * process.c (rb_execarg_fixup): take a VALUE argument instead of
+ struct rb_execarg.
-Thu Nov 25 10:14:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h (rb_execarg_fixup): follow the definition change.
- * dir.c (push_braces): do not reuse buffer strings. [ruby-core:03806]
+ * io.c (pipe_open): follow rb_execarg_fixup change.
-Thu Nov 25 07:59:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/pty/pty.c (establishShell): ditto.
- * io.c (read_all): stringify non-nil buffer argument, and always
- taint the result. [ruby-dev:24955]
+Wed Jun 20 21:25:37 2012 Tanaka Akira <akr@fsij.org>
-Wed Nov 24 01:01:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h (struct rb_execarg): add umask_given and umask_mask
+ fields.
- * io.c (io_read): integer conversion should be prior to
- GetOpenFile(). [ruby-dev:24952]
+ * process.c (STATIC_ASSERT): removed.
+ (rb_execarg_addopt): follow the rb_execarg change.
+ (rb_execarg_run_options): ditto.
- * configure.in, io.c: cancel [ ruby-Patches-1074 ].
+Wed Jun 20 20:38:23 2012 Tanaka Akira <akr@fsij.org>
-Tue Nov 23 08:09:50 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * internal.h (struct rb_execarg) moved and renamed from
+ struct rb_exec_arg in intern.h.
- * ext/tk/lib/tk/menu.rb: improve usability of TkOptionMenubutton
+ * include/ruby/intern.h (struct rb_exec_arg): refer Data object which
+ contains struct rb_execarg.
-Tue Nov 23 02:00:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c: use struct rb_execarg instead of struct rb_exec_arg
+ except functions declared in intern.h.
+ (rb_exec_arg_addopt): extract a pointer to struct rb_execarg from
+ struct rb_exec_arg.
+ (rb_exec_arg_init): ditto.
+ (rb_exec_arg_fixup): ditto.
+ (rb_run_exec_options_err): ditto.
+ (rb_run_exec_options): ditto.
+ (rb_exec_err): ditto.
+ (rb_exec): ditto.
- * file.c (rb_file_chown): integer conversion should be prior to
- GetOpenFile(). [ruby-dev:24949]
+ * io.c: use struct rb_execarg instead of struct rb_exec_arg.
-Tue Nov 23 00:10:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/pty/pty.c: ditto.
- * file.c (rb_file_chown): integer conversion should be prior to
- GetOpenFile(). [ruby-dev:24947]
+Wed Jun 20 19:13:25 2012 Tanaka Akira <akr@fsij.org>
- * file.c (rb_file_truncate): ditto.
+ * internal.h (rb_execarg_new): declared.
+ (rb_execarg_get): ditto.
- * file.c (rb_file_s_truncate): ditto.
+ * process.c (mark_exec_arg): new function.
+ (free_exec_arg): ditto.
+ (memsize_exec_arg): ditto.
+ (exec_arg_data_type): defined.
+ (rb_execarg_new): new function.
+ (rb_execarg_get): ditto.
+ (rb_f_exec): use rb_execarg_new.
+ (rb_spawn_internal): ditto.
+ (rb_f_spawn): ditto.
- * dir.c (dir_seek): use NUM2OFFT().
+ * io.c (pipe_open_v): use rb_execarg_new.
+ (pipe_open_s): ditto.
- * misc/ruby-mode.el (ruby-non-block-do-re): should not match words
- start with block keyword and underscore. [ruby-core:03719]
+ * ext/pty/pty.c (establishShell): use rb_execarg_new.
-Mon Nov 22 22:33:02 2004 Dave Thomas <dave@pragprog.com>
+Wed Jun 20 16:36:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::parse_require): Don't use names
- of variables or constants when oarsing 'require'
+ * missing/setproctitle.c (environ): use (*_NSGetEnviron()) instead of
+ environ on Darwin for namespace cleanness, same as [ruby-core:00537].
+ [ruby-core:45615] [Bug #6576]
-Mon Nov 22 00:13:35 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jun 20 11:33:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dir.c (dir_seek): should retrieve dir_data after NUM2INT().
- [ruby-dev:24941]
+ * process.c (rb_execarg_addopt): always make Fixnum, and ignore higher
+ bits in too large umask value.
-Sat Nov 20 23:57:33 2004 Dave Thomas <dave@pragprog.com>
+Wed Jun 20 11:24:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/README (et al): Add a new directive, :section:, and
- change the output format to accomodate. :section: allows to to
- group together methods, attributes, constants, etc under
- headings in the output. If used, a table of contents is
- generated.
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): deal with
+ sudden-death of workers.
-Sat Nov 20 23:56:54 2004 Dave Thomas <dave@pragprog.com>
+Mon Jun 18 20:34:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rdoc/options.rb (Options::parse): Force --inline-source if
- --one-file option given
+ * time.c (init_leap_second_info): fix non-ANSI function declaration.
-Sat Nov 20 23:55:19 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jun 18 20:29:04 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * string.c (rb_str_splice): should place index wrapping after
- possible modification. [ruby-dev:24940]
+ * ruby.c (rb_f_sub): use ansi style declaration.
+ * ruby.c (rb_f_gsub): ditto.
+ * ruby.c (rb_f_chomp): ditto.
-Sat Nov 20 13:26:03 2004 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jun 18 20:26:23 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/nkf/nkf-utf8/utf8tbl.c: original revision 1.7
+ * random.c (rb_random_int32): get rid of "warning: constant 0x100000000
+ is so big it is long" warning.
-Sat Nov 20 05:34:24 2004 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jun 18 20:07:23 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/nkf/nkf-utf8/nkf.c: original nkf.c rev:1.40
+ * dir.c (dir_initialize): get rid of "unused return: argc = rb_scan_args()"
+ warning.
- * ext/nkf/test.rb: add test for mime encode/decode
+Mon Jun 18 19:31:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Nov 20 01:37:34 2004 Johan Holmberg <holmberg@iar.se>
+ * include/ruby/missing.h: include math.h before checking INFINITY
+ and NAN. Otherwise, strange macro redefinition will occur.
- * eval.c (error_print): nicer traceback at interrupt.
- [ruby-core:03774]
+Mon Jun 18 19:12:37 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Nov 20 00:07:16 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * array.c (ary_reverse): use ansi style declaration.
- * string.c (str_gsub): internal buffer should not be listed by
- ObjectSpace.each_object() by String#gsub. [ruby-dev:24931]
+Tue Jun 19 18:43:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Nov 19 01:20:22 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/backward/rubysig.h: fix visibility. [Bug #6607]
- * lib/cgi/session.rb (CGI::Session::FileStore::initialize): raise
- exception if data corresponding to session specified from the
- client does not exist.
+Tue Jun 19 17:51:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Nov 19 00:59:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (rb_execarg_run_options): do not call any methods in the
+ async-signal-safe function. mask has been checked with NUM2MODET()
+ already and converted with LONG2NUM().
- * string.c (str_gsub): internal buffer should not be listed by
- ObjectSpace.each_object(). [ruby-dev:24919]
+Tue Jun 19 11:59:56 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Nov 18 18:41:08 2004 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * ext/readline/readline.c (Init_readline): don't set 0 to
+ rl_catch_signals and rl_catch_sigwinch. [Bug #5423]
- * test/ruby/test_stringchar.rb (test_bang): added.
+Tue Jun 19 11:52:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * string.c (rb_str_upcase_bang, rb_str_capitalize_bang)
- (rb_str_swapcase_bang): missing rb_str_modify(). [ruby-dev:24915]
+ * ext/readline/readline.c (readline_s_get_special_prefixes): suppress
+ warning: uninitialized instance variable.
-Thu Nov 18 00:21:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Jun 19 11:43:16 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * process.c (proc_getpgrp): prohibit for $SAFE=2.
- [ruby-dev:24899]
+ * ext/readline/readline.c (readline_getc): fix editline compatibility
+ broken by r36123. [Bug #6601]
- * process.c (get_pid): ditto. [ruby-dev:24904]
+Mon Jun 18 17:10:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (get_ppid): ditto.
+ * string.c (rb_str_subpos): split from rb_str_substr. returns
+ adjusted position for substring.
- * array.c (rb_ary_delete): defer rb_ary_modify() until actual
- modification. [ruby-dev:24901]
+Mon Jun 18 10:42:57 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 18 10:10:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/readline/readline.c (readline_getc): deal with ESC just followed
+ by ASCII as meta prefix in incremental search mode. based on the
+ patch from rctay (Tay Ray Chuan) at [ruby-core:45682]. [Bug #6601]
- * io.c, rubyio.h (rb_io_modenum_flags): exported.
+Sun Jun 17 22:23:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/stringio/stringio.c (strio_initialize): allow Fixnum as mode as
- well as IO.new does. [ruby-dev:24896]
+ * dir.c (rb_file_directory_p): move documentation for Dir.exist? from
+ file.c so that the proper description will be shown instead of the
+ documentation of File.directory?. [ruby-core:45685]
-Wed Nov 17 23:42:40 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sun Jun 17 16:21:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_settracefunc.rb: added. [ruby-dev:24884]
+ * thread_win32.h (rb_thread_lock_t): make a union for USE_WIN32_MUTEX.
+ this internal is used only in thread_win32.c, but has to be complete
+ to define rb_thread_t.
-Wed Nov 17 13:56:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread_win32.c (native_mutex_lock, native_mutex_destroy): fix for
+ USE_WIN32_MUTEX.
- * parse.y (newline_node): should not use FL_SET. [ruby-dev:24874]
+ * thread_win32.c (native_cond_timedwait_ms): rename reserved pattern
+ name. user defined symbols should not start with __.
- * parse.y (string_content): should not use FL_UNSET.
+Sat Jun 16 19:24:01 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * node.h (NODE_NEWLINE): remove unused bit to utilize flag field
- in nodes.
+ * ext/date/date_core.c: define date_sg_t.
-Wed Nov 17 13:09:40 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Jun 16 18:46:57 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * {bcc32,win32,wince}/Makefile.sub (test): should build ruby.exe
- before running test. [ruby-core:03756]
+ * ext/date/date_tmx.h: offset in struct tmx_funcs is now int.
+ * ext/date/date_strftime.c: ditto.
+ * ext/date/date_core.c: ditto.
-Wed Nov 17 04:33:01 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Jun 16 18:31:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * pack.c: all features are backport from 1.9. [ruby-dev:24826]
+ * eval.c (ruby_setup): set running state in the normal case before
+ popping a tag.
- * bignum.c (rb_big2ulong_pack): new function to pack Bignums.
+Sat Jun 16 07:46:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 17 03:42:45 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): format workers
+ results in the parent.
- * string.c (rb_str_splice): move rb_str_modify() after
- StringValue(), which may alter the receiver. [ruby-dev:24878]
+Sat Jun 16 07:12:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 16 23:45:07 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * tool/runruby.rb (File.realpath): return real path of expanded path.
+ [Bug #6598]
- * numeric.c (flo_divmod): protect float values from GC by
- assignment to local variables. [ruby-dev:24873]
+Sat Jun 16 07:12:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 16 16:30:21 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * bootstraptest/runner.rb (main): ignore -j option for compatibility
+ with test/unit.
- * {bcc32,win32,wince}/setup.mak (-epilogue-): remove config.h and
- config.status to force updating them.
+Sat Jun 16 07:11:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 16 16:20:45 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/test/unit.rb (Test::Unit::Runner#puke): modify only result and
+ drop useless reports, not override entirely.
- * ext/stringio/stringio.c (strio_read): position was ignored when a
- buffer was passed. http://www.yo.rim.or.jp/~nov/d/?date=20041116#p03
+ * lib/test/unit/parallel.rb (Test::Unit::Worker#_run_suite): report
+ unformatted results. formatting messages is not a workers task.
-Tue Nov 16 11:19:07 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/test/unit/parallel.rb (Test::Unit::Worker#puke): store raw
+ results.
- * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::options): use
- Regexp conversion.
+Sat Jun 16 01:27:14 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Tue Nov 16 01:41:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/psych/lib/psych.rb: bumping psych to 1.3.3
+ * ext/psych/psych.gemspec: ditto
- * string.c (str_mod_check): frozen check should be separated.
- [ruby-core:3742]
+Fri Jun 15 20:54:28 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * array.c (rb_ary_update): pedantic check to detect
- rb_ary_to_ary() to modify the receiver. [ruby-dev:24861]
+ * vm_backtrace.c (backtrace_collect): rename from backtreace_collect.
-Mon Nov 15 13:50:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Jun 15 19:22:13 2012 Koichi Sasada <ko1@atdot.net>
- * string.c (rb_str_justify): typo fixed. [ruby-dev:24851]
+ * vm_core.h: remove VM_FRAME_MAGIC_FINISH (finish frame type).
+ Before this commit:
+ `finish frame' was place holder which indicates that VM loop
+ needs to return function.
+ If a C method calls a Ruby methods (a method written by Ruby),
+ then VM loop will be (re-)invoked. When the Ruby method returns,
+ then also VM loop should be escaped. `finish frame' has only
+ one instruction `finish', which returns VM loop function.
+ VM loop function executes `finish' instruction, then VM loop
+ function returns itself.
+ With such mechanism, `leave' instruction (which returns one
+ frame from current scope) doesn't need to check that this `leave'
+ should also return from VM loop function.
+ Strictly, one branch can be removed from `leave' instruction.
+ Consideration:
+ However, pushing the `finish frame' needs costs because
+ it needs several memory accesses. The number of pushing
+ `finish frame' is greater than I had assumed. Of course,
+ pushing `finish frame' consumes additional control frame.
+ Moreover, recent processors has good branch prediction,
+ with which we can ignore such trivial checking.
+ After this commit:
+ Finally, I decide to remove `finish frame' and `finish'
+ instruction. Some parts of VM depend on `finish frame',
+ so the new frame flag VM_FRAME_FLAG_FINISH is introduced.
+ If this frame should escape from VM function loop, then
+ the result of VM_FRAME_TYPE_FINISH_P(cfp) is true.
+ `leave' instruction checks this flag every time.
+ I measured performance on it. However on my environments,
+ it improves some benchmarks and slows some benchmarks down.
+ Maybe it is because of C compiler optimization parameters.
+ I'll re-visit here if this cause problems.
-Mon Nov 15 11:50:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * insns.def (leave, finish): remove finish instruction.
- * misc/ruby-mode.el (ruby-special-char-p, ruby-parse-partial): handle
- operator symbols. [ruby-talk:120177]
+ * vm.c, vm_eval.c, vm_exec.c, vm_backtrace.c, vm_dump.c:
+ apply above changes.
-Sun Nov 14 13:27:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 15 19:11:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/pp.rb (PP#object_address_group): remove odd number of 'f'
- prefixed to negative address.
+ * lib/test/unit.rb (Test::Unit::Runner#puke): always add skipped
+ results to the report for parallel test. [Bug #6595]
-Sun Nov 14 08:51:04 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Fri Jun 15 09:01:35 2012 Yuki Yugui Sonoda <yugui@google.com>
- * test/logger/test_logger.rb: Logger just expects
- Logger#datetime_format to be used for Time#strftime independently of
- locale. [ruby-dev:24828]
+ * nacl/pepper_main.c: Removed an unnecessary and erroneous inclusion.
-Fri Nov 12 15:03:26 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Jun 14 22:59:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (ruby_options): now we cannot call rb_glob() before
- ruby_init(), so call rb_w32_cmdvector() at ruby_options().
+ * configure.in (RUBY_CPPOUTFILE): check if output is really sent to
+ specified file to tell if -o option works. [ruby-dev:45742]
+ [Bug#6591]
- * win32.{c,h} (rb_w32_cmdvector): rename make_cmdvector() and
- export it.
+ * configure.in (RUBY_CPPOUTFILE): check if output file is actually
+ created. [ruby-dev:45742] [Bug#6591]
-Fri Nov 12 14:08:01 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Jun 14 22:10:50 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/event.rb: remove $LOADED_FEATURES trick
+ * process.c (proc_exec_sh): don't strip leading spaces of the script.
- * ext/tk/lib/tk.rb: ditto
+Thu Jun 14 15:54:02 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Nov 12 00:31:05 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * file.c (rb_file_s_basename, rb_file_s_dirname): documentation fix.
+ File.basename and File.dirname support File::ALT_SEPARATOR.
- * ext/gdbm/gdbm.c (fgdbm_store): StringValue() may alter string
- pointer. [ruby-dev:24783]
+Thu Jun 14 11:10:10 2012 Yuki Yugui Sonoda <yugui@google.com>
-Thu Nov 11 17:36:12 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * nacl/pepper_main.c: Applies the new embedding API to pepper_ruby.
- * dir.c (rb_globi): also should call back via rb_glob_caller().
- [ruby-dev:24775]
+Thu Jun 14 10:44:41 2012 Yuki Yugui Sonoda <yugui@google.com>
-Thu Nov 11 16:47:21 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * include/ruby/ruby.h: Grouped APIs for embedding CRuby interpreter.
+ (ruby_setup, ruby_compile_main_from_file,
+ ruby_compile_main_from_string, ruby_eval_main,
+ ruby_set_script_name): new APIs to embed CRuby.
+ (ruby_opaque_t) Opaque pointer to an internal data, to NODE or iseq
+ in particular.
- * test/ruby/test_file.rb (test_truncate_wbuf): we want to test
- only File#truncate, not behaviour of seek(2).
+ * eval.c (ruby_setup): Similar to ruby_init but returns an error code
+ instead of exit(3) on error.
+ (ruby_eval_main): Similar to ruby_exec_node but returns the
+ evaluation result.
+ (ruby_eval_main_internal): renamed from ruby_exec_internal.
-Thu Nov 11 09:41:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ruby.c (toplevel_context): new helper function.
+ (PREPARE_EVAL_MAIN): moved.
+ (process_options): refactored with new functions.
+ (parse_and_compile_main) new helper function.
+ (ruby_compile_main_from_file, ruby_compile_main_from_string) new API
+ (ruby_set_script_name): new API.
- * dir.c (push_braces): was confusing VALUE and char*.
- * dir.c (rb_push_glob): Dir.glob should have called its block.
+Thu Jun 14 10:39:48 2012 Yuki Yugui Sonoda <yugui@google.com>
-Thu Nov 11 01:52:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c: Add doxygen comments.
- * error.c (syserr_initialize): use stringified object.
- [ruby-dev:24768]
+ * ruby.c: ditto.
-Wed Nov 10 22:49:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread_pthread.c: ditto
- * lib/delegate.rb (SimpleDelegator::dup): wrong number of
- arguments.
+ * version.c: ditto.
- * lib/delegate.rb (DelegateClass::dup): ditto.
+ * vm_core.h: ditto.
-Wed Nov 10 12:31:21 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jun 14 10:16:07 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * README.EXT (Example): extconf.rb is indispensable now.
+ * configure.in: revert r36071 and add NetBSD to blacklist of -ansi.
-Wed Nov 10 03:33:36 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Jun 14 07:59:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tcltklib/tcltklib.c: fix SEGV when compiled with Tcl/Tk8.3.x
- or older
+ * thread_pthread.c (get_stack): Linux is the only OS which includes
+ the size of guard page into the stack size.
- * ext/tk/lib/tkextlib/tile/style.rb: bug fix
+Thu Jun 14 06:21:00 2012 Eric Hodel <drbrain@segment7.net>
-Tue Nov 9 14:27:18 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/drb/drb.rb: Replace broken links to the English DRb book.
+ Patch by Zachary Scott. [ruby-trunk - Bug #6544]
- * lib/optparse.rb (OptionParser::Officious): moved from DefaultList.
+Thu Jun 14 06:17:47 2012 Eric Hodel <drbrain@segment7.net>
-Tue Nov 9 01:05:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/observer.rb: Update broken link to the Programming Ruby book.
+ Patch by Zachary Scott. [ruby-trunk - Bug #6536]
+ * lib/drb/drb.rb: ditto.
- * dir.c (rb_glob2): do not allocate buffer from heap to avoid
- memory leaks. use string object for buffering instead.
- [ruby-dev:24738]
+Thu Jun 14 05:23:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * dir.c (join_path): ditto.
+ * regparse.c (PFETCH_READY): suppress Wunused-but-set-variable.
- * io.c (io_read): external input buffer may be modified even after
- rb_str_locktmp(). [ruby-dev:24735]
+ * regparse.c (is_onechar_cclass): restructured to clarify that c is
+ used iff found == 1.
- * dir.c (fnmatch): p or s may be NULL. [ruby-dev:24749]
+Thu Jun 14 02:54:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Nov 9 00:53:53 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * configure.in: use -fbuiltin with -ansi -std=iso9899:199409.
+ This prevents errors introduced by disabling builtin functions,
+ which is the sub-effect of -ansi/-std.
+ Now NetBSD can use -ansi -std=iso9899:199409.
+ Maybe mingw, cygwin and darwin can also.
- * regex.c (slow_match): avoid GCC 3.4.x warnings.
+Thu Jun 14 02:53:30 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Nov 9 00:50:06 2004 Dave Thomas <dave@pragprog.com>
+ * Makefile.in: don't remove macros. now name2ctype uses macros.
- * lib/rdoc/rdoc.rb: Change version numbering of RDoc and ri
+ * tool/enc-unicode.rb: add comment why it uses Hash#index.
-Mon Nov 8 23:38:35 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * enc/unicode/{name2ctype.kwd,name2ctype.src,name2ctype.h.blt}:
+ update to follow the current name2ctype.h.
+ FYI current Unicode version is 6.1.
- * lib/drb/extservm.rb: add DRb::ExtServManager#uri=.
- [ruby-dev:24743]
+Thu Jun 14 00:16:59 2012 Akinori MUSHA <knu@iDaemons.org>
-Mon Nov 8 22:20:19 2004 Dave Thomas <dave@pragprog.com>
+ * lib/net/http/responses.rb, lib/webrick/httpstatus.rb: Add HTTP
+ response codes added in RFCs 2817 and 4918. [ruby-core:45547]
+ [Feature #6569]
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_class):
- Fix bug where parent class wasn't being detected if the
- child class was defined using the A::B notation.
+ * lib/net/http/responses.rb: Rename Net::HTTPMultipleChoice to
+ Net::HTTPMultipleChoices, leaving the former as alias to the
+ latter for backward compatibility. [ruby-core:45547]
+ [Feature #6569]
-Mon Nov 8 00:14:13 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * lib/net/http/responses.rb: Add comments about unused,
+ still-in-draft and private extension response codes.
+ [ruby-core:45547] [Feature #6569]
- * configure.in: add setup for mignw32 cross compiling.
- [ruby-talk:119413]
+Wed Jun 13 22:44:32 2012 Naohisa Goto <ngotogenome@gmail.com>
-Sun Nov 7 23:49:26 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/dl/test_func.rb (test_qsort1, test_qsort2): use TYPE_SIZE_T
+ for size_t variables. [ruby-dev:45733] [Bug #6584]
- * ext/tk/lib/tk.rb: bind-event methods accept multi substitution
- arguments.
+Wed Jun 13 22:18:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/canvas.rb: ditto.
+ * configure.in: remove -ansi and -std options for lgamma_r() and
+ finite().
- * ext/tk/lib/tk/canvastag.rb: ditto.
+Wed Jun 13 21:46:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/text.rb: ditto.
+ * configure.in: cygwin does not provide some declarations in strict
+ ANSI mode.
- * ext/tk/lib/tk/texttag.rb: ditto.
+Wed Jun 13 20:19:59 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tkextlib: ditto.
+ * process.c (rb_fork_internal): move a variable declaration.
-Sat Nov 6 14:58:44 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Wed Jun 13 17:54:38 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * lib/webrick/server.rb (WEBrick::HTTPServer#start): remove
- :DoNotReverseLookup option. (Socket#do_not_reverse_lookup is a
- ruby 1.9 feature)
+ * regparse.c (PFETCH_READY): this line was to suppress warning,
+ but did emit warnings if -Wuninitialized was set. Assigning
+ NULL instead if pfetch_prev should suffice the situation.
-Sat Nov 6 11:31:04 2004 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Jun 13 17:51:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/date.rb (_parse): checks whether zone was given.
+ * configure.in: cygwin needs C99 for some stuff, e.g.,
+ pthread_attr_setstacksize, sched_yield.
-Sat Nov 6 00:46:27 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jun 13 17:50:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_locktmp): check STR_TMPLOCK flag before
- locking. [ruby-dev:24727]
+ * Makefile.in (.c.i): add warnflags to make the result consistent with
+ compilation.
-Fri Nov 5 18:12:42 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Jun 13 15:12:07 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/tk/lib/tk/scrollable.rb: divide Scrollable module into
- X_Scrollable and Y_Scrollable
+ * configure.in: On Windows platforms, system provided headers are
+ VC++ optimized. That is, C++ habits are often contaminated into
+ various headers. Most frequent situation is the use of //
+ comments. We bypass ANSI C mode for them. Otherwise extension
+ libs cannot include those headers.
- * ext/tk/lib/tk/entry.rb: include X_Scrollable instead of Scrollable
+Wed Jun 13 13:39:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/autoload.rb: define autoload for X_Scrollable and
- Y_Scrollable
+ * include/ruby/win32.h: get rid of C99 style one line comments.
-Fri Nov 5 16:05:32 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Jun 13 13:39:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk.rb: TkComm._at() supprts both of "@x,y" and "@x"
+ * encoding.c (enc_alias_internal): use strdup defined as macro.
-Fri Nov 5 13:22:58 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Jun 13 10:20:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/text.rb: sorry. bug fix again.
+ * process.c (rb_exec_fillarg): get rid of SIZE_T_MAX which may need
+ more headers.
-Fri Nov 5 13:17:54 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * process.c (rb_exec_fillarg): fix array element size. "continue" and
+ "readonly" exceeded the size.
- * ext/tk/lib/tk/text.rb: bug fix
+ * process.c (rb_exec_fillarg): use shell if the first word is reserved
+ or special built-in name.
+ http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
-Fri Nov 5 08:52:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (rb_exec_fillarg): treat '=' only in the first word. if
+ the first word does not contain '=', it is the command name and
+ environment assignments cannot be anymore.
- * gc.c (gc_mark): stricter GC stack check.
+Tue Jun 12 23:45:36 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Nov 5 08:52:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/mkmf.rb: add dummy clean-static target to prevent errors for the
+ case real clean-static target doesn't exist.
- * gc.c (gc_mark): stricter GC stack check.
+Tue Jun 12 22:49:42 2012 Naohisa Goto <ngotogenome@gmail.com>
-Fri Nov 5 08:34:43 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (rb_exec_arg_fixup): fix compile error
- * string.c (str_gsub): should have removed rb_str_unlocktmp(str).
- [ruby-dev:24708]
+Tue Jun 12 21:40:13 2012 Tanaka Akira <akr@fsij.org>
-Thu Nov 4 21:25:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (rb_exec_fillarg): treat '=' character as a meta
+ character to detect assignments preceding command name.
- * string.c (str_gsub): string modify check no longer based on
- tmplock. [ruby-dev:24706]
+Tue Jun 12 20:29:19 2012 Tanaka Akira <akr@fsij.org>
-Thu Nov 4 19:27:46 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * include/ruby/intern.h (rb_exec_arg_init): deprecated.
+ (rb_exec_arg_addopt): ditto.
+ (rb_exec_arg_fixup): ditto.
+ (rb_run_exec_options): ditto.
+ (rb_run_exec_options_err): ditto.
- * io.c (rb_f_open): fix typo.
+ * internal.h (rb_execarg_init): declared.
+ (rb_execarg_addopt): ditto.
+ (rb_execarg_fixup): ditto.
+ (rb_execarg_run_options): ditto.
-Thu Nov 4 15:02:14 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * process.c: call rb_execarg_addopt, rb_execarg_fixup,
+ rb_execarg_run_options, rb_execarg_init.
+ (rb_execarg_addopt): renamed from rb_exec_arg_addopt.
+ (rb_exec_arg_addopt): stub to call rb_execarg_addopt.
+ (rb_execarg_init): renamed from rb_exec_arg_init.
+ (rb_exec_arg_init): stub to call rb_execarg_init.
+ (rb_execarg_fixup): renamed from rb_exec_arg_fixup.
+ (rb_exec_arg_fixup): stub to call rb_execarg_fixup.
+ (rb_execarg_run_options): renamed from rb_run_exec_options_err.
+ (rb_run_exec_options_err): stub to call rb_execarg_run_options.
+ (rb_run_exec_options): call rb_execarg_run_options.
- * ext/tk/lib/tk/variable.rb: forget to initialize instance_variables
- of TkVarAccess objects
+ * io.c: call rb_execarg_addopt, rb_execarg_fixup,
+ rb_execarg_run_options, rb_execarg_init.
-Thu Nov 4 09:11:35 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/pty/pty.c (establishShell): call rb_execarg_init and
+ rb_execarg_fixup.
- * gc.c (gc_mark): enable GC stack checking.
+Tue Jun 12 18:39:59 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Thu Nov 4 03:11:33 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in: enable strict ANSI mode by default in case of GCC,
+ requested by _ko1.
- * string.c (str_gsub): lock strings temporarily. [ruby-dev:24687]
+Tue Jun 12 06:40:23 2012 Tanaka Akira <akr@fsij.org>
- * ext/socket/socket.c (s_recvfrom): tmplock input buffer.
- [ruby-dev:24705]
+ * process.c (rb_exec_fillarg): detect '#' as a meta character.
-Wed Nov 3 22:32:12 2004 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jun 11 22:15:44 2012 Tanaka Akira <akr@fsij.org>
- * process.c: On NetBSD don't use setruid() and setrgid().
+ * include/ruby/intern.h (rb_proc_exec_n): deprecated.
+ (rb_exec): ditto.
+ (rb_exec_err): ditto.
+ (rb_fork): ditto.
+ (rb_fork_err): ditto.
-Wed Nov 3 22:24:17 2004 Daigo Moriwaki <techml@sgtpepper.net>
+Mon Jun 11 18:49:52 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/webrick/httpauth/digestauth.rb: use Base64.encode64 to
- avoid warnings.
+ * configure.in: on checking libexecinfo, don't specify /use/local.
+ On FreeBSD people must specify --with-opt-dir or --with-execinfo-dir.
-Wed Nov 3 17:19:59 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jun 11 12:14:37 2012 Koichi Sasada <ko1@atdot.net>
- * array.c (rb_ary_uniq_bang): do not push frozen string from hash
- table. [ruby-dev:24695]
+ * vm_core.h: remove lfp (local frame pointer) and rename
+ dfp (dynamic frame pointer) to ep (environment pointer).
+ This change make VM `normal' (similar to other interpreters).
+ Before this commit:
+ Each frame has two env pointers lfp and dfp. lfp points
+ local environment which is method/class/toplevel frame.
+ lfp[0] is block pointer.
+ dfp is block local frame. dfp[0] points previous (parent)
+ environment pointer.
+ lfp == dfp when frame is method/class/toplevel.
+ You can get lfp from dfp by traversing previous environment
+ pointers.
+ After this commit:
+ Each frame has only `ep' to point respective environment.
+ If there is parent environment, then ep[0] points parent
+ environment (as dfp). If there are no more environment,
+ then ep[0] points block pointer (as lfp). We call such ep
+ as `LEP' (local EP). We add some macros to get LEP and to
+ detect LEP or not.
+ In short, we replace dfp and lfp with ep and LEP.
+ rb_block_t and rb_binding_t member `lfp' and `dfp' are removed
+ and member `ep' is added.
+ rename rb_thread_t's member `local_lfp' and `local_svar' to
+ `root_lep' and `root_svar'.
+ (VM_EP_PREV_EP(ep)): get previous environment pointer. This macro
+ assume that ep is not LEP.
+ (VM_EP_BLOCK_PTR(ep)): get block pointer. This macro assume
+ that ep is LEP.
+ (VM_EP_LEP_P(ep)): detect ep is LEP or not.
+ (VM_ENVVAL_BLOCK_PTR(ptr)): make block pointer.
+ (VM_ENVVAL_BLOCK_PTR_P(v)): detect v is block pointer.
+ (VM_ENVVAL_PREV_EP_PTR(ptr)): make prev environment pointer.
+ (VM_ENVVAL_PREV_EP_PTR_P(v)): detect v is prev env pointer.
- * array.c (rb_ary_and): ditto.
+ * vm.c: apply above changes.
+ (VM_EP_LEP(ep)): get LEP.
+ (VM_CF_LEP(cfp)): get LEP of cfp->ep.
+ (VM_CF_PREV_EP(cfp)): utility function VM_EP_PREV_EP(cfp->ep).
+ (VM_CF_BLOCK_PTR(cfp)): utility function VM_EP_BLOCK_PTR(cfp->ep).
- * array.c (rb_ary_or): ditto.
+ * vm.c, vm_eval.c, vm_insnhelper.c, vm_insnhelper.h, insns.def:
+ apply above changes.
-Wed Nov 3 17:13:02 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * cont.c: ditto.
- * io.c (pipe_open): fix compile error
+ * eval.c, eval_intern.h: ditto.
-Wed Nov 3 16:58:07 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * proc.c: ditto.
- * ext/tk/lib/tk.rb: support to use different Tcl commands between
- configure and configinfo
+ * thread.c: ditto.
- * ext/tk/lib/font.rb: ditto.
+ * vm_dump.c: ditto.
- * ext/tk/lib/itemconfig.rb: support to use different Tcl commands
- between item_configure and item_configinfo
+ * vm_exec.h: fix function name (on vm debug mode).
- * ext/tk/lib/itemfont.rb: ditto.
+Mon Jun 11 11:52:18 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/tk/extconf.rb: install SUPPORT_STATUS
+ * compile.c (iseq_set_sequence): nonstatic initializer of an
+ aggregate type is a C99ism.
- * ext/tk/lib/tkextlib: some bug fixes (see ext/tk/ChangeLog.tkextlib)
+ * compile.c (enum compile_array_type_t): comma at the end of enum
+ list is a C99ism.
-Wed Nov 3 16:30:41 2004 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_backtrace.c (enum LOCATION_TYPE): ditto.
- * ext/nkf: follow nkf 2.0.4
+Mon Jun 11 06:31:33 2012 Tanaka Akira <akr@fsij.org>
-Wed Nov 3 15:53:34 2004 Kouhei Sutou <kou@cozmixng.org>
+ * process.c (rb_proc_exec_n): revert the function removed at r35889.
- * test/rss/test_maker_*.rb: added tests for RSS Maker.
+Mon Jun 11 06:20:50 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rss/maker.rb: added RSS Maker.
+ * thread_pthread.c (rb_thread_create_timer_thread): assign return
+ value to the variable err.
- * lib/rss/maker/*.rb: ditto.
+Mon Jun 11 06:17:06 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Nov 2 16:35:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread_pthread.c (native_cond_initialize): fix typo in r36022.
+ this cause a failure on FreeBSD 8.2 amd64.
+ http://fbsd.rubyci.org/~chkbuild/ruby-trunk/log/20120610T130201Z.diff.html.gz
- * ext/enumerator/enumerator.c (each_cons_i): pass copy of an
- internal consequent array. [ruby-talk:118691]
+Mon Jun 11 05:21:57 2012 Koichi Sasada <ko1@atdot.net>
-Tue Nov 2 16:05:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * .gdbinit (SDR): add SDR function. It's only for VM debugging.
- * process.c (rb_f_fork): need to flush stdout and stderr before
- fork(2). [ruby-talk:117715]
+Sun Jun 10 21:50:45 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-Tue Nov 2 01:20:09 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * nacl/nacl_config.rb: Fixed for 32bit hosts.
- * eval.c (proc_invoke): nail down dyna_var node when Proc object
- or continuation is created. [ruby-dev:24671]
+Sun Jun 10 20:23:14 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-Mon Nov 1 13:59:28 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ Fixes threading on NativeClient.
- * ext/extmk.rb (MANIFEST): do not use anymore, use extconf.rb instead.
+ * thread_pthread.c (timer_thread_sleep): Extracted out a function from
+ thread_timer(). Added an alternative implementation for platforms
+ that lacks select(2) or pipe(2).
+ (rb_thread_create_timer_thread, native_cond_initialize,
+ native_cond_destroy): Replaced wrong HAVE_XXX checks.
- * ext/enumerator/extconf.rb, ext/fcntl/extconf.rb,
- ext/stringio/extconf.rb: added.
+ * configure.in (pthread_attr_init): New check.
- * MANIFEST, ext/**/MANIFEST: removed.
+Sun Jun 10 21:30:11 2012 Tanaka Akira <akr@fsij.org>
- * README.EXT, README.EXT.ja: remove MANIFEST stuff.
+ * process.c (rb_exec_without_timer_thread): renamed from rb_exec_err.
+ (rb_exec_err): new stub function to call
+ rb_exec_without_timer_thread.
+ (rb_f_exec): call rb_exec_without_timer_thread.
+ (rb_exec): call rb_exec_without_timer_thread.
-Mon Nov 1 01:14:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Jun 10 21:13:10 2012 Tanaka Akira <akr@fsij.org>
- * io.c (rb_f_open): create copy of popen specifier. [ruby-dev:24656]
+ * process.c (rb_fork): call rb_fork_internal instead of rb_fork_err.
-Mon Nov 1 00:36:48 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Sun Jun 10 20:55:59 2012 Tanaka Akira <akr@fsij.org>
- * main.c (_stklen): move to gc.c.
+ * process.c (rb_fork_ruby): call rb_fork_internal directly.
-Sun Oct 31 00:22:28 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Jun 10 20:19:40 2012 Tanaka Akira <akr@fsij.org>
- * string.c (rb_str_locktmp): lock string temporarily.
+ * process.c (rb_fork_ruby): new function.
+ (rb_f_fork): use rb_fork_ruby instead of rb_fork.
+ (rb_daemon): ditto.
- * string.c (str_independent): add tmplock check.
+ * io.c (pipe_open): use rb_fork_ruby instead of rb_fork.
- * io.c (io_write): lock output string temporarily.
- [ruby-dev:24649]
+ * internal.h (rb_fork_ruby): declared.
- * io.c (io_write): use rb_str_locktmp().
+Sun Jun 10 18:58:16 2012 Akinori MUSHA <knu@iDaemons.org>
- * io.c (read_all): ditto.
+ * lib/net/http/response.rb: Remove a duplicated rdoc and leave a
+ pointer.
-Sat Oct 30 06:53:24 2004 Peter Vanbroekhoven <peter.vanbroekhoven@cs.kuleuven.ac.be>
+ * lib/net/http/responses.rb: Add RFC numbers to base on.
- * eval.c (rb_eval): NODE_XSTR should pass copy of literal string.
+Sun Jun 10 18:31:42 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-Sat Oct 30 00:19:40 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in (RUBY_NACL): Warns if $PATH does not contain the path
+ to NativeClient SDK. PATH variable redefinition in GNUmakefile does
+ not work for GNU make 3.81.
- * enum.c (enum_sort_by): protect continuation jump in.
- [ruby-dev:24642]
+Sun Jun 10 17:54:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Oct 29 21:27:51 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.h (IS_STACK_DIR_UPPER): utility macro.
- * io.c (rb_io_check_initialized): new function to check uninitialized
- object. [ruby-talk:118234]
+ * thread_pthread.c (get_stack): seems stack size does not include
+ guard size on Mac OS X.
- * file.c (rb_file_path), io.c (rb_io_closed): check if initialized.
+ * thread_pthread.c (ruby_init_stack): adjust stack size for offset of
+ addr from the bottom.
-Fri Oct 29 10:00:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Jun 10 15:49:47 2012 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_thread_start_0): forget to free some memory chunks.
- [ruby-core:03611]
+ * process.c (retry_fork): call after_fork except in a child process.
+ (rb_fork_internal): restrict after_fork call condition.
- * eval.c (ruby_cleanup): ruby_finalize_1 may cause exception,
- should be wrapped by PUSH_TAG/POP_TAG(). [ruby-dev:24627]
+Sun Jun 10 14:19:33 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Oct 28 08:42:02 2004 Tanaka Akira <akr@m17n.org>
+ * configure.in: NetBSD 6 adds libexecinfo but it only works on amd64.
+ http://www.mail-archive.com/source-changes-full@netbsd.org/msg38729.html
- * io.c (argf_forward): use ANSI style.
- (argf_read): call argf_forward with argv argument.
- [ruby-dev:24624]
+Sun Jun 10 12:43:23 2012 Tanaka Akira <akr@fsij.org>
-Thu Oct 28 23:32:54 2004 akira yamada <akira@ruby-lang.org>
+ * process.c (rb_f_exec): call rb_exec_async_signal_safe except on
+ Mac OS X. cf. the comment in before_exec_non_async_signal_safe.
- * ext/zlib/zlib.c (zstream_detach_input): resets klass of z->input if
- z->input isn't nil.
+Sun Jun 10 12:15:18 2012 Tanaka Akira <akr@fsij.org>
-Thu Oct 28 23:19:31 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (popen_exec): don't call rb_thread_atfork_before_exec. use
+ rb_exec_async_signal_safe instead of rb_exec_err.
+ (pipe_open): use rb_fork_async_signal_safe instead of rb_fork_err.
- * ext/extmk.rb: prefer relative path. [ruby-talk:93037]
+Sun Jun 10 11:44:57 2012 Tanaka Akira <akr@fsij.org>
-Wed Oct 27 18:49:11 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * process.c (rb_fork_internal): call after_fork only unless
+ chfunc_is_async_signal_safe.
- * gc.c: prototype; rb_io_fptr_finalize() doesn't return any value
- at this version.
+Sun Jun 10 11:33:01 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Wed Oct 27 17:27:45 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/openssl/ossl_pkey_ec.c
+ test/openssl/test_pkey_ec.rb: Add support for EC_POINT_mul.
+ Patch provided by Sambasiva Suda. Thanks!
+ [ruby-core:44408][ruby-trunk - Feature #6310]
- * gc.c (gc_sweep): recover ruby_in_compile variable.
+Sun Jun 10 10:48:15 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Wed Oct 27 09:17:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/openssl/ssl.rb: Use a simple random number to generate the
+ session id. MD5, as was used before, causes problems when
+ using a FIPS version of OpenSSL. Issue was found by Jared
+ Jennings, thank you!
+ [ruby-trunk - Bug #6137]
- * string.c (str_gsub): use a string object for exception safeness.
- [ruby-dev:24601]
+Sun Jun 10 10:27:34 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Tue Oct 26 23:52:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * NEWS: Add note about the new private key export behavior.
- * io.c (rb_io_getline): rs modification check should not interfere in the loop.
+Sun Jun 10 10:24:51 2012 Tanaka Akira <akr@fsij.org>
-Tue Oct 26 23:30:39 2004 Dave Thomas <dave@pragprog.com>
+ * process.c (rb_exec_async_signal_safe): exported.
- * lib/rdoc/code_objects.rb (RDoc::Context::add_class_or_module):
- Restore correct :nopdoc: behavior with nested classes and modules.
+ * ext/pty/extconf.rb: modify $INCFLAGS to include internal.h
-Tue Oct 26 18:21:29 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/pty/pty.c: include internal.h.
+ (chfunc): don't call rb_thread_atfork_before_exec. use
+ rb_exec_async_signal_safe instead of rb_f_exec.
+ (establishShell): set up earg. use rb_fork_async_signal_safe
+ instead of rb_fork_err.
- * string.c (RESIZE_CAPA): check string attribute before modifying
- capacity member of string structure. [ruby-dev:24594]
+ * internal.h (rb_exec_async_signal_safe): declared.
+ (rb_fork_async_signal_safe): declared.
-Tue Oct 26 11:33:26 2004 David G. Andersen <dga@lcs.mit.edu>
+Sun Jun 10 10:21:37 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain
- performance. [ruby-talk:117701]
+ * ext/openssl/ossl.c
+ ext/openssl/ossl_pkey_rsa.c
+ ext/openssl/ossl_pkey_dsa.c
+ ext/openssl/ossl_pkey_ec.c: Forbid export passwords that are less
+ than four characters long, as OpenSSL itself does not allow this.
+ Issue found by Eric Hodel.
+ * ext/openssl/ossl_pkey_ec.c: Add export as an alias of to_pem,
+ following the PKey interface contract.
+ * test/openssl/test_pkey_dsa.rb
+ test/openssl/test_pkey_rsa.rb
+ test/openssl/test_pkey_ec.rb: Add tests that assert correct
+ behaviour when dealing with passwords that are less than four
+ characters long.
+ [ruby-core: 42281][ruby-trunk - Bug #5951]
-Tue Oct 26 10:56:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Jun 10 10:14:26 2012 Tanaka Akira <akr@fsij.org>
- * sprintf.c (rb_f_sprintf): raise ArgumentError for extra
- arguments, unless (digit)$ style used.
+ * process.c (rb_f_exec): use rb_exec_arg_prepare.
-Tue Oct 26 11:33:26 2004 David G. Andersen <dga@lcs.mit.edu>
+Sun Jun 10 06:43:51 2012 Tanaka Akira <akr@fsij.org>
- * ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain
- performance. [ruby-talk:117701]
+ * process.c: split after_exec into async-signal-safe part and rest.
+ (after_exec_async_signal_safe): extracted from after_exec.
+ (after_exec_non_async_signal_safe): ditto.
+ (after_exec): call them.
+ (rb_exec_async_signal_safe): call after_exec_async_signal_safe.
+ (rb_exec_err): call after_exec_non_async_signal_safe instead of
+ after_exec.
-Tue Oct 26 10:56:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Jun 10 06:21:10 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * sprintf.c (rb_f_sprintf): raise ArgumentError for extra
- arguments, unless (digit)$ style used.
+ * NEWS: document new features of Ruby OpenSSL.
-Mon Oct 25 18:35:39 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Sun Jun 10 03:09:41 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * win32/win32.c (isUNCRoot): should check NUL after '.'.
- [ruby-dev:24590]
+ * ext/openssl/ossl.c: Fix error in example. Patch by David Albert.
- * win32/win32.c (isUNCRoot): fixed buffer overrun.
+ Add/extend existing documentation. Examples now also cover RSA
+ signatures and PBKDF2.
+ [ruby-core: 45154][ruby-trunk - Bug #6475]
-Mon Oct 25 08:03:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (get_backtrace): ignore illegal backtrace. [ruby-dev:24587]
+Sun Jun 10 01:41:45 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Sun Oct 24 00:41:09 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_ssl.c: Introduce SSLContext#renegotiation_cb and
+ remove SSLContext#disable_client_renegotiation and related
+ functionality introduced in r35797. The new callback approach
+ gives clients maximum flexibility to decide on their own what to
+ do on renegotiation attempts.
+ Add documentation for SSL module and SSLError.
+ * test/openssl/test_ssl.rb: Add a test for
+ SSLContext#renegotiation_cb.
- * eval.c (rb_load, search_required, rb_require_safe, rb_require): use
- frozen shared string to avoid outside modification. [ruby-dev:24580]
+Sun Jun 10 01:37:18 2012 Tanaka Akira <akr@fsij.org>
-Sat Oct 23 22:18:32 2004 Guy Decoux <ts@moulon.inra.fr>
+ * process.c (rb_fork_internal): initialize exc.
- * eval.c (frame_free): Guy Decoux solved the leak problem.
- Thanks. [ruby-core:03549]
+Sun Jun 10 00:19:25 2012 Tanaka Akira <akr@fsij.org>
-Sat Oct 23 00:20:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c: don't use non async-signal-safe functions in a child
+ process before exec, for invoking a command.
+ (rb_exec_atfork): call rb_exec_async_signal_safe only.
+ (retry_fork): take chfunc_is_async_signal_safe argument. call
+ before_fork and after_fork only unless chfunc_is_async_signal_safe.
+ (send_child_error): take chfunc_is_async_signal_safe argument.
+ send an exception only unless chfunc_is_async_signal_safe.
+ (recv_child_error): take chfunc_is_async_signal_safe argument.
+ receive an exception only unless chfunc_is_async_signal_safe.
+ (rb_fork_internal): renamed from rb_fork_err and take
+ chfunc_is_async_signal_safe argument.
+ use rb_protect only unless chfunc_is_async_signal_safe.
+ (rb_fork_err): call rb_fork_internal with false as
+ chfunc_is_async_signal_safe.
+ (rb_fork_async_signal_safe): call rb_fork_internal with true as
+ chfunc_is_async_signal_safe.
+ (rb_spawn_process): call rb_fork_async_signal_safe instead of
+ rb_fork_err.
- * ext/zlib/zlib.c (zstream_append_input): clear klass for z->input
- to avoid potential vulnerability.
+Sat Jun 9 23:57:03 2012 Tanaka Akira <akr@fsij.org>
- * ext/zlib/zlib.c (zstream_run): always use zstream_append_input()
- to avoid SEGV. [ruby-dev:24568]
+ * process.c (rb_fork_err): rewrite a complex "if" statement.
-Fri Oct 22 12:02:28 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Jun 9 23:44:29 2012 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_alias): was warning for wrong condition.
- [ruby-dev:24565]
+ * process.c (before_exec_async_signal_safe): extracted from
+ before_exec.
+ (before_exec_non_async_signal_safe): ditto.
+ (before_exec): call before_exec_async_signal_safe and
+ before_exec_non_async_signal_safe.
+ (rb_exec_async_signal_safe): call before_exec_async_signal_safe.
+ (rb_exec_err): call before_exec_non_async_signal_safe instead of
+ before_exec.
-Fri Oct 22 10:36:37 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Jun 9 23:36:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#meta_vars):
- should check if path_info is not nil.
+ * iseq.c (iseq_load, insn_operand_intern, rb_iseq_disasm)
+ (rb_iseq_parameters): use rb_id2str() instead of rb_id2name() to
+ keep encoding.
-Fri Oct 22 00:22:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * string.c (rb_str_symname_p): new function that checks if the string
+ is valid as a symbol name. split from sym_inspect().
- * ext/zlib/zlib.c (zstream_shift_buffer): should restore class
- field of a buffer. [ruby-dev:24562]
+Sat Jun 9 22:27:05 2012 Tanaka Akira <akr@fsij.org>
-Fri Oct 22 00:20:33 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (retry_fork): rewrite a complex "for" statement by
+ simple statements.
- * string.c (rb_str_include): should not treat char as negative value.
- [ruby-dev:24558]
+Sat Jun 9 21:50:04 2012 Tanaka Akira <akr@fsij.org>
-Thu Oct 21 21:32:30 2004 IWATSUKI Hiroyuki <don@na.rim.or.jp>
+ * process.c (retry_fork): extracted from rb_fork_err.
+ (send_child_error): ditto.
+ (recv_child_error): ditto.
- * lib/pstore.rb (PStore#transaction): Use the empty content when a
- file is not found. [ruby-dev:24561]
+Sat Jun 9 17:21:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Oct 21 19:06:15 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * iseq.c (iseq_load): type is a symbol, and invalid as ID in common.
- * lib/webrick/httpresponse.rb (WEBrick::HTTPResponse#send_body_io):
- ensure to close @body. (http://bugs.debian.org/277520)
+Sat Jun 9 10:57:14 2012 Tanaka Akira <akr@fsij.org>
-Thu Oct 21 00:36:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (rb_exec_async_signal_safe): extracted from rb_exec_err.
- * eval.c (rb_alias): should warn on method discarding.
- [ruby-dev:24546]
+Sat Jun 9 09:31:07 2012 Tanaka Akira <akr@fsij.org>
- * ext/zlib/zlib.c (zstream_expand_buffer_into): hide internal
- string buffer by clearing klass. [ruby-dev:24548]
+ * process.c: simplified because close_others option is always
+ enabled by default.
+ (rb_f_exec): don't need to set the option.
+ (rb_exec_arg_prepare): don't need to set the option. don't need
+ default_close_others argument.
+ (rb_spawn_internal): don't need to give default_close_others
+ argument for rb_exec_arg_prepare. don't need default_close_others
+ argument.
+ (rb_spawn_err): don't need to give default_close_others
+ argument for rb_spawn_internal.
+ (rb_spawn): don't need to give default_close_others
+ argument for rb_spawn_internal.
+ (rb_f_system): don't need to give default_close_others argument for
+ rb_spawn_internal.
+ (rb_f_spawn): don't need to give default_close_others argument for
+ rb_exec_arg_prepare.
-Wed Oct 20 19:45:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Jun 9 09:00:58 2012 Tanaka Akira <akr@fsij.org>
- * string.c (str_gsub): reentrant check. [ruby-dev:24432]
+ * process.c (rb_proc_exec): call before_exec() here addition to
+ rb_exec_err.
- * backport all SEGV bug fixes from CVS HEAD. [ruby-dev:24536]
+Sat Jun 9 08:30:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Oct 20 04:17:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread_pthread.c (ruby_init_stack): use stack info if possible.
- * ext/dbm/dbm.c (fdbm_delete_if): should check if deleting element
- is a string. [ruby-dev:24490]
+Sat Jun 9 08:21:32 2012 Eric Hodel <drbrain@segment7.net>
- * ext/sdbm/init.c (fsdbm_delete_if): ditto.
+ * README.EXT (prepare extconf.rb): Added note to see MakeMakefile for
+ documentation of extconf.rb functions. Patch by Zachary Scott.
+ [ruby-trunk - Feature #6522]
+ * README.EXT (Appendix C): Removed in favor of MakeMakefile.
+ Patch by Zachary Scott.
+ * lib/mkmf.rb: Merged documentation from README.EXT Appendix C. Patch
+ by Zachary Scott.
-Wed Oct 20 01:37:18 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Jun 9 08:16:47 2012 Eric Hodel <drbrain@segment7.net>
- * array.c (rb_ary_times): Array#* should return an instance of
- the class of right operand. [ruby-dev:24526]
+ * doc/re.rdoc: Completed wording in the description of the =~ operator.
+ [ruby-trunk - Bug #6529]
- * ext/zlib/zlib.c (zstream_detach_buffer): should not expose
- class-less object to Ruby world. [ruby-dev:24530]
+Sat Jun 9 08:09:38 2012 Eric Hodel <drbrain@segment7.net>
- * eval.c (proc_dup): provide Proc#dup as well. [ruby-talk:116915]
+ * string.c (rb_str_start_with): Removed "p" from start_with? examples
+ to match other String method examples. [ruby-trunk - Bug #6553]
+ * string.c (rb_str_end_with): Updated end_with? to use code markup
+ instead of italic.
- * eval.c (ruby_exec): stack marking position may be higher than
- expected. thanks to Guy Decoux. [ruby-core:03527]
+Sat Jun 9 07:56:03 2012 Eric Hodel <drbrain@segment7.net>
-Tue Oct 19 22:43:12 2004 Dave Thomas <dave@pragprog.com>
+ * lib/benchmark.rb: Updated formatting of Benchmark documentation for
+ consistency. [ruby-trunk - Bug #6533]
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_attr): If
- we come across 'attr' in a context where it isn't
- followed by a symbol, just issue a warning.
+Sat Jun 9 07:46:26 2012 Eric Hodel <drbrain@segment7.net>
-Tue Oct 19 20:41:37 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * lib/delegate.rb: Added documentation for Delegator#!. Patch by
+ Zachary Scott. [ruby-trunk - Feature #6534]
- * ext/win32ole.c(ole_invoke): retrieve the result value when
- retrying the IDispatch::invoke.
+Sat Jun 9 07:39:50 2012 Eric Hodel <drbrain@segment7.net>
-Tue Oct 19 17:24:11 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/net/http/responses.rb: Add RFC 6585 response codes. Patch by
+ Sangil Jung. [ruby-trunk - Feature #6480]
+ * lib/net/http/response.rb: ditto
+ * lib/net/http.rb: ditto
+ * lib/webrick/httpstatus.rb: ditto
- * io.c (read_all): block string buffer modification during
- rb_io_fread() by freezing it temporarily. [ruby-dev:24479]
+Sat Jun 9 01:24:28 2012 Tanaka Akira <akr@fsij.org>
- * dir.c (rb_push_glob): block call at once the end of method.
- [ruby-dev:24487]
+ * process.c (rb_exec_err): before_exec() call moved from proc_exec_cmd
+ and proc_exec_sh.
+ (rb_proc_exec): ditto.
- * ext/enumerator/enumerator.c (enum_each_slice): remove
- rb_gc_force_recycle() to prevent potential SEGV.
- [ruby-dev:24499]
+Sat Jun 9 01:11:07 2012 Tanaka Akira <akr@fsij.org>
- * ext/zlib/zlib.c (zstream_expand_buffer): hide internal string
- buffer by clearing klass. [ruby-dev:24510]
+ * include/ruby/intern.h (rb_exec_arg_init): declaration changed to
+ return a value.
-Tue Oct 19 16:12:18 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * process.c (rb_exec_arg_init): return a value.
- * ext/tk/tkutil.c: backport from CVS HEAD
+Fri Jun 8 23:44:14 2012 Tanaka Akira <akr@fsij.org>
-Tue Oct 19 08:54:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c: don't check the availability of FD_CLOEXEC. It should
+ be available if fork() is available.
- * intern.h, object.c (rb_class_inherited_p): export.
+ * io.c: ditto.
-Tue Oct 19 08:46:57 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 8 22:39:32 2012 Tanaka Akira <akr@fsij.org>
- * string.c (rb_str_upto): method result must be checked. [ruby-dev:24504]
+ * process.c (rb_fork_err): revert r35955. The condition needs !chfunc
+ to close ep[0] and ep[1]. The catched exception is re-raised
+ immediately after that if status is not NULL.
- * eval.c (error_print): ditto. [ruby-dev:24519]
+Fri Jun 8 19:43:33 2012 Tanaka Akira <akr@fsij.org>
-Mon Oct 18 23:37:05 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (rb_exec_err): after_exec() call moved from proc_exec_cmd
+ and proc_exec_sh.
+ (rb_proc_exec): ditto.
- * marshal.c (r_object0): check inheritance by the internal function.
- [ruby-dev:24515]
+Fri Jun 8 19:00:59 2012 Tanaka Akira <akr@fsij.org>
-Mon Oct 18 15:58:01 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * process.c (ARGV_COUNT): unused macro removed.
+ (ARGV_SIZE): ditto.
+ (ALLOC_ARGV): ditto.
+ (ALLOC_ARGV_WITH_STR): ditto.
- * range.c (range_step, range_each): need cast.
+Fri Jun 8 16:19:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Oct 29 16:34:19 2004 Daiki Ueno <ueno@unixuser.org>
+ * test/runner.rb (src_testdir): expand real path so that
+ TestGem#test_self_find_files does not fail by aliased load path when
+ srcdir contains a symbolic link.
- * misc/ruby-mode.el (ruby-parse-partial): Parse the rest of the
- line after opening heredoc identifier. [ruby-dev:24635]
+ * tool/runruby.rb (srcdir): ditto.
-Mon Oct 18 07:26:21 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 8 12:04:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * file.c (rb_file_truncate): discard read buffer before truncation.
- [ruby-dev:24197]
+ * process.c (rb_fork_err): error state in the child process is prior
+ to exceptions in proc_syswait().
-Mon Oct 18 02:11:21 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * process.c (rb_fork_err): determine status on errors.
- * lib/webrick/config.rb (WEBrick::Config::General): add default values:
- - WEBrick::Config[:DoNotReverseLookup]
- - WEBrick::Config[:RequestCallback] (it used as an alias of
- :RequestHandler in WEBrick::HTTPServer#run)
- - WEBrick::Config::FileHandler[:AcceptableLanguages]
+ * ext/pty/pty.c (establishShell): reraise exception if something
+ raised during sleep.
- * lib/webrick/httpservlet/filehandler.rb
- (WEBrick::HTTPServlet::FileHandler#set_filename): search files
- having suffix of language-name which Accept-Language header field
- includes if :AcceptableLanguages options is present.
+ * ext/pty/pty.c (establishShell): now needs status to protect from
+ exceptions in rb_fork_err().
- * lib/webrick/httpservlet/filehandler.rb
- (WEBrick::HTTPServlet::FileHandler#get_servlet): new method to
- search servlet correspond to the suffix of filename.
+Thu Jun 7 22:13:05 2012 Tanaka Akira <akr@fsij.org>
- * lib/webrick/httprequest.rb: add attributes access methods: accept,
- accept_charset, accept_encoding, accept_language, content_length
- and content_type.
+ * process.c (rb_fork_err): Fix the condition to use rb_protect.
- * lib/webrick/httpresponse.rb: add attribute access methods:
- content_length, content_length=, content_type and content_type=.
+Thu Jun 7 20:29:12 2012 Tanaka Akira <akr@fsij.org>
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.mime_types):
- use the second suffix to detect media type. (the first suffix
- may be a language name.)
+ * include/ruby/intern.h: rb_exec_arg and related stuff moved back from
+ internal.h
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_qvalues):
- add method to parse Accept header field. it returns an Array of
- values sorted by the qvalues.
+Thu Jun 7 15:53:03 2012 Koichi Sasada <ko1@atdot.net>
-Mon Oct 18 02:04:11 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * .gdbinit: add function `trace_machine_instructions' to trace
+ in native machine assemble.
+ See https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/MachineInstructionsTraceWithGDB
+ for more details.
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#virtual_host): new
- method to register virtual hosting servers.
+Wed Jun 6 21:31:21 2012 Tanaka Akira <akr@fsij.org>
- * lib/webrick/server.rb (WEBrick::GenericServer#accept): call
- do_not_reverse_lookup for each socket if :DoNotReverseLookup
- is set. [ruby-core:02357]
+ * process.c (proc_exec_cmd) renamed from proc_exec_v.
+ (proc_exec_sh): renamed from rb_proc_exec_e.
+ (proc_spawn_cmd_internal): renamed from proc_spawn_v.
+ (proc_spawn_cmd): renamed from proc_spawn_n.
+ (proc_spawn_sh): renamed from proc_spawn.
-Mon Oct 18 00:42:45 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jun 6 21:18:47 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/socket/socket.c (sock_s_getservbyaname): protocol string
- might be altered. [ruby-dev:24503]
+ * process.c (try_with_sh): please take care of the macro defined by
+ you.
- * string.c (rb_str_upto): check if return value from succ is a
- string. [ruby-dev:24504]
+Wed Jun 6 20:45:08 2012 Tanaka Akira <akr@fsij.org>
-Sun Oct 17 23:03:48 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * process.c (proc_exec_v): don't call dln_find_exe_r here because it
+ is not async-signal-safe and proc_exec_v is called in a child
+ process.
+ command_abspath field of rb_exec_arg.
+ (rb_exec_fillarg): call dln_find_exe_r and set command_abspath.
+ (rb_exec_err): Give the absolute path of the invoking command for
+ proc_exec_v, instead of the command name.
- * ext/tk/lib/tk/timer.rb: TkTimer#start and restart accept a block
+ * internal.h: add command_abspath field for rb_exec_arg.
-Sun Oct 17 13:05:04 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Wed Jun 6 20:08:01 2012 Tanaka Akira <akr@fsij.org>
- * ext/win32ole/win32ole.c (fole_func_methods): correct argument mismatch.
- * ext/win32ole/win32ole.c (fole_get_methods): ditto.
- * ext/win32ole/win32ole.c (fole_put_methods): ditto.
- * ext/win32ole/tests/testWIN32OLE.rb: add test for WIN32OLE#ole_func_methods
- WIN32OLE#ole_get_methods, WIN32OLE#ole_put_methods
+ * process.c (try_with_sh): take envp argument.
+ (exec_with_sh): ditto. use it for execve.
+ (proc_exec_v): provide envp for try_with_sh.
-Sat Oct 16 14:45:28 2004 Kouhei Sutou <kou@cozmixng.org>
+Wed Jun 6 13:25:04 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/rss/0.9.rb (RSS::Rss#to_s): removed garbage.
+ * win32/win32.c, include/ruby/win32.h (rb_w32_wrap_io_handle): new API.
+ this API wraps an I/O handle (HANDLE or SOCKET) and returns fd.
+ the second parameter should be combination of O_*, for example,
+ O_RDWR | O_BINARY | O_NOINHERIT.
-Sat Oct 16 13:42:49 2004 Kouhei Sutou <kou@cozmixng.org>
+ * win32/win32.c, include/ruby/win32.h (rb_w32_unwrap_io_handle): new
+ API. this API unwraps an I/O handle and close the fd (not closes
+ the handle itself).
- * lib/rss/: untabified.
- * test/rss/: untabified.
- * lib/rss/0.9.rb (RSS::Rss#to_s): inent -> indent.
+ [Feature #4906] [ruby-core:37227]
-Sat Oct 16 13:34:56 2004 Kouhei Sutou <kou@cozmixng.org>
+Wed Jun 6 13:18:26 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/rss: supported prety print.
- * test/rss/test_1.0.rb: added test for calculating default indent size.
+ * win32/win32.c (rb_w32_close): of course, console handle is not socket.
-Fri Oct 15 18:04:35 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Jun 6 12:37:43 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/lib/tk/timer.rb: TkTimer.new(interval, loop){ ... } is
- acceptable. Add TkTimer.start ( == new + start ).
+ * process.c (rb_run_exec_options_err): allocate a temporary buffer for
+ run_exec_dup2() for restoring fds on non-fork environments.
-Fri Oct 15 12:43:09 2004 Tanaka Akira <akr@m17n.org>
+Wed Jun 6 09:45:21 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (Init_stack): make prototype declaration consistent with
- the definition in gc.c.
+ * test/dl/test_c_{struct_entry,union_entity}.rb: sorry, typos.
-Thu Oct 14 14:34:01 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Wed Jun 6 05:27:54 2012 Tanaka Akira <akr@fsij.org>
- * io.c (MODE_BINMODE, MODE_BINARY): fixed reversed condition.
+ * process.c (rb_exec_fillarg): check use_shell field before accessing
+ a union field.
-Thu Oct 14 13:33:59 2004 Kouhei Sutou <kou@cozmixng.org>
+Wed Jun 6 04:58:44 2012 Tanaka Akira <akr@fsij.org>
- * lib/rss/rss.rb: added link to Tutorial.
+ * process.c (rb_spawn_process): prog variable is not used for Unix.
-Mon Oct 11 13:48:20 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Jun 6 00:20:37 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/*: untabify
+ * internal.h (rb_exec_arg_init): change return type to void.
-Sun Oct 10 12:32:08 2004 Dave Thomas <dave@pragprog.com>
+ * process.c (rb_exec_arg_init): don't return a value.
+ (rb_exec_arg_prepare): ditto.
+ (rb_spawn_process): don't take the prog argument. extract the
+ information from earg.
+ (rb_spawn_internal): follow rb_spawn_process change.
+ (rb_f_spawn): ditto.
- * lib/rdoc/parsers/parse_rb.rb (RDoc::parse_require): Allow 'require'
- to be used as a variable name
+ * io.c (pipe_open): don't take the prog argument. extract the
+ information from eargp.
+ (pipe_open_v): follow pipe_open change.
+ (pipe_open_s): ditto.
-Sat Oct 9 21:23:37 2004 Kouhei Sutou <kou@cozmixng.org>
+Tue Jun 5 23:51:33 2012 Tanaka Akira <akr@fsij.org>
- * lib/rss/converter.rb: changed to try to use Iconv for default
- conversion.
+ * internal.h (rb_exec_arg): use union to represent command invocation
+ with/without shell.
- * lib/rss/rss.rb: 0.0.9 -> 0.1.0.
+ * process.c: follow the rb_exec_arg change.
-Sat Oct 9 19:50:36 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (pipe_open): ditto.
- * io.c (rb_io_getline): should not treat char as negative value.
- [ruby-dev:24460]
+Tue Jun 5 22:28:46 2012 Tanaka Akira <akr@fsij.org>
-Fri Oct 8 09:49:32 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h: rb_exec_arg and related stuff moved from intern.h
- * pack.c (pack_pack): pointer modification check before each
- iteration. [ruby-dev:24445]
+ * include/ruby/intern.h (rb_proc_exec_n): removed.
-Fri Oct 8 01:13:05 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Jun 5 21:57:22 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/optiondb.rb: make it more secure
+ * process.c (rb_exec_arg_fixup): allocate a temporary buffer for
+ run_exec_dup2 here because it should be async-signal-safe.
+ (run_exec_dup2): use the temporary buffer.
+ (run_exec_dup2_tmpbuf_size): new function.
-Thu Oct 7 23:47:57 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * include/ruby/intern.h (rb_exec_arg): add dup2_tmpbuf field.
- * ext/tk/lib/tk/scrollbar.rb: When 'set' operation, a scrollbar
- cannot propagate view port information from the source widget
- (that calls 'set') to other assigned widgets.
+Tue Jun 5 20:13:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Oct 7 17:36:25 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * object.c (rb_obj_init_copy): should check if trusted too.
- * ext/tk/lib/tk.rb: When CHILDKILLED and so on, Tk.errorCode returns
- a Fixnum for 2nd element (it's pid) of the return value.
+Tue Jun 5 19:59:13 2012 Tanaka Akira <akr@fsij.org>
-Thu Oct 7 12:55:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (strtok): declaration removed because it is not used.
- * io.c (io_read): should freeze buffer before thread context
- switch. [ruby-dev:24442]
+Tue Jun 5 19:33:51 2012 Tanaka Akira <akr@fsij.org>
- * pack.c (pack_unpack): string conversion should at the top of the
- method. [ruby-dev:24439]
+ * process.c (proc_spawn): don't detect simple command line here
+ because rb_exec_fillarg already did.
- * io.c (io_read): buffer should be frozen only after the length
- check. [ruby-dev:24440]
+Tue Jun 5 19:21:10 2012 Tanaka Akira <akr@fsij.org>
-Thu Oct 7 02:56:43 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (rb_exec_fillarg): bail out a loop eagerly.
- * ext/stringio/stringio.c: use FMODE_APPEND.
+Tue Jun 5 19:15:14 2012 Tanaka Akira <akr@fsij.org>
-Thu Oct 7 01:05:33 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * process.c: add comments about async-signal-safe.
- * ext/tk/lib/tk.rb: add Tk.errorInfo and Tk.errorCode
+ * io.c: ditto.
-Thu Oct 7 00:08:37 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Jun 5 09:25:10 2012 Eric Hodel <drbrain@segment7.net>
- * io.c (rb_io_s_sysopen): preserve path in the buffer allocated by
- ALLOCA_N() to prevent modification. [ruby-dev:24438]
+ * io.c: Edited documentation for IO and File open and new and
+ Kernel#open for consistency and clarity.
-Wed Oct 6 09:21:00 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jun 4 21:53:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (rb_io_mode_flags): preserve append mode flag.
- [ruby-dev:24436]
+ * win32/win32.c (rb_w32_sysinit): let the system not display the
+ critical-error-handler message box and the Windows Error Reporting
+ dialog. [ruby-core:45389] [Bug #6535]
- * io.c (rb_io_modenum_mode): do not use external output buffer.
+Mon Jun 4 19:36:25 2012 Tanaka Akira <akr@fsij.org>
- * string.c (rb_str_justify): differ pointer retrieval to prevent
- padding string modification. [ruby-dev:24434]
+ * process.c (rb_exec_fillarg): allocate one more element before
+ beginning in argv_str for try_with_sh.
- * range.c (range_each_func): allow func to terminate loop by
- returning RANGE_EACH_BREAK.
+ * internal.h (ARGVSTR2ARGC): adjust for the above change.
+ (ARGVSTR2ARGV): ditto.
- * range.c (member_i): use RANGE_EACH_BREAK. [ruby-talk:114959]
+Mon Jun 4 19:17:06 2012 Tanaka Akira <akr@fsij.org>
-Mon Oct 4 14:04:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h (ARGVSTR2ARGC): defined.
+ (ARGVSTR2ARGV): defined.
- * io.c (rb_file_open_internal, rb_io_reopen): fname might be altered
- while GC. [ruby-dev:24408]
+ * process.c (proc_exec_v): use ARGVSTR2ARGV.
+ (rb_spawn_process): use ARGVSTR2ARGC and ARGVSTR2ARGV.
-Mon Oct 4 12:53:45 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * io.c (pipe_open): use ARGVSTR2ARGV.
- * ext/tk/lib/tk/optiondb.rb: support definition of command
- resources on widgets
+Mon Jun 4 16:13:00 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk/image.rb: bug fix
+ * vm_insnhelper.h: remove magical code "lfp[0] & 0x02".
+ Current VM doesn't use this bit.
-Sun Oct 3 21:20:03 2004 Shugo Maeda <shugo@ruby-lang.org>
+ * vm_core.h (RUBY_VM_GET_BLOCK_PTR): added.
- * lib/net/imap.rb (TEXT_REGEXP): allow 8-bit characters for the german
- version of Microsoft Exchange Server. (backported from HEAD)
+ * eval.c (rb_block_given_p): use RUBY_VM_GET_BLOCK_PTR().
- * lib/net/imap.rb (RTEXT_REGEXP): ditto.
+ * vm_eval.c (rb_f_block_given_p): ditto.
- * lib/net/imap.rb (CTEXT_REGEXP): ditto.
+Mon Jun 4 15:39:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Oct 2 20:34:22 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (constat_apply): apply VT100 functions.
+ [ruby-core:44958] [Feature #6418]
- * node.h (NEW_DVAR): extra semicolon.
+ * win32/win32.c (constat_parse): parse some VT100 escape sequence.
-Sat Oct 2 00:42:20 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jun 4 14:06:12 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * marshal.c (r_byte): retrieve pointer from string value for each
- time. [ruby-dev:24404]
+ * process.c (rb_exec_err): should preserve errno.
- * marshal.c (r_bytes0): ditto.
+Mon Jun 4 13:10:11 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * enum.c (sort_by_i): re-entrance check added. [ruby-dev:24399]
+ * test/dl/test_c_{struct_entry,union_entity}.rb: broken require.
- * io.c (io_read): should freeze all reading buffer.
- [ruby-dev:24400]
+Mon Jun 4 12:01:21 2012 Koichi Sasada <ko1@atdot.net>
- * string.c (rb_str_sum): should use bignums when bits is greater
- than or equals to sizeof(long)*CHAR_BITS. [ruby-dev:24395]
+ * test/ruby/test_backtrace.rb: fix test.
+ Windows path includes `:' character.
- * eval.c (specific_eval): defer pointer retrieval to prevent
- unsafe sourcefile string modification. [ruby-dev:24382]
+Mon Jun 4 11:42:39 2012 Koichi Sasada <ko1@atdot.net>
- * eval.c (specific_eval): defer pointer retrieval to prevent
- unsafe sourcefile string modification. [ruby-dev:24382]
+ * vm_core.h (rb_location_t): fix type and field name.
+ (1) rename rb_location_t to rb_iseq_location_t.
+ (2) rename field names of rb_iseq_location_t to adjust
+ RubyVM::Backtrace::Location methods.
+ (2-1) filename -> path
+ (2-2) filepath -> absolute_path
+ (2-3) basename -> base_label
+ (2-4) name -> label
+ (3) rename filed name rb_iseq_location_t#line_no to
+ rb_iseq_location_t#first_lineno to clear purpose of this field.
+ (4) The field names rb_binding_t#(filename|line_no) are also renamed
+ to rb_binding_t#(path|first_lineno).
- * string.c (rb_str_sum): wrong cast caused wrong result.
- [ruby-dev:24385]
+ * compile.c: apply above changes.
- * enum.c (enum_sort_by): hide temporary array from
- ObjectSpace.each_object. [ruby-dev:24386]
+ * iseq.c: ditto.
- * string.c (rb_str_sum): check was done with false pointer.
- [ruby-dev:24383]
+ * proc.c: ditto.
- * string.c (rb_str_sum): string may be altered. [ruby-dev:24381]
+ * vm*.c: ditto.
-Mon Oct 11 17:51:34 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jun 4 11:40:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (rb_io_popen): get mode string via rb_io_flags_mode() to
- avoid mode string modification. [ruby-dev:24454]
+ * marshal.c (r_object0): also load TYPE_USRMARSHAL, TYPE_DATA using
+ compatible loader.
- * io.c (rb_io_getline_fast): should take delim as unsigned char to
- distinguish EOF and '\377'. [ruby-dev:24460]
+Mon Jun 4 11:33:42 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * io.c (rb_io_getline): add check for RS modification.
- [ruby-dev:24461]
+ * process.c (rb_run_exec_options_err): restore save_env() call for
+ non-fork environments.
- * enum.c (enum_sort_by): use qsort() directly instead using
- rb_iterate(). [ruby-dev:24462]
+ * process.c (rb_exec_err): restore environments after the failure of
+ exec to fix [ruby-core:44093] [Bug #6249] on non-fork environments
- * enum.c (enum_each_with_index): remove rb_gc_force_recycle() to
- prevent access to recycled object (via continuation for
- example). [ruby-dev:24463]
+Mon Jun 4 10:42:04 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Oct 1 11:40:14 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * io.c (pipe_open): follow up changes in r35889.
- * eval.c (rb_f_eval): defer pointer retrieval to prevent unsafe
- sourcefile string modification. [ruby-dev:24373]
+ * process.c (proc_spawn_n): now uses char ** instead of VALUE *.
- * io.c (io_read): block string buffer modification during
- rb_io_fread() by freezing it temporarily. [ruby-dev:24366]
+ * process.c (rb_spawn_process): prog is now VALUE of String, not char *.
- * io.c (rb_io_s_popen): mode argument may be altered.
- [ruby-dev:24375]
+Mon Jun 4 06:12:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * file.c (rb_file_s_basename): ext argument may be altered.
- [ruby-dev:24377]
+ * marshal.c (r_object0): remove old warning for _alloc.
- * enum.c (enum_sort_by): use NODE instead of 2 element arrays.
- [ruby-dev:24378]
+Mon Jun 4 04:24:06 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * string.c (rb_str_chomp_bang): StringValue() may change the
- receiver. [ruby-dev:24371]
+ * marshal.c: experimental test aborted.
+ * complex.c: ditto.
+ * rational.c: ditto.
+ * include/ruby/intern.h: ditto.
-Fri Oct 1 11:25:20 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Mon Jun 4 00:45:18 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/grid.rb: revive TkGrid.grid
+ * process.c (rb_spawn_process): fix for Windows. not tested.
- * ext/tk/lib/tk/pack.rb: revive TkPack.pack
+Mon Jun 4 00:11:51 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/place.rb: revive TkPlace.place
+ * process.c (rb_proc_exec_e): don't use ISSPACE(). \f, \r and \v
+ are not word separator in Bourne shell.
-Thu Sep 30 00:50:44 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sun Jun 3 23:47:30 2012 Tanaka Akira <akr@fsij.org>
- * ext/tcltklib/tcltklib.c (ip_init): bug fix
+ * include/ruby/intern.h (rb_exec_arg): remove argc and argv fields.
+ add use_shell, argv_str and argv_buf fields.
- * ext/tk/tkutil.c (get_eval_string_core): accept a Regexp object
+ * process.c (rb_proc_exec_e): don't split shell command line arguments
+ here to avoid memory allocation in a child process.
+ (rb_exec_fillarg): split shell command line arguments here.
+ (proc_exec_v): takes argv_str argument instead of argv.
+ (rb_proc_exec_ne): removed.
+ (rb_proc_exec_n): removed.
+ (rb_run_exec_options_err): don't initialize the removed fields.
+ (rb_exec_err): don't initialize the removed fields.
+ call proc_exec_v directly instead of rb_proc_exec_ne.
+ (rb_spawn_process): use use_shell field.
- * ext/tk/lib/multi-tk.rb: fix bug on 'exit' operation
+Sun Jun 3 21:53:00 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/lib/tk/text.rb: 'tksearch' accepts a Regexp object as a
- matting pattern argument
+ * GPL: update text of GPLv2. [ruby-core:44488] [Bug #6328]
+ http://www.gnu.org/licenses/gpl-2.0.txt
-Wed Sep 29 10:58:07 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jun 3 21:22:52 2012 Tanaka Akira <akr@fsij.org>
- * enum.c (sort_by_i): internally used object must not be changed
- outside. [ruby-dev:24368]
+ * process.c (rb_exec_getargs): remove rb_exec_arg argument.
-Mon Sep 27 13:46:45 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jun 3 21:14:26 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * intern.h, struct.c (rb_struct_s_members, rb_struct_members): public
- accessors. [ruby-dev:24342]
+ * marshal.c: calls directly rb_{Complex,Rational}_marshal_load().
+ But now disabled. [experimental]
+ * complex.c: followed the above.
+ * rational.c: ditto.
+ * include/ruby/intern.h: ditto.
- * marshal.c (w_object, r_object0): use accessors.
+Sun Jun 3 21:18:17 2012 Tanaka Akira <akr@fsij.org>
-Mon Sep 27 09:14:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (rb_check_argv): use rb_str_new_frozen instead of
+ rb_str_new4.
- * ext/socket/socket.c (s_accept): don't retry for EWOULDBLOCK.
- [ruby-talk:113807]
+Sun Jun 3 20:10:52 2012 Tanaka Akira <akr@fsij.org>
-Fri Sep 24 16:09:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (rb_proc_exec_e): extended version of rb_proc_exec() to
+ call execle().
+ (rb_proc_exec): use rb_proc_exec_e().
+ (rb_exec_err): use rb_proc_exec_e().
- * eval.c (proc_invoke): propagate DVAR_DONT_RECYCLE on termination
- to avoid double call to rb_gc_force_recycle(). [ruby-dev:24311]
+Sun Jun 3 19:47:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Sep 24 08:29:45 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread.c (vm_living_thread_num): suppress a warning.
- * array.c (rb_ary_subseq): original object might be modified after
- sharing data creation. [ruby-dev:24327]
+Sun Jun 3 17:23:52 2012 Tanaka Akira <akr@fsij.org>
- * array.c (rb_ary_replace): ditto.
+ * use execve() to preserve environment variables when exec method is
+ failed. [ruby-core:44093] [ruby-trunk - Bug #6249]
- * array.c (ary_make_shared): freeze shared array. [ruby-dev:24325]
+ * include/ruby/intern.h (rb_exec_arg): add envp_str and envp_buf field
+ to store envp of execve().
- * struct.c (struct_members): always check struct size and size of
- members list in the class. [ruby-dev:24320]
+ * process.c (proc_exec_v): takes envp_str as an argument and use it
+ for execve().
+ (rb_proc_exec_ne): extended version of rb_proc_exec_n().
+ (rb_proc_exec_n): use rb_proc_exec_ne().
+ (rb_proc_exec): follow proc_exec_v() change.
+ (fill_envp_buf_i): new function.
+ (rb_exec_arg_fixup): set up envp_str and envp_buf.
+ (save_env_i): removed.
+ (save_env): removed.
+ (rb_run_exec_options_err): don't modify environment variables.
+ (rb_exec_err): use rb_proc_exec_ne().
-Thu Sep 23 09:29:14 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Jun 3 16:33:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_sub_bang): check if string is not modified
- during iteration. [ruby-dev:24315]
+ * marshal.c: revert r35879 "now marshal_{load|dump} are external."
- * hash.c (rb_hash_rehash): replace st_foreach() by its deep
- checking counterpart. [ruby-dev:24310]
+ * complex.c (nucomp_marshal__{dump,load}): should use rb_marshal_{dump,load}.
-Wed Sep 22 13:38:12 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * rational.c (nurat_marshal__{dump,load}): ditto.
- * hash.c (rb_hash_rehash): add iteration check. [ruby-dev:24301]
+Sun Jun 3 14:13:58 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * st.c (st_foreach): add deep check.
+ * ext/date/date_core.c: checks whether the object is frozen or not.
-Wed Sep 22 13:06:14 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Jun 3 14:00:51 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * win32/win32.c (rb_w32_call_handler): workaround for Ctrl-C.
- merge from HEAD.
+ * complex.c: wrote Complex#_dump and Complex::load. But now
+ disabled (due to compatibility) [experimental].
-Wed Sep 22 00:11:12 2004 Dave Thomas <dave@pragprog.com>
+ * rational.c: wrote Rational#_dump and Rational::load. ditto.
- * process.c: Add documentation for fork()
+Sun Jun 3 10:23:32 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Wed Sep 22 09:04:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * complex.c (nucomp_marshal_load): [ruby-core:45394]
+ * rational.c (nurat_marshal_load): ditto.
- * array.c (rb_ary_collect_bang): element size might change during
- comparison. [ruby-dev:24300]
+Sun Jun 3 03:15:46 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * array.c (rb_ary_reject_bang): ditto. [ruby-dev:24300]
+ * regparse.c (onig_number_of_names): suppress a warning.
- * array.c (rb_ary_eql): ditto. [ruby-dev:24300]
+Sun Jun 3 01:36:52 2012 Koichi Sasada <ko1@atdot.net>
-Tue Sep 21 18:29:49 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_backtrace.c: change names.
+ (1) Class name: RubyVM::FrameInfo -> RubyVM::Backtrace::Location.
+ (2) Method name: RubyVM::FrameInfo.caller ->
+ Kernel.caller_locations.
+ (3) Instance methods of
+ RubyVM::FrameInfo (RubyVM::Backtrace::Location)
+ (3-1) name -> label
+ (3-2) basename -> base_label (basename is confusing with
+ File.basename)
+ (3-3) line_no -> lineno (We have already similar name
+ File#lineno, commented by kou [ruby-dev:45686]).
+ (3-4) filename -> path.
+ (3-5) filepath -> absolute_path.
+ (3-5) iseq -> removed (we will make other APIs to access iseq
+ and other information of frame for debugging).
- * array.c (rb_ary_equal): merge miss.
+ * test/ruby/test_backtrace.rb: apply above changes.
+ And apply comment from kou [ruby-dev:45686].
- * array.c (rb_ary_uniq_bang): element size might change during
- comparison. [ruby-dev:24298]
+Sun Jun 3 00:49:11 2012 Koichi Sasada <ko1@atdot.net>
-Mon Sep 20 00:24:19 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * common.mk: fix to build vm_backtrace.c only itself (vm_backtrace.c
+ is no longer included from vm.c). I hope this separation reduce
+ compile time of vm.c.
- * enum.c (enum_sort_by): do not use qsort directly. use
- rb_ary_sort_bang() instead. [ruby-dev:24291]
+ * internal.h: ditto.
- * enum.c (enum_sort_by): pedantic type check added.
- [ruby-dev:24291]
+ * vm.c, vm_core.h, vm_dump.c, vm_eval.c: ditto.
- * hash.c (rb_hash_foreach_iter): check iter_lev after each
- iteration. [ruby-dev:24289]
+ * vm_eval.c: some functions (callee, etc) moved to vm_backtrace.c.
- * array.c (rb_ary_and): element size might change during
- comparison. [ruby-dev:24290]
+Sun Jun 3 00:20:53 2012 Koichi Sasada <ko1@atdot.net>
- * array.c (rb_ary_or): ditto. [ruby-dev:24292]
+ * vm_backtrace.c: added. Separate backtrace related functions to
+ this file.
- * array.c (rb_ary_equal): wrong fix. [ruby-dev:24286]
+ * vm.c, common.mk: ditto.
-Sat Sep 18 15:02:22 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Jun 2 18:09:02 2012 Akinori MUSHA <knu@iDaemons.org>
- * array.c (rb_ary_equal): element size might change during
- comparison. [ruby-dev:24254]
+ * lib/ipaddr.rb: Inhibit zero-filled octets in an IPv4 address in
+ all platforms. [ruby-dev:45671]
- * array.c (rb_ary_diff): ditto. [ruby-dev:24274]
+ * lib/ipaddr.rb: Allow the x:x:x:x:x:x:d.d.d.d form not limited to
+ IPv4 mapped/compatible addresses. This change also makes it
+ possible for the parser to understand IPv4 mapped and compatible
+ IPv6 addresses in non-compressed form.
- * array.c (rb_ary_select): ditto. [ruby-dev:24278]
+ * lib/ipaddr.rb: Stop exposing IPSocket.valid*? methods which were
+ only usable on non-IPv6-ready platforms.
- * array.c (rb_ary_delete): ditto. [ruby-dev:24283]
+Sat Jun 2 16:59:00 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * array.c (rb_ary_rindex): ditto. [ruby-dev:24275]
+ * string.c (rb_enc_cr_str_buf_cat): don't reset coderange as unknown.
+ the condition 'ptr_a8 && str_cr != ENC_CODERANGE_7BIT' means not
+ unknown, str is also ASCII-8BIT because str_encindex == ptr_encindex,
+ and nont (str_cr == ENC_CODERANGE_UNKNOWN) and
+ str_cr != ENC_CODERANGE_7BIT means str_cr is valid because ASCII-8BIT
+ can't be broken. [ruby-dev:45688] [Bug #6509]
- * array.c (rb_ary_initialize): element size might change during
- initializing block. [ruby-dev:24284]
+Sat Jun 2 07:04:48 2012 Eric Hodel <drbrain@segment7.net>
-Sat Sep 18 14:10:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * doc/re.rdoc (Performance): Replaced incorrect example of reducing
+ backtracking through anchoring with reduced backtracking through a
+ range. [ruby-trunk - Bug #6525]
- * dir.c (dir_s_chdir): avoid memory leak and unnecessary chdir to
- the original directory when exception has caused in changing
- direcotry or within block. thanks to Johan Holmberg
- <holmberg@iar.se> [ruby-core:03446]
+Sat Jun 2 06:34:15 2012 Eric Hodel <drbrain@segment7.net>
-Fri Sep 17 20:20:27 2004 Minero Aoki <aamine@loveruby.net>
+ * doc/re.rdoc (Performance): Removed useless sample output from final
+ performance example and switched from #match to #=~ for consistency.
+ [ruby-trunk - Bug #6524]
- * lib/fileutils.rb (mkdir_p): backport from CVS HEAD 1.45. [ruby-core:03420]
+Fri Jun 1 09:30:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Sep 17 17:11:08 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * object.c (class_or_module_required): extract check for class or
+ module.
- * array.c (rb_ary_delete): element comparison might change array
- size. [ruby-dev:24273]
+Fri Jun 1 08:50:47 2012 Eric Hodel <drbrain@segment7.net>
- * file.c (rb_file_truncate): clear stdio buffer before truncating
- the file. [ruby-dev:24191]
+ * array.c: Updated Array documentation formatting. Patch by Zachary
+ Scott. [ruby-trunk - Feature #6517]
- * ext/digest/digest.c: use rb_obj_class() instead of CLASS_OF
- which might return singleton class. [ruby-dev:24202]
+Fri Jun 1 06:57:10 2012 Eric Hodel <drbrain@segment7.net>
-Fri Sep 17 16:07:09 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/dl/lib/dl/struct.rb (DL::CStructEntity#set_ctypes): Refactored
+ #set_ctypes using newer ruby features to simplify its implementation.
+ * test/dl/test_c_struct_entry.rb (class DL): Test to verify
+ refactoring.
- * ext/tk/lib/multi-tk.rb: improve exit operation
+Fri Jun 1 06:40:25 2012 Eric Hodel <drbrain@segment7.net>
-Fri Sep 17 15:01:57 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * object.c (Init_Object): Restored Kernel documentation based on
+ Pickaxe book documentation. Patch by Zachary Scott.
+ [ruby-trunk - Feature #6521]
- * ext/tcltklib/tcltklib.c: fix SEGV when (thread_)vwait or
- (thread_)tkwait
+Fri Jun 1 06:29:42 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/lib/tk.rb: add alias wait_window to wait_destroy
+ * object.c (rb_equal): Let Object be a link in #=== documentation.
+ Patch by Zachary Scott. [ruby-trunk - Feature #6518]
- * ext/tk/lib/multi-tk.rb: support calling 'mainloop' on slave
- interpreters (however, the 'real' eventloop must be run on the
- Default Master IP)
+Thu May 31 09:27:06 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/lib/remote-tk.rb: follow the changes of ext/tk/lib/multi-tk.rb
+ * ext/dl/lib/dl/struct.rb (DL::CStructEntity::size): Refactored ::size
+ to remove unused variables and simplify using newer ruby features.
+ * test/dl/test_c_struct_entry.rb: Test to validate refactoring
- * ext/tk/sample/remote-ip_sample2.rb: ditto
+Thu May 31 08:40:34 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/sample/tkoptdb-safeTk.rb: ditto
+ * ext/dl/lib/dl/struct.rb (DL::CUnionEntity#set_ctypes): Refactored
+ #set_types to reuse DL::CUnionEntity::size
+ * test/dl/test_c_union_entity.rb: Added test
-Thu Sep 16 18:12:32 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu May 31 08:20:14 2012 Eric Hodel <drbrain@segment7.net>
- * lib/webrick/cgi.rb (WEBrick::CGI#start): should set REMOTE_USER
- to request.user attribute.
+ * ext/dl/lib/dl/struct.rb (DL::CUnionEntity::size): Fixed ::size to
+ return the size of the union.
+ * test/dl/test_c_union_entity.rb: Test for DL::CUnionEntity::size
- * lib/webrick/httpservlet/filehandler.rb
- (WEBrick::HTTPServlet::FileHandler#initialize): should expand
- the pathname of document root directory.
+Thu May 31 07:45:43 2012 Eric Hodel <drbrain@segment7.net>
-Thu Sep 16 15:49:28 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/dl: Added documentation. Patch by Vincent Batts.
+ [ruby-trunk - Bug #6496]
- * string.c (rb_str_intern): protect string argument from GC.
- [ruby-core:03411]
+Wed May 30 16:30:00 2012 Kenta Murata <mrkn@cookpad.com>
-Wed Sep 15 20:22:23 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/bigdecimal/lib/bigdecimal/jacobian.rb,
+ ext/bigdecimal/lib/bigdecimal/newton.rb:
+ fix documentation comments.
+ Patch by alperakgun from github.com/shyouhei/ruby/pull/8
- * ext/tk/sample/tkoptdb-safeTk.rb: fix a bug depend on the changes
- of MultiTkIp
+Wed May 30 16:20:00 2012 Kenta Murata <mrkn@cookpad.com>
-Tue Sep 14 23:54:11 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/bigdecimal/lib/bigdecimal/jacobian.rb (Jacobian#dfdxi):
+ fix jacobian to get stuck in an infinite loop when a solution is not
+ found due to forget to increment nRetry counter.
+ Patch by alperakgun from github.com/shyouhei/ruby/pull/8
- * ext/tk/lib/multi-tk.rb: MultiTkIp#eval_string was en-bugged by
- the previous changes.
+Wed May 30 10:58:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Sep 14 23:45:44 2004 Dave Thomas <dave@pragprog.com>
+ * time.c (utc_offset_arg): utc offset can be precision in seconds.
+ e.g. old Europe/Lisbon (c.f. [ruby-dev:40066])
- * lib/rdoc/ri/ri_formatter.rb (RI::TextFormatter::TextFormatter.for):
- Add Eric Hodel's simpleformatter.
+Wed May 30 06:20:29 2012 Eric Hodel <drbrain@segment7.net>
-Tue Sep 14 16:59:37 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * error.c (exc_set_backtrace): Updated documentation to indicate
+ set_backtrace allows a string as well as an array of strings.
+ [ruby-trunk - Bug #6501]
- * ext/tcltklib/tcltklib.c: fix SEGV
+Tue May 29 17:28:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/multi-tk.rb: improve safe-level handling of argument proc
+ * strftime.c (rb_strftime_with_timespec): support GNU extension triple
+ colons modifier. [EXPERIMENTAL]
- * ext/tk/sample/multi-ip_sample.rb: rename of old 'safe-tk.rb'
+ * strftime.c (rb_strftime_with_timespec): check conversion with locale
+ modifier.
- * ext/tk/sample/safe-tk.rb: new sample script
+ * strftime.c (rb_strftime_with_timespec): colons are valid only for
+ 'z' and must come just before it.
-Tue Sep 14 00:15:15 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Mon May 28 16:56:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/zlib/zlib.c: backported from HEAD.
+ * lib/test/unit.rb (Test::Unit::Runner#_prepare_run): StatusLineOutput
+ needs job_status to be :replace.
-Mon Sep 13 19:16:33 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Mon May 28 13:35:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (blk_copy_prev): need frame_dup(). [ruby-dev:24103]
+ * common.mk (do-install-*): fix dependencies. based on the patch by
+ nagachika at [ruby-dev:45683]. [Bug #6506]
-Mon Sep 13 16:23:27 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Mon May 28 12:03:04 2012 Narihiro Nakamura <authornari@gmail.com>
- * ext/tk/lib/multi-tk.rb: MultiTkIp.new_master and new_slave accept
- safe-level value argument
+ * gc.c (obj_free): doesn't free a method table if it doesn't
+ exist. [ruby-dev:44436]
+ * test/ruby/test_gc.rb (class TestGc): added the test case for
+ this issue.
-Mon Sep 13 10:20:45 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun May 27 23:37:48 2012 Koichi Sasada <ko1@atdot.net>
- * object.c (nil_inspect): fix typo.
+ * benchmark/bm_vm1_lvar_init.rb: added.
+ This benchmark measures a initialize time of non-used variable.
-Mon Sep 13 01:03:02 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * benchmark/bm_vm1_lvar_set.rb: added.
+ This benchmark measures a local variables initialization time.
- * ext/tcltklib/tcltklib.c: improve control of preserv/release tcltkip
+ * benchmark/bm_vm2_bigarray.rb: added.
+ This benchmark mesures a big array literal creation time.
- * ext/tcltklib/tcltklib.c: store original 'exit' command
+ * benchmark/bm_vm2_bighash.rb: added.
+ This benchmark mesures a big hash literal creation time.
- * ext/tk/tkutil.c: fix(?) SEGV
+ * benchmark/bm*: change notation "i=0" to "i = 0".
-Sun Sep 12 23:46:23 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sun May 27 13:33:26 2012 Koichi Sasada <ko1@atdot.net>
- * util.c (ruby_strdup): remove unnecessary code. (xmalloc never
- returns NULL.)
+ * benchmark/driver.rb: fix to continue benchmarks when
+ an error is occurred.
- * util.c (ruby_getcwd): fix memory leak on failure.
+Sun May 27 11:27:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Sep 12 02:41:58 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/test/unit.rb (Test::Unit::Runner#_prepare_run): fix operator
+ precedence, so that platform and TERM should be counted.
- * ext/tcltklib/tcltklib.c: add TclTkIp#allow_ruby_exit? and
- allow_ruby_exit=
+Sun May 27 10:02:33 2012 Tadayoshi Funaba <tadf@dotrb.org>
+ * ext/date/date_strftime.c: allows %Ok and %Ol.
- * ext/tk/lib/multi-tk.rb: ditto.
+Sun May 27 09:29:20 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/tk/lib/remote-tk.rb: ditto.
+ * ext/date/date_core.c: modified doc.
- * ext/tcltklib/MANUAL.euc: ditto.
+Sat May 26 19:04:34 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/tcltklib/MANUAL.eng: ditto.
+ * ext/date/date_core.c: added description.
- * ext/tcltklib/tcltklib.c: fix some reasons of SEGV
+Sat May 26 18:14:57 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/tk/tkutil.c: ditto.
+ * ext/date/date_strftime.c: reduced the code.
- * ext/tk/lib/multi-tk.rb: ditto.
+Sat May 26 18:08:59 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/tk/lib/tk/timer.rb: ditto.
+ * time.c: modified doc.
+ * ext/date/date_core.c: ditto.
-Sat Sep 11 16:09:46 2004 Dave Thomas <dave@pragprog.com>
+Sat May 26 17:05:45 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rdoc/parsers/parse_rb.rb: Fix up cross-file class merging.
+ * vm.c (backtrace_*): change type of lev and n from size_t to int.
+ Also set type of rb_backtrace_t#backtrace_size to int.
+ A patch from nobu.
-Fri Sep 10 20:20:53 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * vm_eval.c: ditto.
- * ext/tcltklib/tcltklib.c (lib_merge_tklist): fix suspicious
- pointer conversion.
+Sat May 26 16:26:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Sep 10 02:43:54 2004 Dave Thomas <dave@pragprog.com>
+ * file.c (realpath_rec): UNC prefix does not end with path separator,
+ so new separator is needed after it.
- * lib/rdoc/generators/template/kilmer.rb: James Buck's
- patch for call-seq.
+Sat May 26 15:29:22 2012 Koichi Sasada <ko1@atdot.net>
-Thu Sep 9 13:58:56 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/ruby/test_backtrace.rb (test_caller_lev):
+ decrease recursion size.
- * ext/tcltklib/tcltklib.c (ip_init): change flag value for setting
- 'argv' and 'argv0' variable
+Sat May 26 13:50:48 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/remote-tk.rb: follow changes of multi-tk.rb
+ * NEWS: add Kernel#caller's second argument.
-Thu Sep 9 11:46:18 2004 Dave Thomas <dave@pragprog.com>
+Sat May 26 13:40:29 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_classes): Allow
- spaces aroun parameter to define_method_under (James Buck)
+ * vm.c (RubyVM::FrameInfo): add a class to access each frame
+ information. You don't need to parse strings from caller().
+ FrameInfo has the following methods:
+ FrameInfo#name: method name, class name, etc with decorations.
+ FrameInfo#basename: name without decorations.
+ FrameInfo#line_no: line number.
+ FrameInfo#filename: file name.
+ FrameInfo#filepath: full filepath.
+ FrameInfo#iseq: iseq if it is iseq frame (defined by ruby script)
+ FrameInfo#to_s: return caller() method style string.
+ RubyVM::FrameInfo.caller(n, lev) returns array of FrameInfo objects.
+ The name "RubyVM::FrameInfo.caller" is long and ambiguous (it is
+ confusing with Kernel::caller() method), we need to change the name
+ before Ruby 2.0 release. Good names or comments are welcome.
-Wed Sep 8 18:44:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_backtrace.rb: add a test for above change.
- * ext/stringio/stringio.c (strio_write): zero fill a gap if exsts.
- [ruby-dev:24190]
+Sat May 26 12:18:09 2012 Koichi Sasada <ko1@atdot.net>
-Wed Sep 8 15:19:49 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm.c (frame_info_to_str): add `break'.
- * ext/tcltklib/tcltklib.c (ip_init): cannot create a IP at level 4
+ * vm.c (backtrace_object): remove lev and n parameter.
+ backtrace_object always returns all of backtrace information.
- * ext/tk/lib/multi-tk.rb: improve 'exit' operation, security check,
- and error treatment
+ * vm.c (rb_backtrace_to_str_ary): fix to use backtrace_object().
+ This change improve performance of caller(lev, n).
- * ext/tk/lib/multi-tk.rb: allow a trusted slave IP to create slave IPs
+ * benchmark/bm_vm3_backtrace.rb: added to check above improvement.
+ FYI: measurement on my laptop, 1.9.3p229 needs 5.125 sec,
+ and current trunk only needs 0.299sec.
- * ext/tk/lib/tk/listbox.rb: add TkListbox#value, value=, clear, and
- erase
+Sat May 26 11:05:09 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk/text.rb: add TkText#clear and erase
+ * vm.c (rb_frame_info_t): keep previous ISEQ frame info for CFUNC
+ frame info. And fix to cache a calculated line_no of ISEQ frame
+ info.
-Tue Sep 7 15:17:49 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat May 26 09:54:53 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/socket/socket.c (ruby_connect): break immediately if a
- socket is non-blocking. [ruby-talk:111654]
+ * ext/openssl/ossl_ssl.c: Allow disabling client-side renegotiation.
+ * test/openssl/test_ssl.rb: Simple tests for this.
-Mon Sep 6 11:08:50 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ Client-side renegotiation is still considered problematic, even
+ when used in the context of secure renegotiation (RI, RFC 5746).
+ The changes allow users to either completely disable client
+ renegotiation on the server, or to specify a maximum number of
+ handshakes allowed in total. The number of total handshakes is
+ counted in a callback set as SSL_set_info_callback. If the
+ maximum number of handshakes is exceeded an error will be raised
+ We do not support renegotiation in the OpenSSL extension, therefore
+ this feature can only be tested externally.
+ The feature is opt-in, the default setting will be to allow
+ unlimited client renegotiation, as was the case before.
- * ext/tk/lib/tk/menu.rb(TkOptionMenubutton#insert): call correct method
+Fri May 25 23:38:58 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Mon Sep 6 11:00:47 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/openssl/test_ssl.rb: Clarify the intention of errors to be
+ expected. Two errors are possible when connection is refused due
+ to a protocol version that was explicitly disallowed,
+ OpenSSL::SSL::SSLError or Errno::ECONNRESET, depending on the
+ OpenSSL version in use.
- * dir.c (dir_s_chdir): the patch to shut up false warning when
- exception occurred within a block. a patch was given from Johan
- Holmberg <holmberg at iar.se>. [ruby-core:03292]
+Fri May 25 22:19:40 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Mon Sep 6 07:51:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/openssl/ossl_ssl.c: Revert r35583
+ * test/openssl/test_ssl.rb: Handle ECONNRESET in code instead to avoid
+ the test failing in Ruby CI [1]
- * eval.c (cvar_cbase): singletons should refer outer cvar scope.
- [ruby-dev:24223]
+ [1] http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20120507T190102Z.log.html.gz#test-all
- * eval.c (rb_load): should preserve previous ruby_wrapper value.
- [ruby-dev:24226]
+Fri May 25 19:51:36 2012 Koichi Sasada <ko1@atdot.net>
-Sat Sep 4 01:14:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_eval.c (rb_f_caller): caller() method accepts second optional
+ argument `n' which specify how many frames should return.
+ For example, `caller(0, 1)' returns only one frame information
+ which calls caller() method. If there are less than n frame
+ information, then all frame information are returned. If n is 0,
+ then always return [].
+ This fix is part of [ruby-dev:42345] [Ruby 1.9-Feature#3917].
+ However, performance and features are not enough.
+ RDoc is also not available.
- * eval.c (cvar_cbase): class variables cause SEGV in
- instance_eval() for fixnums and symbols. [ruby-dev:24213]
+ * test/ruby/test_backtrace.rb: add a test for above.
-Fri Sep 3 17:47:58 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri May 25 17:05:07 2012 Koichi Sasada <ko1@atdot.net>
- * struct.c (make_struct): remove redefining constant when
- conflict. [ruby-dev:24210]
+ * vm.c (oldbt_init, vm_backtrace_str_ary): arg->data should
+ be initialized before calling `backtrace_each()'.
-Fri Sep 3 11:31:44 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri May 25 16:11:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/lib/tk.rb: Tk.after makes TkCore::INTERP.tk_cmd_tbl grow
- [ruby-dev:24207]
+ * trunk/ext/-test-/printf/printf.c: change function names because of
+ conflict with msvcrt. fixed build error of mswin.
-Fri Sep 3 02:12:48 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri May 25 10:52:52 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tcltklib/tcltklib.c: fix typo [ruby-talk:111266]
+ * vm.c: refactoring backtrace related functions.
+ (1) unify similar functions (rb_backtrace_each() and
+ backtrace_object()). backtrace_each() is a unified function.
+ variation:
+ a) backtrace_object(): create backtrace object.
+ b) vm_backtrace_str_ary(): create bt as an array of string.
+ c) vm_backtrace_print(): print backtrace to specified file.
+ d) rb_backtrace_print_as_bugreport(): print backtrace on
+ bugreport style.
+ (2) remove rb_backtrace_each(). Use backtrace_each() instead.
+ (3) change the type of lev parameter to size_t.
+ a) lev == 0 means current frame (exception, etc use it).
+ b) lev == 1 means upper frame (caller(0) use it).
- * ext/tk/lib/tk/text.rb: fix typo
+ * vm_core.h, vm_dump.c, vm_eval.c: ditto.
- * ext/tk/lib/multi-tk.rb: improve safe-level treatment on slave IPs
+ * vm.c (backtrace_object(), vm_backtrace_str_ary()): fix to return a
+ correct size of caller(lev) array.
+ Let n be a "caller(0).size" then ln as caller(lev).size should be
+ (n - lev). However, the previous implementation returns a wrong
+ size array (ln > n - lev). [ruby-dev:45673]
-Fri Sep 3 01:54:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_backtrace.rb: add tests for backtrace.
- * ext/extmk.rb: already built-in libraries satisfy dependencies.
- [ruby-dev:24028]
+Fri May 25 08:51:39 2012 Eric Hodel <drbrain@segment7.net>
-Thu Sep 2 11:36:20 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * enum.c (enum_count): Enumerable#count no longer uses #size when
+ counting elements. Patch by Nobuhiro IMAI. [ruby-trunk - Bug #6473]
- * eval.c (rb_obj_instance_eval): backported from HEAD.
+Fri May 25 01:15:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Sep 1 21:18:25 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * sprintf.c (ruby__sfvextra): [EXPERIMENTAL] use inspect instead of
+ to_s if plus flag is given.
- * ext/tk/lib/tk/spinbox.rb: fix typo
+ * vsnprintf.c (BSD_vfprintf): pass sign flag.
-Tue Aug 31 18:24:04 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri May 25 00:37:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/tkutil.c (cbsubst_init): fix memory leak
+ * test/rubygems/test_gem_indexer.rb (setup, teardown): save @tempdir
+ to remove it properly. [Bug #5348]
- * ext/tk/tkutil.c (cbsubst_get_all_subst_keys): fix SEGV
+Thu May 24 23:36:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 31 16:04:22 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vsnprintf.c (BSD_vfprintf): [EXPERIMENTAL] object representation in
+ rb_enc_vsprintf(). [Feature #5896]
- * ext/tcltklib/tcltklib.c (ip_delete): when a tcltkip is deleted,
- destroy its root widget
+Thu May 24 15:33:01 2012 Koichi Sasada <ko1@atdot.net>
-Tue Aug 31 12:30:36 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm_method.c (rb_method_defined_by): removed.
+ nobu pointed out that rb_method_basic_definition_p() is enough
+ for last commit.
- * ext/tcltklib/tcltklib.c (del_root): fix SEGV
+ * error.c, eval_error.c: change for above.
-Mon Aug 30 23:11:06 2004 Dave Thomas <dave@pragprog.com>
+Thu May 24 14:30:13 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rdoc/ri/ri_driver.rb (and others): ri now merges documentation
- if it finds the same class in multiple places.
+ * vm.c: add RubyVM::Backtrace object (btobj).
+ Backtrace information contains an array consists of location
+ information for each frames by string.
+ RubyVM::Backtrace object is lightweight backtrace information,
+ which contains complete information to generate traditional style
+ backtrace (an array of strings) with faster generation.
+ If someone accesses to backtrace information via
+ Exception#backtrace, then convert a RubyVM::Backtrace object to
+ traditional style backtrace.
+ This change causes incompatibility on marshal dumped binary
+ of Exception. If you have any trouble on it, please tell us
+ before Ruby 2.0 release.
+ Note that RubyVM::Backtrace object should not expose Ruby level.
-Mon Aug 30 22:40:30 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * error.c, eval.c, vm_eval.c: ditto.
- * ext/tk/lib/multi-tk.rb: 'restart' method accepts arguments
+ * internal.h: ditto.
-Mon Aug 30 21:50:14 2004 Dave Thomas <dave@pragprog.com>
+ * eval_error.c: fix to skip "set_backtrace" method invocation in
+ creating an exception object if it call a normal set_backtrace
+ method (defined by core).
- * object.c: Add RDoc for Module.included.
+ * test/ruby/test_settracefunc.rb: fix for above change.
-Mon Aug 30 15:10:46 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * vm_method.c (rb_method_defined_by): added. This function
+ checks that the given object responds with the given method
+ by the given cfunc.
- * configure.in (GNU/k*BSD): fixed FTBFS on GNU/k*BSD. [ruby-dev:24051]
+ * benchmark/bm_vm2_raise1.rb, benchmark/bm_vm2_raise2.rb:
+ add to measure exception creation speed. raise1 create
+ exception objects from shallow stack frame. raise2 create
+ exception objects from deep stack frame.
-Mon Aug 30 11:29:35 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu May 24 12:07:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (CreateChild): strip trailing spaces. [ruby-dev:24143]
- merge from HEAD.
+ * io.c (io_strip_bom): check EOF. [Bug #6487][ruby-core:45203]
-Sun Aug 29 14:08:56 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed May 23 22:06:14 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tcltklib/tcltklib.c: compile error on bcc32 [ruby-dev:24081]
+ * lib/net/http/header.rb (Net::HTTPHeader#range): fix broken parser of
+ HTTP Range request. Old one can't parse invalid specs and multiple
+ specs correctly.
- * ext/tk/lib/multi-tk.rb: MultiTkIp#eval_string does not work
+Wed May 23 10:18:54 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Aug 28 23:04:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * win32/win32.c (finish_overlapped_socket, overlapped_socket_io):
+ replace ECONNABORTED to EPIPE in send, sendto and sendmsg to improve
+ BSD socket compatibility. this change removes a failure on the test
+ of net/ftp.
- * bignum.c (rb_big_and): protect parameters from GC.
- [ruby-talk:110664]
+Wed May 23 05:35:58 2012 Eric Hodel <drbrain@segment7.net>
-Thu Aug 26 04:38:29 2004 Dave Thomas <dave@pragprog.com>
+ * lib/net/http.rb: Broke up Net::HTTP into individual files.
+ [ruby-trunk - Feature #6435]
+ * lib/net/http/backward.rb: ditto.
+ * lib/net/http/response.rb: ditto.
+ * lib/net/http/exceptions.rb: ditto.
+ * lib/net/http/responses.rb: ditto.
+ * lib/net/http/generic_request.rb: ditto.
+ * lib/net/http/header.rb: ditto.
+ * lib/net/http/request.rb: ditto.
+ * lib/net/http/proxy_delta.rb: ditto.
+ * lib/net/http/requests.rb: ditto.
- * eval.c (return_jump): Minor typo in error message. Now reads
- "return can't jump across threads".
+Wed May 23 05:15:11 2012 Eric Hodel <drbrain@segment7.net>
-Tue Aug 24 17:30:00 2004 Shugo Maeda <shugo@ruby-lang.org>
+ * class.c (rb_mod_init_copy): Clear the cached inspect string of a
+ dup'd anonymous module or class. [ruby-trunk - Bug #6454]
+ * test/ruby/test_module.rb (class TestModule): ditto
- * lib/cgi/session.rb (CGI::Session::FileStore#initialize): do not
- use a session id as a filename. (backported from HEAD)
+Tue May 22 16:49:15 2012 Koichi Sasada <ko1@atdot.net>
- * lib/cgi/session/pstore.rb (CGI::Session::PStore#initialize): ditto.
+ * vm_core.h: add a data type rb_location_t to store iseq location
+ information.
+ rb_location_t#filename, filepath, name and line_no was moved from
+ rb_iseq_t. rb_location_t#basename is a new field which is
+ similar to `name' field without any decoration.
+ `name' field contains some decoration such as `block in foo'.
+ `basename' only contains `foo'.
+ rb_iseq_t contains memory object of rb_location_t.
- * lib/cgi/session/pstore.rb (CGI::Session::PStore#initialize): use
- Dir::tmpdir. (backported from HEAD)
+ * iseq.c: setup rb_location_t for each rb_iseq_t memory objects.
-Tue Aug 24 14:40:16 2004 Shugo Maeda <shugo@ruby-lang.org>
+ * compile.c, proc.c, vm.c, vm_dump.c, vm_eval.c, vm_insnhelper.c,
+ vm_method.c: support about it.
- * lib/cgi/session.rb (CGI::Session::FileStore#initialize): untaint
- session id after check. (backported from HEAD)
+Tue May 22 00:45:05 2012 Yusuke Endoh <mame@tsg.ne.jp>
-Tue Aug 24 09:09:01 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * struct.c (rb_struct_members): Refactoring. As Struct#members had
+ returned an array of String, the old code was needed to convert
+ Symbols to Strings. But it is almost unnecessary because the
+ method now returns an array of Symbols. A patch by Masaki
+ Matsushita <glass.saga at gmail dot com> [Feature #6218]
+ [ruby-dev:45451]
- * ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): d2i
- functions may replace the pointer indicated by the first argument.
+Mon May 21 19:20:25 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl_x509ext.c (ossl_x509ext_initialize): ditto.
+ * lib/net/ftp.rb (Net::FTP#retrbinary): close only if conn is not nil
+ because transfercmd may fail and return nil.
- * ext/openssl/ossl_x509name.c (ossl_x509name_initialize): ditto.
+ * lib/net/ftp.rb (Net::FTP#retrlines): ditto.
-Mon Aug 23 14:04:51 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon May 21 15:10:28 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/openssl/ossl_ssl.c (ossl_ssl_read):
- - should return an empty string if specified length to read is 0.
- - should check for pending data and wait for fd before reading.
- - call underlying IO's sysread if SSL session is not started.
- [ruby-dev:24072], [ruby-dev:24075]
+ * ext/syslog/syslog.c: Classify constants and macros into several
+ sub-modules. (Syslog::Priority, Syslog::Level, Syslog::Option
+ and Syslog::Macros)
- * ext/openssl/ossl_ssl.c (ossl_ssl_write):
- - call underlying IO's syswrite if SSL session is not started.
+ * ext/syslog/syslog.c (mSyslog_inspect): Use rb_sprintf().
- * ext/openssl/ossl_ssl.c (ossl_ssl_pending): new method
- OpenSSL::SSL#pending.
+ * ext/syslog/syslog.c (mSyslog_inspect): Make sure self is a
+ module before calling rb_class2name().
- * ext/openssl/lib/openssl/buffering.rb: should not use select.
+Mon May 21 12:44:11 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Mon Aug 23 12:40:56 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * .travis.yml (install): It seems tcl/tk is skipped in Travis
+ CI. Trying to fix the situation.
- * lib/resolv.rb (Config.default_config_hash): when multiple domains
- are set, Win32::Resolv.get_resolv_info returns Array.
+Mon May 21 12:11:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Aug 22 01:15:31 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * enc/depend (ENCOBJS): add dependencies.
- * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_connect):
- should call :ProxyContentHandler before finishing CONNECT.
+ * enc/make_encmake.rb (target_encodings): extract dependencies.
-Sat Aug 21 06:41:16 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon May 21 11:26:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tcltklib/extconf.rb (find_tcl, find_tk): find stub library.
+ * lib/net/ftp.rb (Net::FTP#transfercmd): rescue shutdown.
- * lib/mkmf.rb (arg_config, with_config): deal with '-' and '_'
- uniformly. [ruby-dev:24118]
+Sun May 20 23:00:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 19 16:29:45 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/extmk.rb (extmake): reopen $stdout to NULL, since setting
+ $stdout cannot affect child processes.
- * ext/tk/lib/tk.rb: Fail to treat a hash value of 'font' option.
+Sun May 20 21:36:39 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/lib/tk.rb: bindinfo cannot return '%' substiturion infomation.
+ * enc/shift_jis.c (code_to_mbclen): return
+ ONIGERR_INVALID_CODE_POINT_VALUE if the code is invalid.
- * ext/tk/lib/menu.rb: typo bug.
+ * string.c (tr_next): increment character until the code
+ is a valid character. [ruby-dev:45652] [Bug #6450]
-Thu Aug 19 15:15:24 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun May 20 12:25:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dir.c (free_dir): fix memory leak. reported by yamamoto
- madoka.
+ * Makefile.in (LIBRUBY_SO): link EXTSOLIBS too.
-Thu Aug 19 11:00:00 2004 Akiyoshi, Masamichi <masamichi.akiyoshi@hp.com>
+ * ext/extmk.rb (mf.macro): use EXTSOLIBS instead of SOLIBS to get rid
+ of discard libraries needed by default. [Bug #6462]
- * dln.c (dln_load): Modify to call lib$find_image_symbol for VMS.
- * io.c (rb_io_fwrite): Use fputc() for VMS non-stream file.
+Sat May 19 19:04:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 19 06:07:45 2004 why the lucky stiff <why@ruby-lang.org>
+ * ext/extmk.rb (command_output): ENCOBJS is needed for all linked
+ ruby, if --disable-shared and --with-static-linked-ext.
- * ext/syck/token.c: re2c no longer compiled with bit vectors. caused
- problems for non-ascii characters. [ruby-core:03280]
- * ext/syck/implicit.c: ditto.
- * ext/syck/bytecode.c: ditto.
+ * ext/extmk.rb (command_output): dmyext is needed as DLDOBJS if no
+ static linked extensions.
- * lib/yaml/baseemitter.rb: folding now handles double-quoted strings,
- fixed problem with extra line feeds at end of folding, whitespace
- opening scalar blocks.
+ * Makefile.in, common.mk (PROGRAM): no extension libraries.
- * lib/yaml/rubytypes.rb: subtelties in handling strings with
- non-printable characters and odd whitespace patterns.
+ * common.mk (build-ext): pass macros for libruby.so.
-Wed Aug 18 23:41:33 2004 Minero Aoki <aamine@loveruby.net>
+ * ext/extmk.rb (command_output): link extension libraries and encoding
+ libraries into libruby.so, not ruby executable.
- * lib/net/protocol.rb (rbuf_fill): OpenSSL::SSL::SSLSocket has its own
- buffer, select(2) might not work. [ruby-dev:24072]
+ * ext/extmk.rb (command_output): fold long macro lines.
-Wed Aug 18 17:10:12 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * Makefile.in (LIBEXT): add macro.
- * ext/tcltklib/stubs.c (ruby_tcltk_stubs): need to call
- Tcl_FindExecutable() for Tcl/Tk 8.4.
+ * configure.in (ENCOBJS, EXTOBJS): use LIBEXT, not hardcoded suffix.
-Wed Aug 18 12:52:55 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * Makefile.in (LIBRUBY_A): fix typo. re-applying r35242.
- * eval.c (rb_obj_instance_eval): evaluates under special singleton
- classes as for special constants.
+Sat May 19 04:46:53 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Aug 17 17:20:59 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/openssl/extconf.rb: Use Logging::message instead of message.
+ * ext/zlib/extconf.rb: ditto.
- * io.c (rb_io_reopen): should clear allocated OpenFile. pointed
- out by Guy Decoux. [ruby-core:03288]
+Fri May 18 18:13:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 17 01:36:32 2004 Dave Thomas <dave@pragprog.com>
+ * lib/mkmf.rb (MakeMakefile#configuration): keep space at end of
+ OUTFLAG and COUTFLAG. [ruby-dev:45650]
- * lib/rdoc/usage.rb: Remove extra indent. Tidy 'ri' option
- parsing so RDoc::usage plays better with OptionParser.
+Fri May 18 17:39:42 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Aug 14 13:09:10 2004 Minero Aoki <aamine@loveruby.net>
+ * thread_pthread.c (rb_thread_create_timer_thread): Added error
+ check when failing fcntl(). [Bug #6147] [ruby-dev:45364]
- * lib/fileutils.rb: backport from CVS HEAD (rev1.44).
+Fri May 18 17:41:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/fileutils.rb: cp_r should copy symlink itself, except cp_r
- root.
+ * ext/extmk.rb (extmake): link archives only, skip script only
+ extension libraries.
- * lib/fileutils.rb: new option mv :force.
+Fri May 18 17:25:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/fileutils.rb: new module FileUtils::DryRun.
+ * cont.c: bump up fiber machine stack size when running on 64bit
+ arch. [Bug #6344] [ruby-dev:45554]
-Sat Aug 14 02:48:16 2004 Dave Thomas <dave@pragprog.com>
+Fri May 18 15:20:56 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rdoc/usage.rb: Added. Allows command line programs
- to report usage using their initial RDoc comment.
+ * lib/uri/generic.rb (URI::Generic.build): duplicate args before adding
+ new items. (don't change arguments)
-Fri Aug 13 13:23:17 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/uri/generic.rb (URI::Generic.build): use URI::Generic::COMPONENT
+ if this method is called from URI::Generic.
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_range_header):
- fix regex for range-spec.
+ * lib/uri/generic.rb (URI::Generic.build2): escape only if the item is
+ a String.
- * lib/webrick/httpservlet/filehandler.rb
- (WEBrick::HTTPServlet::DefaultFileHandler#make_partial_content):
- multipart/byteranges response was broken.
+ * lib/uri/generic.rb (URI::Generic.build2): use DEFAULT_PARSER because
+ it doesn't have parser method. [Bug #6420]
- * lib/webrick/httpservlet/erbhandler.rb
- (WEBrick::HTTPServlet::ERBHandler#do_GET): should select media type
- by suffix of script filename.
+Fri May 18 15:54:07 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/xmlrpc/server.rb: refine example code.
+ * ext/zlib/extconf.rb: Use an exception instead of bare puts.
-Wed Aug 11 17:17:50 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Fri May 18 15:53:05 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * configure.in (RPATHFLAG): stop setting RPATHFLAG on Interix.
+ * ext/psych/extconf.rb: Use an exception instead of bare abort.
-Sun Aug 8 00:43:31 2004 why the lucky stiff <why@ruby-lang.org>
+Fri May 18 15:51:32 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/implicit.c: added sexagecimal float#base60.
+ * ext/fiddle/extconf.rb: Use an exception instead of bare abort.
- * ext/syck/rubyext.c (yaml_org_handler): ditto.
+Fri May 18 15:49:35 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/token.c: indentation absolutely ignored when processing flow
- collections. plain scalars are trimmed if indentation follows in
- an ambiguous flow collection.
+ * ext/readline/extconf.rb: Use an exception instead of bare exit.
-Sat Aug 7 00:50:01 2004 Tanaka Akira <akr@m17n.org>
+Fri May 18 15:38:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/zlib/zlib.c: Zlib::GzipReader#read(0) returns "" instead of nil.
+ * ext/ripper/extconf.rb: Use an exception instead of bare
+ Logging.message.
-Tue Aug 3 13:49:20 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri May 18 15:23:06 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/tk/lib/tk/namespace.rb: bug fix
+ * ext/openssl/extconf.rb: Clarify a message when hit Apple
+ OpenSSL issue.
- * ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: add Tk::TreeCtrl.loupe
+Fri May 18 15:14:32 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon Aug 2 18:04:21 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/extmk.rb: Show a message when extconf.rb raised an exception.
+ * ext/openssl/extconf.rb: Use exception raising instead of message
+ and/or abort. We want to display error message to console _and_
+ logging into mkmf.log.
- * ext/tk/lib/tk/msgcat.rb (set_translation): bug fix (fail to set
- trans_str to the same as src_str when trans_str is not given.)
+Fri May 18 06:14:07 2012 Eric Hodel <drbrain@segment7.net>
-Mon Aug 2 11:53:06 2004 Dave Thomas <dave@pragprog.com>
+ * ext/syslog/lib/syslog/logger.rb: Added Syslog::Logger which was
+ ported from the SyslogLogger gem. [ruby-trunk - Feature #5096]
+ * NEWS: ditto.
+ * test/syslog/test_syslog_logger.rb: ditto.
- * lib/rdoc/code_objects.rb (RDoc::Context::find_symbol): Fix infinite recursion
- looking up some top level symbols (batsman)
+Fri May 18 01:28:21 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Mon Aug 2 11:48:29 2004 Dave Thomas <dave@pragprog.com>
+ * ext/psych/parser.c (transcode_string): fix encoding index names.
+ Thanks markizko for reporting.
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_methods): Allow '.'s in
- variable names to support SWIG generated files (Hans Fugal)
+Thu May 17 23:03:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jul 31 17:40:16 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: fix function name to be checked, to initialize
+ rb_thread_cond_t properly.
- * misc/ruby-mode.el (ruby-expr-beg, ruby-parse-partial,
- ruby-calculate-indent, ruby-move-to-block, ruby-forward-sexp,
- ruby-backward-sexp): keywords must match word-wise.
+ * thread_pthread.c (native_cond_initialize, native_cond_destroy):
+ fix macro name.
-Sat Jul 31 05:47:37 2004 why the lucky stiff <why@ruby-lang.org>
+Thu May 17 12:53:07 2012 Yuki Yugui Sonoda <yugui@google.com>
- * lib/yaml.rb (YAML::load_file, YAML::parse_file): added.
+ * thread.c, thread_pthread.c: Moved pthread-specific preprocessor
+ hacks to thread_pthread.c
- * lib/yaml/rubytypes.rb: exceptions were using an older
- YAML.object_maker. [ruby-core:03080]
+Thu May 17 12:18:47 2012 Yuki Yugui Sonoda <yugui@google.com>
- * ext/syck/token.c (sycklex_yaml_utf8): using newline_len to
- handline CR-LFs. "\000" was showing up on folded blocks which
- stopped at EOF.
+ * io.c: Fix a mistake on merging the patch in the previous commit.
- * ext/syck/token.c: re2c compiled with bit vectors now.
- * ext/syck/implicit.c: ditto.
- * ext/syck/bytecode.c: ditto.
+Thu May 17 11:33:07 2012 Yuki Yugui Sonoda <yugui@google.com>
-Fri Jul 30 16:10:54 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ Imports Ruby's port to NativeClient (a.k.a NaCl).
+ Patch by Google Inc. [ruby-core:45073].
- * ext/tcltklib/tcltklib.c (lib_fromUTF8_core): raise ArgumentError when
- the unknown encoding name is given.
+ * configure.in (RUBY_NACL): New M4 func to configure variables for
+ NaCl.
+ (RUBY_NACL_CHECK_PEPPER_TYPES): New M4 func to check the old names
+ of Pepper interface types.
+ (BTESTRUBY): New variable to specify which ruby should be run on
+ "make btest". NaCl can run the built binary by sel_ldr, but it need
+ rbconfig.rb. So this variable is distinguished from $MINIRUBY.
- * ext/tcltklib/tcltklib.c (lib_toUTF8_core): ditto.
+ * thread_pthread.c: Disabled some features on NaCl.
- * ext/tk/lib/tk.rb (Tk::Encoding.encoding_convertfrom): bug fix.
+ * io.c: ditto.
- * ext/tk/lib/tk.rb (Tk::Encoding.encoding_convertto): ditto.
+ * process.c: ditto.
-Wed Jul 28 18:59:17 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * signal.c: ditto.
- * lib/cgi.rb (CGI::initialize): remove at_exit code for CGI_PARAMS
- and CGI_COOKIES. they will no longer be used.
+ * file.c: ditto.
-Wed Jul 28 01:04:44 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * missing/flock.c: ditto.
- * gc.c (run_final): wrong order of data. [ruby-dev:23984]
+ * nacl/pepper_main.c: An example implementation of Pepper application
+ that embeds Ruby.
-Tue Jul 27 07:05:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * nacl/example.html: An example of web page that uses the Pepper
+ application.
- * eval.c (rb_eval): copy on write for argument local variable
- assignment.
+ * nacl/nacl-config.rb: Detects variants of NaCl SDK.
- * eval.c (assign): ditto.
+ * nacl/GNUmakefile.in: Makefile template for NaCl specific build
+ process.
- * eval.c (rb_call0): update ruby_frame->argv with the default
- value used for the optional arguments.
+ * nacl/package.rb: script for packaging a NaCl-Ruby embedding
+ application.
- * object.c (Init_Object): "===" calls rb_obj_equal() directly.
- [ruby-list:39937]
+ * nacl/reate_nmf.rb: Wrapper script of create_nmf.py
-Mon Jul 26 11:22:55 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * dln.c (dln_load): Added a hack to call on NaCl.
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.escape): should
- escape space.
+ * util.c (ruby_getcwd): Path to the current directory is not available
+ on NaCl.
-Sun Jul 25 11:05:21 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu May 17 10:54:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.{h,c} (rb_w32_{f,fd,fs}open): workaround for bcc32's
- {f,fd,fs}open bug. set errno EMFILE and EBADF. [ruby-dev:23963]
+ * ext/tk/extconf.rb: add -l options to $libs not $LDFLAGS,
+ to be passed to EXTLIBS in exts.mk.
-Sat Jul 24 13:32:47 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * enc/encinit.c.erb: use %-lines to adjust indent in the generated file.
- * range.c (rb_range_beg_len): returns Qnil only when "beg" points
- outside of a range. No boundary check for "end".
+ * lib/mkmf.rb (MakeMakefile#have_framework): combine -framework option
+ and its argument with an equal sign not to be separated in merge_libs.
-Fri Jul 23 16:40:25 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/tk/extconf.rb: ditto.
- * gc.c (define_final): should not disclose NODE* to Ruby world.
- [ruby-dev:23957]
+ * ext/extmk.rb: EXTLDFLAGS also needs to be passed.
-Fri Jul 23 09:03:16 2004 Shugo Maeda <shugo@ruby-lang.org>
+Wed May 16 15:44:22 2012 Yuki Yugui Sonoda <yugui@google.com>
- * lib/net/imap.rb (disconnected?): new method. (backported from HEAD)
+ * configure.in: Fix an unbalanced quote.
-Thu Jul 22 16:41:54 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed May 16 15:43:10 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/cgi/session.rb (CGI::Session::FileStore#update): sets the
- permission of the session data file to 0600.
+ * ext/extmk.rb (exts.mk): use double quotes instead of single quotes
+ for commandline because it's not recognized as quotes on Windows.
- * lib/cgi/session/pstore.rb (CGI::Session::Pstore#initialize):
- ditto.
+Wed May 16 15:15:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jul 22 00:02:21 2004 Masahiro Kitajima <katonbo@katontech.com>
+ * configure.in (LD): enclose with single quotes but not double quotes
+ not to expand command substitution.
- * process.c (rb_f_system): not need to call last_status_set() any
- longer on _WIN32.
+Wed May 16 14:19:51 2012 Yuki Yugui Sonoda <yugui@google.com>
-Tue Jul 20 09:15:17 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ Supports static linking of extensions and encodings again.
+ Fixes --with-static-linked-ext.
- * test/fileutils/test_fileutils.rb: File.link raises EINVAL on BeOS.
+ Patch by Google Inc. [ruby-core:45073].
-Mon Jul 19 01:15:07 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * Makefile.in (ENCOBJS, EXTOBJS): New variables to specify static
+ linked libraries. Also reintroduces extinit.o, introduces encinit.o
+ introduces encinit.o
- * lib/webrick/httpservlet/cgihandler.rb
- (WEBrick::HTTPServlet::CGIhandler#do_GET): set SystemRoot environment
- variable to CGI process on Windows native platforms. [ruby-dev:23936]
+ * common.mk: Builds static libraries rather than shared objects if
+ specified.
- * lib/webrick/httpservlet/cgihandler.rb
- (WEBrick::HTTPServlet::CGIhandler#do_GET): use $?.exitstatus and
- refine log message.
+ * configure.in (LD): new substitution.
-Sun Jul 18 16:14:29 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * enc/depend: Supports static linked libraries
+ (libencs, libenc, libtrans): New target.
- * ext/tk/lib/tk/msgcat.rb (TkMsgCatalog.callback): bug fix
- ( wrong number of argument )
+ * enc/encinit.c.erb: new template to generate the initialization of
+ statically linked encodings.
-Sun Jul 18 08:13:58 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enc/make_encmake.rb (--module): new flag to specify whether static
+ or dynamic.
- * sprintf.c (rb_f_sprintf): remove extra sign digit.
+ * transcode_data.h (TRANS_INIT): New macro to get rid of the name
+ collision of encoding initializers and transcoder initializers.
-Sun Jul 18 03:21:42 2004 Akinori MUSHA <knu@iDaemons.org>
+ * ext/extmk.rb: Fixes the behavior on $extstatic is true.
- * dir.c (range): use NULL instead of 0.
+ * lib/mkmf.rb (clean-static): new target to clean up static linked
+ libraries.
- * dir.c (range): get rid of a gcc 3.4 warning.
+ * ruby.c (process_options): New initializes statically linked
+ encodings here.
-Sun Jul 18 03:12:11 2004 Shugo Maeda <shugo@ruby-lang.org>
+Wed May 16 14:30:43 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/net/imap.rb (receive_responses): return if a LOGOUT response
- received. (backported from HEAD)
- * lib/net/imap.rb (send_string_data): wait command continuation
- requests before sending octet data of literals. (backported from HEAD)
+ * io.c: fixed a merge mistake of r33878, reported by nobu via IRC.
-Sat Jul 17 23:54:59 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed May 16 06:59:41 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/tk/lib/tk/variable.rb: TkVariable#ref returns a TkVariable object
+ * ext/date/date_strftime.c: should also be aware of flags on
+ complex specifier.
-Sat Jul 17 22:04:44 2004 akira yamada <akira@ruby-lang.org>
+Wed May 16 05:11:29 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/uri/ldap.rb: method hierarchical? should be in URI::LDAP.
+ * ext/psych/lib/psych/visitors/to_ruby.rb: fix a bug with string
+ subclass dumping and loading.
-Sat Jul 17 18:29:07 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/psych/test_array.rb: pertinent tests
- * parse.y (stmt): not to show same error messages twice.
+ * test/psych/test_string.rb: ditto
-Sat Jul 17 13:13:32 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed May 16 01:31:21 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/irb/ruby-lex.rb (RubyLex::identify_string): %s string do not
- process expression interpolation. [ruby-talk:106691]
+ * ext/psych/lib/psych/visitors/to_ruby.rb: convert omap tagged maps to
+ Psych::Omap objects rather than hashes. [Bug #6425]
-Sat Jul 17 05:26:27 2004 Dave Thomas <dave@pragprog.com>
+ * test/psych/test_omap.rb: pertinent test.
- * lib/rdoc/diagram.rb: Incorporate Micheal Neuman's
- client-side imagemao patch
+Wed May 16 01:15:45 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sat Jul 17 01:57:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: keep a reference to
+ custom coders so that GC does not impact dumped yaml reference ids.
- * eval.c (THREAD_ALLOC): th->thread should be initialized to NULL.
- [ruby-talk:106657] The solution was found by Guy Decoux.
+Tue May 15 23:59:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 16 22:30:28 2004 Michael Neumann <mneumann@ntecs.de>
+ * lib/test/unit.rb (Test::Unit::Options#setup_options): add --color option.
- * file.c (rb_stat_dev_major): new methods File::Stat#dev_major and
- #dev_minor. [ruby-core:03195]
+ * lib/test/unit.rb (Test::Unit::Runner#_prepare_run): defer color code
+ initialization to regard --color option.
-Fri Jul 16 15:23:53 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon May 14 16:28:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (return_jump, break_jump): raise unexpceted local jump
- exception directly. [ruby-dev:23740]
+ * parse.y (f_arglist): should reset lexical states after empty
+ argument list with no parenthesis as well as parenthesized list,
+ so that reserved name method definition work. [ruby-dev:45626]
+ [Bug #6403]
- * lib/base64.rb (Deprecated): super in bound method calls original
- name method in stable version. [ruby-dev:23916]
+Mon May 14 00:14:24 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Fri Jul 16 11:31:49 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * enumerator.c (lazy_take_func, lazy_take): multiple calls of
+ force/to_a method to Enumerator::Lazy#take should return same
+ results. [ruby-dev:45634] [Bug #6428]
- * lib/test/unit/ui/{fox,gtk,gtk2}/testrunner.rb: remove
- garbage (patch from akira yamada) [ruby-dev:23911]
+ * test/ruby/test_lazy_enumerator.rb (test_take_recycle): add test for
+ above.
-Fri Jul 16 11:20:00 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun May 13 23:38:31 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * sprintf.c (rb_f_sprintf): fix output of NaN, Inf and -Inf with
- "%f" or etc on MSVCRT platforms. (backported from HEAD)
+ * test/ruby/test_io.rb (test_flush_in_finalizer1): don't use IO.for_fd
+ to close IO objects. it create IO object with already closed fd, and
+ cause occasional Errno::EBADF in following tests. [ruby-core:45020]
+ [Bug #6228]
-Fri Jul 16 11:17:38 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 13 23:32:16 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * error.c (exit_initialize): use EXIT_SUCCESS instead of 0.
- [ruby-dev:23913]
+ * test/ruby/test_io.rb (TestIO): revert r35631. it broke the intent of
+ test_flush_in_finalizer1. [ruby-core:43951] [Bug #6228]
- * error.c (exit_success_p): new method SystemExit#success?.
- [ruby-dev:23912]
+Sun May 13 22:46:36 2012 Tanaka Akira <akr@fsij.org>
- * error.c (syserr_initialize): initialization for subclasses.
- [ruby-dev:23912]
+ * ext/etc/etc.c (passwd_ensure): move endpwent() call from
+ passwd_iterate to close /etc/passwd on exception.
+ (group_ensure): move endgrent() call from group_iterate to close
+ /etc/group on exception.
-Thu Jul 15 23:53:38 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 13 18:10:43 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/optparse.rb (OptionParser#warn, OptionParser#abort): Exception
- no longer has to_str method.
+ * ext/date/date_strftime.c: removed unused code and changed the style.
-Thu Jul 15 22:59:48 2004 Shugo Maeda <shugo@ruby-lang.org>
+Sun May 13 17:37:56 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/readline/extconf.rb: added dir_config for curses, ncurses,
- termcap. (backported from HEAD)
+ * ext/date/date_strftime.c: refactored.
-Thu Jul 15 20:29:15 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sun May 13 06:40:12 2012 Luis Lavena <luislavena@gmail.com>
- * class.c, error.c, eval.c, intern.h, object.c, variable.c:
- do not set path if it is a singleton class. [ruby-dev:22588]
- (backport from 1.9)
+ * test/ruby/test_io.rb (class TestIO): Disable GC during IO tests to
+ avoid file descriptors being GC'ed. Suggestion by Tomoyuki Chikanaga
+ [ruby-core:43951][Bug #6228]
-Thu Jul 15 10:15:04 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat May 12 07:00:16 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/, ext/tcltklib/: bug fix
+ * ext/sdbm/init.c: Added documentation. Patch by Justin Collins,
+ cleanup by Zachary Scott. [ruby-trunk - #6410]
- * ext/tk/lib/tk.rb: better operation for SIGINT when processing
- callbacks.
- * ext/tk/lib/tk/msgcat.rb: ditto.
- * ext/tk/lib/tk/variable.rb: ditto.
- * ext/tk/lib/tk/timer.rb: ditto.
+Sat May 12 06:02:03 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/lib/tk/validation.rb: add Tk::ValidateConfigure.__def_validcmd
- to define validatecommand methods easier
+ * lib/fileutils.rb (cp_r): Fixed cp_r example. Patch by TJ Koblentz
+ from pull request #114. [ruby-trunk - Bug #6411]
- * ext/tk/lib/tk.rb (_genobj_for_tkwidget): support autoload Tk ext
- classes
+Sat May 12 05:23:06 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/lib/tk/canvas.rb and so on: remove the parent widget type
- check for items (e.g. canvas items; depends on the class) to
- avoid some troubles on Tk extension widget class definition.
+ * thread.c (rb_threadptr_execute_interrupts_common):
+ test_signal_requiring of test/ruby/test_signal.rb fail if the sub
+ process is killed on waiting IO in lex_io_gets in rb_load_file in
+ rb_load_internal in require.
+ This is because
+ (1) the process receive the killing signal in
+ rb_thread_io_blocking_region in rb_read_internal in lex_io_gets.
+ (2) set th->errinfo as INT2FIX(TAG_FATAL) at
+ rb_threadptr_execute_interrupts_common.
+ (3) escape rb_load_file in rb_load_internal and jump to EXEC_TAG()
+ without set loaded as TRUE.
+ (4) call first rb_exc_raise(GET_THREAD()->errinfo); because loaded
+ is FALSE as above. this errinfo should be an exception object
+ but this is INT2FIX(TAG_FATAL).
+ Don't call first rb_exc_raise if GET_THREAD()->errinfo is Fixnum.
- * ext/tk/lib/tkextlib/: add Iwidget and TkTable extension support
+Fri May 11 14:23:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/sample/tkextlib/: add samples of Iwidget and TkTable
+ * parse.y (primary): begin/end block should be isolated from outside.
+ [ruby-dev:45631][Bug #6419]
+Fri May 11 14:09:47 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 14 18:08:37 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ext/bigdecimal/bigdecimal.c (PUSH): to prevent VALUE from GC,
+ must not cast it to unsigned long, which may be shorter than
+ VALUE, and the result can be mere garbage.
- * ext/openssl/ossl_asn1.c (ossl_asn1cons_to_der): fix type of
- argument. [ruby-dev:23891]
+Fri May 11 09:51:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/openssl/test_x509store.rb: prune tests for CRL checking
- unless X509::V_FLAG_CRL_CHECK is defined.
+ * lib/test/unit.rb (Test::Unit::Runner#failed): no unnecessary
+ newlines if no reports to be displayed.
-Wed Jul 14 12:29:07 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu May 10 10:55:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * util.c (ruby_strtod): should not convert string in the form of
- "-I.FE-X" which both "I" and "F" are ommitted. [ruby-dev:23883]
+ * test/minitest/test_minitest_mock.rb: Correct requiring path to
+ metametameta.rb.
- * test/ruby/test_float.rb (test_strtod): add test for bug fix.
+ * test/minitest/test_minitest_unit.rb: Correct requiring path to
+ metametameta.rb.
-Wed Jul 14 00:31:15 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu May 10 10:18:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c: rdoc patch. merged patch from Johan Holmberg
- <holmberg@iar.se> [ruby-core:3170]
+ * parse.y (lex_state_name): returns name for lex_state_e, for debug
+ use.
-Tue Jul 13 19:39:12 2004 akira yamada <akira@ruby-lang.org>
+Wed May 9 16:36:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/uri/generic.rb (URI::Generic#merge_path):
- "URI('http://www.example.com/foo/..') + './'" should return
- "URI('http://www.example.com/')". [ruby-list:39838]
- "URI('http://www.example.com/') + './foo/bar/..'" should return
- "URI('http://www.example.com/foo/')". [ruby-list:39844]
+ * lib/mkmf.rb (MakeMakefile#pkg_config): check if libs resulted from
+ pkg-config works actually.
- * test/uri/test_generic.rb (TestGeneric#test_merge): added tests.
+Wed May 9 16:01:38 2012 Shugo Maeda <shugo@ruby-lang.org>
-Tue Jul 13 15:51:45 2004 Akinori MUSHA <knu@iDaemons.org>
+ * lib/net/imap.rb (decode_utf7, encode_utf7): refactored by
+ Nobuyoshi Nakada, to use String#encode.
- * lib/mkmf.rb (init_mkmf): Do not add $(libdir) to $LIBPATH in
- extmk mode.
+Wed May 9 13:26:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (dir_config): Prepend a new library path instead of
- appending so it is tried first.
+ * test/rubygems/test_gem_remote_fetcher.rb: skip OpenSSL dependent
+ tests if not available.
-Tue Jul 13 00:50:48 2004 Dave Thomas <dave@pragprog.com>
+Wed May 9 08:09:38 2012 Ryan Davis <ryand-ruby@zenspider.com>
- * lib/rdoc/parsers/parse_rb.rb: Support call-seq: for Ruby files.
+ * lib/minitest/*: Imported minitest 3.0.0 (r7435)
+ * test/minitest/*: ditto
+ * test/rubygems/*: Imported fixes for buggy use of assert_match
+ and deprecated assert_block
+ UNBUNCH YOUR PANTIES. THE TESTS DO NOT RUN CLEAN ON OSX.
-Mon Jul 12 21:20:36 2004 Dave Thomas <dave@pragprog.com>
+Wed May 9 06:28:59 2012 Eric Hodel <drbrain@segment7.net>
- * html_generator.rb: Support hyperlinks of the form {any text}[xxx]
- as well as stuff[xxx]
+ * re.c (rb_reg_equal): Removed incorrect example for Regexp#== with
+ "n" option. [ruby-talk - Bug #6415]
-Sat Jul 10 09:30:24 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Wed May 9 06:23:33 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * test/soap/marshal/test_struct.rb: use qualified build-tin class name
- (::Struct) to avoid name crash.
+ * ext/date/date_core.c: reverted.
-Sat Jul 10 04:21:56 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed May 9 04:31:26 2012 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * ext/tk/lib/tk.rb: better operation for SIGINT when processing
- callbacks.
- * ext/tk/lib/tk/msgcat.rb: ditto.
- * ext/tk/lib/tk/variable.rb: ditto.
- * ext/tk/lib/tk/timer.rb: ditto.
+ * lib/rinda/ring.rb (lookup_ring_any): fix Rinda::RingFinger.primary
+ hungs forever. [ruby-talk:395364]
- * ext/tk/lib/tk/validation.rb (__def_validcmd): add a module
- function of Tk::ValidateConfigure to define validatecommand
- methods easier
+Tue May 8 21:09:00 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Fri Jul 9 22:36:36 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * include/ruby/win32.h (FD_SET): change function to macro.
+ To avoid buffer overflow when smaller FD_SETSIZE is used in ext
+ libraries.
- * array.c, enum.c, pack.c: rdoc patch from Johan Holmberg
- <holmberg@iar.se> [ruby-core:3132] [ruby-core:3136]
+ * win32/win32.c (rb_w32_fdset): this function is not used anymore.
+ But we leave this for compatibility.
- * numeric.c: rdoc patch.
+ * win32/win32.c (rb_w32_select_with_thread): fix SEGV when smaller
+ FD_SETSIZE is used in ext libraries. Dereference of fd_set pointer
+ causes SEGV.
-Fri Jul 9 19:26:39 2004 Tanaka Akira <akr@m17n.org>
+ * test/-ext-/win32/test_fd_setsize.rb(TestFdSetSize): add tests for
+ above.
+ * ext/-test-/win32/fd_setsize/depend: ditto.
+ * ext/-test-/win32/fd_setsize/extconf.rb: ditto.
+ * ext/-test-/win32/fd_setsize/fd_setsize.c: ditto.
- * lib/open-uri.rb (URI::HTTPS#proxy_open): raise ArgumentError to
- notice https is not supported.
+ [ruby-core:44588] [Bug #6352]
-Fri Jul 9 14:28:54 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue May 8 20:44:46 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * eval.c (rb_thread_raise): accept third argument as well as
- Kernel#raise, and evaluate the arguments to create an exception in
- the caller's context. [ruby-talk:105507]
+ * io.c (io_unread): fix IO#pos with mode 'r' bug on Windows.
+ If the end of reading buffer is CR, io_unread() needs to unread one
+ more byte.
+ [ruby-core:44874] [Bug #6401]
-Fri Jul 9 01:47:08 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_pos_with_buffer_end_cr):
+ add a test for above.
- * ext/tk/lib : bug fix
- * ext/tk/lib/tkextlib/itcl : add [incr Tcl] support
- * ext/tk/lib/tkextlib/itk : add [incr Tk] support
- * ext/tk/lib/tkextlib/iwidgets : midway point of [incr Widgets] support
- * ext/tk/sample/tkextlib/iwidgets : very simple examples of
- [incr Widgets]
+Tue May 8 13:38:17 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Thu Jul 8 22:52:19 2004 Kouhei Sutou <kou@cozmixng.org>
+ * ext/date/date_core.c: improving introduction in Date/DateTime
+ documentation. patched by Daniel Kaufman via Github.
+ https://github.com/ruby/ruby/pull/110
- * lib/rss/{rss,parser,0.9,1.0,2.0}.rb: supported RSS 0.9x/2.0
- validation and validation which disregard order of elements.
- * test/rss/test_parser.rb: added tests for RSS 0.9x/2.0
- validation.
- * test/rss/{test_trackback,rss-testcase}.rb: fixed no good method
- name.
+Tue May 8 13:36:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jul 8 00:05:23 2004 akira yamada <akira@ruby-lang.org>
+ * configure.in (POSTLINK): default to : command to get rid of flag
+ only command, since BSD make does not work with it.
- * lib/tempfile.rb (Tempfile::initialize): got out code of
- generating tmpname. [ruby-dev:23832][ruby-dev:23837]
+Tue May 8 13:35:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 7 15:53:14 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/test/unit.rb (MiniTest#run_test): remove exact trace and get rid
+ of IndexError, which could caused by modified $@ sometimes.
- * string.c (rb_str_match): raise TypeError when both arguments are
- strings. [ruby-dev:22869] (backported from HEAD)
+Tue May 8 11:21:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * string.c (rb_str_match2): removed.
+ * test/minitest/metametameta.rb (MetaMetaMetaTestCase#assert_report):
+ support drive letter on Windows. yes, the original code is metameta.
- * Makefile.in, bcc32/Makefile.sub, win32/Makefile.sub,
- wince/Makefile.sub (string.c): now not depend on version.h.
+Tue May 8 08:54:48 2012 Eric Hodel <drbrain@segment7.net>
-Wed Jul 7 00:48:34 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * lib/abbrev.rb: Fixed typo in abbrev pattern documentation. Based on
+ patch by Mark Rushakoff. [ruby-trunk - #6346]
- * ext/tk/lib/tkextlib/tktrans.rb,
- ext/tk/lib/tkextlib/treectrl.rb: fix syntax errors.
+Tue May 8 07:44:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Jul 6 18:38:45 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib : improve framework of developping Tcl/Tk extension
- wrappers
-
-Mon Jul 5 23:56:42 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/{trackback,syndication,dublincore,content}.rb: worked
- with ruby 1.6 again.
-
- * test/rss/rss-assertions.rb: ditto.
-
-Mon Jul 5 22:54:39 2004 Tanaka Akira <akr@m17n.org>
-
- * lib/uri/common.rb (Kernel#URI): new global method for parsing URIs.
-
-Mon Jul 5 09:02:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_thread_yield, rb_f_catch): 4th argument to rb_yield_0()
- is a set of bit flags. [ruby-dev:23859]
-
-Mon Jul 5 01:27:32 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/drb/drb.rb(DRbConn self.open): If socket pool is full, close
- the socket whose last-access-time is oldest. (and add new one)
- [ruby-dev:23860]
-
-Sun Jul 4 12:24:50 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb: added copyright header.
-
-Sun Jul 4 00:24:40 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * added files
- * lib/soap/attachment.rb
- * lib/soap/header
- * lib/soap/mimemessage.rb
- * lib/soap/rpc/httpserver.rb
- * lib/wsdl/soap/cgiStubCreator.rb
- * lib/wsdl/soap/classDefCreator.rb
- * lib/wsdl/soap/classDefCreatorSupport.rb
- * lib/wsdl/soap/clientSkeltonCreator.rb
- * lib/wsdl/soap/driverCreator.rb
- * lib/wsdl/soap/mappingRegistryCreator.rb
- * lib/wsdl/soap/methodDefCreator.rb
- * lib/wsdl/soap/servantSkeltonCreator.rb
- * lib/wsdl/soap/standaloneServerStubCreator.rb
- * lib/wsdl/xmlSchema/enumeration.rb
- * lib/wsdl/xmlSchema/simpleRestriction.rb
- * lib/wsdl/xmlSchema/simpleType.rb
- * lib/xsd/codegen
- * lib/xsd/codegen.rb
- * sample/soap/authheader
- * sample/soap/raa2.4
- * sample/soap/ssl
- * sample/soap/swa
- * sample/soap/whois.rb
- * sample/soap/calc/samplehttpd.conf
- * sample/soap/exchange/samplehttpd.conf
- * sample/soap/sampleStruct/samplehttpd.conf
- * sample/wsdl/raa2.4
- * sample/wsdl/googleSearch/samplehttpd.conf
- * test/openssl/_test_ssl.rb
- * test/soap/header
- * test/soap/ssl
- * test/soap/struct
- * test/soap/swa
- * test/soap/wsdlDriver
- * test/wsdl/multiplefault.wsdl
- * test/wsdl/simpletype
- * test/wsdl/test_multiplefault.rb
-
- * modified files
- * lib/soap/baseData.rb
- * lib/soap/element.rb
- * lib/soap/generator.rb
- * lib/soap/marshal.rb
- * lib/soap/netHttpClient.rb
- * lib/soap/parser.rb
- * lib/soap/processor.rb
- * lib/soap/property.rb
- * lib/soap/soap.rb
- * lib/soap/streamHandler.rb
- * lib/soap/wsdlDriver.rb
- * lib/soap/encodingstyle/handler.rb
- * lib/soap/encodingstyle/literalHandler.rb
- * lib/soap/encodingstyle/soapHandler.rb
- * lib/soap/mapping/factory.rb
- * lib/soap/mapping/mapping.rb
- * lib/soap/mapping/registry.rb
- * lib/soap/mapping/rubytypeFactory.rb
- * lib/soap/mapping/wsdlRegistry.rb
- * lib/soap/rpc/cgistub.rb
- * lib/soap/rpc/driver.rb
- * lib/soap/rpc/element.rb
- * lib/soap/rpc/proxy.rb
- * lib/soap/rpc/router.rb
- * lib/soap/rpc/soaplet.rb
- * lib/soap/rpc/standaloneServer.rb
- * lib/wsdl/data.rb
- * lib/wsdl/definitions.rb
- * lib/wsdl/operation.rb
- * lib/wsdl/parser.rb
- * lib/wsdl/soap/definitions.rb
- * lib/wsdl/xmlSchema/complexContent.rb
- * lib/wsdl/xmlSchema/complexType.rb
- * lib/wsdl/xmlSchema/data.rb
- * lib/wsdl/xmlSchema/parser.rb
- * lib/wsdl/xmlSchema/schema.rb
- * lib/xsd/datatypes.rb
- * lib/xsd/qname.rb
- * sample/soap/calc/httpd.rb
- * sample/soap/exchange/httpd.rb
- * sample/soap/sampleStruct/httpd.rb
- * sample/soap/sampleStruct/server.rb
- * sample/wsdl/amazon/AmazonSearch.rb
- * sample/wsdl/amazon/AmazonSearchDriver.rb
- * sample/wsdl/googleSearch/httpd.rb
- * test/soap/test_basetype.rb
- * test/soap/test_property.rb
- * test/soap/test_streamhandler.rb
- * test/soap/calc/test_calc.rb
- * test/soap/calc/test_calc2.rb
- * test/soap/calc/test_calc_cgi.rb
- * test/soap/helloworld/test_helloworld.rb
- * test/wsdl/test_emptycomplextype.rb
- * test/wsdl/axisArray/test_axisarray.rb
- * test/wsdl/datetime/test_datetime.rb
- * test/wsdl/raa/test_raa.rb
- * test/xsd/test_xmlschemaparser.rb
- * test/xsd/test_xsd.rb
-
- * summary
- * add SOAP Header mustUnderstand support.
-
- * add HTTP client SSL configuration and Cookies support (works
- completely with http-access2).
-
- * add header handler for handling sending/receiving SOAP Header.
-
- * map Ruby's anonymous Struct to common SOAP Struct in SOAP Object
- Model. it caused error.
-
- * add WSDL simpleType support to restrict lexical value space.
-
- * add SOAP with Attachment support.
-
-Sat Jul 3 17:19:44 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * ext/tk/lib/tkextlib/tkDND.rb: fix syntax error.
-
-Thu Jul 1 23:15:29 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/pstore.rb (transaction): safer backup scheme. [ruby-list:39102]
-
- * lib/pstore.rb (commit_new): use FileUtils.copy_stream for Cygwin.
- [ruby-dev:23157]
-
- * lib/pstore.rb (transaction): allow overriding dump and load.
- [ruby-dev:23567]
-
- * lib/pstore.rb (PStore#transaction): get rid of opening in write mode
- when read only transaction. [ruby-dev:23842]
-
- * lib/yaml/store.rb: follow lib/pstore.rb's change.
+ * ext/openssl/ossl_ssl.c (ossl_start_ssl): remove useless rb_sys_fail
+ before ossl_raise. this cause a test failure on Linux.
+ http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20120507T190102Z.log.html.gz
-Thu Jul 1 18:36:08 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue May 8 05:35:18 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/lib/tcltklib : bug fix
+ * object.c (Init_Object): Added reference to variable.c where
+ public_constant and private_constant documentation lives. [#6381]
- * ext/tk/lib/tk : bug fix and add Tcl/Tk extension support libraries
+Tue May 8 04:47:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jul 1 11:59:45 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/test/unit.rb (Test::Unit::Runner#output): prefer local output to
+ get rid of unexpected side effect in test/minitest/metametameta.rb.
- * ext/openssl/extconf.rb: check for EVP_CIPHER_CTX_copy, ENGINE_add,
- EVP_CIPHER_CTX_set_padding, EVP_CipherFinal_ex, EVP_CipherInit_ex,
- EVP_DigestFinal_ex and EVP_DigestInit_ex.
+ * lib/test/unit.rb (MiniTest#run_test): show the running test in $0.
- * ext/openssl/openssl_missing.c (EVP_CIPHER_CTX_copy): new function.
+ * lib/test/unit.rb (Test::Unit::StatusLineOutput): new class to output
+ in status line.
- * ext/openssl/openssl_missing.h (EVP_DigestInit_ex, EVP_DigestFinal_ex,
- EVP_CipherInit_ex, EVP_CipherFinal_ex, HMAC_Init_ex): new macro for
- OpenSSL 0.9.6.
+ * test/testunit/test_hideskip.rb (TestHideSkip#test_hideskip):
+ MiniTest#puke now reports Skipped messages only if verbose mode.
- * ext/openssl/ossl_cipher.c (ossl_cipher_encrypt, ossl_cipher_decrypt):
- re-implemnt (the arguments for this method is ).
+ * test/testunit/test_sorting.rb (TestTestUnitSorting#test_sorting):
+ ditto.
- * ext/openssl/ossl_cipher.c (ossl_cipher_pkcs5_keyivgen): new method
- OpenSSL::Cipher::Cipher#pkcs5_keyivgen. it calls EVP_BytesToKey().
+ * lib/test/unit.rb (Test::Unit::Runner#puke): modify only result and
+ drop useless reports, not override entirely.
- * ext/openssl/ossl_cipher.c (ossl_cipher_alloc, ossl_cipher_initialize,
- ossl_cipher_copy, ossl_cipher_reset ossl_cipher_final,
- ossl_cipher_set_key, ossl_cipher_set_iv): replace all EVP_CipherInit
- and EVP_CipherFinal into EVP_CipherInit_ex and EVP_CipherFinal_ex.
- and EVP_CIPHER_CTX_init should only be called once.
+ * bootstraptest/runner.rb (exec_test, show_progress): show rotators
+ and pass/fail counts.
- * ext/openssl/ossl_cipher.c (ossl_cipher_set_key_length): new method
- OpenSSL::Cipher::Cipher#key_len=.
+ * sample/test.rb (PROGRESS): refine output.
- * ext/openssl/ossl_cipher.c (ossl_cipher_init_deprecated): new
- finction; print warning for Cipher#<<.
+Tue May 8 02:34:26 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl_digest.c: replace all EVP_DigestInit and
- EVP_DigestFinal into EVP_DigestInit_ex and EVP_DigestFinal_ex.
- and EVP_MD_CTX_init should only be called once.
+ * lib/minitest/unit.rb (assert_match): refix of r35563.
+ r35563 breaks the intention of the original change.
+ https://github.com/seattlerb/minitest/commit/68858105b2eb11c85105ffac5f32b662c59397f3
+ * lib/minitest/unit.rb (refute_match): ditto.
- * ext/openssl/ossl_digest.c (digest_final): should call
- EVP_MD_CTX_cleanup to avoid memory leak.
+Mon May 7 21:19:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl_hmac.c (ossl_hmac_initialize): repalce HMAC_init
- into HMAC_init_ex. and HMAC_CTX_init is moved to ossl_hmac_alloc.
+ * ext/json: Merge JSON 1.7.1.
+ https://github.com/flori/json/commit/e5b9a9465c1159fae533bca320d950b772bcb4ac
- * ext/openssl/ossl_hmac.c (hmac_final): should call
- HMAC_CTX_cleanup to avoid memory leak.
+Mon May 7 22:54:22 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * test/openssl/test_cipher.rb, test/openssl/test_digest.rb,
- test/openssl/test_hmac.rb: new file.
+ * ext/openssl/ossl_ssl.c: add support for option flags
+ OpenSSL::SSL::OP_NO_TLSv1_1
+ OpenSSL::SSL::OP_NO_TLSv1_2
+ to allow blocking specific TLS versions. Thanks to Justin Guyett for
+ pointing this out to me.
+ * test/openssl/test_ssl.rb: add tests to assert correct behavior when
+ blocking certain versions of TLS/SSL both on server and client side.
+ Also refactored tests to reduce boilerplate code a little.
+ * test/openssl/utils.rb: rescue Errno::ECONNRESET for tests where
+ client rejects the connection because a forbidden protocol version
+ was used.
-Thu Jul 1 04:08:30 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon May 7 20:14:15 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_asn1.c (ossl_i2d_ASN1_TYPE, ossl_ASN1_TYPE_free):
- workaround for the versions earlier than OpenSSL-0.9.7.
+ * lib/securerandom.rb (random_bytes): call to_int method for the
+ argument at first.
-Thu Jul 1 03:33:55 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon May 7 17:54:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl_pkey_dh.c (ossl_dh_initialize): should create
- empty pkey object if no argument is passed. [ruby-talk:103328]
+ * lib/minitest/unit.rb (assert_match): replace matcher only if both
+ matcher and obj are String. fix r35541. [Bug #6405]
+ DON'T COMMIT IF YOU CAN'T RUN TEST.
+ FIX AS SOON AS POSSIBLE YOU BREAK TESTS.
+ patched by ayumin.
+ https://github.com/seattlerb/minitest/pull/124
- * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize): ditto.
+ * lib/minitest/unit.rb (refute_match): ditto.
- * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize): ditto.
+Mon May 7 13:41:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_pkey_dh.c: add new methods: OpenSSL::PKey::DH#p,
- OpenSSL::PKey::DH#p=, OpenSSL::PKey::DH#g, OpenSSL::PKey::DH#g=,
- OpenSSL::PKey::DH#pub_key, OpenSSL::PKey::DH#pub_key=,
- OpenSSL::PKey::DH#priv_key and OpenSSL::PKey::DH#priv_key=.
+ * Makefile.in (PROGRAM), configure.in (POSTLINK): sign built program
+ using RUBY_CODESIGN identity.
- * ext/openssl/ossl_pkey_dsa.c: add new methods: OpenSSL::PKey::DSA#p,
- OpenSSL::PKey::DSA#p=, OpenSSL::PKey::DSA#q, OpenSSL::PKey::DSA#q=,
- OpenSSL::PKey::DSA#g, OpenSSL::PKey::DSA#g=,
- OpenSSL::PKey::DSA#pub_key, OpenSSL::PKey::DSA#pub_key=,
- OpenSSL::PKey::DSA#priv_key and OpenSSL::PKey::DSA#priv_key=.
+Mon May 7 13:03:55 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Jul 1 03:16:09 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/net/imap.rb (body_type_attachment): parse body type
+ "ATTACHMENT". [ruby-core:44849] [Bug #6397]
- * ext/openssl/ossl_ssl.c (ossl_ssl_read): take optional second argument
- to specify a string to be written.
+Mon May 7 10:49:36 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#read):
- take optional second argument to specify a string to be written.
+ * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): define IDs before
+ they are used. [ruby-core:44900] [Bug #6406]
- * ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#gets):
- refine regexp for end-of-line.
+Mon May 7 10:27:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/opnessl/lib/openssl/ssl.rb
- (OpenSSL::SSL::SocketForwarder#listen): fix typo.
+ * ext/digest/rmd160/rmd160.c (RMD160_Update): fix for huge data.
-Wed Jun 30 11:38:51 2004 Mikael Brockman <phubuh@phubuh.org>
+Mon May 7 10:23:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (primary): should not be NULL. [ruby-core:03098]
+ * test/fileutils/fileasserts.rb: use assert_equal, assert_match, and so on.
-Wed Jun 30 02:53:24 2004 why the lucky stiff <why@ruby-lang.org>
+ * test/ruby/enc/test_utf16.rb, test/ruby/enc/test_utf32.rb,
+ test/ruby/test_io_m17n.rb (assert_str_equal): ditto.
- * ext/syck/rubyext.c (syck_emitter_new): set buffer after
- Data_Wrap_Struct to avoid possible GC. [ruby-talk:104835]
+ * test/rubygems/test_gem_remote_fetcher.rb
+ (assert_data_from_{server,proxy}): ditto.
-Tue Jun 29 10:31:19 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/test_pstore.rb (test_thread_safe): ditto.
- * eval.c (rb_eval_cmd, rb_thread_trap_eval): restore safe level.
+Mon May 7 10:16:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (define_final, run_final): preserve and restore safe level for
- finalizers. [ruby-core:03058]
+ * test/rubygems/test_gem_installer.rb (TestGemInstaller#test_dir): fix
+ argument order. expected value must come first.
- * signal.c (signal_exec, rb_trap_exit, trap): preserve and restore
- safe level for signal handlers. [ruby-dev:23829]
+Mon May 7 09:14:11 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Mon Jun 28 14:57:56 2004 Jeff Mitchell <quixoticsycophant@yahoo.com>
+ * ext/openssl/ossl_ssl.c: support TLSv1.1 & TLSv1.2. Add
+ SSLContext#version to inspect the version that was negotiated for
+ a given connection.
+ * ext/openssl/extconf.rb: detect TLS 1.1 & 1.2 support.
+ * test/openssl/test_ssl.rb: add tests for TLS 1.1 & 1.2 given they
+ are supported by the native OpenSSL being used.
- * configure.in, lib/mkmf.rb (LIBPATHFLAG): use double quotes due to
- DOSISH compilers. [ruby-core:03107]
+Sun May 6 21:34:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Jun 28 00:30:19 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * io.c (io_encoding_set): suppress warnings. [ruby-dev:45627]
+ this tmp1 is not required after r35538.
- * sample/drb/*.rb: using 'DRb.thread.join' instead of 'gets'
+ * addr2line.c: suppress warnings.
-Sun Jun 27 22:39:51 2004 Kouhei Sutou <kou@cozmixng.org>
+Sun May 6 18:39:39 2012 Koichi Sasada <ko1@atdot.net>
- * sample/rss/tdiary_plugin/rss-recent.rb: supported Hiki.
+ * compile.c (iseq_compile_each): remove unused variable `size'.
-Sun Jun 27 12:19:46 2004 Kouhei Sutou <kou@cozmixng.org>
+Sun May 6 14:50:03 2012 Tanaka Akira <akr@fsij.org>
- * {lib,sample,test}/rss: added RSS Parser. [ruby-dev:23780]
+ * lib/securerandom.rb: show actual read length in an error message.
-Sat Jun 26 11:07:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat May 5 06:43:10 2012 Ryan Davis <ryand-ruby@zenspider.com>
- * configure.in (aix): -b must come at the start of the command line,
- and -e must not appear while testing libraries. [ruby-talk:104501]
+ * lib/minitest/*: Imported minitest 2.12.1 (r7323)
+ * test/minitest/*: ditto
- * lib/mkmf.rb (dir_config): quote directory names if necessary.
- [ruby-talk:104505]
+Sat May 5 01:47:33 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Jun 25 15:33:19 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/zlib/test_zlib.rb (test_inflate): add a test for Zlib.inflate.
+ patched by headius (Charles Nutter). [ruby-core:44859] [Bug #6398]
- * ext/iconv/extconf.rb: check stricter. [ruby-talk:104501]
+ * test/zlib/test_zlib.rb (test_deflate): add a test for Zlib.deflate.
- * ext/iconv/extconf.rb: include iconv.h for libiconv. [ruby-dev:22715]
+Sat May 5 00:53:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Jun 25 08:31:29 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * io.c (parse_mode_enc): remove warnings 'Ignoring internal encoding'.
+ [ruby-core:44455] [Bug #6324]
- * eval.c (rb_thread_atfork): remove "fork terminates thread"
- warning. [ruby-dev:23768]
+ * io.c (io_encoding_set): ditto.
- * object.c (rb_obj_clone): backport FL_FINALIZE patch from 1.9.
- [ruby-core:02786][ruby-core:03067]
+Fri May 4 07:19:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/socket/socket.c (sock_sockaddr): Socket#gethostbyname()
- should give us packed address, not struct sockaddr.
- [ruby-core:03053]
+ * lib/rdoc/parser.rb (RDoc.binary?): fix wrong regexp.
+ [ruby-core:44798] [Bug #6393]
-Fri Jun 25 02:04:23 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri May 4 01:33:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * {bcc32,win32,wince}/setup.mak: remove RUBY_EXTERN lines when
- including version.h. [ruby-talk:104456] (backported from HEAD)
+ * lib/rdoc/parser.rb (RDoc.alias_extension): a real file is irrelevant
+ to aliasing. [ruby-core:44796][Bug #6392]
-Thu Jun 24 14:23:29 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rdoc/parser.rb (RDoc.zip?): non-existent file will not be a zip
+ file.
- * io.c (rb_io_fread): return already read data when system call is
- interrupted. [ruby-talk:97206]
+ * lib/rdoc/parser.rb (RDoc.can_parse_by_name): accept aliased
+ extension file names.
-Thu Jun 24 01:32:43 2004 Shugo Maeda <shugo@ruby-lang.org>
+ * lib/rdoc/parser.rb (RDoc.binary?): binary read data may have
+ incomplete multibyte sequence. [ruby-core:44798][Bug #6393]
- * version.h: added declarations of ruby_version,
- ruby_release_date, ruby_platform.
- (backported from HEAD)
+Wed May 2 23:55:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 23 22:23:37 2004 Dave Thomas <dave@pragprog.com>
+ * lib/test/unit.rb (Test::Unit::RequireFiles#non_options): expand
+ real path to get rid of loading same files via symlinks.
- * ext/socket/socket.c (sock_s_gethostbyaddr): Work around problem
- with OS X not returning 'from' parameter to recvfrom for
- connection-oriented sockets.
+Wed May 2 23:26:04 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Wed Jun 23 01:45:27 2004 Dave Thomas <dave@pragprog.com>
+ * cont.c (rb_fiber_m_transfer): improve sample code in Fiber#transfer
+ documentation. emphasize the difference between transfer and resume.
- * lib/rdoc/parsers/parse_rb.rb (RubyLex::identify_quotation):
- Fix problem with the 'r' being dropped from %r{xxx}
+Wed May 2 23:21:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 23 00:20:20 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * parse.y (parser_yylex): allow spaces between lambda arrow and
+ parenthesis. [ruby-dev:45605][Feature #6390]
- * ext/win32ole/win32ole.c (ole_hresult2msg): remove trailing
- CRs and LFs. (doesn't depend on CR+LF) [ruby-dev:23749]
+Wed May 2 19:06:30 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Wed Jun 23 00:00:25 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * cont.c (rb_fiber_m_transfer): Improved Fiber documentation.
+ patched by Anuj Dutta. [ruby-core:44540][Bug #6343]
- * io.c (rb_io_initialize): should check fcntl result. [ruby-dev:23742]
+Wed May 2 13:06:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jun 22 21:11:36 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * README, README.ja: reformatted using rdoc markup. based on the
+ patches by zzak (Zachary Scott) in [Feature #6388].
- * ext/win32ole/win32ole.c (OLE_FREE): should not call CoFreeUnuse-
- dLibraries().
+ * README, README.ja: updated the author's mail address.
- * ext/win32ole/win32ole.c (ole_event_free): ditto.
+Wed May 2 09:46:09 2012 Kouji Takao <kouji@takao7.net>
- * ext/win32ole/win32ole.c (ole_hresult2msg): truncate error message
- before CR.
+ * ext/readline/readline.c (Readline.special_prefixes=)
+ (Readline.special_prefixes): new function. An original patch was
+ created by nagachika. [Feature #5784]
-Tue Jun 22 16:47:42 2004 Shugo Maeda <shugo@ruby-lang.org>
+Tue May 1 22:18:45 2012 Kouji Takao <kouji@takao7.net>
- * lib/net/ftp.rb (MDTM_REGEXP): fix for demon's ftp server.
- Thanks, Rutger Nijlunsing.
+ * ext/readline/readline.c (Readline.pre_input_hook)
+ (Readline.insert_text, Readline.redisplay): new function. An
+ original patch was created by nagachika. [Feature #5785]
-Mon Jun 21 10:19:23 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue May 1 15:46:48 2012 Koichi Sasada <ko1@atdot.net>
- * win32/win32.c (rb_w32_opendir): use FindFirstFile()/FindNextFile()/
- FindClose() instead of _findfirst()/_findnext()/_findclose().
- merge from HEAD.
+ * common.mk: "$(Q)-..." doesn't work on nmake.
-Sat Jun 19 13:24:15 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue May 1 15:32:10 2012 Koichi Sasada <ko1@atdot.net>
- * eval.c (method_call): allow changing $SAFE. [ruby-dev:23713]
+ * common.mk: replace '@' prefix to '$(Q)' to control build
+ process outputs.
-Fri Jun 18 23:12:22 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue May 1 14:17:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (proc_save_safe_level, rb_set_safe_level, safe_setter): limit
- safe level.
+ * ext/openssl/deprecation.rb (OpenSSL.check_func): check if header is
+ available for macro compatibility.
-Wed Jun 16 23:05:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue May 1 10:53:54 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * object.c (rb_mod_freeze): prepare string representation before
- freezing. [ruby-talk:103646]
+ * test/ruby/test_settracefunc.rb: ignore traces from another threads
+ because Kernel.set_trace_func affects other threads.
-Wed Jun 16 16:04:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue May 1 06:04:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * object.c (rb_mod_le): singleton class inherits Class rather than its
- object's class. [ruby-dev:23690]
+ * ext/digest/sha2/sha2.c (REVERSE32): explicitly cast since unsigned
+ long may be larger than sha2_word32.
-Wed Jun 16 16:01:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/digest/sha2/sha2.c (SHA{256,512,384}_{Final,End}): should clear
+ whole content, not pointer size.
- * gc.c (stack_grow_direction): memoize the direction.
+ * ext/digest/*/extconf.rb: use pkg_config to use same library with
+ openssl. [ruby-core:44755][Bug #6379]
- * gc.c (Init_stack): should always move to end of VALUE.
+ * ext/openssl/deprecation.rb: extract check for broken Apple OpenSSL.
-Tue Jun 15 12:10:04 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue May 1 05:02:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk.rb: bug fix (TkWindow#grab)
+ * configure.in (optflags): disable unsafe optimizations.
+ [ruby-core:44679][Bug #6370]
-Mon Jun 14 18:23:27 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Mon Apr 30 23:36:49 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/remote-tk.rb: bug fix
+ * lib/fileutils.rb (copy_metadata): use File.lchown and File.lchmod to
+ update meta data of symlinks.
-Sun Jun 13 00:23:04 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Mon Apr 30 23:05:53 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * ext/tcltklib/extconf.rb: [EXPERIMENTAL] MacOS X (darwin) support
+ * test/ruby/test_continuation.rb (tracing_with_set_trace_func): don't
+ call Continuation from other threads. [ruby-dev:45596] [Bug #6382]
- * ext/tcltklib/tcltklib.c: fix thread trouble on callback proc, and
- eliminate warning about instance variable access
+Mon Apr 30 20:10:04 2012 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/menubar.rb: improve supported menu_spec
+ * ext/zlib/extconf.rb: detect z_crc_t type which will be defined
+ since zlib-1.2.7.
- * ext/tk/lib/tk/menuspec.rb: [add] menu_spec support library
+ * ext/zlib/zlib.c (rb_zlib_crc_table): use z_crc_t if available.
- * ext/tk/lib/tk/root.rb: add menu_spec support
+Mon Apr 30 09:02:15 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * ext/tk/lib/tk/text.rb: bug fix
+ * ext/openssl/lib/openssl/ssl.rb: add hostname to "hostname does not
+ match server cert." error. patched by Wes Morgan via Github.
+ https://github.com/ruby/ruby/pull/122
- * ext/tk/lib/tk/toplevel.rb: add menu_spec support
+Mon Apr 30 04:43:53 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/tk/sample/menubar?.rb: [add] sample of menu_spec usage
+ * ext/psych/lib/psych/json/yaml_events.rb: implicit styles should not
+ be changeable for JSON events.
-Sat Jun 12 11:15:53 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Sun Apr 29 06:12:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (target_os): strip -gnu suffix on Linux.
+ * parse.y (assoc, parser_yylex): add syntax to splat keyword hash.
+ [ruby-core:44591][Feature #6353]
-Fri Jun 11 17:08:21 2004 Akinori MUSHA <knu@iDaemons.org>
+ * compile.c (compile_array_): generate keyword splat insns.
- * config.guess: Restore a wrongly removed hyphen.
+ * vm.c (m_core_hash_merge_kwd): merge keyword hash into intermediate
+ hash. leftward argument is prior currently.
-Fri Jun 11 14:30:08 2004 Akinori MUSHA <knu@iDaemons.org>
+Fri Apr 27 12:34:23 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * config.guess: Attempt to avoid system name change on
- Darwin platforms also.
+ * ext/dl/cfunc.c (rb_dlcfunc_call): should convert a Bignum value to
+ unsigned long long on Win64.
+ [ruby-core:44636][Bug #6364] reported by raylinn@gmail.com (ray linn)
-Fri Jun 11 14:22:45 2004 Akinori MUSHA <knu@iDaemons.org>
+Fri Apr 27 10:58:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * config.guess, config.sub: Attempt to avoid system name change on
- Linux platforms. We have been using "linux" instead of
- "linux-gnu" on this branch.
+ * test/readline/test_readline.rb (setup): avoid affected by user's
+ inputrc file. [ruby-dev:45584][Bug #6357]
-Thu Jun 10 19:19:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Apr 27 01:45:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/sdbm/init.c (fsdbm_store): sdbm should use StringValue().
- [ruby-talk:103062]
+ * thread.c (rb_threadptr_execute_interrupts_common):
+ handle timer_interrupt only on the first loop for the case to avoid
+ the infinite loop like following case:
+ * there is 2 Ruby threads (3 pthreads)
+ (1) main thread is waiting at gvl_yield:112 (native_cond_wait)
+ (2) sub thread works
+ (3) sub thread waits at gvl_yield:133 (native_mutex_unlock)
+ (4) main thread works
+ (5) main thread goes to gvl_acquire_common
+ (6) main thread call rb_wakeup_timer_thread
+ (7) timer thread set timer interrupt to the main thread
+ (8) main thread works
+ (9) main thread waits at gvl_acquire_common:64 (native_cond_wait)
+ (10) sub tread works
+ (11) set sub thread as the current thread
+ (12) run Ruby thread
+ (13) ...100ms
+ (14) sub thread goes to rb_threadptr_execute_interrupts_common
+ (15) sub thread call rb_thread_schedule_limits
+ (16) sub thread call gvl_release_common
+ (17) sub threads waits at gvl_yield:121 (native_cond_wait)
+ (18) main threads works
+ (19) main thread back to gvl_yield
+ (20) set main thread as the current thread
+ (21) main thread call gvl_yield
+ (22) main thread waits at gvl_yield:112 (native_cond_wait)
+ As described above, the main thread can't escape from
+ rb_threadptr_execute_interrupts_common.
+ See extended memo: http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/R35480_ExtendedMemo
-Wed Jun 9 18:04:14 2004 akira yamada <akira@ruby-lang.org>
+Fri Apr 27 07:15:07 2012 Tanaka Akira <akr@fsij.org>
- * lib/uri/generic.rb (URI::Generic::merge,
- URI::Generic::route_from): accepts non-hierarchical URI.
- [ruby-dev:23631]
+ * ext/socket/socket.c (sock_s_pack_sockaddr_un): support the longest
+ path in sockaddr_un, really.
+ reported by nagachika.
+ http://d.hatena.ne.jp/nagachika/20120426/ruby_trunk_changes_35474_35476
- * test/uri/test_generic.rb (TestGeneric::test_route,
- TestGeneric::test_merge): added tests for above changes.
+Thu Apr 26 12:28:06 2012 Tanaka Akira <akr@fsij.org>
-Wed Jun 9 17:39:37 2004 Akinori MUSHA <knu@iDaemons.org>
+ * ext/socket/raddrinfo.c (init_unix_addrinfo): support the longest
+ path in sockaddr_un.
+ (inspect_sockaddr): ditto.
+ (addrinfo_mdump): ditto.
+ (addrinfo_mload): ditto.
+ (rsock_unixpath_str): new function.
+ (rsock_unixpath): removed.
+ (rsock_unixaddr): use rsock_unixpath_str.
- * config.guess, config.sub: Update to a more recent version as of
- 2004-01-20.
+ * ext/socket/socket.c (sock_s_pack_sockaddr_un): support the longest
+ path in sockaddr_un.
+ (sock_s_unpack_sockaddr_un): ditto.
+ (sock_s_gethostbyaddr): unused variable removed.
- * configure.in: Add support for DragonFly BSD.
+ * ext/socket/unixsocket.c (rsock_init_unixsock): support the longest
+ path in sockaddr_un.
-Wed Jun 2 20:16:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/rubysocket.h (rsock_unixpath_str): declared.
+ (rsock_unixpath): removed.
- * string.c (str_new4): should share shared instance if it already
- exists. [ruby-dev:23665]
+ * test/socket/test_unix.rb: comment out test_nul because abstract unix
+ sockets may contain NULs.
-Wed Jun 2 12:41:53 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Apr 26 01:32:33 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * io.c (rb_io_gets_m): set lastline ($_) even when read line is
- nil. [ruby-dev:23663]
+ * test/optparse/test_summary.rb (test_summary_containing_space): add
+ test for r35467. OptionParser#to_a shouldn't split banner by spaces.
-Fri May 28 11:20:31 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Apr 25 23:02:46 2012 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_eval): bad influence on frame node.
+ * ext/socket/raddrinfo.c (init_unix_addrinfo): refine error message
+ format.
+ (addrinfo_mload): show more information on "too long AF_UNIX path"
+ error.
+ (addrinfo_unix_path): ditto for "too short AF_UNIX address" and
+ "too long AF_UNIX address" error.
- * eval.c (eval): reverted wrongly removed condition. [ruby-dev:23638]
+Wed Apr 25 05:46:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu May 27 23:15:18 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/optparse.rb (OptionParser#to_a): split for each lines.
+ [ruby-dev:45568][Bug #6348]
- * lib/logger.rb: leading 0 padding of timestamp usec part.
+Tue Apr 24 21:57:53 2012 Tanaka Akira <akr@fsij.org>
- * lib/csv.rb (CSV.parse): [CAUTION] behavior changed. in the past,
- CSV.parse accepts a filename to be read-opened (it was just a
- shortcut of CSV.open(filename, 'r')). now CSV.parse accepts a
- string or a stream to be parsed e.g.
- CSV.parse("1,2\n3,r") #=> [['1', '2'], ['3', '4']]
+ * ext/socket/raddrinfo.c (init_unix_addrinfo): show actual path length
+ when it is too long for Unix socket.
- * lib/csv.rb: CSV::Row and CSV::Cell are deprecated. these classes
- are removed in the future. in the new csv.rb, row is represented
- as just an Array. since CSV::Row was a subclass of Array, it won't
- hurt almost all programs except one which depended CSV::Row#match.
- and a cell is represented as just a String or nil(NULL). this
- change will cause widespread destruction.
+ * ext/socket/unixsocket.c (rsock_init_unixsock): ditto.
- CSV.open("foo.csv", "r") do |row|
- row.each do |cell|
- if cell.is_null # using Cell#is_null
- p "(NULL)"
- else
- p cell.data # using Cell#data
- end
- end
- end
+ * ext/socket/socket.c (sock_s_pack_sockaddr_un): ditto.
- must be just;
+Tue Apr 24 21:43:58 2012 Yusuke Endoh <mame@tsg.ne.jp>
- CSV.open("foo.csv", "r") do |row|
- row.each do |cell|
- if cell.nil?
- p "(NULL)"
- else
- p cell
- end
- end
- end
+ * lib/net/smtp.rb (check_continue): raise an error with an explanatory
+ message. [ruby-core:35854] [Feature #4598]
- * lib/csv.rb: [CAUTION] record separator(CR, LF, CR+LF) behavior
- change. CSV.open, CSV.parse, and CSV,generate now do not force
- opened file binmode. formerly it set binmode explicitly.
+Tue Apr 24 21:11:31 2012 NARUSE, Yui <naruse@ruby-lang.org>
- with CSV.open, binmode of opened file depends the given mode
- parameter "r", "w", "rb", and "wb". CSV.parse and CSV.generate open
- file with "r" and "w".
+ * lib/optparse.rb (OptionParser#to_a): should split by end-of-line,
+ and MUST TEST IT, MUST RUN THE TEST, MUST VERIFY BEFORE BACKPORT.
+ [ruby-dev:45568][Bug #6348]
- setting mode properly is user's responsibility now.
+Tue Apr 24 19:59:31 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/csv.rb: accepts String as a fs (field separator/column separator)
- and rs (record separator/row separator)
+ * enc/euc_jp.c: added EUC-JP-2004 and its alias EUC-JISX0213.
+ [ruby-dev:45571] [Feature #6349]
+ Requested by Kyouhei Yanagita <yanagi@shakenbu.org>.
- * lib/csv.rb (CSV.read, CSV.readlines): added. works as IO.read and
- IO.readlines in CSV format.
+ * enc/trans/japanese_euc.trans: ditto.
- * lib/csv.rb: added CSV.foreach(path, rs = nil, &block). CSV.foreach
- now does not handle "| cmd" as a path different from IO.foreach.
- needed?
+ * enc/trans/JIS/JISX0213-[12]%UCS@{BMP,SIP}.src: JIS X 0213:2004 ->
+ Unicode mapping table from NetBSD.
- * test/csv/test_csv.rb: updated.
+ * enc/trans/JIS/UCS@{BMP,SIP}%JISX0213-[12].src: Unicode -> JIS X
+ 0213:2004 mapping table from NetBSD.
- * test/ruby/test_float.rb: added test_strtod to test Float("0").
+ * tool/transcode-tblgen.rb: added SIP support.
-Thu May 27 21:37:50 2004 Tanaka Akira <akr@m17n.org>
+ * test/ruby/test_transcode.rb: tests of above changes.
- * lib/pathname.rb (Pathname#initialize): refine pathname initialization
- by pathname.
+Tue Apr 24 18:12:13 2012 Koichi Sasada <ko1@atdot.net>
-Thu May 27 20:22:05 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * compile.c: fix to output warning when the same literals
+ are available as a condition of same case clause.
+ And remove information ('#n') because we can find duplicated
+ condition with explicit line numbers.
+ [ruby-core:38343] [Ruby 1.9 - Bug #5068]
- * io.c (rb_io_fwrite): check all case errno != 0 [ruby-dev:23648]
+ * test/ruby/test_syntax.rb: add a test for above.
-Thu May 27 14:53:13 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Tue Apr 24 17:03:51 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * io.c (rb_io_fwrite): workaround for bcc32's fwrite bug.
- add errno checking. [ruby-dev:23627]
+ * win32/win32.c (waitpid): need to check the return value of
+ FindChildSlotByHandle() before passing poll_child_status().
+ this fixed a SEGV in test-all. reported by ko1 via IRC.
-Wed May 26 14:19:42 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Apr 24 16:04:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_eval, eval): make line number consistent on eval with
- Proc. [ruby-talk:101253]
+ * parse.y (parser_yylex): EXPR_BEG by keywords is a start point of
+ commands. [ruby-dev:45563][Bug #6347]
-Wed May 26 13:59:17 2004 Dave Thomas <dave@pragprog.com>
+ * parse.y (superclass): ditto for superclass.
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::skip_for_variable): Allow for
- 'do' after for statement
+ * parse.y (parser_parse_string, parser_here_document): ditto for
+ string interpolation.
-Wed May 26 13:56:03 2004 Dave Thomas <dave@pragprog.com>
+ * parse.y (parser_yylex): ditto for singleton class.
- * lib/rdoc/generators/html_generator.rb (Generators::MarkUp::style_url): Fix
- relative path to code CSS file
+Tue Apr 24 15:51:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed May 26 13:14:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/optparse.rb (OptionParser#to_a): should split by end-of-line
+ [ruby-dev:45568][Bug #6348]
- * io.c (rb_io_init_copy): copy also positions. [ruby-talk:100910]
+ * lib/optparse.rb (OptionParser#to_a): String#to_a is no longer
+ defined. [ruby-dev:45568][Bug #6348]
-Wed May 26 00:00:00 2004 why the lucky stiff <why@ruby-lang.org>
+Tue Apr 24 12:46:50 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * ext/syck/syck.c (syck_new_parser): clear parser on init.
- thanks, ts. [ruby-core:02931]
+ * hash.c, object.c, struct.c, lib/ostruct.rb: add to_h methods.
+ [Feature #6276]
- * ext/syck/token.c (sycklex_yaml_utf8): buffer underflow.
- thanks, ts. [ruby-core:02929]
+Tue Apr 24 10:54:34 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/yaml/baseemitter.rb (indent_text): simpler flow block code.
+ * test/drb/drbtest.rb ({DRbCore,DRbAry}#teardown): cannot pass SIGTERM
+ to another process on Windows, so use SIGINT instead.
- * lib/yaml.rb: added rdoc to beginning of lib.
+Tue Apr 24 00:25:39 2012 Yusuke Endoh <mame@tsg.ne.jp>
-Mon May 24 10:46:26 2004 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * thread.c (rb_check_deadlock): refine an error message of deadlock
+ detection. [ruby-core:44336] [Bug #6288]
- * lib/rdoc/generators/template/html/html.rb: SYSTEM identifiers
- must be absolute URIs
+Tue Apr 24 00:14:42 2012 Yusuke Endoh <mame@tsg.ne.jp>
-Sat May 22 12:00:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (primary): remove wrong "fixpos" that caused incorrect
+ source_location of blocks. [ruby-core:42232] [Bug #5930]
- * MANIFEST: add new encodings in rexml.
+ * test/ruby/test_proc.rb: add a test for above.
- * ext/tk/MANIFEST: add recent files.
+Mon Apr 23 22:56:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat May 22 05:37:11 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/iconv: deprecated. [Feature #6322]
- * ext/tk/lib/remote-tk.rb: (NEW library) controll Tk interpreters
- on the other processes by Tcl/Tk's 'send' command
+Mon Apr 23 22:07:00 2012 Tanaka Akira <akr@fsij.org>
-Fri May 21 09:22:05 2004 Dave Thomas <dave@pragprog.com>
+ * test/socket/test_unix.rb (bound_unix_socket): make temporary
+ filename shorter for less possibility of Unix socket path over
+ 107 bytes when TMPDIR has long path.
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_parameters):
- Add ()'s around parameters that don't have them
+Mon Apr 23 20:35:49 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu May 20 17:02:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (szInternalCmds, internal_match, internal_cmd_match):
+ get rid of a segmentation fault with GCC 4.7.0.
+ reported by raylinn@gmail.com (ray linn) at [ruby-core:44505]
+ [Bug #6333], and patched by mame.
- * lib/mkmf.rb (check_sizeof): define result size. [ruby-core:02911]
+ * test/ruby/test_system.rb (TestSystem#test_system): test for it.
- * lib/mkmf.rb (create_header): macro name should not include equal
- sign.
+Mon Apr 23 20:11:02 2012 Tanaka Akira <akr@fsij.org>
-Thu May 20 15:59:50 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/drb/ssl.rb: generate 1024 bits RSA key instead of 512 bits.
+ OpenSSL 1.0.1 rejects 512 bits RSA key for TLS1.2 with SHA512.
+ http://rt.openssl.org/Ticket/Display.html?id=2769&user=guest&pass=guest
+ reported by Bohuslav Kabrda.
+ [ruby-core:43844] [ruby-trunk - Bug #6221]
- * ext/socket/socket.c: fix SEGV. [ruby-dev:23550]
+Mon Apr 23 19:54:33 2012 Tanaka Akira <akr@fsij.org>
-Thu May 20 14:35:52 2004 Tanaka Akira <akr@m17n.org>
+ * test/drb/drbtest.rb: rescue Errno::ESRCH for Process.kill.
+ reported by NARUSE, Yui. [ruby-dev:45551]
- * ext/socket/socket.c: check SCM_RIGHTS macro addition to
- the msg_control field to test existence of file descriptor passing
- by msg_control.
+Mon Apr 23 14:16:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu May 20 12:38:06 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * .gdbinit (rb_ps_vm): follow st_table's packing change.
- * numeric.c (flo_eq): always check if operands are NaN.
- [ruby-list:39685]
+Mon Apr 23 10:43:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu May 20 12:34:39 2004 Dave Thomas <dave@pragprog.com>
+ * configure.in: disable rubygems not to load rbconfig.rb before
+ fake.rb. [ruby-core:44492][Bug #6329]
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_visibility):
- At Ryan Davis' suggestion, honor visibility modifers if guarded by a
- statement modifier
+Sun Apr 22 20:26:06 2012 Tanaka Akira <akr@fsij.org>
-Thu May 20 12:22:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/drb/extservm.rb (DRb::ExtServManager): don't use /bin/sh to
+ invoke service subprocess. mark detach threads for clean up.
- * lib/mkmf.rb (have_type): do not check pointer to incomplete type,
- which always get compiled. [ruby-list:39683]
+ * test/drb/drbtest.rb: clean up the service subprocess in teardown.
-Wed May 19 11:09:00 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/drb/test_drb.rb: set @service_name for teardown.
- * ext/tk/lib/tk.rb: change permition of TkObject#tk_send from
- private to public
+ * test/drb/test_drbunix.rb: ditto.
-Tue May 18 14:00:46 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/drb/test_drbssl.rb: ditto.
- * node.h (NEW_DSTR): adjust list length.
+ [ruby-dev:45547]
- * parse.y (literal_concat): ditto.
+Sun Apr 22 07:51:29 2012 Tanaka Akira <akr@fsij.org>
-Mon May 17 16:14:25 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/drb/ssl.rb: close accepted TCP socket if SSL accept is failed.
+ [ruby-dev:45541]
- * numeric.c (flo_to_s): it's preferable that "p 0.0" outputs "0.0"
- instead of "0.0e+00". [ruby-dev:23480]
+Sat Apr 21 14:36:49 2012 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * numeric.c (flo_to_s): it's preferable that "p 0.00000000000000000001"
- outputs "1.0e-20" instead of "9.999999999999999e-21". (the precision
- is considered, but there is assumption DBL_DIG == 15 in current
- implementation)
+ * test/rinda/test_rinda.rb: fix sticks on some tests problem
+ [Bug #6272]
-Mon May 17 10:13:33 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Apr 20 12:24:04 2012 Eric Hodel <drbrain@segment7.net>
- * ext/socket/socket.c (setup_domain_and_type): honor duck typing.
- [ruby-dev:23522]
+ * lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem: Removed to avoid
+ conflict with ca-bundle.pem
+ * lib/rubygems/ssl_certs/VerisignClass3PublicPrimaryCertificationAuthority-G2.pem:
+ ditto.
+ * lib/rubygems/ssl_certs/Entrust_net-Secure-Server-Certification-Authority.pem:
+ ditto.
- * ext/socket/socket.c (sock_s_getnameinfo): ditto.
+Fri Apr 20 08:07:06 2012 Eric Hodel <drbrain@segment7.net>
-Mon May 17 01:15:23 2004 why the lucky stiff <why@ruby-lang.org>
+ * lib/rubygems: Update to RubyGems 1.8.23 which contains security
+ fixes:
- * lib/yaml.rb: removed fallback to pure Ruby parser.
+ RubyGems now disallows redirection from HTTPS to HTTP.
- * lib/yaml/baseemitter.rb (indent_text): was forcing a mod value
- of zero at times, which kept some blocks from getting indentation.
+ RubyGems now verifies SSL connections.
- * lib/yaml/baseemitter.rb (node_text): rewriting folded scalars.
+ See https://github.com/rubygems/rubygems/blob/1.8/History.txt for
+ changes since 1.8.22.
+ * test/rubygems: ditto.
- * ext/syck/syck.h: reports style of scalars now, be they plain, block
- single-, or double-quoted.
+Thu Apr 19 16:33:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/syck/syck.c: ditto.
+ * strftime.c (rb_strftime_with_timespec): fix carry-up bug and
+ overwrite '+' with '-' if negative offset less than a hour.
+ [ruby-core:44447][Bug #6323]
- * ext/syck/gram.c: ditto.
+Thu Apr 19 09:39:57 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/syck/node.c: ditto.
+ * ext/-test-/win32/dln/extconf.rb: need import library for ordinal
+ entry even on mingw. [ruby-core:44441][Bug #6320]
- * ext/syck/token.c: ditto.
+Thu Apr 19 09:35:15 2012 Eric Hodel <drbrain@segment7.net>
- * ext/syck/rubyext.c (yaml_org_handler): symbols loaded only
- if scalar style is plain.
+ * random.c (random_init): Clarify that the default seed is
+ Random.new_seed, not zero. Based on patch by Roger Pack.
+ [ruby-trunk - Bug #6313]
+ * random.c (rb_f_srand): ditto.
- * ext/syck/rubyext.c (yaml_org_handler): some empty strings were
- loaded as symbols.
+Thu Apr 19 08:59:02 2012 Eric Hodel <drbrain@segment7.net>
- * test/yaml/test_yaml.rb (test_perl_regexp): updated test to
- match new regexp serialization.
+ * ext/curses/curses.c (window_nodelay): Fixed call-seq of nodelay to
+ include the '='.
-Mon May 17 00:03:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ Improved description window.nodelay=.
- * lib/drb/drb.rb: Cosmetic documentation changes.
+Thu Apr 19 08:47:54 2012 Eric Hodel <drbrain@segment7.net>
-Sun May 16 22:36:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * io.c (io_readpartial): Document the output buffer parameter is
+ overwritten with the read contents even when non-empty.
+ Patch by yu nobuoka. [ruby-trunk - Bug #6285]
+ * io.c (io_read_nonblock): ditto.
+ * io.c (io_read): ditto.
+ * io.c (rb_io_sysread): ditto.
+ * io.c (argf_read): ditto.
+ * io.c (argf_readpartial): ditto.
+ * ext/stringio/stringio.c (strio_read): ditto.
+ * test/ruby/test_argf.rb (class TestArgf): Add test for existing
+ behavior of read outbuf.
+ * test/ruby/test_io.rb (class TestIO): ditto.
+ * test/stringio/test_stringio.rb (class TestStringIO): ditto.
- * lib/test/unit.rb: Removed :nodoc: directive (it prevented effective
- RDoc operation), and added file-level comment.
+Wed Apr 18 22:58:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun May 16 20:55:49 2004 Tanaka Akira <akr@m17n.org>
+ * configure.in (DOT, DOXYGEN): use AC_CHECK_PROGS instead of
+ AC_CHECK_PROG which needs the third argument. [ruby-core:44433]
+ [Bug #6316]
- * ext/dbm/dbm.c (fdbm_initialize): accept optional 3rd argument to
- specify an open flag.
- (Init_dbm): define open flags: DBM::READER, DBM::WRITER, DBM::WRCREAT
- and DBM::NEWDB.
+ * configure.in (PKG_CONFIG): fix condition to skip older version
+ of pkg-config. continue in backticks does not affect outside.
-Sun May 16 13:10:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Wed Apr 18 13:59:40 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/test/unit/**/*.rb: Removed :nodoc: directives (many were
- generating warnings, many were on private methods).
+ * win32/file.c (INVALID_FILE_ATTRIBUTES): define for old SDK.
-Sat May 15 01:41:34 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Apr 18 10:22:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (eval): forgot to restore $SAFE value before evaluating
- compiled node. [ruby-core:02872]
+ * strftime.c (rb_strftime_with_timespec): add an interim digit for
+ the timezone offset which is less than an hour.
-Sat May 15 01:33:12 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Apr 18 09:58:29 2012 Eric Hodel <drbrain@segment7.net>
- * range.c (range_each_func): terminates loop if generating value
- is same to @end. [ruby-talk:100269]
+ * lib/rubygems/version.rb: Fixed init_with warning by calling into
+ yaml_initialize (for syck) from psych's init_with
-Fri May 14 22:08:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Apr 18 09:03:43 2012 Eric Hodel <drbrain@segment7.net>
- * string.c (rb_str_new4): should not reuse frozen shared string if
- the original is not an instance of String. [ruby-talk:100193]
+ * lib/rubygems: Update to RubyGems 1.8.22 plus r33517 and r35337 which
+ were ported to the rubygems git repository.
-Fri May 14 18:39:25 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ See https://github.com/rubygems/rubygems/blob/1.8/History.txt for
+ changes since 1.8.11.
- * ext/tk/lib/tk/canvas.rb: improve coords support for canvas items.
- Now, supports all of the followings.
- TkcLine.new(c, 0, 0, 100, 100, :fill=>'red')
- TkcLine.new(c, [0, 0, 100, 100], :fill=>'red')
- TkcLine.new(c, [0, 0], [100, 100], :fill=>'red')
- TkcLine.new(c, [[0, 0], [100, 100]], :fill=>'red')
- TkcLine.new(c, :coords=>[0, 0, 100, 100], :fill=>'red')
- TkcLine.new(c, :coords=>[[0, 0], [100, 100]], :fill=>'red')
+ * test/rubygems: ditto.
-Fri May 14 12:11:43 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Apr 17 22:18:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * util.c (ruby_strtod): strtod("0", &end); => end should point '\0'.
- [ruby-dev:23498]
+ * strftime.c (rb_strftime_with_timespec): fix padding of time zone
+ offset. [ruby-dev:43287][Bug #4458]
-Thu May 13 15:47:30 2004 akira yamada <akira@ruby-lang.org>
+Tue Apr 17 13:11:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/telnet.rb (Net::Telnet::login): "options" can specify
- regexps for login prompt and/or password prompt.
+ * 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]
-Thu May 13 14:23:45 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Mon Apr 16 18:22:14 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * hash.c (delete_if_i): use st_delete_safe() (via
- rb_hash_delete()) instead of returning ST_DELETE.
- backport from HEAD. [ruby-dev:23487]
+ * spec/default.mspec: expand relative path for ruby_exe which uses
+ them with Dir.chdir; it breaks relative paths, for example
+ core/kernel/exec_spec.rb.
-Thu May 13 13:01:30 2004 akira yamada <akira@ruby-lang.org>
+Mon Apr 16 16:22:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/uri/mailto.rb (URI::MailTo::to_s): should include fragment.
+ * win32/win32.c (gmtime_r, localtime_r): POSIX compliant reentrant
+ versions.
-Thu May 13 11:04:08 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (RUBY_MSVCRT_VERSION): define on mingw too.
- * pack.c (pack_pack): always add with null for 'Z'.
+ * win32/Makefile.sub (config.h): prefix RT_VER with RUBY and make
+ more descriptive to get rid of potential conflict.
+
+Mon Apr 16 15:19:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (NO_RUBY_VENDOR_LIB): fix missing comma.
+
+Mon Apr 16 12:17:12 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb (hermitian?): Bug fix, patch by George Koehler
+ [Bug #6290] [rubyspec:4b9573d7613]
+
+Mon Apr 16 09:42:50 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/rubygems/remote_fetcher.rb (Gem::RemoteFetcher#download): should
+ use File.identical? to check the identity of the files.
+ this fixed an error of a test on Windows.
+
+Sat Apr 14 12:55:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (UNREACHABLE): gcc 4.4 eliminates unreachable code
+ if -O3 is given.
+
+ * win32/win32.c (child_result): dropped colon.
+
+Sat Apr 14 10:45:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * 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]
+
+Sat Apr 14 09:35:45 2012 Eric Hodel <drbrain@segment7.net>
+
+ * variable.c (trace_ev): Removed "not reached" comment as this line is
+ reached.
+ * variable.c (rb_obj_remove_instance_variable): Replaced "not reached"
+ comment with the UNREACHABLE macro.
+ * variable.c (rb_mod_const_missing): ditto.
+ * variable.c (rb_mod_remove_cvar): ditto.
+ * enum.c (first_i): ditto.
+ * string.c (rb_str_aref): ditto.
+ * string.c (str_byte_aref): ditto.
+ * string.c (rb_to_id): ditto.
+ * io.c (rb_io_fmode_modestr): ditto.
+ * io.c (rb_io_oflags_modestr): ditto.
+ * pack.c (num2i32): ditto.
+ * vm_eval.c (rb_method_missing): ditto.
+ * vm_eval.c (rb_f_throw): ditto.
+ * dir.c (dir_read): ditto.
+ * win32/win32.c (child_result): ditto.
+ * struct.c (rb_struct_getmember): ditto.
+ * struct.c (rb_struct_set): ditto.
+ * struct.c (rb_struct_aref_id): ditto.
+ * eval.c (rb_f_raise): ditto.
+ * process.c (rb_f_exit_bang): ditto.
+ * process.c (rb_f_exit): ditto.
+ * process.c (rb_f_abort): ditto.
+ * ext/-test-/iter/break.c (iter_break_value): ditto.
+ * ext/pty/pty.c (pty_check): ditto.
+ * ext/openssl/ossl_pkey.c (ossl_pkey_new): ditto.
+ * ext/readline/readline.c (rb_remove_history): ditto.
+ * ext/stringio/stringio.c (strio_unimpl): ditto.
+ * numeric.c (num_sadded): ditto.
+ * numeric.c (num_init_copy): ditto.
+ * numeric.c (rb_num2ll): ditto.
+ * numeric.c (rb_num2ull): ditto.
+ * vm_insnhelper.c (call_cfunc): ditto.
+ * ruby.c (opt_W_getter): ditto.
+ * bignum.c (rb_big_coerce): ditto.
+ * file.c (rb_f_test): ditto.
+
+Sat Apr 14 08:38:20 2012 Eric Hodel <drbrain@segment7.net>
+
+ * encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "control
+ reaches end of non-void function" warnings. [ruby-trunk - Bug #6066]
+ * re.c (name_to_backref_number): ditto.
+ * object.c (rb_Float): ditto.
+ * io.c (io_readpartial): ditto.
+ * io.c (io_read_nonblock): ditto.
+ * pack.c (rb_uv_to_utf8): ditto.
+ * proc.c (rb_method_entry_arity): ditto.
+ * vm_method.c (rb_f_notimplement): ditto.
+ * struct.c (rb_struct_aset_id): ditto.
+ * class.c (rb_scan_args): ditto.
+ * process.c (rlimit_resource_type): ditto.
+ * process.c (rlimit_resource_value): ditto.
+ * process.c (p_uid_switch): ditto.
+ * process.c (p_gid_switch): ditto.
+ * ext/digest/digest.c (rb_digest_instance_update): ditto.
+ * ext/digest/digest.c (rb_digest_instance_finish): ditto.
+ * ext/digest/digest.c (rb_digest_instance_reset): ditto.
+ * ext/digest/digest.c (rb_digest_instance_block_length): ditto.
+ * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): ditto.
+ * ext/dl/handle.c (rb_dlhandle_close): ditto.
+ * ext/tk/tcltklib.c (pending_exception_check0): ditto.
+ * ext/tk/tcltklib.c (pending_exception_check1): ditto.
+ * ext/tk/tcltklib.c (ip_cancel_eval_core): ditto.
+ * ext/tk/tcltklib.c (lib_get_reltype_name): ditto.
+ * ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core): ditto.
+ * ext/tk/tkutil/tkutil.c (tk_hash_kv): ditto.
+ * ext/openssl/ossl_ssl.c (ossl_ssl_session_reused): ditto.
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1): ditto.
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit): ditto.
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve): ditto.
+ * ext/fiddle/conversions.c (generic_to_value): ditto.
+ * ext/socket/raddrinfo.c (rsock_io_socket_addrinfo): ditto.
+ * ext/socket/socket.c (sock_s_getnameinfo): ditto.
+ * ext/ripper/eventids2.c (ripper_token2eventid): ditto.
+ * cont.c (return_fiber): ditto.
+ * dmydln.c (dln_load): ditto.
+ * vm_insnhelper.c (vm_search_normal_superclass): ditto.
+ * bignum.c (big_fdiv): ditto.
+ * marshal.c (r_symlink): ditto.
+ * marshal.c (r_symbol): ditto.
+
+Fri Apr 13 17:12:09 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * hash.c (inspect_i): keep string's coderange.
+
+Fri Apr 13 15:26:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_aset, rb_hash_update, rb_hash_update_by): use
+ st_update() to reduce evaluation of hash values.
+
+Fri Apr 13 15:17:36 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * 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).
+
+Thu Apr 12 19:51:45 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: added some notes.
+
+Wed Apr 11 17:16:49 2012 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (compile_array, compile_array_):
+ Divide big array (or hash) literals into several blocks and
+ concatenate 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. [ruby-dev:37701] [Bug #982]
+
+ * 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.
+
+Thu Apr 12 07:10:37 2012 Eric Hodel <drbrain@segment7.net>
- * pack.c (pack_unpack): terminated by null for 'Z'. [ruby-talk:98281]
+ * 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
-Wed May 12 19:59:43 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Apr 12 06:15:44 2012 Eric Hodel <drbrain@segment7.net>
- * lib/mkmf.rb (have_type, check_sizeof): replace unusable characters.
- [ruby-talk:99788]
+ * 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
-Wed May 12 17:41:42 2004 Tanaka Akira <akr@m17n.org>
+Thu Apr 12 05:27:01 2012 Eric Hodel <drbrain@segment7.net>
- * lib/resolv.rb (Resolv::DNS::Config): make it configurable without
- external file such as /etc/resolv.conf.
+ * 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.
-Wed May 12 14:37:27 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Apr 12 03:50:44 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl_x509name.c: attribute value of DC (short name of
- domainComponent) should be IA5String.
+ * lib/test/unit.rb (Test::Unit:Runner::Worker#_run_suites):
+ call GC.start before running the test suites.
-Wed May 12 13:20:19 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Apr 11 22:31:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/composite.rb: improve configure methods (based on
- the proposal of [ruby-talk:99671]).
+ * parse.y (rb_check_id_cstr): new function to check if ID is
+ registered with NUL-terminated C string.
-Wed May 12 11:51:08 2004 Dave Thomas <dave@pragprog.com>
+ * sprintf.c (rb_str_format): avoid inadvertent symbol creation.
- * class.c (rb_obj_singleton_methods): fix rdoc
+Wed Apr 11 20:28:36 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Mon May 10 21:44:42 2004 Dave Thomas <dave@pragprog.com>
+ * 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]
- * lib/rdoc/generators/html_generator.rb: Change scheme for
- looking up symbols in HTML generator.
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_read_crlf_and_eof):
+ test for above.
-Mon May 10 16:45:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Apr 11 07:38:33 2012 Eric Hodel <drbrain@segment7.net>
- * eval.c (eval): warning during eval should not cause deadlock.
- [ruby-talk:98651]
+ * ext/digest/sha2/lib/sha2.rb (Digest#block_length): Fixed method name
+ in documentation examples. Patch by naleski via
+ https://github.com/ruby/ruby/pull/115
- * eval.c (rb_eval): raise TypeError exception for superclass
- mismatch. [ruby-list:39567]
+Wed Apr 11 07:33:13 2012 Eric Hodel <drbrain@segment7.net>
-Mon May 10 12:11:37 2004 Dave Thomas <dave@pragprog.com>
+ * 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.
- * lib/rdoc/generators/html_generator.rb: Hack to search parents
- for unqualified constant names.
+Wed Apr 11 06:11:10 2012 Eric Hodel <drbrain@segment7.net>
-Mon May 10 12:11:37 2004 Dave Thomas <dave@pragprog.com>
+ * string.c (rb_str_tr): Documented use of \ to escape characters.
+ [ruby-trunk - Bug #6161]
+ * string.c (rb_str_count): ditto
- * lib/rdoc/generators/html_generator.rb: Hack to search parents
- for unqualified constant names.
+Wed Apr 11 05:14:51 2012 Eric Hodel <drbrain@segment7.net>
-Sun May 9 22:37:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * lib/abbrev.rb: Clarified that Abbrev.abbrev returns a Hash instead
+ of an Array. Patch by Andrei Bocan. [ruby-trunk - Bug #6107]
- * lib/net/ftp.rb: improved documentation
- * lib/net/imap.rb: ditto
- * lib/net/pop.rb: ditto
- * lib/net/smtp.rb: ditto
- * lib/net/telnet.rb: ditto
+Wed Apr 11 03:02:24 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Fri May 7 21:50:21 2004 Dave Thomas <dave@pragprog.com>
+ * ext/ripper/lib/ripper/sexp.rb: fix spelling. patched by
+ Jonathan Hinkle via https://github.com/ruby/ruby/pull/116
- * lib/rdoc/parsers/parse_rb.rb (RDoc::parse_include): Allow
- multiple arguments to 'include'
+Tue Apr 10 19:07:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 7 21:31:56 2004 Minero Aoki <aamine@loveruby.net>
+ * 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]
- * lib/fileutils.rb (fu_list): Array() breaks pathes including "\n".
- [ruby-core:02843]
+Tue Apr 10 18:19:32 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri May 7 11:25:53 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/net/http.rb (Net::HTTP#send_request_with_body_stream):
+ use IO.copy_stream for requests using body_stream.
+ patched by Eric Wong. [ruby-core:40898] [Feature #5605]
- * util.c (ruby_strtod): "0.0000000000000000001" should be converted
- to 1.0e-19 instead of 0.0. (leading zeros aren't significant digits)
- [ruby-talk:99318] [ruby-dev:23465]
+Tue Apr 10 16:53:21 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 7 10:00:05 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * thread_pthread.c: add prototype declarations for older Mac OS X.
+ [ruby-core:43376][Bug #6170]
- * ext/tk/tkutil.c (get_eval_string_core): bug fix. [ruby-dev:23466]
+Tue Apr 10 15:35:21 2012 Koichi Sasada <ko1@atdot.net>
-Thu May 6 22:13:17 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * compile.c (iseq_set_sequence): show a hint if there are duplicated
+ "when" clauses. [ruby-core:41502] [ruby-trunk - Feature #5716]
- * ext/socket/socket.c (ippaddr): use NUMERICHOST if can not resolve
- hostname.
+Tue Apr 10 09:57:00 2012 Eric Hodel <drbrain@segment7.net>
-Thu May 6 14:22:29 2004 why the lucky stiff <why@ruby-lang.org>
+ * string.c (rb_str_split_m): Documented behavior of split on the empty
+ string. [ruby-trunk - Feature #3575]
- * lib/yaml/rubytypes.rb (to_yaml): added instance variable handling
- for Ranges, Strings, Structs, Regexps.
+Tue Apr 10 09:48:31 2012 Eric Hodel <drbrain@segment7.net>
- * lib/yaml/rubytypes.rb (to_yaml_fold): new method for setting a
- String's flow style.
+ * ext/zlib/zlib.c (rb_deflate_s_deflate): Fixed ruby example replacing
+ NO_FLUSH with FINISH. [ruby-trunk - Bug #6273]
- * lib/yaml.rb (YAML::object_maker): now uses Object.allocate.
+Mon Apr 9 23:10:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/syck/gram.c: fixed transfer methods on structs, broke it
- last commit.
+ * win32/win32.c (isUNCRoot, winnt_stat): support long UNC.
+ [ruby-core:30623][Feature #3399]
-Thu May 6 11:40:28 2004 Shugo Maeda <shugo@ruby-lang.org>
+Mon Apr 9 15:16:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/imap.rb (string): accept NIL.
+ * parse.y (string_content, parser_yylex): count brace nesting to
+ dispatch embexpr_end. [ruby-core:43775][Bug #6211]
- * lib/net/imap.rb (body_type_basic): allow body-fields omissions.
+Mon Apr 9 13:06:58 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Thu May 6 01:59:04 2004 Dave Thomas <dave@pragprog.com>
+ * hash.c (rb_hash_set_default_proc): Accept nil, patch by Run Paint
+ [Feature #4234]
- * lib/rdoc/generators/html_generator.rb (Generators::HtmlMethod::params):
- Don't include the &block parameter if we have explicit
- yield parameters.
+ * test/ruby/test_hash.rb: test for above.
-Wed May 5 03:40:29 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Mon Apr 9 08:01:15 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/rinda/ring.rb: use recv instead of recvfrom.
+ * ext/date/date_strftime.c: gets the value with range() consistently.
+ * ext/date/date_strftime.c (range): now just replaces the given item.
-Tue May 4 23:52:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Mon Apr 9 06:58:01 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/gserver.rb: documented
+ * complex.c (nucomp_expt): [ruby-core:44170].
-Tue May 4 23:46:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Mon Apr 9 02:52:03 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/xmlrpc/README.txt: introduced for documentation purposes
+ * complex.c (nucomp_expt): the result of f_complex_new2 may be a fixnum
+ with mathn. [ruby-core:44170] [Bug #6267]
-Mon May 3 09:47:24 2004 Dave Thomas <dave@pragprog.com>
+Sun Apr 8 22:46:01 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
- Fix parsing bug if yield called within 1 line block
+ * ext/json/generator/generator.c (generate_json_bignum):
+ add RB_GC_GUARD.
+ http://fb.rubyci.org/~chkbuild/ruby-trunk/log/20120407T210301Z.diff.html.gz
-Sun May 2 01:04:38 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sun Apr 8 07:26:40 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tcltklib, ext/tk: renewal Ruby/Tk
+ * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): get keys
+ and fetch values from it to prevent @timeout_info's error
+ "can't add a new key into hash during iteration".
-Fri Apr 30 20:08:41 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Sun Apr 8 06:51:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * time.c (SIZEOF_TIME_T): support SIZEOF_TIME_T == SIZEOF_INT.
+ * io.c (io_unread): cast as long the value for extra_max.
+ [ruby-core:44137] [Bug #6257]
-Tue Apr 27 13:12:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Apr 8 06:46:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * eval.c (rb_eval): too many line trace call. (ruby-bugs PR#1320)
+ * 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]
-Tue Apr 27 08:41:28 2004 why the lucky stiff <why@ruby-lang.org>
+Sat Apr 7 22:35:36 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * lib/yaml/rubytypes.rb: passing Range tests.
+ * include/ruby/win32.h (rb_w32_aspawn_flags): add the declaration of
+ new function.
- * ext/syck/syck.h: version 0.44.
+ * process.c (enum): add EXEC_OPTION_PGROUP and move the position
+ above for the usage in proc_spawn_n().
- * ext/syck/gram.c: transfers no longer open an indentation.
- fixed transfers which precede blocks.
+ * 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.
- * ext/syck/token.c: ditto.
+ * process.c (rb_exec_arg_addopt): ditto.
- * ext/syck/syck.c: fixed segfault if an anchor has been released already.
+ * process.c (rb_spawn_process): ditto.
- * ext/syck/node.c (syck_free_members): organized order of free'd nodes.
+ * process.c (documentation for rb_f_spawn): add documentation for new
+ option `new_pgroup` of spawn.
- * ext/syck/rubyext.c (syck_emitter_write_m): test for proper string with
- StringValue.
+ * test/ruby/test_process.rb (TestProcess#test_execopts_new_pgroup):
+ add tests for option `new_pgroup`.
-Mon Apr 26 23:56:54 2004 Daniel Kelley <news-1082945587@dkelley.gmp.san-jose.ca.us>
+ * 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.
- * README.EXT, README.EXT.ja: fixed wrong function signature.
- [ruby-talk:98349]
+ * win32/win32.c (CreateChild): add an argument to pass
+ dwCreationFlags of CreateProcessW().
-Mon Apr 26 21:40:09 2004 Dave Thomas <dave@pragprog.com>
+ * win32/win32.c (rb_w32_spawn): ditto.
- * lib/rdoc/code_objects.rb (RDoc::Context::add_alias): Only alias
- to instance methods.
+ * win32/win32.c (rb_w32_aspawn_flags): add new function to pass
+ dwCreationFlags.
-Sat Apr 24 10:38:31 2004 Dave Thomas <dave@pragprog.com>
+ * win32/win32.c (rb_w32_aspawn): refactor to move the content to
+ rb_w32_aspawn_flags().
+ [ruby-core:43245][Bug #6131]
- * lib/rdoc/markup/simple_markup.rb (SM::SimpleMarkup::group_lines):
- Fix bug where consecutive headings are merged.
+Sat Apr 7 22:32:00 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Fri Apr 23 23:26:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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().
- * lib/mkmf.rb: $hdrdir should not contain macros for backward
- compatibility. [bruby-dev:28]
+ * win32/win32.c (CreateChild): revert the usage of
+ CREATE_NEW_PROCESS_GROUP flag for compatibility.
+ [ruby-core:43245][Bug #6131]
- * version.c (ruby_show_copyright): obtain copyright year from
- RUBY_RELEASE_YEAR.
+Sat Apr 7 10:28:40 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * win32/resource.rb: ditto.
+ * ext/psych/lib/psych.rb: bumping up psych version to match release.
+ * ext/psych/psych.gemspec: ditto
- * win32/resource.rb: default rubyw icon to ruby.ico, and let DLL also
- include them.
+Sat Apr 7 02:07:00 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * win32/resource.rb: include winver.h for older WindowsCE.
+ * 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
-Fri Apr 23 16:38:46 2004 Tanaka Akira <akr@m17n.org>
+Fri Apr 6 16:24:24 2012 Martin Duerst <duerst@it.aoyama.ac.jp>
- * lib/pathname.rb: sync taint/freeze flag between
- a pathname object and its internal string object.
+ * struct.c (documentation for rb_struct_members_m):
+ fix 'array of strings' to 'array of symbols'
+ [ruby-core:44152][Bug #6264]
-Fri Apr 23 14:52:08 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Apr 6 14:27:04 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * parse.y (stmt, arg, aref_args): should not make sole splat into
- array, in aref_args other than aref with op_asgn.
+ * Makefile.in ($(LIBRUBY_A)): fix typo.
-Fri Apr 23 14:14:38 2004 Tanaka Akira <akr@m17n.org>
+Thu Apr 5 13:26:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/resolv.rb: don't use Regexp#source to embed regexps.
- [ruby-dev:23432]
+ * missing/alloca.c (xmalloc, xfree): use ruby version, not
+ depending on RUBY_LIB_PREFIX. [ruby-dev:45492][Bug #6255]
-Thu Apr 22 04:15:36 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Apr 4 13:06:39 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * parse.y (aref_args): should pass expanded list. [ruby-core:02793]
+ * lib/ftp/ftp.rb (Net::FTP#close): restore original read_timeout.
-Thu Apr 22 01:12:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Apr 4 10:33:31 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * numeric.c (flo_to_s): tweak output string based to preserve
- decimal point and to remove trailing zeros. [ruby-talk:97891]
+ * lib/ftp/ftp.rb (Net::FTP#close): ignore exceptions from shutdown and
+ read on closing.
- * string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM
- search. [ruby-talk:97342]
+Wed Apr 4 01:48:35 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Apr 21 22:57:27 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/ftp/ftp.rb (Net::FTP#close): close socket more gracefully.
- * lib/rinda/rinda.rb, test/rinda/test_rinda.rb: check Hash tuple size.
+ * lib/ftp/ftp.rb (Net::BufferedSocket#shutdown): added.
-Wed Apr 21 20:05:00 2004 Tanaka Akira <akr@m17n.org>
+ * test/net/ftp/test_ftp.rb (FTPTest#create_ftp_server): wait socket
+ with shutdown and read.
- * lib/open-uri.rb (URI::HTTP#proxy_open): set Host: field explicitly.
- [ruby-list:39542]
+Tue Apr 3 19:00:52 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Apr 19 18:11:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * 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.
- * hash.c (rb_hash_equal): returns true if two hashes have same set
- of key-value set. [ruby-talk:97559]
+Tue Apr 3 18:33:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * hash.c (rb_hash_eql): returns true if two hashes are equal and
- have same default values.
+ * process.c (setreuid, setregid): suppress warnings.
+ [ruby-core:43374][Bug #6169]
-Mon Apr 19 08:19:58 2004 Doug Kearns <djkea2@mugca.its.monash.edu.au>
+Tue Apr 3 10:18:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dln.c, io.c, lib/benchmark.rb, lib/cgi.rb, lib/csv.rb, lib/date.rb,
- lib/ftools.rb, lib/getoptlong.rb, lib/logger.rb, lib/matrix.rb,
- lib/monitor.rb, lib/set.rb, lib/thwait.rb, lib/timeout.rb,
- lib/yaml.rb, lib/drb/drb.rb, lib/irb/workspace.rb, lib/net/ftp.rb,
- lib/net/http.rb, lib/net/imap.rb, lib/net/telnet.rb,
- lib/racc/parser.rb, lib/rinda/rinda.rb, lib/rinda/tuplespace.rb,
- lib/shell/command-processor.rb, lib/soap/rpc/soaplet.rb,
- lib/test/unit/testcase.rb, lib/test/unit/testsuite.rb: typo fix.
+ * enumerator.c (inspect_enumerator): suppress uninitialized
+ instance variable warnings. [ruby-dev:45449][Bug #6214]
+ patched by no6v (Nobuhiro IMAI).
-Mon Apr 19 08:14:18 2004 Dave Thomas <dave@pragprog.com>
+Mon Apr 2 13:25:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_body): Allow for
- #ifdef HAVE_PROTOTYPES
+ * lib/optparse/ac.rb: autoconf-like options.
-Fri Apr 16 22:33:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Mon Apr 2 10:34:00 2012 eregon <eregontp@gmail.com>
- * ext/iconv/iconv.c: nearly finished RDoc comments.
+ * 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]
-Fri Apr 16 17:04:07 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Apr 2 03:35:25 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * string.c (rb_str_equal): always returns true or false, never
- returns nil. [ruby-dev:23404]
+ * lib/webrick/server.rb (WEBrick::GenericServer): close socket only if
+ the socket is not closed yet.
-Fri Apr 16 08:27:02 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Apr 1 23:03:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/extmk.rb: skip linking when libraries to be preloaded not
- compiled. [ruby-list:39561]
+ * lib/net/ftp.rb (Net::BufferedSocket): should delegate send() to @io
+ for Net::FTP#abort and Net::FTP#status.
-Thu Apr 15 23:21:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Apr 1 00:41:56 2012 Shugo Maeda <shugo@ruby-lang.org>
- * process.c (pst_success_p): new method Process::Status#success?.
- [ruby-dev:23385]
+ * lib/net/ftp.rb: fixed the domain name in examples.
-Thu Apr 15 17:12:13 2004 Tanaka Akira <akr@m17n.org>
+Sat Mar 31 21:39:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/gdbm/gdbm.c (Init_gdbm): define GDBM::READER, GDBM::WRITER,
- GDBM::WRCREAT and GDBM::NEWDB.
- (fgdbm_initialize): use specified read/write flag.
+ * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): dup to prevent
+ @timeout_info's "can't add a new key into hash during iteration".
-Wed Apr 14 11:29:56 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Sat Mar 31 14:22:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * numeric.c (flo_eq): workaround for bcc32's bug.
- (ruby-bugs-ja:PR#594)
+ * 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.
-Wed Apr 14 13:06:35 2004 Doug Kearns <djkea2@mugca.its.monash.edu.au>
+Sat Mar 31 14:16:02 2012 Sokolov Yura (funny-falcon) <funny.falcon@gmail.com>
- * array.c, enum.c, eval.c, file.c, io.c, numeric.c, object.c, prec.c,
- process.c, re.c, string.c: typos in RDoc comments. [ruby-core:02783]
+ * hash.c: do not allocate st_table when it is not necessary.
-Wed Apr 14 11:06:38 2004 Dave Thomas <dave@pragprog.com>
+Sat Mar 31 13:42:39 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::scan): Changed
- behavior of :enddoc: -- it now unconditionally terminates
- processing of the current file.
+ * lib/net/ftp.rb (read_timeout=, open_timeout=): supported timeout.
-Wed Apr 14 11:03:22 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat Mar 31 13:20:40 2012 Sokolov Yura (funny-falcon) <funny.falcon@gmail.com>
- * defines.h: include <net/socket.h> to get fd_set definition in BeOS.
+ * hash.c: remove unnecessary checks for Qundef in hash iterations.
+ since hash use st_foreach_check for iterations, such checks are
+ needless.
-Tue Apr 13 23:06:30 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat Mar 31 12:05:01 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * lib/rinda/rinda.rb: change pattern matching.
- a === b -> a == b || a === b. [druby-ja:98]
+ * ext/openssl/ossl_x509cert.c: Fix doc typo.
- * test/rinda/test_rinda.rb: ditto.
+Sat Mar 31 10:13:24 2012 Sokolov Yura (funny-falcon) <funny.falcon@gmail.com>
-Tue Apr 13 19:54:29 2004 Minero Aoki <aamine@loveruby.net>
+ * st.c (st_foreach_check, st_foreach): remove ancient check. This
+ check are from initial ordered hash commit when first entry were
+ created with entry->fore = entry->back = entry.
- * lib/net/http.rb: should not overwrite HTTP request header.
- [ruby-list:39543]
+ * st.c (st_delete): use real_entries in st_delete for packed tables
-Tue Apr 13 01:30:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Sat Mar 31 07:53:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/iconv/iconv.c: RDoc documentation (from RD; nearly finished).
- * ext/iconv/charset_alias.rb: Prevent from RDoc'ing.
+ * st.c (st_foreach_check): remove the entry by replacing with never
+ when ST_DELETE.
-Mon Apr 12 19:11:29 2004 Eric Hodel <drbrain@segment7.net>
+ * hash.c (st_foreach_safe): since table is not for VALUE, Qundef is
+ not special value, so use 0 instead. therefore this function can be
+ applied to only st_table which 0 is invalid as keys, e.g., IDs.
- * gc.c (rb_gc_copy_finalizer): typo. [ruby-core:02774]
+ * hash.c: Qundef cannot be passed from st_foreach_check().
-Mon Apr 12 18:52:32 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * hash.c, marshal.c, object.c, variable.c: fix callback argument types
+ of iterators.
- * ext/openssl/ossl_x509name.c (ossl_x509name_init_i): should return
- a value.
+Thu Mar 29 23:50:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 12 10:43:47 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * st.c (st_update): pass pointer to key to the callback function.
- * dir.c (rb_glob2, rb_glob, rb_globi, push_globs, push_braces,
- rb_push_glob): fix memory leak. (leaked when block was interrupted)
+Thu Mar 29 16:36:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 12 10:27:37 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * st.c (st_update): add existing parameter to the callback function.
- * bcc32/Makefile.sub: backport SIZEOF_TIME_T definition from 1.9.
+Thu Mar 29 16:35:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/Makefile.sub: ditto.
+ * lib/test/unit.rb (terminal_width, del_status_line, put_status):
+ extract as methods.
- * wince/Makefile.sub: ditto.
+Thu Mar 29 10:20:18 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Sun Apr 11 19:12:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * ruby.c (require_libraries): restore source file/line after
- statically linked extensions initialized. [ruby-dev:23357]
+Thu Mar 29 10:16:05 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Apr 11 10:47:04 2004 Dave Thomas <dave@pragprog.com>
+ * thread_win32.c (TIME_QUANTUM_USEC): 10ms(= old setting) [experimental]
+ cf. [Bug #6098]
- * lib/rdoc/code_objects.rb (RDoc::TopLevel::add_class_or_module): Toplevel
- classes and modules are a special case too... (handle extending existing
- classes with or without :enddoc:)
+Thu Mar 29 10:12:12 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Apr 10 23:51:13 2004 Dave Thomas <dave@pragprog.com>
+ * thread.c (rb_threadptr_execute_interrupts_common): use defined
+ TIME_QUANTUM_USEC instead of a magic number. there is no meanings
+ to use different values for checking interval of interruption and
+ thread switching limits.
+ cf. [Bug #6098]
- * lib/rdoc/code_objects.rb (RDoc::Context::add_to): Implementation of :enddoc:
- made one too many assumptions...
+Thu Mar 29 09:26:17 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Sat Apr 10 00:00:19 2004 Dave Thomas <dave@pragprog.com>
+ * 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]
- * lib/rdoc/markup/simple_markup/inline.rb: Fix problem
- with \_cat_<b>dog</b>
+Thu Mar 29 08:25:35 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Wed Apr 7 00:19:50 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * NEWS: add note about unified behavior of encoding nil values in
+ instances of OpenSSL::ASN1::ASN1Data.
- * lib/rinda/rinda.rb: fix hash tuple bug.
+Thu Mar 29 07:45:36 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * lib/rinda/tuplespace.rb: ditto.
+ * 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]
- * test/rinda/test_rinda.rb
+Wed Mar 28 16:39:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Apr 6 18:24:18 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (obj2uid, obj2gid): allow strings as input user/group id.
+ [ruby-core:40923][Feature #5610]
- * io.c (rb_io_reopen): should use rb_io_check_io().
+Wed Mar 28 15:06:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Apr 6 16:46:09 2004 Tanaka Akira <akr@m17n.org>
+ * 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]
- * configure.in: check the size of time_t.
+Wed Mar 28 08:44:24 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * time.c (time_add): new function.
- (time_plus): use time_add.
- (time_minus): use time_add.
+ * ext/psych/lib/psych.rb: updating version to match gem
+ * ext/psych/psych.gemspec: ditto
+ * ext/psych/lib/psych/visitors/to_ruby.rb: fixing deprecation warning
-Tue Apr 6 13:21:30 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Mar 27 23:44:11 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/socket/socket.c (make_hostent): must return value.
+ * io.c (io_unread): fixed memory leak. report by nagachika via IRC.
-Tue Apr 6 00:05:30 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Mar 27 22:44:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rinda/rinda.rb: add require 'drb/drb'
+ * configure.in (verconf.h): separate load path specific stuff from
+ config.h.
-Mon Apr 5 08:18:23 2004 Dave Thomas <dave@pragprog.com>
+Tue Mar 27 22:43:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/rdoc.rb: Remove leading ./ from file names so that cross
- references work properly.
+ * win32/Makefile.sub: fix config.h path to include.
-Sun Apr 4 20:33:42 2004 Minero Aoki <aamine@loveruby.net>
+Tue Mar 27 17:08:08 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * eval.c (Init_load): make $LOADED_FEATURES built-in.
- [ruby-dev:23299]
+ * win32/win32.c (check_if_dir): fix memory leak.
- * ruby.c (ruby_prog_init): make $PROGRAM_NAME built-in.
+Tue Mar 27 13:13:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/English.rb: remove $LOADED_FEATURES and $PROGRAM_NAME.
+ * string.c (str_new_empty): should copy also the encoding as an
+ empty substring. [ruby-dev:45441][Bug #6206]
-Sun Apr 4 14:01:20 2004 Dave Thomas <dave@pragprog.com>
+Mon Mar 26 23:43:04 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/rdoc/options.rb (Options::parse): Allow multiple -x options to RDoc.
- Fix bug where files weren't being excluded properly
+ * lib/net/ftp.rb (parse227, parse228, parse229): don't use $~.
-Sat Apr 3 17:11:05 2004 why the lucky stiff <why@ruby-lang.org>
+Mon Mar 26 23:34:40 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/syck/syck.h: version 0.43.
+ * lib/net/ftp.rb (parse227, parse228, parse229): don't use local
+ variables defined by named capture for other Ruby implementations
+ such as Rubinius.
- * ext/syck/lib/gram.c: allow root-level inline collections.
- [ruby-talk:94922]
+Mon Mar 26 23:19:03 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/yaml/rubytypes.rb (Symbol#to_yaml): emit symbols as implicits.
- [ruby-talk:94930]
+ * lib/net/ftp.rb (parse_pasv_port): refactored.
- * ext/syck/bytecode.c: turn off default implicit typing.
+Mon Mar 26 19:49:49 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/syck/implicit.c: detect base60 integers.
+ * test/net/ftp/test_ftp.rb: add the test, which was forgotten in the
+ previous commit.
- * ext/syck/rubyext.c: handle base60, as well as hex and octal
- with commas. implicit typing of ruby symbols.
+Mon Mar 26 19:37:27 2012 Shugo Maeda <shugo@ruby-lang.org>
-Fri Apr 2 17:27:17 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/net/ftp.rb (parse227, parse228, parse229): refactored.
- * eval.c (top_include): include in the wrapped load is done for
- the wrapper, not for a singleton class for wrapped main.
- [ruby-dev:23305]
+Mon Mar 26 11:46:23 2012 Shugo Maeda <shugo@ruby-lang.org>
-Fri Apr 2 15:13:44 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * enumerator.c (inspect_enumerator): show method arguments of
+ lazy enumerators correctly.
- * bignum.c (rb_big_eq): use temporary double variable to save the
- result (internal float register may be bigger than 64 bits, for
- example, 80 bits on x86). [ruby-dev:23311]
+Mon Mar 26 13:51:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Apr 2 14:35:26 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * win32/win32.c (check_if_dir, check_if_wdir): fix for Visual C++
+ not to use S_ISDIR(). [Feature #2408][ruby-core:26925]
- * eval.c (block_pass): should generate unique identifier of the
- pushing block. [ruby-talk:96363]
+ * ruby.c (load_file_internal): ditto.
-Fri Apr 2 07:31:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Mar 26 11:46:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c (make_hostent): fix memory leak, based on
- the patch from HORIKAWA Hisashi <vzw00011@nifty.ne.jp>.
+ * ruby.c (load_file_internal): bail out if the script is a directory.
+ [Feature #2408][ruby-core:26925]
-Thu Apr 1 22:55:33 2004 Dave Thomas <dave@pragprog.com>
+ * win32/win32.c (rb_w32_open, rb_w32_wopen): check if the file is a
+ directory when access denied, to set errno to EISDIR.
- * lib/rdoc/parsers/parse_rb.rb: Allow rdoc comments in
- =begin rdoc/=end
+Sun Mar 25 18:13:14 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rdoc/parsers/parse_rb.rb: Fix problem with comment in
- top-level method being taken as file comment.
+ * string.c (tr_setup_table): fix multiple non latin argument for
+ non latin (over 256 characters) tr-like methods.
+ [ruby-core:43371] [Bug #6167]
-Thu Apr 1 22:55:04 2004 Dave Thomas <dave@pragprog.com>
+Sun Mar 25 00:46:06 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/rdoc/ri/ri_options.rb: Fix undefined variable warning.
+ * 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.
-Thu Apr 1 19:58:37 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * enumerator (RETURN_LAZY): don't set the instance variable "receiver".
- * lib/soap/mapping/{factory.rb,registry.rb}: fixed illegal mapped URI
- object with soap/marshal.
- added URIFactory class for URI mapping. BasetypeFactory checks
- instance_variables when original mapping is not allowed (ivar must
- be empty). Instance of URI have instance_variables but it must be
- llowed whenever original mapping is allowed or not.
+Sat Mar 24 23:59:00 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/xsd/datatypes.rb: check the smallest positive non-zero
- single-precision float exactly instead of packing with "f".
- [ruby-talk:88822]
+ * enumerator (enumerator_inspect): include the original receiver and
+ method name of Enumerator::Lazy in the result of inspect.
+ [ruby-core:43345] [Bug #6159]
- * lib/soap/mapping/rubytypeFactory.rb: should not dump singleton class.
- [ruby-dev:22588]
- c = class << Object.new; class C; self; end; end; SOAPMarshal.dump(c)
+ * 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.
-Wed Mar 31 19:06:23 2004 Tanaka Akira <akr@m17n.org>
+Sat Mar 24 22:22:18 2012 Sambasiva Rao Suda <sambasivarao@gmail.org>
- * time.c (year_leap_p): new function.
- (timegm_noleapsecond): ditto.
- (search_time_t): use timegm_noleapsecond instead of
- mktime for first guess.
+ * time.c (time_init_1): Time.new will accept seconds as string or
+ int. [ruby-core:43569][Bug #6193]
-Wed Mar 31 12:04:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Mar 23 15:12:12 2012 Martin Duerst <duerst@it.aoyama.ac.jp>
- * lib/delegate.rb (DelegateClass): define internal methods of the
- result class, but not metaclass of the caller. [ruby-talk:96156]
+ * transcode.c (documentation for str_encode): Explain
+ that transcoding to the same encoding is a no-op
+ (i.e. no exceptions, no replacements,...).
+ [ruby-core:43557][Bug #6190]
- * intern.h: provide proper prototypes. [ruby-core:02724]
+Fri Mar 23 13:19:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby.h: missing.h is now prerequisite to intern.h.
+ * bignum.c (rb_str_to_inum): must be ASCII compatible encoding as
+ well as String#hex and String#oct. [ruby-core:43566][Bug #6192]
-Tue Mar 30 20:25:34 2004 Tanaka Akira <akr@m17n.org>
+ * string.c (rb_must_asciicompat): check if ASCII compatible.
- * time.c (search_time_t): limit guess range by mktime if it is
- available. [ruby-dev:23274]
+Thu Mar 22 23:14:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Mar 28 14:16:59 2004 Minero Aoki <aamine@loveruby.net>
+ * transcode.c (str_encode_bang, encoded_dup): if nothing was
+ transcoded, just set encoding but leave coderange unchanged as
+ force_encoding. [ruby-core:43557][Bug #6190]
- * lib/net/pop.rb (auth): failed when account/password include "%".
- [ruby-talk:95933]
+Thu Mar 22 22:30:44 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Sat Mar 27 21:40:41 2004 Tanaka Akira <akr@m17n.org>
+ * io.c (static int io_fflush): add the definition.
+ Use it in set_binary_mode_with_seek_cur().
- * lib/open-uri.rb: permit extra semicolon in content-type field.
+ * io.c (set_binary_mode_with_seek_cur): refactoring to split the
+ content into io_unread(). Fix the possibility of buffer overflow.
-Sat Mar 27 10:40:48 2004 Tanaka Akira <akr@m17n.org>
+ * 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.
- * (lib/pp.rb, lib/prettyprint.rb): define seplist in PP::PPMethods
- instead of PrettyPrint.
+ * 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]
-Thu Mar 25 23:28:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Mar 22 19:55:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * time.c (time_overflow_p): backport 1.9 usec overflow function.
- (ruby-bugs PR#1307)
+ * win32/win32.c (rb_w32_fstat, rb_w32_fstati64): convert FILETIME
+ to time_t directly, not to be affected by TZ unnecessarily.
-Thu Mar 25 23:15:24 2004 Dave Thomas <dave@pragprog.com>
+ * win32/win32.c (unixtime_to_filetime): convert time_t to FILETIME
+ simply.
- * lib/rdoc/ri/ri_options.rb (RI::Options::show_version):
- Add --version option
+Thu Mar 22 13:43:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Mar 25 04:16:18 2004 Dave Thomas <dave@pragprog.com>
+ * ext/openssl/ossl_pkey_rsa.c (rsa_generate): fix argument type.
+ [Bug #6094]
- * lib/rdoc/ri/ri_options.rb (RI::Options): Add the --list-names option,
- which dumps our all known names
+Thu Mar 22 11:14:10 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Mar 25 03:57:47 2004 Dave Thomas <dave@pragprog.com>
+ * test/ruby/test_io.rb (TestIO#test_pos_with_getc): updated.
+ see [ruby-core:43550]
- * lib/rdoc/ri/ri_util.rb (NameDescriptor::initialize): No longer
- allow nested classes to be designated using "."--you must
- now use "::"
+Wed Mar 21 17:57:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Mar 25 02:00:18 2004 Dave Thomas <dave@pragprog.com>
+ * regcomp.c: Merge Onigmo 3d855b30d574536d3ae600260208c6624ae4791c.
+ [Bug#6143] [Bug#6144] [Bug#6145]
- * lib/rdoc/generators/template/html/one_page_html.rb (Page):
- Fix to work with C modules.
+Wed Mar 21 17:01:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Mar 24 21:17:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * test/ruby/test_io.rb (TestIO#test_pos_with_getc): added.
+ see [Bug #6179][ruby-core:43518]
- * lib/uri.rb: Documented (thanks Dmitry V. Sabanin).
- * lib/uri/common.rb: Ditto.
- * lib/uri/ftp.rb: Ditto.
- * lib/uri/generic.rb: Ditto.
- * lib/uri/http.rb: Ditto.
- * lib/uri/https.rb: Ditto.
- * lib/uri/ldap.rb: Ditto.
- * lib/uri/mailto.rb: Ditto.
- (All backported from 1.9)
+Mon Mar 19 17:18:51 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed Mar 24 18:48:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enumerator.c (lazy_flat_map_func): convert the block value to
+ Array if it doesn't respond to each. [ruby-core:43334]
+ [Bug #6155]
- * lib/mkmf.rb ($ruby, $topdir, $hdrdir): should not be affected by
- DESTDIR after installed.
+Mon Mar 19 16:34:14 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/mkmf.rb (RUBY): / is not recognized as path separator on
- nmake/bmake. [ruby-list:39388]
+ * enum.c (zip_i): variadic argument needs explicit cast on the
+ platforms where VALUE is longer than int.
- * lib/mkmf.rb (init_mkmf): $INCFLAGS also should be lazy-evaluated.
+Mon Mar 19 15:36:41 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed Mar 24 12:32:56 2004 Dave Thomas <dave@pragprog.com>
+ * enumerator.c (enumerable_lazy): add an example of take and first
+ to the documentation. [ruby-core:43344] [Bug #6158]
+ add the description of the behavior when a block is given to zip
+ or cycle.
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::handle_class_module):
- Don't document methods if we don't know for sure the
- class or module.
+Mon Mar 19 15:20:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_class):
- Don't store documentation for singleton classes if we
- don't know the real class.
+ * compile.c (iseq_specialized_instruction): DRY and replace chain
+ of if-else with switch for special instructions. based on a
+ patch by Vasfed. https://github.com/ruby/ruby/pull/105
-Wed Mar 24 11:11:26 2004 Dave Thomas <dave@pragprog.com>
+Mon Mar 19 15:05:54 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * lib/rdoc/generators/html_generator.rb (Generators::HTMLGenerator::load_html_template):
- Allow non-RDoc templates by putting a slash in the template name
+ * test/test_pty.rb: same as r29280, skip tests when PTY allocation
+ failed (that's not our fault).
-Mon Mar 22 16:19:57 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Sun Mar 18 23:21:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby.1: add -width option to .Bl for old groff.
+ * gc.c (aligned_free): fix condition for free. memalign() and
+ posix_memalign() are not defined together normally.
-Sun Mar 21 21:11:16 2004 Keiju Ishitsuka <keiju@ishitsuka.com>
+Sun Mar 18 18:31:45 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * lib/shell/*: bug fix for Shell#system(command_line_string).
+ * gc.c (aligned_malloc, aligned_free): added fallback implementations
+ for platforms like OSX Leopard.
-Sat Mar 20 20:57:10 2004 David Black <dblack@wobblini.net>
+Sun Mar 18 17:17:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/scanf.rb: Backported 1.9 branch
- modifications/corrections to 1.8 branch
+ * bignum.c (rb_big_pow): estimate result bit size more precisely.
+ [ruby-core:30735][Feature #3429]
-Sat Mar 20 23:51:03 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Sun Mar 18 17:17:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_require_safe): preserve old ruby_errinfo.
- [ruby-talk:95409]
+ * gc.c (free_method_entry_i): method entry may be in
+ unlinked_method_entry_list. [ruby-core:43383][Bug #6171]
- * eval.c (rb_f_raise): should not clear backtrace information if
- exception object already have one.
+Sun Mar 18 15:27:31 2012 Tanaka Akira <akr@fsij.org>
-Sat Mar 20 15:25:36 2004 Dave Thomas <dave@pragprog.com>
+ * compile.c: typo fix by Run Paint Run Run.
+ [ruby-core:28368] [Bug #2824]
- * lib/rdoc/generators/template/html/html.rb (RDoc::Page): Force
- page background to white.
+Sun Mar 18 10:01:02 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Sat Mar 20 09:52:33 2004 Tadayoshi Funaba <tadf@dotrb.org>
+ * lib/profiler.rb: support calling singleton methods of
+ an instance of BasicObject.
- * lib/date.rb, lib/date/format.rb: _parse() now accepts fractional
- part of second minute that follows a comma or a full stop.
+Sat Mar 17 06:56:58 2012 Eric Hodel <drbrain@segment7.net>
-Fri Mar 19 01:55:57 2004 Mauricio Fernandez <batsman.geo@yahoo.com>
+ * object.c: Fix indentation of Class#inherited example.
- * io.c (rb_io_sync): need not to check writable. [ruby-core:02674]
+Sat Mar 17 01:46:05 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Thu Mar 18 21:44:38 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * string.c (trnext): fix bug with string ending with '\\'.
+ [ruby-dev:45374][Bug #6160]
- * lib/drb/drb.rb: backport drb.rb 1.16.
+ * test/ruby/test_string.rb (TestString#test_delete): test for
+ above.
-Fri Mar 18 17:49:51 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Mar 16 20:06:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * struct.c (make_struct): allow const_id for accessor names.
- [ruby-core:04585]
+ * string.c (trnext): should advance char-wise.
+ [ruby-core:43335][Bug #6156]
- * eval.c (rb_attr): check if attribute name is local_id or
- const_id.
+Fri Mar 16 17:42:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Mar 18 16:22:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * parse.y (block_append_gen): fix unreachable warning line number.
+ should warn at the code, not jump.
- * eval.c (proc_eq): avoid false positive by using scope and
- dyna_vars. no longer use frame.uniq.
+Fri Mar 16 17:33:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 17 14:44:43 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * enum.c (enum_take): allocate buffer array before iteration, as well
+ as enum_first did.
- * dir.c (range): fix possible "\0" overrun. (in case of "\0-")
+ * enum.c (enum_first): remove duplication.
-Mon Mar 15 07:39:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Mar 16 14:43:18 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * eval.c (rb_yield_0): should not re-submit TAG_BREAK if this
- yield is not break destination. [ruby-dev:23197]
+ * load.c (ruby_init_ext): don't free the given pointer itself.
+ It is not guaranteed even that the pointer is on heap.
-Sat Mar 13 14:28:16 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Fri Mar 16 14:37:57 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test/drb/test_drbssl.rb: rescue LoadError. (Barkport from main
- trunk)
+ * vm_eval.c (rb_mod_module_eval): fix the documentation of
+ class_eval to mention class variable lookup. [ruby-core:40649]
+ [Bug #5544]
- * test/drb/test_drbunix.rb: ditto.
+Fri Mar 16 14:27:11 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed Mar 10 22:28:09 2004 Minero Aoki <aamine@loveruby.net>
+ * vm_eval.c (rb_mod_module_eval): fix the documentation of
+ class_eval to mention constant lookup. [ruby-core:41718]
+ [Bug #5777]
- * lib/fileutils.rb (remove_dir): should handle symlink correctly.
- This patch is contributed by Christian Loew. [ruby-talk:94635]
- (Backport from main trunk)
+Fri Mar 16 14:10:45 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed Mar 10 16:28:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/net/imap.rb (initialize): raise Net::IMAP::Error when the
+ connection is closed without a greeting response.
+ [ruby-core:40938] [Bug #5616]
- * eval.c (return_jump): set return value to the return
- destination. separated from localjump_destination().
+Fri Mar 16 13:50:12 2012 Shugo Maeda <shugo@ruby-lang.org>
- * eval.c (break_jump): break innermost loop (or thread or proc).
+ * lib/net/imap.rb (rfc822_text): ignore [] after RFC822.
+ [ruby-core:40945] [Bug #5620]
- * eval.c (rb_yield_0): set exit_value for block break.
+Fri Mar 16 12:00:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 10 15:58:43 2004 Ryan Davis <ryand@zenspider.com>
+ * vm_insnhelper.c (argument_error): use line number at the beginning
+ of lambda, not the first code of its body.
+ [ruby-core:43314][Bug #6151]
- * eval.c (eval): Only print backtrace if generating the backtrace
- doesn't generate an exception. [ruby-core:02621]
+ * iseq.c (rb_iseq_first_lineno): constified.
-Tue Mar 9 13:04:26 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Mar 16 11:20:07 2012 Shugo Maeda <shugo@ruby-lang.org>
- * io.c (rb_io_ungetc): raise IOError instead of calling
- rb_sys_fail(). [ruby-talk:23181]
+ * enumerator.c (lazy_take): don't enumerate an extra value.
+ [ruby-dev:45370] [Bug #6152]
-Mon Mar 8 19:32:28 2004 akira yamada <akira@ruby-lang.org>
+Fri Mar 16 06:30:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/uri/common.rb (URI::REGEXP::PATTERN::HOSTPORT): (?:#{PORT})
- -> (?::#{PORT}). [ruby-dev:23170]
+ * enumerator.c (lazy_zip_func): variadic argument needs explicit cast
+ on the platforms where VALUE is longer than int.
-Mon Mar 8 15:31:41 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * enumerator.c (lazy_init_iterator): no need to check overflow twice.
- * dir.c (range): treat incomplete '[' as ordinary character (like
- has_magic does).
+Fri Mar 16 05:47:09 2012 Eric Hodel <drbrain@segment7.net>
- * dir.c (range): Cancel above change. More discussion is needed.
+ * enumerator.c (lazy_init_iterator): Fix type error (int vs long).
-Sun Mar 7 22:37:46 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Thu Mar 15 23:13:36 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test/drb/ut_drb.rb: use 'druby://localhost:0'. [ruby-dev:23078]
+ * enum.c (rb_enum_values_pack): rename from enum_values_pack, and
+ remove static.
- * test/drb/ut_eval.rb: ditto.
+ * enumerator.c (lazy_init_iterator, lazy_init_yielder,
+ lazy_select_func, lazy_reject_func, lazy_grep_func): handle
+ multiple values correctly.
- * test/drb/ut_large.rb: ditto.
+ * enumerator.c (lazy_grep): change the behavior when a block is
+ given, to be consistent with Enumerable#grep.
- * test/drb/ut_safe1.rb: ditto.
+Thu Mar 15 19:12:31 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test/drb/ut_drb_drbssl.rb: use 'drbssl://localhost:0'.
+ * enumerator.c (lazy_zip): rescue StopIteration returned by
+ Enumerator#next.
-Sun Mar 7 16:22:26 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Thu Mar 15 18:19:53 2012 Shugo Maeda <shugo@ruby-lang.org>
- * Makefile.in (lex.c): use $? instead of $<.
+ * 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}.
-Fri Mar 5 00:54:14 2004 Dave Thomas <dave@pragprog.com>
+Thu Mar 15 17:45:27 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/test/unit.rb: MOve RDoc documentation so that you can
- now say 'ri Test::Unit'
+ * enumerator.c (InitVM_Enumerator): renamed Enumerable::Lazy to
+ Enumerator::Lazy.
-Tue Mar 2 12:32:59 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Mar 15 16:37:38 2012 Shugo Maeda <shugo@ruby-lang.org>
- * win32/Makefile.sub, wince/Makefile.sub (config.h): shouldn't check
- defined? NORETURN. [ruby-dev:23100]
+ * enumerator.c (enumerable_lazy): added cycle to the documentation.
-Mon Mar 1 12:24:10 2004 Dave Thomas <dave@pragprog.com>
+Thu Mar 15 15:37:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_alias):
- Allow aliases to have parentheses
+ * parse.y (parser_yylex): fix warning line number.
-Sun Feb 29 23:14:53 2004 Dave Thomas <dave@pragprog.com>
+Thu Mar 15 15:19:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_class):
- Handle :nodoc: on singleton classes.
+ * enumerator.c (lazy_cycle): check argument number overflow before
+ creating temporary array.
-Sat Feb 28 10:58:49 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Thu Mar 15 15:04:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * MANIFEST: add test_erb.rb
+ * util.c (ruby_strtod): no need to check same digit for hexdigit
+ twice. [ruby-dev:45363][Bug #6146]
- * lib/erb.rb, test/erb/test_erb.rb: don't forget filename,
- if both filename and safe_level given. [ruby-dev:23050]
+ * parse.y (sym_check_asciionly): check ascii compatibility before
+ scanning for code range.
-Fri Feb 27 01:00:09 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * parse.y (intern_str): set to us-ascii if ascii only.
+ [ruby-dev:45363][Bug #6146]
- * lib/drb/drb.rb, test/drb/drbtest.rb: require drb/eq.rb by default
+ * file.c (ruby_enc_find_basename): allow NULL as alllen.
+ [ruby-dev:45363][Bug #6146]
-Wed Feb 25 21:16:25 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 15 14:49:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * instruby.rb (with_destdir): should return the given argument if no
- DESTDIR is given.
+ * string.c (rb_str_conv_enc_opts): default to original encoding.
- * instruby.rb: use path name expansion of cmd.exe.
+Thu Mar 15 13:47:17 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Feb 25 09:35:22 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * hash.c (env_str_new, rb_f_getenv, env_fetch): use rb_str_conv_enc()
+ instead of rb_str_encode() to simplify the code.
- * error.c (NameError::Message): new class for lazy evaluation of
- message to ensure replaced before marshalling. merge from HEAD.
- (ruby-bugs-ja:PR#588)
+Thu Mar 15 12:44:50 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (rb_method_missing): use NameError::Message. merge from
- HEAD. (ruby-bugs-ja:PR#588)
+ * win32/win32.c, include/ruby/win32.h (rb_w32_ugetenv): new API to
+ accept and to return UTF-8 strings.
-Tue Feb 24 18:59:37 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * win32/win32.c (rb_w32_getenv): follow above change.
- * dir.c (glob_helper): '**/' should not match leading period
- unless File::FNM_DOTMATCH is set. (like '*/') [ruby-dev:23014]
+ * win32/win32.c (rb_w32_get_environ): returns UTF-8 environment area.
-Tue Feb 24 13:22:21 2004 Dave Thomas <dave@pragprog.com>
+ * hash.c (env_str_new, rb_f_getenv, env_fetch): follow above changes.
+ [Bug #5570] [ruby-core:40737]
- * lib/rdoc/rdoc.rb (RDoc::RDoc::normalized_file_list): Attempt to get better
- heuristics on which files to include and exclude. Now only include
- non-standard files if they are explicitly named in ARGV.
+Thu Mar 15 10:57:27 2012 Shugo Maeda <shugo@ruby-lang.org>
-Tue Feb 24 07:23:30 2004 Dave Thomas <dave@pragprog.com>
+ * enumerator.c (lazy_cycle): add Enumerable::Lazy#cycle.
- * lib/rdoc/generators/html_generator.rb: Deal with :stopdoc: when
- choosing a default main page to display (ie. don't select a page
- if we don't have documentation for it).
+Thu Mar 15 10:31:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Feb 24 06:40:14 2004 Dave Thomas <dave@pragprog.com>
+ * test/ruby/test_arity.rb (TestArity#err_mess): use assert_raise.
- * lib/rdoc/parsers/parse_rb.rb (RubyLex::identify_identifier): Handle
- class variables in code listings
+Thu Mar 15 07:03:52 2012 Eric Hodel <drbrain@segment7.net>
-Tue Feb 24 06:40:14 2004 Dave Thomas <dave@pragprog.com>
+ * vm_eval.c (check_funcall): Raise ArgumentError if respond_to?
+ requires more than three arguments. [Bug #6000]
- * lib/rdoc/parsers/parse_rb.rb (RubyLex::identify_identifier): Handle
- class variables in code listings
+ * test/ruby/test_object.rb (class TestObject): Test for respond_to?
+ requiring more than three arguments.
-Tue Feb 24 06:32:27 2004 Dave Thomas <dave@pragprog.com>
+Thu Mar 15 06:08:06 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_aliases): Handle
- aliases in C files.
+ * include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]
-Tue Feb 24 06:16:22 2004 Dave Thomas <dave@pragprog.com>
+ * array.c: Use rb_check_arity / rb_error_arity
- * lib/rdoc/rdoc.rb (RDoc::RDoc::document): Now create op dir _before_
- parsing files.
+ * class.c: ditto
-Tue Feb 24 06:08:47 2004 Dave Thomas <dave@pragprog.com>
+ * enumerator.c: ditto
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_constant):
- Start collecting text of constant values earlier: was missing
- values in output if there was no space after '='
+ * eval.c: ditto
-Tue Feb 24 06:08:25 2004 Dave Thomas <dave@pragprog.com>
+ * file.c: ditto
- * lib/rdoc/generators/html_generator.rb: Escape contant values.
+ * hash.c: ditto
-Tue Feb 24 03:45:06 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * numeric.c: ditto
- * ext/openssl/ossl_config.c (ossl_config_each): add new method
- OpenSSL::Config#each. it iterates with section name, field name
- and value.
+ * proc.c: ditto
- * ext/openssl/ossl_config.c (Init_ossl_config): include Enumerable.
+ * process.c: ditto
-Mon Feb 23 09:16:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * random.c: ditto
- * instruby.rb (DOSISH): embedded path in batch files should not be
- prefixed by DESTDIR. [ruby-core:02186]
+ * re.c: ditto
-Sun Feb 22 09:54:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * signal.c: ditto
- * re.c: corrected documentation format (again)
+ * string.c: ditto
-Sun Feb 22 09:43:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * struct.c: ditto
- * re.c: corrected documentation format (rb_reg_initialize_m)
+ * transcode.c: ditto
-Sat Feb 21 22:36:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * vm_eval.c: ditto
- * ext/zlib/zlib.c: documented, but needs more effort.
+ * vm_insnhelper.c: ditto & implementation of rb_error_arity
-Sat Feb 21 11:12:15 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_arity.rb: tests for above
- * missing/os2.c, missing/x68.c: typo fix. pointed out by greentea.
+Thu Mar 15 06:08:05 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Fri Feb 20 18:59:47 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_insnhelper.c: improve number of arguments error in case of
+ optional parameters (issue #6085)
- * lib/irb/init.rb (IRB::IRB.parse_opts): add -I option to
- irb. [ruby-dev:39243]
+ * include/ruby/intern.h: define UNLIMITED_ARGUMENTS
-Thu Feb 19 23:24:16 2004 Dave Thomas <dave@pragprog.com>
+ * test/ruby/test_arity.rb: test for above
- * lib/rdoc/generators/html_generator.rb (Generators::HtmlClass::build_attribute_list):
- Support visibility modifiers for attributes
+Thu Mar 15 00:58:04 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Feb 19 23:24:16 2004 Dave Thomas <dave@pragprog.com>
+ * enumerator.c (enumerable_lazy): fix the documentation of
+ Enumerable#lazy.
- * lib/rdoc/generators/html_generator.rb (Generators::HtmlClass::build_attribute_list):
- Support visibility modifiers for attributes
+Wed Mar 14 22:01:06 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Feb 19 22:39:04 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * enumerator.c (lazy_init_iterator): break when Qundef is returned
+ to make obj.drop(3).take(2) work properly.
- * test/rinda/test_rinda.rb: DRb.start_service only once in testsuites.
- DRb.start_service could handle this.
+ * enumerator.c (lazy_take_while): add Enumerable::Lazy#take_while.
-Thu Feb 19 22:19:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * enumerator.c (lazy_drop): add Enumerable::Lazy#drop.
- * lib/ostruct.rb: documented
+ * enumerator.c (lazy_drop_while): add Enumerable::Lazy#drop_while.
-Thu Feb 19 21:28:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * enumerator.c (InitVM_Enumerator): add Enumerable::Lazy#force as an
+ alias of to_a.
- * ext/strscan/strscan.c: improved documentation
+Wed Mar 14 19:28:40 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Feb 19 03:10:52 2004 Minero Aoki <aamine@loveruby.net>
+ * enumerator.c (lazy_take): add Enumerable::Lazy#take.
- * ext/strscan/strscan.c: synchronized with main trunk (rev 1.11).
+Wed Mar 14 18:40:36 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Feb 19 02:30:34 2004 Minero Aoki <aamine@loveruby.net>
+ * enumerator.c: use long for array indices.
- * ext/strscan/strscan.c: documentation checked.
+Wed Mar 14 18:25:18 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Feb 19 00:11:05 2004 Dave Thomas <dave@pragprog.com>
+ * enumerator.c: moved the comment of StopIteration.
- * lib/rdoc/markup/simple_markup/preprocess.rb (SM::PreProcess::handle):
- Strip extraneous space from filenames in :include:
+Wed Mar 14 17:55:29 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Feb 18 22:52:00 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * numeric.c (flodivmod): must go through the same pass if HAVE_FMOD or
+ not. this is a bugfix of r35013.
- * lib/drb/unix.rb: remove O_NONBLOCK, thanks \ay
+Wed Mar 14 16:41:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Feb 18 22:47:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * test/test_tmpdir.rb (TestTmpdir#test_world_writable): skip on Windows.
- * ext/strscan/strscan.c: documented
+Wed Mar 14 15:09:23 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Wed Feb 18 22:03:11 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * numeric.c: fix flodivmod for cornercases [Bug #6044]
+ add ruby_float_mod
- * test/*: should not depend on $KCODE.
+ * insns.def (opt_mod): use ruby_float_mod
-Wed Feb 18 17:18:01 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * internal.h: declare ruby_float_mod
- * ext/win32ole/win32ole.c: need to include <olectl.h> on Cygwin.
+ * test/ruby/test_float.rb: tests for above
-Wed Feb 18 10:40:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/envutil.rb: create helper assert_is_minus_zero
- * sprintf.c (rb_f_sprintf): do not prepend dots for negative
- numbers if FZERO is specified. [ruby-list:39218]
+Wed Mar 14 10:44:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Feb 17 23:40:34 2004 Guy Decoux <ts@moulon.inra.fr>
+ * enumerator.c (lazy_grep_func): should use === instead of =~, as
+ well as Enumerable#grep
- * sprintf.c (rb_f_sprintf): preserve original val for
- format_integer. [ruby-talk:92975]
+Wed Mar 14 08:15:54 2012 Shugo Maeda <shugo@ruby-lang.org>
-Tue Feb 17 23:28:45 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * enumerator.c (lazy_flat_map_func): use each for non-Array objects.
- * test/ruby/marshaltestlib.rb: common marshal testcase added.
+Wed Mar 14 08:06:35 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test/ruby/test_marshal.rb: use above testsuite.
+ * enumerator.c (lazy_zip): add Enumerable::Lazy#zip.
- * test/soap/marshal/test_marshal.rb: ditto.
+ * enumerator.c (lazy_lazy): just returns self.
- * test/soap/marshal/cmarshal.rb: removed (not used).
+Wed Mar 14 07:48:36 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Tue Feb 17 10:51:23 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/date/date_core.c (datetime_s_now): [ruby-core:43256].
- * ext/syck/rubyext.c (syck_emitter_end_object): takes only one arg.
+Tue Mar 13 22:00:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Feb 17 01:35:28 2004 Tanaka Akira <akr@m17n.org>
+ * compile.c (iseq_set_arguments): keyword rest arg without keyword args.
- * eval.c (rb_eval): care that another thread replace NODE_DREGX_ONCE
- to NODE_LIT. [ruby-dev:22920]
+ * node.c (dump_node): dump kw_rest_arg too.
-Tue Feb 17 01:24:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (block_param, f_arg): more kwrest patterns.
+ [ruby-core:42455][Bug #5989]
- * bcc32/Makefile.sub, win32/Makefile.sub (config.h): define
- STACK_GROW_DIRECTION. [ruby-dev:22910]
+ * parse.y (new_args_gen): no extra kw_rest_arg if no keyword rest arg.
- * bcc32/Makefile.sub (config.h): add newer checks.
+Tue Mar 13 15:17:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * wince/Makefile.sub (config.h): define NEED_IO_SEEK_BETWEEN_RW.
+ * parse.y (block_param, f_args): add rules for the case arguments
+ begin with kwrest. [ruby-core:42455][Bug #5989]
-Tue Feb 17 00:38:10 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Mar 13 12:37:53 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rinda/tuplespace.rb: TupleSpace#initialize, stop doubling timeout
+ * io.c (io_encoding_set): always warn if external encoding and internal
+ encoding are identical. [ruby-core:40727] [Bug #5568]
-Tue Feb 17 00:18:03 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Mar 13 12:37:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/rinda/test_rinda.rb: import test_rinda.rb
+ * gc.c: add ObjectSpace::WeakMap. [ruby-dev:44565][Bug #5350]
-Tue Feb 17 00:14:30 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/weakref.rb: use WeakMap instead of _id2ref.
- * bcc32/Makefile.sub: avoid warning "Redefinition of macro
- 'HAVE_GETLOGIN'".
+Tue Mar 13 10:59:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vms/config.h_in: ditto.
+ * tool/rbinstall.rb (prepare): skip if basedir is not defined.
+ [ruby-core:39135][Bug #5238]
-Mon Feb 16 23:28:14 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * tool/rbinstall.rb (CONFIG.[]): check for mandatory
+ configurations.
- * lib/csv.rb: document reduction. [ruby-core:02429]
+Tue Mar 13 00:09:18 2012 Shugo Maeda <shugo@ruby-lang.org>
-Mon Feb 16 22:08:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * enumerator.c (enumerable_lazy): added documentation.
- * lib/generator.rb: corrected doc format
- * lib/rinda/rinda.rb: added documentation (from Hugh Sasse)
- * lib/rinda/tuplespace.rb: ditto
+Mon Mar 12 20:19:25 2012 Tanaka Akira <akr@fsij.org>
-Mon Feb 16 20:41:32 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/tmpdir.rb (Dir::tmpdir): test the current directory suitable for
+ temporary directory.
- * bcc32/Makefile.sub: show more warnings. (refering to mingw)
+Mon Mar 12 20:08:16 2012 Tanaka Akira <akr@fsij.org>
- * bcc32/setup.mak: ditto.
+ * lib/fileutils.rb (fu_have_symlink?): specify TypeError for rescue
+ clause.
-Mon Feb 16 13:39:44 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Mar 12 19:23:13 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dir.c (rb_glob, rb_globi): add const.
+ * encoding.c (rb_find_encoding): new function find encoding from
+ arbitrary object as a pointer to rb_encoding, and return NULL if
+ not found.
- * ruby.h: ditto.
+ * io.c (io_encoding_set): just warn unsupported encodings, but not
+ exception. [ruby-core:40726] [Bug #5567]
-Mon Feb 16 02:16:33 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Mar 12 19:03:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bcc32/Makefile.sub: should warn suspicious pointer conversion.
+ * vm_method.c (Init_eval_method): respond_to? and
+ respond_to_missing? are public.
- * bcc32/setup.mak: ditto.
+Mon Mar 12 14:56:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Feb 15 19:06:42 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * node.h (NEW_YIELD), parse.y (new_yield_gen): array-values flags
+ has been already obsolete. patch by Thomas Enebo.
+ [ruby-core:41929][Bug #5847]
- * lib/rinda/tuplespace.rb: TupleSpace#read(tpl, 0), raise
- RequestExpiredError if not found.
+Mon Mar 12 12:44:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Feb 15 15:56:46 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * vm_method.c (Init_eval_method): copy basic methods to Exception.
+ [ruby-core:40287][Bug #5473]
- * ext/win32ole/win32ole.c: add IDispatch wrapper in val2variant.
- Thanks, arton.
+Mon Mar 12 10:13:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Feb 15 01:46:05 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * eval_jump.c (rb_exec_end_proc): remember the latest exit status.
+ [ruby-core:43173][Bug #5218]
- * lib/mkmf.rb: absolute path of ruby is assigned to $(RUBY).
- [ruby-dev:22870]
+Mon Mar 12 07:33:12 2012 Tanaka Akira <akr@fsij.org>
-Sat Feb 14 11:29:41 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/tmpdir.rb: update document for changing
+ FileUtils.remove_entry_secure to FileUtils.remove_entry.
- * sample/drb/*: import lib/drb/sample
+ * NEWS: add incompatibility note for lib/tmpdir.rb.
-Sat Feb 14 11:08:23 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Mon Mar 12 07:19:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/drb/drb.rb: add pretty_print, thanks gotoken.
+ * lib/tmpdir.rb (Dir.tmpdir): should not use world-writable but
+ non-sticky directory.
-Fri Feb 13 12:35:08 2004 Minero Aoki <aamine@loveruby.net>
+ * lib/tmpdir.rb (Dir.mktmpdir): check the parent directory.
- * test/fileutils/test_fileutils.rb: File.link may raise EINVAL and
- EACCES on Windows.
+Mon Mar 12 07:04:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Feb 12 21:45:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * random.c (Init_Random): removed rb_Random_DEFAULT and register as
+ mark-object instead of global variable.
- * lib/ftools.rb: documented
+Mon Mar 12 07:03:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Feb 12 21:25:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * random.c (random_s_rand): ensure default PRNG is re-initialized
+ after fork. patched by Eric Wong. [ruby-core:41209][Bug #5661]
- * lib/base64.rb: backported from HEAD (modularised and documented)
+Sun Mar 11 23:57:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Feb 12 20:31:48 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * lib/mkmf.rb (create_tmpsrc): cpp32 of Borland C++ ignores #error
- directives in DOS line-ending files at all.
+Sun Mar 11 22:32:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Feb 12 02:23:56 2004 Tanaka Akira <akr@m17n.org>
+ * ext/json: Merge 164a75c8bd2007d32c4d7665d53140d8fc126dcd.
+ [ruby-core:41917] [Bug #5846]
- * lib/pathname.rb: use assert_raise instead of assert_raises.
+Sun Mar 11 17:10:04 2012 Shota Fukumori <sorah@tubusu.net>
- * lib/pp.rb: ditto.
+ * lib/test/unit.rb: Put error message into STDERR if failed to launch
+ worker (job) process. [ruby-dev:44802] [Bug #5577]
- * lib/time.rb: ditto.
+ * lib/test/unit/parallel.rb: If failed to increment_io, exit with code
+ 2. [ruby-dev:44802] [Bug #5577]
- * lib/tsort.rb: ditto.
- use TSortHash and TSortArray instead of Hash and Array in test.
+Sun Mar 11 15:46:45 2012 Shota Fukumori <sorah@tubusu.net>
-Wed Feb 11 20:01:12 2004 akira yamada <akira@ruby-lang.org>
+ * io.c: fix rdoc of `IO.binwrite` to show same as `IO.write` except
+ it opens file with mode "wb:ASCII-8BIT". [Bug #5782] [ruby-core:42592]
- * test/ruby/test_file.rb (TestFile::test_fnmatch): added tests for
- File.fnmatch. [ruby-dev:22815][ruby-dev:22819]
+Sat Mar 10 23:52:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_proc.rb (TestProc::test_eq): added a
- test. [ruby-dev:22599]
+ * st.c: pack tables also generic keys. patched by Sokolov Yura at
+ https://github.com/ruby/ruby/pull/84
- * test/ruby/test_proc.rb (TestProc::test_eq): added tests for
- Proc#==. [ruby-dev:22592], [ruby-dev:22601]
+ * 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
-Tue Feb 10 16:43:56 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * st.c: fix packed num_entries on delete_safe. patched by Sokolov
+ Yura at https://github.com/ruby/ruby/pull/84
- * eval.c (umethod_bind): purge unused check. [ruby-dev:22850]
+Fri Mar 9 14:29:32 2012 Shugo Maeda <shugo@ruby-lang.org>
-Mon Feb 9 17:16:00 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * enumerator.c (lazy_flat_map): add Enumerable::Lazy#flat_map.
- * lib/rdoc/parsers/parse_c.rb: escape '{' and '}' to avoid warnings.
+Fri Mar 9 06:29:22 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Mon Feb 9 13:00:55 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * ext/psych/lib/psych.rb (load, parse): stop parsing or loading after
+ the first document has been parsed.
- * dir.c (fnmatch): File.fnmatch('*?', 'a') should return true.
- [ruby-dev:22815]
+ * test/psych/test_stream.rb: pertinent tests.
- * dir.c (fnmatch): File.fnmatch('\[1\]' , '[1]') should return true.
- [ruby-dev:22819]
+Fri Mar 9 06:17:05 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun Feb 8 16:46:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/lib/psych.rb (parse_stream, load_stream): if a block is
+ given, documents will be yielded to the block as they are parsed.
+ [ruby-core:42404] [Bug #5978]
- * lib/pp.rb (PP::PPMethods::object_address_group): suppress negative
- sign for higher heap areas.
+ * ext/psych/lib/psych/handlers/document_stream.rb: add a handler that
+ yields documents as they are parsed
-Fri Feb 6 22:48:16 2004 Dave Thomas <dave@pragprog.com>
+ * test/psych/test_stream.rb: corresponding tests.
- * lib/rdoc/generators/html_generator.rb (gen_url): Support
- https in RDoc hyperlinks
+Fri Mar 9 00:35:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Feb 6 22:41:22 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * enumerator.c (lazy_initialize, enumerable_lazy): no additional
+ arguments.
- * lib/pp.rb (PPInspectTest#test_to_s_with_iv): rollback the previous
- commit. [ruby-dev:22813]
+Fri Mar 9 00:30:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Feb 6 22:22:50 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * enumerator.c: add Enumerable#lazy. based on the patch by
+ Innokenty Mikhailov at <https://github.com/ruby/ruby/pull/101>
+ [ruby-core:37164] [Feature #4890]
- * lib/pp.rb (PPInspectTest#test_to_s_with_iv): remove instance
- variable which is defined in the test.
+Fri Mar 9 00:25:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Feb 6 00:48:37 2004 Tanaka Akira <akr@m17n.org>
+ * enumerator.c (enumerator_each, generator_each): pass arguments to
+ the block with yielder.
- * lib/prettyprint.rb (PrettyPrint#first?): obsoleted.
+Fri Mar 9 00:25:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Feb 5 23:56:55 2004 Tanaka Akira <akr@m17n.org>
+ * array.c (rb_ary_cat): new function to concat objects into array.
- * lib/prettyprint.rb (PrettyPrint#seplist): added.
+Thu Mar 8 16:44:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/pp.rb (PPMethods#pp_object): use seplist.
- (PPMethods#pp_hash): ditto.
- (Array#pretty_print): ditto.
- (Struct#pretty_print): ditto.
- (MatchData#pretty_print): ditto.
+ * .gdbinit (rb_numtable_entry): update for recent refactoring of
+ st_table.
- * lib/set.rb (Set#pretty_print): use seplist.
+Wed Mar 7 22:41:50 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Wed Feb 4 02:12:06 2004 Tanaka Akira <akr@m17n.org>
+ * lib/xmlrpc/client.rb (module XMLRPC): fix typo.
- * file.c (test_l): fix wrong method name in document.
- (test_S): ditto.
- (test_b): ditto.
- (test_c): ditto.
- (test_suid): ditto.
- (test_sgid): ditto.
- (test_sticky): ditto.
+ * test/xmlrpc/test_client.rb (test_async_call): add test for
+ XMLRPC::Client#call_async to check above fix.
-Tue Feb 3 08:04:57 2004 Tanaka Akira <akr@m17n.org>
+Wed Mar 7 16:30:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/pp.rb (Struct#pretty_print_cycle): follow 1.8 style.
+ * error.c (rb_load_fail): should honor encoding.
-Mon Feb 2 19:33:49 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * load.c (load_failed): ditto.
- * configure.in: backport from 1.9 for Interix.
+Wed Mar 7 12:26:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dln.c (dln_load): ditto.
+ * error.c (rb_load_fail): use path as a string, not char*.
-Mon Feb 2 13:31:51 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * internal.h: (rb_load_fail): moved from ruby/intern.h.
- * lib/net/http.rb (canonical_each): fix merge miss.
+ * ruby.c (load_file_internal): fname cannot be NULL.
-Mon Feb 2 01:54:00 2004 Tanaka Akira <akr@m17n.org>
+Wed Mar 7 08:32:43 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/pp.rb (Struct#pretty_print): make it 1.8 style.
- (Numeric#pretty_print, FalseClass#pretty_print)
- (TrueClass#pretty_print, Module#pretty_print): fix pp for objects
- with instance variables. [ruby-talk:91157]
+ * error.c (rb_loaderror_with_path): Adding the missing file as an
+ instance variable to the LoadError exception.
+ [ruby-core:39079]
- * lib/open-uri.rb (URI::Generic#find_proxy): return nil on loopback
- address.
+ * load.c: call rb_loaderror_with_path so that the missing path is
+ added to the exception.
- * lib/resolv-replace.rb (BasicSocket#send): don't replace because
- it has no hostname argument.
- (IPSocket.getaddress): raise SocketError instead of
- Resolv::ResolvError for errors.
- (TCPSocket#initialize, UDPSocket#bind, UDPSocket#connect)
- (SOCKSSocket#initialize): use IPSocket.getaddress instead of
- Resolv.getaddress.
- (UDPSocket#send): recognize 3 arguments form. try all addresses on
- 4 arguments form.
+ * ruby.c: call rb_loaderror rather than raising our own LoadError
+ exception.
-Sun Feb 1 18:17:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * include/ruby/intern.h: add declaration for rb_loaderror_with_path.
- * lib/net/http.rb: merged coding style changes from HEAD.
+ * test/ruby/test_require.rb: add supporting test for LoadError#path
+ method.
-Sun Feb 1 16:15:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Wed Mar 7 08:28:00 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/test/unit.rb: rearranged documentation for RDoc's sake.
- * lib/matrix.rb: improved documentation.
- * lib/net/http.rb: slight documentation formatting improvement.
+ * lib/xmlrpc/parser.rb: support i8 types. Thanks Stas Kelvich!
+ [ruby-core:29246] [Feature #3090]
-Sun Feb 1 05:30:06 2004 Tanaka Akira <akr@m17n.org>
+ * test/xmlrpc/test_client.rb: supporting test
- * lib/open-uri.rb (URI::Generic#find_proxy): warn HTTP_PROXY.
- raise an errror on non-http proxy URI.
- (OpenURI::Buffer#<<): make a tempfile binmode. [ruby-talk:90793]
+Wed Mar 7 07:43:29 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sat Jan 31 09:20:32 2004 NAKAMURA, Hiroshi <nakahiro@sairon.co.jp>
+ * lib/xmlrpc/client.rb: assume servers that do not send a Content-Type
+ header are sending 'text/xml'. Thanks Nathan Leavitt!
+ [ruby-core:41204] [Bug #5660]
- * sample/openssl/gen_csr.rb: wrong usage string.
+ * test/xmlrpc/test_client.rb: supporting test
-Sat Jan 31 01:00:32 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Wed Mar 7 07:39:28 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/soap/wsdlDriver.rb, lib/wsdl/soap/operation.rb: add support of
- "parts" attribute of soap:body element in WSDL.
+ * test/xmlrpc/test_client.rb: adding a test for performing an XMLRPC
+ call.
+ * test/xmlrpc/data/blog.xml: supporting XML document for the response.
- * lib/wsdl/xmlSchema/schema.rb: friendly warning message for
- simpleType element which is not supported for now.
+Tue Mar 6 16:24:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/soap/mapping/factory.rb: deleted unused methods.
+ * parse.y (parser_tokadd_string): escape simple regexp meta
+ character terminators.
- * lib/soap/mapping/rubytypeFactory.rb: do no ignore case while xsi:type
- string <-> Ruby class name matching.
+Tue Mar 6 10:11:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/wsdl/soap/{soapbodyparts.wsdl,test_soapbodyparts.wsdl}: new
- files.
+ * ext/io/console/console.c (set_rawmode): clear ECHOE and ECHOK
+ bits too.
-Thu Jan 29 23:56:00 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * ext/io/console/console.c (echo_p): ignore ECHOE and ECHOK bits.
+ [ruby-dev:45309] [Bug #6116]
- * util.c (mblen): fix overrun. [ruby-dev:22672]
+ * ext/io/console/console.c (console_raw): fix rdoc.
-Thu Jan 29 22:41:53 2004 Dave Thomas <dave@pragprog.com>
+ * ext/io/console/console.c (console_set_echo): mentioned about
+ platform dependency.
- * lib/rdoc/generators/html_generator.rb: Allow 'link:' in Tidylinks.
- THis means you can write "see f1[link:files/f1_rb.html]".
+Tue Mar 6 07:18:10 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Jan 29 15:33:23 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/xmlrpc/client.rb: switch net/http post2 calls to modern
+ `request_post` methods.
- * ext/openssl/ossl_x509hame.c (ossl_x509name_initialize): change
- second argument. it expected to be a Hash not an Integer.
+Tue Mar 6 02:31:20 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/openssl/ossl_x509name.c (ossl_x509name_add_entry): add new
- function for OpenSSL::X509::Name#add_entry.
+ * ext/psych/lib/psych/core_ext.rb: only extend Kernel if IRB is loaded
+ in order to stop method pollution.
- * ext/openssl/ossl_x509name.c (ossl_x509name_to_a): append ASN.1
- tag number to each element of return value.
+Tue Mar 6 01:34:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_x509name.c (Init_ossl_x509name): add constants
- OpenSSL::X509::Name::DEFAULT_OBJECT_TYPE and OBJECT_TYPE_TEMPLATE.
+ * parse.y (block_call): rules for block_call after block_call.
+ based on a patch by pasberth https://github.com/ruby/ruby/pull/102
+ [ruby-dev:45308][Bug #6115]
- * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name#initialize):
- second argument takes OBJECT_TYPE_TEMPLATE by default.
+Tue Mar 6 01:24:13 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * sample/openssl/gen_csr.rb: use OpenSSL::X509::Name.parse.
+ * parse.y (block_command, block_call): simplified rules.
-Wed Jan 28 04:29:41 2004 Eric Schwartz <emschwar@fc.hp.com>
+Mon Mar 5 18:28:35 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/cgi/session.rb: use LOCK_SH to read, and a few other
- improvements. [ruby-core:02328]
+ * test/ruby/test_regexp.rb (TestRegexp#test_source): fix typo.
+ * test/ruby/test_regexp.rb (TestRegexp#test_equal): ditto.
-Tue Jan 27 11:09:29 2004 FUKUMOTO Atsushi <fukumoto@nospam.imasy.or.jp>
+Mon Mar 5 17:11:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c (s_recvfrom): sending length should be an
- invariant while retrying on EAGAIN. [ruby-talk:89962]
+ * ext/syck/lib/syck/rubytypes.rb (Exception.yaml_new): fix bug
+ that causes YAML serialization problem for Exception.
+ Exception#initialize doesn't use visible instance variable for
+ the exception message, so call the method with the message.
+ patched by Jingwen Owen Ou <jingweno AT gmail.com>.
+ http://github.com/ruby/ruby/pull/41
-Tue Jan 27 10:35:18 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Mar 5 16:50:22 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/win32ole/win32ole.c (set_argv): fix condition.
+ * test/ruby/test_sleep.rb (TestSleep#test_sleep_5sec): syntax error.
-Tue Jan 27 02:26:31 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/ruby/test_sleep.rb (TestSleep#test_sleep_5sec): call uname
+ only on linux because it's a workaround for linux only.
- * lib/webrick/httputils.rb (WEBrick:HTTPUtils::parse_header):
- refine regex for header-name.
+Mon Mar 5 12:44:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jan 27 00:30:11 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * st.c (unpack_entries): chain entries directly. based on a patch
+ by Sokolov Yura <funny.falcon AT gmail.com>.
- * win32/Makefile.sub: rollback.
+ * st.c (unpack_entries): use union instead of casted pointer.
+ patched by Sokolov Yura <funny.falcon AT gmail.com>.
-Mon Jan 26 22:53:04 2004 Dave Thomas <dave@pragprog.com>
+ * st.c: use PACKED_ENT and FIND_ENTRY. patched by Sokolov
+ Yura <funny.falcon AT gmail.com>.
- * io.c: Remove documentation references to $defout.
+ * st.c (unpack_entries): reallocate bins if packed array size
+ is not same as initial bins size. based on a patch by
+ Sokolov Yura <funny.falcon AT gmail.com>.
-Mon Jan 26 15:11:47 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Mar 5 11:51:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * sample/exyacc.rb: escape '}' to avoid warning.
+ * ext/bigdecimal/lib/bigdecimal/math.rb: remove description about
+ BigMath#log. patched by Sho Hashimoto [ruby-dev:45307] [Bug #6112]
-Mon Jan 26 14:41:46 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * string.c (str_byteslice): fix typo.
- * lib/delegate.rb (Delegator::initialize): preserve
- singleton_method_added method [ruby-dev:22685]
+Sun Mar 4 23:21:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/delegate.rb (Delegator::initialize): use Kernel::raise
- instead of mere raise. [ruby-dev:22681]
+ * parse.y (parser_tokadd_string): regexp engine doesn't need
+ terminators to be escaped. [ruby-core:40364][Bug #5484]
-Mon Jan 26 12:47:17 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat Mar 3 22:51:46 2012 Tanaka Akira <akr@fsij.org>
- * ext/tcltklib/tcltklib.c: define CONST84 when TCL_MAJOR_VERSION == 7
+ * process.c (rb_run_exec_options_err): chdir at last to interpret
+ relative pathnames from the current directory of the parent process.
-Mon Jan 26 11:35:23 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Mar 3 12:20:44 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/extmk.rb: Makefiles should depend on also rbconfig.rb.
- (ruby-bugs:PR#1256)
+ * ext/date/date_strftime.c: reassigned some variables.
- * ext/win32ole/win32ole.c (set_argv): set real arguments to
- WIN32OLE::ARGV. [ruby-list:39073]
+Sat Mar 3 12:12:16 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Thu Jan 22 22:54:53 2004 Shugo Maeda <shugo@ruby-lang.org>
+ * ext/date/date_{parse,strptime}.c: [ruby-dev:45303].
- * lib/net/imap.rb (BEG_REGEXP): allow 8-bit characters in quoted
- strings for Novell GroupWise Internet Agent.
- * lib/net/imap.rb (DATA_REGEXP): ditto.
+Sat Mar 3 10:09:21 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Jan 22 16:21:33 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/xmlrpc/client.rb (initialize): net/http defaults to 1_2 in 1.8+,
+ so we can safely remove the call to enable it.
- * parse.y (string_content): reset lexical states at the beginning of
- string contents. [ruby-list:39061]
+Sat Mar 3 08:42:25 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Jan 21 21:55:51 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/xmlrpc/client.rb (new2): use URI for uri parsing.
+ * test/xmlrpc/test_client.rb: test that query params are passed to the
+ client constructor.
- * lib/drb/drb.rb: remove O_NONBLOCK, thanks \ay
- * lib/drb/extserv.rb: typo
+Sat Mar 3 08:20:10 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Jan 21 17:57:56 2004 Shugo Maeda <shugo@ruby-lang.org>
+ * lib/xmlrpc/client.rb (new2): raises an ArgumentError on bad
+ arguments.
+ * test/xmlrpc/test_client.rb: tests for bad uris
- * lib/net/imap.rb (envelope): allow NIL.
- * lib/net/imap.rb (body): ditto.
- * lib/net/imap.rb (number): ditto.
- * lib/net/imap.rb (ensure_nz_number): show a detailed error
- message.
+Sat Mar 3 08:08:11 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Jan 21 16:44:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/xmlrpc/client.rb (new2): fix custom port specification when an
+ SSL uri is used.
+ * test/xmlrpc/test_client.rb: tests for XMLRPC::Client.new2
- * lib/mkmf.rb (merge_libs): squeeze successive same libraries.
- [ruby-dev:22652]
+Sat Mar 3 08:03:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jan 21 16:01:37 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/syck/rubyext.c (mktime_do): use ISDIGIT().
+ [ruby-core:43060] [Bug #6108]
- * ext/digest/rmd160/extconf.rb: have_library appends found library.
+ * ext/syck/token.c (sycklex_yaml_utf8): cast as unsigned char.
+ [ruby-core:43060] [Bug #6108]
-Wed Jan 21 11:36:00 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Mar 3 06:57:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (block_append): update nd_end for "real" head node.
- [ruby-list:39058]
+ * configure.in (ruby_pc): make configurable. [Bug #6051]
-Tue Jan 20 14:48:13 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Mar 2 17:49:03 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
- * ext/openssl/extconf.rb: should check <openssl/conf_api.h> instead
- of OPENSSL_VERSION_NUMBER. [ruby-list:39056]
+ * .travis.yml (branches): Enable TravisCI for ruby_1_9_3.
-Tue Jan 20 14:43:17 2004 Dave Thomas <dave@pragprog.com>
+Fri Mar 2 17:13:33 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
- * lib/base64.rb: Add RDoc
+ * test/ruby/test_array.rb (test_combination2): Make the test case for
+ [ruby-core:29240] more descriptive.
+ cf. http://bugs.jruby.org/6518
-Tue Jan 20 14:25:51 2004 Dave Thomas <dave@pragprog.com>
+Fri Mar 2 16:37:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/abbrev.rb: Add RDoc
+ * file.c (file_expand_path): use wcscasecmp().
-Tue Jan 20 13:22:39 2004 Dave Thomas <dave@pragprog.com>
+Fri Mar 2 16:36:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/generators/html_generator.rb: Document aliases at
- top-most level.
+ * thread_pthread.c (native_cond_timeout): cast explicitly to suppress
+ a warning.
- * lib/English.rb: Document English.rb.
+Fri Mar 2 16:35:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jan 20 02:49:22 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * io.c (pipe_open): cmd is no longer used if fork is available.
- * ext/openssl/extconf.rb: add check for OpenSSL version.
- [ruby-list:39054]
+Thu Mar 1 16:13:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jan 20 02:38:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h (rb_file_const, rb_file_load_ok): moved functions for
+ internal use only.
- * marshal.c (w_class): should not dump singleton class.
- [ruby-dev:22631]
+Thu Mar 1 15:40:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jan 20 01:31:36 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * win32/makedirs.bat: new command to make intermediate
+ directories, and not to report any errors if the directory
+ already exists.
- * io.c (lineno): typo fix(FIX2INT -> INT2FIX).
+ * win32/Makefile.sub (MAKEDIRS): enable command extensions.
-Mon Jan 19 21:53:38 2004 akira yamada <akira@ruby-lang.org>
+Thu Mar 1 01:25:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c, re.c, string.c, time.c: fixed up positions of RDocs.
+ * regparse.c (is_onechar_cclass): optimize character class
+ Merge Onigmo 27278c12e6674043cc8affca6507e20e119a86ee.
-Mon Jan 19 07:09:20 2004 Tadayoshi Funaba <tadf@dotrb.org>
+ * regparse.c (is_onechar_cclass): [bug] unexpected match occurs when a
+ char class contains no char
- * lib/date.rb: zone was wrong when it was behind UTC.
- Thanks Mark J. Reed.
+ * enc/unicode.c (init_case_fold_table): define the sizes of case
+ folding tables in casefold.h
- * lib/date/format.rb: %z is now always replaced by four digits
- with a leading plus or minus sign.
+Wed Feb 29 16:11:34 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * sample/cal.rb: added a class, anyway.
+ * win32/Makefile.sub (MAKEDIRS): use mkdir of cmd.exe instead of ruby.
+ [Bug #6103] [ruby-core:43012]
-Sun Jan 18 20:47:35 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * win32/README.win32: added a notice about command extension of cmd.exe.
- * ruby.c: use translate_char() on Cygwin.
+Wed Feb 29 15:39:39 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Jan 18 02:33:26 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * test/ruby/test_io.rb (TestIO#test_readpartial_locktmp): skip on
+ windows because of the platform restriction.
- * defines.h (_WIN32): undef _WIN32 on Cygwin before defining DOSISH.
+Wed Feb 29 15:38:50 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Jan 18 00:23:55 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/memory_status.rb (Memory): syntax error.
- * marshal.c (class2path): check anonymous class/module before
- checking referable, and allow singleton classes.
+Wed Feb 29 13:06:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jan 16 14:33:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/memory_status.rb: use /proc/self/status if it is in
+ the expected format.
- * marshal.c (class2path): get class path and check referable.
- [ruby-dev:22588]
+Wed Feb 29 06:14:51 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Fri Jan 16 09:52:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/date/date_core.c: reverted r34825.
- * eval.c (proc_eq): Proc with empty body may not be equal.
- [ruby-dev:22590]
+Tue Feb 28 23:20:01 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Thu Jan 15 13:03:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * Makefile.in (PLATFORM_DIR): add a variable for `win32` directory.
+ * Makefile.in (clean-platform): add new target.
+ It cleans `win32` directory.
- * io.c (argf_read): do not append EOF. (ruby-bugs-ja:PR#585)
+ * common.mk (clean): add a dependency for `win32` directory.
+ * common.mk (distclean): ditto.
+ * common.mk (distclean-platform): add new target.
+ It cleans `win32` directory.
+ * common.mk ($(PLATFORM_D)): add new target to make `win32` directory.
+ * common.mk (win32/win32.$(OBJEXT)): move win32.o into `win32`
+ directory.
+ * common.mk (win32/file.$(OBJEXT)): add new target for win32/file.c.
- * io.c (rb_io_fwrite): ad-hockery hack to get rid of HP-UX stdio
- weird behavior. [ruby-dev:22424]
+ * configure.in: move win32.o into `win32` directory and add
+ win32/file.o to MISSING.
-Wed Jan 14 13:31:06 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * file.c (file_load_ok, rb_file_load_ok): replace static
+ file_load_ok() with public rb_file_load_ok().
+ It's to link Windows implementation in win32/file.c.
+ * file.c (rb_find_file_ext_safe): ditto.
+ * file.c (rb_find_file_safe): ditto.
- * ext/iconv/extconf.rb: wrapper iconv.rb is dependent on platform.
+ * win32/file.c (rb_file_load_ok): new file. Add Windows specific
+ optimized implementation of rb_file_load_ok(). We created a
+ separated file to avoid too many #ifdef macro which is unreadable.
-Tue Jan 13 18:54:28 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * win32/Makefile.sub (PLATFORM_DIR): add a variable for `win32`
+ directory.
+ * win32/Makefile.sub (MISSING): move win32.obj into `win32`
+ directory and add win32/file.obj to MISSING.
+ * win32/Makefile.sub (MAKEDIRS): replace MINIRUBY with BASERUBY.
+ It's because miniruby doesn't exist when making `win32` directory.
+ * win32/Makefile.sub (clean-platform): add new target to clean `win32`
+ directory.
+ * win32/Makefile.sub ({$(srcdir)}.c{}.obj): make it not match
+ win32/file.c to build properly.
+ * win32/Makefile.sub (win32/win32.$(OBJEXT)): move win32.obj into
+ `win32` directory.
- * lib/logger.rb(Logger#msg2str): no special treatment for the object
- which responds to :to_str. commited at 2004-01-11T21:46:27 by
- gsinclair.
+ Patch created with Luis Lavena.
+ [ruby-core:42480] [Feature #5999]
- * lib/logger.rb(LogDevice#initialize): remove type checking if the
- given object is a String. Kernel.open handles it correctly.
- commited at 2004-01-11T21:46:27 by gsinclair.
+Tue Feb 28 20:27:25 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * test/logger/test_logger.rb: follow above change (ArgumentError ->
- TypeError.) follow above commit.
+ * ext/date/date_core.c: [ruby-core:42998]
-Tue Jan 13 14:27:13 2004 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Tue Feb 28 18:47:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/ui/testrunnerutilities.rb (TestRunnerUtilities):
- moved run method which allows output level. [ruby-dev:22554]
+ * io.c (io_binwrite, rb_io_syswrite): use shared frozen source
+ strings.
-Tue Jan 13 04:29:52 2004 Dave Thomas <dave@pragprog.com>
+ * io.c (io_fread, io_getpartial, rb_io_sysread): set buffer size
+ after check if readable, which can cause thread switch.
+ [ruby-dev:45297][Bug #6099]
- * lib/rdoc/ri/ri_driver.rb (RiDriver::report_method_stuff):
- Show fully-qualified class names in class list.
+Tue Feb 28 17:16:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jan 13 01:04:37 2004 Dave Thomas <dave@pragprog.com>
+ * lib/time.rb (Time#xmlschema): use strftime specifiers instead of
+ fractional exponential calculation which yields undesirable
+ result. [ruby-core:42997][Bug #6100]
- * lib/rdoc/ri/ri_paths.rb (RI::Paths): First attempt at
- incorporating DESTDIR in the rdoc installation.
+Tue Feb 28 14:15:29 2012 Eric Hodel <drbrain@segment7.net>
-Mon Jan 12 23:27:19 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/protocol.rb: Add OpenTimeout subclass of Timeout::Error
+ * lib/net/pop.rb: Modernize Timeout usage. Patch by Eric Wong.
+ Use Net::OpenTimeout instead of Timeout::Error. [Bug #5765]
+ * lib/net/http.rb: ditto
+ * lib/net/smtp.rb: ditto
+ * lib/net/telnet.rb: ditto
- * parse.y (primary): fix position after FCALL. [ruby-dev:22574]
+Tue Feb 28 13:51:12 2012 Eric Hodel <drbrain@segment7.net>
-Mon Jan 12 12:07:22 2004 Dave Thomas <dave@pragprog.com>
+ * lib/net/http.rb: Retry HTTP requests for additional network errors.
+ Introduce OpenTimeout subclass of Timeout::Error. [Bug #6001]
+ * test/net/http/test_http.rb: Reduce timeout to 0.01s for faster test
+ * test/net/http/test_https.rb: ditto
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_methods):
- Someone changed the "// in eval.c" comments to "/*...*/" style,
- so the parsing of the source file name broke.
+Tue Feb 28 11:44:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * object.c: Remove spurious space in TrueClass documentation.
+ * configure.in (debugflags): check if -ggdb is accepted.
+ [ruby-core:42875][Bug #6080]
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_body): Fix
- bad regexp: if the code before a documented method contained
- a comment that wasn't terminated by whitespace, that comment
- and all intervening code was included in the following
- method's documentation.
+Tue Feb 28 10:28:51 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/rdoc/ri/ri_formatter.rb (RI::HtmlFormatter::break_to_newline):
- HTML formats need explicit line breaks.
+ * ext/psych/lib/psych.rb: default open YAML files with utf8 external
+ encoding. [ruby-core:42967]
+ * test/psych/test_tainted.rb: ditto
-Mon Jan 12 11:46:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Feb 27 23:46:09 2012 Yukihiro Matsumoto <matz@ruby-lang.org>
- * configure.in (LIBPATHFLAG, RPATHFLAG): enclose paths with single
- quotes. [ruby-dev:22564]
+ * parse.y (opt_bv_decl): allow newline at the end. [ruby-dev:45292]
- * lib/mkmf.rb (libpathflag): do not enclose with quotes always.
+Mon Feb 27 20:43:05 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * {bcc32,win32,wince}/Makefile.sub (LIBPATHFLAG): quoted.
+ * io.c (rb_io_set_pos): add rdoc about textmode.
-Mon Jan 12 02:24:07 2004 Dave Thomas <dave@pragprog.com>
+ * test/ruby/test_io.rb (TestIO#test_setpos): use binmode.
- * lib/rdoc/ri/ri_formatter.rb (RI::HtmlFormatter): Add HTML
- generation support to ri (Elliot Hughes)
+Mon Feb 27 17:00:15 2012 Akinori MUSHA <knu@iDaemons.org>
-Mon Jan 12 02:24:07 2004 Dave Thomas <dave@pragprog.com>
+ * string.c (rb_str_crypt): Update rdoc and state that this
+ function is system dependent. Reviewed by nobu, thanks to
+ @takai.
- * lib/rdoc/ri/ri_formatter.rb (RI::HtmlFormatter): Add HTML
- generation support to ri (Elliot Hughes)
+Mon Feb 27 17:03:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jan 11 02:07:47 2004 Dave Thomas <dave@pragprog.com>
+ * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): since methods
+ can be overridden, so should not make an assumption on the type
+ of results. [ruby-core:42969][Bug #6093]
- * lib/rdoc/ri/ri_options.rb (RI::Options::OptionList::OptionList):
- Also accept command line options via the 'RI' environment variable.
+Mon Feb 27 10:54:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jan 11 02:07:47 2004 Dave Thomas <dave@pragprog.com>
+ * lib/mkmf.rb (try_cppflags, try_cflags, try_ldflags): replace the
+ target flags if the given flag is accepted.
- * lib/rdoc/ri/ri_options.rb (RI::Options::OptionList::OptionList):
- Also accept command line options via the 'RI' environment variable.
+Mon Feb 27 10:53:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jan 10 21:27:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/rubygems/test_gem_specification.rb (test_self_from_yaml_syck_default_key_bug):
+ ignore the test for too old versions.
- * eval.c (eval): need to add message delimiter. [ruby-dev:22561]
+Mon Feb 27 10:53:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jan 10 01:54:50 2004 Eric Sunshine <sunshine@sunshineco.com>
+ * lib/test/unit.rb (Test::Unit::Runner#puke): skips with no
+ messages should be trivial.
- * defines.h (__NeXT__): Ensure that all standard S_IRUSR, S_IWGRP,
- S_IRWXO, etc. macros are defined since future code might require
- them (even though present code only requires a subset).
+Mon Feb 27 10:50:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * defines.h (__NeXT__): Bug fix: WORDS_BIGENDIAN was not being set
- correctly on Rhapsody when -arch compiler flag was used (via
- configure's --enable-fat-binary option).
+ * io.c, process.c, time.c, ext: use rb_sys_fail_str instead of
+ rb_sys_fail.
-Fri Jan 9 10:05:14 2004 Siena. <siena@faculty.chiba-u.jp>
+Mon Feb 27 10:48:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (libpathflag): use single quotes. [ruby-dev:22440]
+ * ext/openssl/extconf.rb: suppress useless deprecation warnings
+ from OpenSSL added by Apple.
-Thu Jan 8 23:49:21 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Sun Feb 26 23:29:49 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in (RDOCTARGET): new macro. if you want to install
- rdoc documentation, you need to run configure with
- --enable-install-doc.
+ * regparse.c (add_code_range_to_buf0): wrong condition of duplicated
+ warnings.
-Thu Jan 8 21:29:43 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Feb 26 11:26:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_pkey.c (ossl_pkey_to_der): removed; it returns
- public key only.
+ * compile.c (iseq_compile_each): call on special object instead of
+ self. since stabby lambda is a syntax, so it should not be
+ affected by the context. [ruby-core:42349][Bug #5966]
- * ext/openssl/ossl_pkey_dh.c (ossl_dh_to_der): new function for
- OpenSSL::PKey::DH#to_der.
+ * insns.def (send): no special deal for FCALL. self should be put
+ on TOS instead.
- * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_to_der): new function for
- OpenSSL::PKey::DSA#to_der.
+Sun Feb 26 05:35:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_to_der): new function for
- OpenSSL::PKey::RSA#to_der.
+ * error.c (report_bug): use buf and snprintf to avoid consuming stack.
+ [ruby-dev:45272] [Bug #6058]
-Thu Jan 8 16:51:04 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sat Feb 25 17:41:19 2012 Tanaka Akira <akr@fsij.org>
- * test/wsdl/datetime/test_datetime.rb: fixed a stupid testcase which
- dumps "E" at month-end.
+ * ext/dbm/extconf.rb (headers): try ambiguous headers at last.
-Thu Jan 8 11:20:01 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Sat Feb 25 17:07:15 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * eval.c, object.c, process.c, re.c: don't use C++ style comments.
+ * lib/fileutils.rb: use chomp(?/) instead of sub to optimize and avoid
+ to regexping invalid string.
-Thu Jan 8 04:36:21 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Feb 25 16:18:24 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/webrick/cgi.rb (WEBrick::CGI#initialize): should create
- @config[:Logger] if it was not given.
+ * complex.c (nucomp_marshal_load): raise error on invalid data.
+ reported by John Firebaugh [ruby-core:42860] [Bug #6076]
- * sample/webrick/*: new files.
+Sat Feb 25 14:46:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * MANIFEST: add sample/webrick/*
+ * ext/dl/dl.c (Init_dl): support intrinsic types, size_t, ptrdiff_t
+ and intptr_t. [ruby-core:42460][Feature #5992]
-Wed Jan 7 13:00:18 2004 Dave Thomas <dave@pragprog.com>
+ * ext/fiddle/fiddle.c (Init_fiddle): ditto.
- * lib/rdoc/ri/ri_driver.rb: Fix problem where ri was
- being too eager to find matches of ambiguous method
- names (such as "ri Thread.join" would return both
- Thread.join and ThreadsWait.join)
+ * ext/dl/lib/dl/cparser.rb (DL::CParser#parse_ctype): ditto.
-Wed Jan 7 12:35:41 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sat Feb 25 11:08:28 2012 Tanaka Akira <akr@fsij.org>
- * lib/debug.rb: revert command parse regexps. [ruby-list:39014] by
- Shirai,Kaoru.
+ * ext/curses/curses.c (Init_curses): use rb_define_const once for
+ Curses::VERSION.
-Wed Jan 7 08:21:04 2004 Dave Thomas <dave@pragprog.com>
+ * ext/dbm/dbm.c (Init_dbm): ditto for DBM::VERSION.
- * lib/rdoc/parsers/parserfactory.rb: Check for shebang
- line in files that would otherwise be treated as
- plain text.
+Sat Feb 25 10:34:22 2012 Tanaka Akira <akr@fsij.org>
-Tue Jan 6 22:13:34 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/curses/curses.c (Init_curses): make Curses::VERSION
+ understandable without context.
- * eval.c (rb_mod_modfunc): should break if m has no super class.
- [ruby-dev:22498]
+ * ext/dbm/dbm.c (Init_dbm): ditto for DBM::VERSION.
-Tue Jan 6 21:55:02 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Feb 25 07:53:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (fptr_finalize): should save errno just after failure.
- [ruby-dev:22492]
+ * parse.y (parser_tokadd_string): insert a backslash only if
+ quoted by single quotes. [ruby-dev:45281] [Bug #6069]
-Tue Jan 6 14:53:14 2004 Dave Thomas <dave@pragprog.com>
+Sat Feb 25 07:53:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bin/ri: split out the display side, making it pluggable. Added
- new ri_driver and ri_display files in lib/rdoc/ri.
+ * dir.c (dir_inspect), io.c (rb_io_inspect): keep encoding of path.
+ [Bug #6072]
-Tue Jan 6 06:37:53 2004 Dave Thomas <dave@pragprog.com>
+Sat Feb 25 07:53:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bin/rdoc: Add --ri-system switch
+ * dir.c (dir_initialize): keep path in original encoding.
- * lib/.document: Update with list of files that seem to have
- documentation
+ * error.c (syserr_initialize): prefer the encoding of message over
+ locale. [ruby-dev:45279][Bug #6071]
- * lib/test/unit.rb: Reorder comment to make it RDoc friendly.
+Sat Feb 25 06:55:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * Makefile.in: add install-nodoc target, and make it
- generate RDoc on default install.
+ * file.c (utime_internal): fix a variable missed to replace.
+ [ruby-core:42864] [Bug #6077]
- * lib/rdoc/ri/ri_options.rb (RI::Options::parse): Add
- --doc-dir option to ri.
+Fri Feb 24 18:21:55 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
-Tue Jan 6 00:04:40 2004 Dave Thomas <dave@pragprog.com>
+ * test/zlib/test_zlib.rb (TestZlibGzipReader#test_encoding): Add
+ encoding testcases for GzipReader#read. read() emits
+ Encoding.default_external in contrast to read(size) emits BINARY.
+ See also: http://bugs.jruby.org/6208
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
- fix parsing if there are braces in a method parameter list
+Fri Feb 24 17:56:39 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Fri Jan 2 14:54:11 2004 Dave Thomas <dave@pragprog.com>
+ * test/ruby/test_literal.rb (TestRubyLiteral#test_special_const):
+ test for https://bugs.php.net/bug.php?id=61095
- * bin/ri: Add new --classes option, and arrange for
- help messages to be paged too.
+Fri Feb 24 16:48:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bin/rdoc: Add statistics.
+ * dir.c, file.c, io.c (rb_sys_fail_path): use rb_sys_fail_str.
- * process.c: (MG) Added Process documentation
+ * error.c: new functions to deal exceptions with string instances.
- * lib/rdoc/ri/ri_formatter.rb (RI::AttributeFormatter::wrap):
- Fix problem with labels not displaying in RI labeled
- lists using BS and ANSI modes.
+ * dir.c, file.c, io.c: use rb_sys_fail_path.
-Fri Jan 2 01:50:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Feb 24 15:49:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (argf_eof): ARGF.eof? should not have any side effect.
- [ruby-dev:22469]
+ * configure.in (__builtin_unreachable): check for clang.
+ [ruby-core:42849]
-Wed Dec 31 17:25:17 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/ruby.h (UNREACHABLE): fallback definition.
- * io.c (argf_each_byte): should return self. [ruby-dev:22465]
+Fri Feb 24 13:54:33 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Dec 31 11:20:34 2003 Dave Thomas <dave@pragprog.com>
+ * ext/psych/parser.c: prevent a memory leak by protecting calls to
+ handler callbacks.
+ * test/psych/test_parser.rb: test to demonstrate leak.
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_methods): Make
- file referenced in "// in sss.c" relative to current file.
+Fri Feb 24 12:07:34 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Wed Dec 31 11:17:37 2003 Dave Thomas <dave@pragprog.com>
+ * lib/net/http.rb: Fix documentation. Patched from Florian Mhun
+ via http://github.com/ruby/ruby/pull/96
- * lib/rdoc/generators/html_generator.rb: Fix problem when
- a public method was aliased, but the alias is then
- made private, and hence doesn't appear in RDoc output.
+Fri Feb 24 11:48:07 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Wed Dec 31 01:33:05 2003 Dave Thomas <dave@pragprog.com>
+ * string.c (rb_str_prepend): Fix documentation for String#prepend.
+ Patched from Franck Verrot via http://github.com/ruby/ruby/pull/98
+ and Andrew Horsman via http://github.com/ruby/ruby/pull/55
- * array.c, error.c, eval.c, io.c, prec.c, range.c, re.c,
- string.c, time.c: Add RDoc for Kernel functions, and tidy.
+Fri Feb 24 10:08:33 2012 Eric Hodel <drbrain@segment7.net>
-Tue Dec 30 19:39:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/net/http.rb (Net::HTTP#transport_request): Fix infinite loop
+ upon EOFError or Errno::ECONNRESET where count is reset to 0.
+ * test/net/http/test_http.rb (class TestNetHTTPKeepAlive): Test for
+ above.
- * io.c (rb_f_readline): should raise EOFError at the end of
- files. [ruby-dev:22458]
+Fri Feb 24 09:05:40 2012 Eric Hodel <drbrain@segment7.net>
- * io.c (argf_read): should concatenate input files when length
- argument is nil. [ruby-dev:22450]
+ * complex.c (Init_Complex): Document Complex::I. Patch by Sylvain
+ Daubert. [Feature #5623]
- * io.c (argf_read): should update supplied string buffer (2nd
- argument) even when IO#read is called multiple times.
+Fri Feb 24 08:52:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c: should initialize lineno by zero. [ruby-dev:22460]
+ * parse.y (parser_tokadd_string, parser_yylex): insert a backslash
+ if the next character is non-ascii. [ruby-dev:45278] [Bug #6069]
-Tue Dec 30 12:30:30 2003 Dave Thomas <dave@pragprog.com>
+Fri Feb 24 08:13:20 2012 Eric Hodel <drbrain@segment7.net>
- * lib/rdoc/code_objects.rb (RDoc::Context::find_symbol): If a
- class and a method have the same name, finding Xxx.abc was trying
- to find 'abc' in method 'Xxx', not class 'Xxx'.
+ * lib/profiler.rb: Add Profiler documentation by Gonzalo Rodriguez.
+ [Bug #5816]
+Fri Feb 24 08:08:38 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Tue Dec 30 08:32:32 2003 Dave Thomas <dave@pragprog.com>
+ * ext/psych/parser.c: set parser encoding based on the YAML input
+ rather than user configuration.
+ * test/psych/test_encoding.rb: corresponding tests.
+ * test/psych/test_parser.rb: ditto
+ * test/psych/test_tainted.rb: ditto
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method):
- Handle undoing nesting of yield parameters correctly for:
+Fri Feb 24 08:02:52 2012 Eric Hodel <drbrain@segment7.net>
- def each_entry(&b) Dir.foreach(@path) {|f| yield P.new(f) } end
+ * hash.c (Init_Hash): Add section on how objects are used as Hash keys
+ and how to use custom classes as Hash keys.
+Fri Feb 24 07:36:11 2012 Eric Hodel <drbrain@segment7.net>
-Tue Dec 30 08:32:32 2003 Dave Thomas <dave@pragprog.com>
+ * object.c (rb_obj_eql): Improve equality documentation by adding an
+ example of equal? vs == and recommending eql? be aliased to == when
+ overridden.
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method):
- Handle undoing nesting of yield parameters correctly for:
+Fri Feb 24 07:21:15 2012 Eric Hodel <drbrain@segment7.net>
- def each_entry(&block) Dir.foreach(@path) {|f| yield Pathname.new(f) } end
+ * object.c (rb_obj_hash): Added note that the hash value is not
+ deterministic on Marc-Andre's suggestion. Expanded description of
+ the purpose of the hash method. [Bug #6068]
-Mon Dec 29 12:51:02 2003 Dave Thomas <dave@pragprog.com>
+Thu Feb 23 23:01:21 2012 Tanaka Akira <akr@fsij.org>
- * eval.c: Add RDoc for Kernel global functions.
+ * ext/dbm/extconf.rb: unused macro removed.
-Mon Dec 29 11:00:16 2003 Dave Thomas <dave@pragprog.com>
+Thu Feb 23 22:26:53 2012 Tanaka Akira <akr@fsij.org>
- * array.c: Tidy up RDoc loose ends.
+ * test/test_curses.rb: new file.
-Mon Dec 29 05:05:51 2003 Dave Thomas <dave@pragprog.com>
+Thu Feb 23 19:57:56 2012 Tanaka Akira <akr@fsij.org>
- * struct.c, random: Add RDoc comments
+ * ext/curses/rain.rb: trap SIGHUP, SIGINT, SIGQUIT and SIGTERM only.
-Mon Dec 29 02:20:54 2003 Dave Thomas <dave@pragprog.com>
+Thu Feb 23 19:56:48 2012 Tanaka Akira <akr@fsij.org>
- * eval.c: Add RDoc for class Proc, Method, UnboundMethod
+ * signal.c (sig_trap): show signal name on error.
-Mon Dec 29 00:41:44 2003 Dave Thomas <dave@pragprog.com>
+Thu Feb 23 12:21:48 2012 Tanaka Akira <akr@fsij.org>
- * math.c: Add RDoc comments
+ * ext/dbm/extconf.rb: use DBM_SUFFIX only to detect header of
+ Berkeley DB.
-Sun Dec 28 20:19:11 2003 Tanaka Akira <akr@m17n.org>
+Thu Feb 23 10:00:18 2012 Eric Hodel <drbrain@segment7.net>
- * ext/stringio/stringio.c (strio_sysread): StringIO.new.sysread didn't
- raise EOFError.
+ * io.c (rb_io_f_sync): Fix double-negative typo. [ruby-trunk - #5837]
- * ext/zlib/zlib.c (gzreader_gets): don't increment lineno when
- gzfile_read_all returns "".
+Thu Feb 23 09:57:21 2012 Eric Hodel <drbrain@segment7.net>
-Sun Dec 28 15:25:08 2003 Dave Thomas <dave@pragprog.com>
+ * load.c (rb_f_require): Add note to require for scope of items in the
+ loaded file. [ruby-trunk - #5910]
- * class.c,object.c,parse.y,sprintf.c,variable.c: Document classes
- Object, Module, etc...
+Thu Feb 23 03:58:08 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Sun Dec 28 11:55:29 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/ostruct.rb (delete_field): Bug fix so previous value is
+ returned. Patch by Nick Recobra [Bug #6063]
- * test/csv/test_csv.rb: generate bom.csv and mac.csv files on the fly.
- [ruby-talk:88852]
+Thu Feb 23 02:33:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/csv/{bom.csv,mac.csv}: removed.
+ * io.c (rb_io_extract_modeenc): fail only if conflicting
+ text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]
-Sun Dec 28 08:56:51 2003 Dave Thomas <dave@pragprog.com>
+Wed Feb 22 23:27:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c: Thead[Group] RDoc (thanks to MG)
+ * test/iconv/test_option.rb: enabled. [ruby-core:42802][Bug #6061]
-Sun Dec 28 03:50:05 2003 Dave Thomas <dave@pragprog.com>
+Wed Feb 22 21:45:56 2012 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_override_comment):
- Escape method names used in regexp
+ * ext/curses/curses.c: use defined() to suppress a warning.
-Sun Dec 28 01:46:02 2003 Dave Thomas <dave@pragprog.com>
+Wed Feb 22 21:44:29 2012 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/ri/ri_formatter.rb (RI::TextFormatter::display_flow_item):
- Add support for rules in 'ri' output.
+ * ext/curses/extconf.rb: refactored.
-Sun Dec 28 01:35:35 2003 Dave Thomas <dave@pragprog.com>
+Wed Feb 22 20:42:28 2012 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_body):
- Sometimes the Ruby source aliases two otherwise
- unrelated methods (for example Kernel#object_id and
- Kernel#hash are both the same C function). Provide a
- facility to allow the methods to be documented
- separately.
+ * ext/curses/extconf.rb: try to distinguish curses_version is a
+ function or variable.
-Sun Dec 28 01:05:31 2003 Dave Thomas <dave@pragprog.com>
+ * ext/curses/curses.c (Init_curses): refine Curses::VERSION.
- * marshal.c, signal.c: RDoc collemts added by Elliott Hughes
+Wed Feb 22 19:47:03 2012 Tanaka Akira <akr@fsij.org>
-Sun Dec 28 00:48:47 2003 Dave Thomas <dave@pragprog.com>
+ * ext/curses/extconf.rb: show the chosen header and library.
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_class_comment):
- Some source files use lower case class or module names
- when naming the Init_XXX function in C.
+Wed Feb 22 19:22:31 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Sat Dec 27 23:41:46 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * reverted 34739 for test/date.
- * configure.in: fix "test: too many arguments" error.
+Wed Feb 22 19:08:55 2012 Tanaka Akira <akr@fsij.org>
-Sat Dec 27 15:32:19 2003 Dave Thomas <dave@wireless_3.local.thomases.com>
+ * ext/curses/extconf.rb: refactored.
- * time.c: RDoc comments added
+Wed Feb 22 18:44:41 2012 Shota Fukumori <sorah@tubusu.net>
-Sat Dec 27 15:07:57 2003 Dave Thomas <dave@pragprog.com>
+ * lib/test/unit.rb (setup_options): add option "--retry" as opposite
+ for "--no-retry"
- * object.c: Add RDoc comments for Symbol class.
+Wed Feb 22 18:34:02 2012 Shota Fukumori <sorah@tubusu.net>
-Sat Dec 27 14:42:30 2003 Dave Thomas <dave@pragprog.com>
+ * lib/test/unit.rb (setup_options): add option "--show-skip" to
+ cancel "--hide-skip" (-q)
- * numeric.c: Add RDoc comments.
+Wed Feb 22 17:36:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 27 00:44:00 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * io.c (rb_io_s_foreach): argument check before making Enumerator.
+ [ruby-dev:31525]
- * io.c (next_argv): warn always for stdin on inplace edit mode.
+Wed Feb 22 17:07:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (read_all): need to check string value.
+ * io.c (rb_io_s_foreach): return enumerator including keyword
+ arguments. [ruby-dev:45267][Bug #6054]
- * io.c (argf_read): allow ARGF.read(nil). [ruby-dev:22433]
+Wed Feb 22 12:15:16 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Dec 26 23:02:09 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in: allow llvm-gcc because it work fine with r34278.
- * io.c (rb_f_backquote): need not to check nil result.
- [ruby-core:02078]
+Wed Feb 22 10:57:08 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c (rb_io_getline): should return nil when read_all gives
- empty string, even when nil rs is specified. [ruby-core:02077]
+ * regparse.c (fetch_token): don't use // comment.
-Fri Dec 26 18:50:59 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 22 10:32:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: check if getcontext and setcontext are available.
+ * test/mkmf/test_framework.rb: try CoreFoundation framework, than
+ Cocoa which is dependent on QuickTime SDK which has separated
+ since Xcode 4.3.
- * eval.c: use presence of getcontext/setcontext.
+Wed Feb 22 10:18:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Dec 26 16:40:53 2003 Tanaka Akira <akr@m17n.org>
+ * common.mk (test-all, test-ruby): more dependencies.
- * lib/pathname.rb (PathnameTest#test_plus): add 2 assertions.
+Wed Feb 22 06:48:55 2012 Eric Hodel <drbrain@segment7.net>
-Fri Dec 26 09:26:58 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * file.c (rb_f_test): Fix formatting of Kernel#test rdoc.
- * pack.c (pack_pack): add sign check for 'i', and 'l'.
- [ruby-dev:22427]
+Wed Feb 22 06:12:15 2012 Tanaka Akira <akr@fsij.org>
- * bignum.c (rb_quad_pack): add range check for 'quad int'.
+ * ext/dbm/extconf.rb: check DBM_SUFFIX for Mac OS X.
+ Its ndbm.h doesn't include db.h.
-Thu Dec 25 22:39:59 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Feb 22 06:02:42 2012 Tanaka Akira <akr@fsij.org>
- * string.c (rb_str_update): don't return any value.
+ * ext/dbm/dbm.c (fdbm_initialize): disable Berkeley DB error messages.
-Thu Dec 25 15:30:17 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/dbm/extconf.rb: check DBC type for above.
- * string.c (rb_str_update): call rb_str_modify().
+ [ruby-dev:45269]
-Thu Dec 25 05:08:09 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 21 20:23:47 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (search_required): search actual file name once when no
- extension specified.
+ * hash.c (rb_any_hash): treat Qundef like as other special constants.
-Thu Dec 25 04:00:44 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * hash.c (hash_foreach_iter): fix signature.
- * stable version 1.8.1 released.
+Tue Feb 21 19:39:34 2012 Tanaka Akira <akr@fsij.org>
-Thu Dec 25 00:17:53 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/curses/curses.c (Init_curses): use curses_version() for
+ Curses::VERSION.
- * configure.in: check for nanosleep, -lrt if required.
- [ruby-core:02059]
+Tue Feb 21 18:21:25 2012 Narihiro Nakamura <authornari@gmail.com>
- * eval.c (thread_timer): use select(2) if nanosleep(2) is not
- available.
+ * gc.c : remove gc_clear_mark_on_sweep_slots() and use
+ rest_sweep() instead of it, because some dead objects might be
+ marked in next the mark phase by false pointers.
+ [ruby-core:42672]
- * eval.c: check __stub_getcontext for glibc on some platforms.
- [ruby-list:38984]
+Tue Feb 21 16:08:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 24 23:48:04 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * proc.c (rb_hash_proc): get wrapped pointer properly. [Bug #6048]
- * test/soap/test_basetype.rb, test/soap/marshal/test_marshal.rb
- test/xsd/test_xsd.rb: use "(-1.0 / (1.0 / 0.0))" instead of "-0.0"
- to express -0.0. [ruby-talk:88786]
+Tue Feb 21 14:41:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 24 23:29:30 2003 Tanaka Akira <akr@m17n.org>
+ * template/ruby.pc.in: added rubylibprefix, {rubylib,vendor,site}dir
+ and {ruby,vendor,site}archdir. [ruby-core:42766][Feature #6052]
- * lib/tsort.rb (test_orphaned_break): removed.
+Tue Feb 21 09:13:25 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Wed Dec 24 20:53:06 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * proc.c (method_hash, proc_hash): Fix {Unbound}Method#hash
+ [Bug #6048]. Isolate hash computation for proc
- * ext/tk/sample/tkmulticolumnlist.rb: new sample
+ * internal.h: Declaration for above
- * ext/tk/sample/tkmultilistframe.rb: bug fix
+ * vm_method.c (rb_method_definition_hash): Computation for
+ hash part of a method definition
-Wed Dec 24 20:37:37 2003 Eric Sunshine <sunshine@sunshineco.com>
+ * method.h: Declaration for above
- * configure.in (LDSHARED): Fixed typographical error in assignment of
- LDSHARED for Rhapsody which caused linking of extension modules to
- fail.
+ * test/ruby/test_method.rb: Test for above
-Wed Dec 24 17:51:18 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Feb 21 02:56:15 2012 Yukihiro Matsumoto <matz@ruby-lang.org>
- * file.c (rb_thread_flock): enable thread support again.
+ * enumerator.c (enumerator_rewind): update the documentation.
+ fixed: #6053
-Wed Dec 24 16:46:08 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Feb 20 23:38:35 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (catch_timer): do not call rb_thread_schedule() inside to
- avoid pthread_mutex_lock() deadlock. interrupts to system calls
- are detected by TRAP_END via EINTR error.
+ * enc/depend: ignore mktable.c because it's not encoding library.
+ [ruby-core:42760] [Bug #6049]
- * eval.c (thread_timer): do not post signal unless it is
- absolutely necessary.
+Mon Feb 20 21:40:53 2012 Tanaka Akira <akr@fsij.org>
- * rubysig.h (TRAP_END): add CHECK_INTS to switch thread.
+ * ext/curses/extconf.rb: fold too long lines.
- * regex.c (re_compile_pattern): check if nextp is smaller than
- pend. [ruby-dev:22372]
+Mon Feb 20 21:16:48 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * eval.c (umethod_bind): remove method overridden check.
- [ruby-dev:22366]
+ * lib/fileutils.rb: revert a line modified accidentally at r34669.
+ This fixes mingw test errors in TestDir_M17N.
+ [ruby-core:42728] [Feature #4970]
-Wed Dec 24 16:13:05 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Feb 20 21:09:27 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_ssl.c (ossl_ssl_read): should check for error
- status by SSL_get_error().
+ * ext/curses/curses.c (Init_curses): define Curses::VERSION.
- * ext/openssl/ossl_ssl.c (ossl_ssl_write): ditto.
+Mon Feb 20 21:08:00 2012 Tanaka Akira <akr@fsij.org>
-Wed Dec 24 14:23:27 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/curses/extconf.rb: restore $libs and $defs for each
+ header/library choice.
- * ext/stringio/stringio.c (strio_read): clear the buffer argument
- when returning nil. [ruby-dev:22363]
+Mon Feb 20 19:57:26 2012 Tanaka Akira <akr@fsij.org>
- * test/ruby/ut_eof.rb (TestEOF::test_eof_0, TestEOF::test_eof_1):
- add buffer argument tests.
+ * ext/dbm/extconf.rb: weaken header/library consistency check if db is
+ "ndbm". It seems several (possibly historical) distributions
+ provide libndbm. However the content of libndbm vary: Berkeley DB,
+ GDBM or even 4.3BSD NDBM. (Mandriva, Tru64 UNIX, OpenSuSE,
+ SCO OpenServer, ...)
+ "ndbm" is not searched automatically now (dblib doesn't contain it)
+ but configure --with-dbm-type=ndbm choose libndbm and ndbm.h.
-Wed Dec 24 14:07:55 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Feb 20 19:15:57 2012 Tanaka Akira <akr@fsij.org>
- * lib/test/unit/assertions.rb: Modules are allowed to rescue.
+ * ext/dbm/extconf.rb: refine variable names.
- * lib/test/unit/autorunner.rb: show output_level in order.
+Mon Feb 20 15:50:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/collector/dir.rb: get rid of successive same
- directories in load path.
+ * configure.in: check if -fstack-protector is really available.
- * test/testunit/test_assertions.rb (test_assert_nothing_raised,
- test_assert_raise): test for modules.
+Sun Feb 19 23:43:38 2012 Tanaka Akira <akr@fsij.org>
-Wed Dec 24 13:43:34 2003 Shugo Maeda <shugo@ruby-lang.org>
+ * ext/dbm/extconf.rb: show header and library found.
- * lib/net/imap.rb (authenticate): remove "\n" from base64 encoded
- strings.
+Sun Feb 19 23:01:01 2012 Tanaka Akira <akr@fsij.org>
-Wed Dec 24 11:26:41 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dbm/dbm.c (Init_dbm): refine DBM::VERSION definition.
- * test/fileutils/test_fileutils.rb: should not create any
- files or directories in current directory. [ruby-talk:88724]
+ * ext/dbm/extconf.rb: provide RUBYDBM_GDBM_HEADER macro.
-Wed Dec 24 10:29:53 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Feb 19 17:07:27 2012 Tanaka Akira <akr@fsij.org>
- * ext/stringio/stringio.c (strio_read): never return nil at
- unlimited read. [ruby-dev:22334]
+ * test/dbm/test_dbm.rb (test_dbmfile_suffix): check pag and dir is
+ empty for 4.3BSD ndbm.
- * ext/stringio/stringio.c (strio_read): support second
- argument. [ruby-dev:22350]
+Sun Feb 19 03:00:30 2012 Tanaka Akira <akr@fsij.org>
-Wed Dec 24 09:38:49 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/dbm/test_dbm.rb (test_dbmfile_suffix): check magic numbers.
- * parse.y (arg): should return 0 after error. [ruby-dev:22360]
+Sun Feb 19 01:05:41 2012 Tanaka Akira <akr@fsij.org>
-Wed Dec 24 00:56:54 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/dbm/extconf.rb: detect GDBM's ndbm.h by testing dbm_clearerr is
+ an empty macro.
- * io.c (read_all): do not return nil at the end of file.
- [ruby-dev:22334]
+Sun Feb 19 00:25:55 2012 Tanaka Akira <akr@fsij.org>
- * io.c (argf_read): do not depend on nil at eof behavior of
- IO#read().
+ * ext/dbm/extconf.rb: don't choose 'dbm' if _GDB_H_ is defined which
+ is available since GDBM 1.9 because 'gdbm_compat' is appropriate
+ choice since GDBM 1.8.1.
- * eval.c (rb_thread_join): dup exception before re-raising it.
+Sat Feb 18 23:27:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * io.c (rb_io_eof): call clearerr() to prevent side effect. this
- patch is supplied by Masahiro Sakai <sakai@tom.sfc.keio.ac.jp>.
- [ruby-dev:22234]
+ * random.c: remove a duplicated comment.
- * pack.c (OFF16): get offset for big endian machines.
+Sat Feb 18 18:43:13 2012 Tanaka Akira <akr@fsij.org>
- * pack.c (pack_pack): use OFF16 instead of OFF16B.
- [ruby-dev:22344]
+ * ext/dbm/extconf.rb (dblib): prefer recent GDBM over older GDBM.
+ (have_declared_libvar): new function to check a declared variable
+ exists in a library.
+ (have_undeclared_libvar): renamed from renamed from have_libvar.
+ (headers.db_check2): check that GDBM version variable if GDBM header
+ is chosen.
- * pack.c (pack_unpack): ditto.
+ * ext/dbm/dbm.c (Init_dbm): use HAVE_DECLARED_LIBVAR_GDBM_VERSION and
+ HAVE_UNDECLARED_LIBVAR_GDBM_VERSION macro.
-Tue Dec 23 22:47:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Feb 18 13:53:01 2012 Tanaka Akira <akr@fsij.org>
- * io.c (rb_io_check_readable): set FMODE_RBUF always, even if
- NEED_IO_SEEK_BETWEEN_RW is not defined. [ruby-dev:22340]
+ * test/dbm/test_dbm.rb (test_dbmfile_suffix): DBM::VERSION should
+ be Berkeley DB if foo.db is created by DBM.open.
- * io.c (rb_io_check_writable): clear FMODE_RBUF before writing
- something.
+Sat Feb 18 13:40:37 2012 Tanaka Akira <akr@fsij.org>
-Tue Dec 23 22:25:00 2003 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * test/dbm/test_dbm.rb (test_dbmfile_suffix): test dbm file suffix.
- * lib/optparse.rb: incomplete RDoc documentation added in place of
- existing RD comments. Tabs converted to spaces.
+Sat Feb 18 12:50:59 2012 Tanaka Akira <akr@fsij.org>
-Tue Dec 23 19:44:47 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/dbm/dbm.c (DBM::VERSION): define it by detecting _GDBM_H_ or
+ _DBM_IOERR.
- * test/soap/test_streamhandler.rb (test_basic_auth): removed.
- soap4r + basic_auth is not officially supported in ruby/1.8.1 even
- though soap4r + basic_auth + http-access2 should run fine.
+Sat Feb 18 07:52:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Dec 23 19:42:59 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/enc-unicode.rb: don't use 1.9 feature on tools.
- * io.c (rb_io_ungetc): raise an exception at unread stream to
- avoid unspecified behavior. [ruby-dev:22330]
+Sat Feb 18 02:48:39 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * test/ruby/test_system.rb (test_syntax): glob relatively from
- __FILE__.
+ * lib/fileutils.rb: refactored FileUtil methods to use the
+ `define_command` API. Patch from 7rans <transfire@gmail.com>
+ * test/fileutils/test_dryrun.rb: corresponding test refactoring
+ * test/fileutils/test_nowrite.rb: ditto
+ * test/fileutils/test_verbose.rb: ditto
-Tue Dec 23 18:09:40 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Feb 17 21:39:36 2012 Tanaka Akira <akr@fsij.org>
- * pack.c (pack_pack): remove unnecessary negative value check.
- [ruby-dev:22329]
+ * ext/dbm/extconf.rb: remove dbm.
-Tue Dec 23 17:26:55 2003 KONISHI Hiromasa <konishih@fd6.so-net.ne.jp>
+Fri Feb 17 21:18:39 2012 Tanaka Akira <akr@fsij.org>
- * bcc32/Makefile.sub (config.h): bcc has finite(). [ruby-list:38940]
+ * ext/dbm/extconf.rb: refine header/library mismatch detection.
+ check only for ndbm.h except libc. check _GDBM_H_ for gdbm.
+ check _DBM_IOERR for the original ndbm.
-Tue Dec 23 16:08:16 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Fri Feb 17 20:30:44 2012 Tanaka Akira <akr@fsij.org>
- * lib/rexml/encodings/US-ASCII.rb: typo. [ruby-talk:88650]
+ * ext/dbm/extconf.rb: don't check libdbm. It is not a ndbm
+ implementation. (libdbm in Version 7 Unix is database library
+ for single database per process.)
- * test/ruby/test_system.rb: num of asserts depended on running dir.
+Fri Feb 17 15:38:53 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/xsd/test_noencoding.rb: rexml + without iconv/uconv cannot
- handle euc-jp. install iconv, uconv or xmlscan.
+ * Merge Onigmo-5.13.1. [ruby-dev:45057] [Feature #5820]
+ https://github.com/k-takata/Onigmo
+ cp reg{comp,enc,error,exec,parse,syntax}.c reg{enc,int,parse}.h
+ cp oniguruma.h
+ cp tool/enc-unicode.rb
+ cp -r enc/
-Tue Dec 23 14:13:51 2003 akira yamada <akira@ruby-lang.org>
+Fri Feb 17 15:20:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/uri/generic.rb (URI::Generic::check_userinfo,
- URI::Generic::check_user, URI::Generic::check_password): tests
- conflicts/depends with other components closely.
+ * enum.c (enum_each_slice): arrays to be yielded can be newly
+ created in the block.
- * test/uri/test_generic.rb (TestGeneric::test_set_component):
- added tets.
+ * enum.c: move work variables to objects not to let called blocks
+ access stack area out of scope. [Bug #5801]
-Tue Dec 23 11:08:34 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Fri Feb 17 12:35:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/xsd/test_noencoding.rb: rescue Errno::EINVAL and do not test.
- "euc-jp" might not be in supported encoding name list.
- [ruby-talk:88650]
+ * tool/merger.rb: remove borders from the commit message which is used
+ when the commit doesn't change ChangeLog.
-Tue Dec 23 06:10:31 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Feb 17 11:50:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/cgi.rb (CGI): add support for mod_ruby.
+ * common.mk (btest, btest-ruby, test-sample test-knownbugs)
+ (test-all, test-ruby): depend on prog.
- * lib/webrick/cgi.rb (CGI::Socket): add check for existence of
- OpenSSL module in all HTTPS related methods.
+Fri Feb 17 09:56:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/cgi.rb (CGI::Socket#cipher): should create similar
- value to OpenSSL::SSLSocket#cipher.
+ * lib/mkmf.rb (create_header): log the content of header.
- * lib/webrick/httpresponse.rb (HTTPResponse#setup_header): should
- set "connection: close" if @keep_alive is false.
+Fri Feb 17 09:44:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/webrick/https.rb (HTTPrequest#meta_vars): add supprt for
- SSL_PROTOCOL, SSL_CIPHER_USEKEYSIZE and SSL_CIPHER_ALGKEYSIZE.
+ * tool/transcode-tblgen.rb (import_ucm): don't use \h because the
+ script should work with ruby 1.8.
-Mon Dec 22 23:00:05 2003 akira yamada <akira@ruby-lang.org>
+ * tool/enc-unicode.rb: ditto.
- * lib/uri/generic.rb (URI::Generic::check_opaque): fixed typo.
+Fri Feb 17 07:33:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 22 21:59:24 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enum.c (id_lshift): use constant ID.
- * ext/iconv/iconv.c (map_charset): always ensure code is a String.
+Fri Feb 17 07:30:53 2012 Tanaka Akira <akr@fsij.org>
-Mon Dec 22 21:15:29 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dbm/extconf.rb: refactored to split too long conditions.
- * class.c (rb_mod_init_copy): always copy singleton class.
- [ruby-dev:22325]
+Fri Feb 17 00:23:25 2012 Tanaka Akira <akr@fsij.org>
-Mon Dec 22 20:44:36 2003 akira yamada <akira@ruby-lang.org>
+ * test/dbm/test_dbm.rb: fix skip condition for libgdbm 1.8.0 or prior.
+ reported by Bohuslav Kabrda.
+ [ruby-core:42685] [ruby-trunk - Bug #6036]
- * lib/uri/generic.rb (URI::Generic#route_from): accepts urls which
- has no host-part.
+Fri Feb 17 00:04:21 2012 Tanaka Akira <akr@fsij.org>
- * test/uri/test_generic.rb (TestGeneric::test_route): added a test.
+ * ext/dbm/extconf.rb: check _DB_H_ macro unavailable except
+ Berkeley DB library.
-Mon Dec 22 20:38:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Feb 16 05:41:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/cgi.rb: reduce eval.
+ * insns.def (splatarray): make new array if flag is set.
- * lib/cgi.rb (CGI::QueryExtension::read_multipart): alias path to
- local_path. [ruby-list:38883]
+ * compile.c (iseq_compile_each): make new array with
+ splat. [ruby-core:21901][Feature #1125]
-Mon Dec 22 20:09:31 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Thu Feb 16 00:14:04 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * test/soap/test_property.rb: remove duplicated test method.
+ * lib/abbrev.rb (Array#abbrev): add missing '"' in documentation.
-Mon Dec 22 18:22:04 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Feb 15 22:20:19 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * bcc32/Makefile.sub, win32/Makefile.sub (config.h): remove
- HAVE_ISINF definition to follow previous commits of missing.h
- and win32/win32.h.
+ * cont.c (rb_fiber_reset_root_local_storage): add a new function to
+ restore rb_thread_t::local_storage.
-Mon Dec 22 17:23:42 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * cont.c (rb_obj_is_fiber): add a new function to tell finalizer to
+ prevent fibers from destroy.
- * configure.in (ac_cv_func_setitimer): moved from defines.h
+ * gc.c (rb_objspace_call_finalizer): don't sweep fibers at finalizing
+ objspace.
- * defines.h, rubysig.h, signal.c: removed macro handling which
- should be done in configure.
+ * internal.h (rb_fiber_reset_root_local_storage, rb_obj_is_fiber):
+ add prototypes.
- * configure.in (intrinsics.h): check if present.
+ * vm.c (ruby_vm_destruct): reset main thread's local_storage before
+ free main thread. rb_thread_t::local_storage is replaced by fiber's
+ local storage when forked from fiber, and it should be already freed
+ when the fiber was destroyed. [ruby-core:41456] [Bug #5700]
- * ruby.h: include intrinsics.h if available.
+ * test/ruby/test_fiber.rb (test_fork_from_fiber): add test for fork
+ from fiber.
- * bignum.c, marshal.c: include ieeefp.h if available.
+Wed Feb 15 19:57:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * missing.h (isinf): define as a macro if finite() and isnan()
- are available. [ruby-core:02032]
+ * ext/fiddle/closure.c (callback): deal with unsigned integers.
+ [ruby-core:42458][Bug #5991][Bug #6022]
-Mon Dec 22 17:07:31 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * ext/fiddle/conversions.c (value_to_generic, generic_to_value):
+ ditto.
- * configure.in (mingw): set isnan, finite and isinf to yes.
+ * ext/fiddle/closure.c (callback): same as r34506.
-Mon Dec 22 13:40:19 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Wed Feb 15 17:41:31 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/soap/property.rb: passing block by reference.
+ * io.c (io_strsetbuf): call rb_str_modify to make str independent
+ before calling rb_str_set_len for r34580.
-Mon Dec 22 00:32:43 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Feb 15 12:30:10 2012 Eric Hodel <drbrain@segment7.net>
- * eval.c (rb_with_disable_interrupt): use ENABLE_INTS instead of
- ALLOW_INTS which may switch context. [ruby-dev:22319]
+ * ext/zlib/zlib.c (Init_zlib): Added Zlib::TEXT and note that
+ Zlib::ASCII is deprecated in zlib 1.2.3 and newer.
- * ext/syck/emitter.c (syck_emitter_write): str bigger than
- e->bufsize causes buffer overflow. [ruby-dev:22307]
+Wed Feb 15 12:24:40 2012 Eric Hodel <drbrain@segment7.net>
-Sun Dec 21 17:29:00 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/zlib/zlib.c: Move constant descriptions to constants. Remove
+ extra comment block at the top of Init_zlib().
- * class.c (rb_check_inheritable): new function. [ruby-dev:22316]
+Wed Feb 15 12:30:46 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * intern.h: add prototype.
+ * lib/ostruct.rb: Create getters and setters after dup.
+ [Bug #6028] [rubyspecs:0380bcc]
- * eval.c (superclass): use rb_check_inheritable().
+Wed Feb 15 10:59:52 2012 Narihiro Nakamura <authornari@gmail.com>
- * object.c (rb_class_initialize): check argument validity.
+ * gc.c (HEAP_BITMAP_LIMIT): HEAP_BITMAP_LIMIT is computed on the
+ basis of HEAP_SIZE because it must covers a whole heap block.
+ [ruby-trunk - Bug #6006]
-Sun Dec 21 16:25:10 2003 Tanaka Akira <akr@m17n.org>
+Wed Feb 15 09:27:45 2012 Eric Hodel <drbrain@segment7.net>
- * lib/pathname.rb (Pathname#+): re-implemented to resolve ".." in
- beginning of the argument.
- (Pathname#join): concatenate from the last argument.
- (Pathname#parent): just use Pathname#+.
+ * ext/zlib/zlib.c (Init_zlib): Added Zlib::FIXED and Zlib::RLE
+ strategies.
+ * NEWS: Add note about the new Zlib constants.
-Sun Dec 21 00:12:37 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Feb 15 09:11:36 2012 Eric Hodel <drbrain@segment7.net>
- * ext/tk/lib/tk.rb: add new methods (TkScrollbar#assign, assign_list)
+ * ext/zlib/zlib.c: Improve documentation. [ruby-trunk - Bug #5948]
- * ext/tk/sample/tkmultilistframe.rb: use TkScrollbar#assign method
+Wed Feb 15 07:28:54 2012 Eric Hodel <drbrain@segment7.net>
-Sat Dec 20 21:59:03 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * encoding.c (Init_Encoding): Add IO example of internal and external
+ encoding. Fixed a typo in the force_encoding example. [#5949]
- * lib/webrick/httprequest.rb (HTTPRequest#meta_vars): refine regexp.
+Wed Feb 15 06:58:21 2012 Eric Hodel <drbrain@segment7.net>
- * lib/webrick/cgi.rb (CGI#start): NPH scripts return status line
- instead of Status: header field.
+ * encoding.c (Init_Encoding): Add Encoding documentation.
+ [ruby-trunk - Bug #5949]
+ * encoding.c (rb_set_default_external): Fix typo in documentation.
- * lib/webrick/cgi.rb (CGI::Socket): refine some coditions.
+Tue Feb 14 20:22:11 2012 Narihiro Nakamura <authornari@gmail.com>
-Sat Dec 20 16:07:14 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (CEILDIV): rename to a appropriate name.
- * lib/optparse.rb (OptionParser::Completion::complete): wrong
- Regexp for word boundary. pointed out by Gavin Sinclair.
+Tue Feb 14 18:07:20 2012 Narihiro Nakamura <authornari@gmail.com>
- * lib/optparse.rb (OptionParser::make_switch): [no-] prefix was
- missing.
+ * gc.c (assign_heap_slot): SEGV happens cause on 64-bit platform
+ sometime there should be `objs-=2` instead of `objs--`.
+ [Bug #6006]
+ patched by Sokolov Yura. https://github.com/ruby/ruby/pull/92
-Sat Dec 20 11:40:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 14 16:00:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/yaml.rb (YAML::YAML): adjust Marshal version.
+ * io.c (io_setstrbuf): cut down the buffer if longer.
-Sat Dec 20 03:56:02 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Feb 14 15:06:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_with_disable_interrupt): prohibit thread context
- switch during proc execution. [ruby-dev:21899]
+ * lib/test/unit/assertions.rb (build_message): skip escaped
+ question marks.
-Sat Dec 20 02:41:02 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Feb 14 12:10:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/cgi.rb: add file. (yet another CGI library)
+ * variable.c (autoload_const_set, autoload_require): fix
+ signatures.
- * MANIFEST: add lib/webrick/cgi.rb.
+Tue Feb 14 05:23:40 2012 Eric Hodel <drbrain@segment7.net>
-Sat Dec 20 02:18:31 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (proc_wait): Change typo "SystemError" to
+ "SystemCallError". [ruby-trunk - Bug #5962]
+ * process.c (proc_wait2): ditto
- * misc/ruby-mode.el (ruby-calculate-indent): proper indentation
- inside of parentheses. [ruby-dev:22308]
+Tue Feb 14 05:18:24 2012 Eric Hodel <drbrain@segment7.net>
-Fri Dec 19 21:24:22 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * enumerator.c: Document use of Enumerator.new for creating a lazy
+ enumeration for filtering/chaining. [ruby-trunk - Feature #707]
- * lib/webrick/httprequest.rb (HTTPRequest#meta_vars): should not set
- HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH.
+Mon Feb 13 23:01:50 2012 Akinori MUSHA <knu@iDaemons.org>
- * lib/webrick/https.rb (HTTPRequest#parse): should check presence
- of cert() method to detect SSLSocket.
+ * vm_method.c (rb_method_boundp):
+ obj.respond_to?(:a_protected_method) should return false because
+ calling a protected method may cause NoMethodError if called
+ from outside the class inheritance tree. Kernel#respond_to? is
+ mostly used to test if it is safe to call a method, so the false
+ positive should be avoided. [ruby-dev:40461] [ruby-dev:41739]
+ [ruby-dev:41837]
-Fri Dec 19 22:56:46 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Mon Feb 13 21:52:06 2012 Narihiro Nakamura <authornari@gmail.com>
- * lib/soap/property.rb (SOAP::Property#load): new method for loading
- property value into existing property tree.
+ * gc.c (HEAP_OBJ_LIMIT, HEAP_BITMAP_LIMIT): HEAP_OBJ_LIMIT used
+ `sizeof(struct heaps_slot)` while heap is currently allocated
+ with `struct heaps_header`.
+ HEAP_BITMAP_LIMIT were calculated from
+ `HEAP_OBJ_LIMIT/sizeof(uintptr_t)` - one Byte for each object,
+ not one Bit. [Bug #6006]
+ patched by Sokolov Yura. https://github.com/ruby/ruby/pull/92
- * test/soap/test_property.rb: add test.
+Mon Feb 13 18:30:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Dec 19 19:21:49 2003 akira yamada <akira@ruby-lang.org>
+ * io.c (io_setstrbuf): defer resizing buffer string until data is
+ read actually.
- * lib/runit/cui/testrunner.rb (RUNIT::CUI::TestRunner::run):
- should use Test::Unit::UI::{PROGRESS_ONLY,VERBOSE}.
+Mon Feb 13 10:24:39 2012 Loren Segal <lsegal@soen.ca>
-Fri Dec 19 17:36:49 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * io.c (Init_IO): use directive hack to make ARGF documentable
+ in other tools. [ruby-core:42515][Bug #6007]
- * ext/tk/sample/tkmultilistbox.rb: bug fix
+Sun Feb 12 20:43:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/sample/tkmultilistframe.rb: new sample script
+ * include/ruby/ruby.h (rb_event_hook_func_t): add argument names.
-Fri Dec 19 03:44:27 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Feb 12 16:30:23 2012 Akinori MUSHA <knu@iDaemons.org>
- * lib/webrick/httputils.rb (parse_form_data): should return an
- empty Hash if the body is empty.
+ * tool/merger.rb (#default_merge_branch): Add support for
+ Subversion 1.7 which adopted a whole new working directory
+ structure.
-Thu Dec 18 21:47:35 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Feb 12 15:14:41 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * lib/mkmf.rb (create_makefile): should remove deffile if it's
- made by miniruby. based on nobu's patch.
+ * benchmark/driver.rb: suppress unused/shadowing variable warnings.
-Thu Dec 18 21:44:21 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Feb 12 03:14:40 2012 Eric Hodel <drbrain@segment7.net>
- * eval.c (stack_extend): ignore inline optimization on VC7.
+ * vm_eval.c (check_funcall): Call respond_to? with matching arity for
+ legacy single-argument implementations. [ruby-trunk - Bug #6000]
- * win32/Makefile.sub (OS, RT): can override.
+Sat Feb 11 12:04:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/Makefile.sub (LDFLAGS): ditto. shouldn't use pdb:none
- option. based on Tietew's patch [ruby-dev:22289]
+ * compile.c (defined_expr): guard the whole expression.
+ [ruby-dev:45021][Bug#5786]
-Thu Dec 18 16:38:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Feb 11 08:34:42 2012 Eric Hodel <drbrain@segment7.net>
- * dir.c (fnmatch): unlike find_dirsep(), rb_path_next() never
- return NULL.
+ * ext/zlib/zlib.c (rb_inflate_add_dictionary): Added
+ Zlib::Inflate#add_dictionary to allow users to pre-specify
+ for using during #inflate. [ruby-trunk - Feature #5937]
-Thu Dec 18 15:27:59 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Sat Feb 11 08:23:02 2012 Eric Hodel <drbrain@segment7.net>
- * lib/ipaddr.rb (IPSocket::getaddress): merge usa's patch.
- [ruby-dev:21678]
+ * ext/zlib/zlib.c (do_inflate): Inflate more data if buffered data
+ exists. Allows Zlib::Inflate#set_dictionary to work.
+ [ruby-trunk - Bug #5929]
-Wed Dec 17 15:15:30 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Feb 11 06:00:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/cgi.rb (CGI::QueryExtension::Value::[]): should work like
- String#[] if more than one arguments are specified.
+ * dir.c (fnmatch): The * needs to be escaped to avoid formatting in
+ fnmatch comment.
+ patched by @dalton. https://github.com/ruby/ruby/pull/91
- * lib/delegate.rb: avoid using common instance name as "@obj".
+Fri Feb 10 03:41:31 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/cgi.rb (CGI::QueryExtension::Value): Value is no longer
- subclass of String, but DelegateClass(String).
+ * ext/psych/parser.c: removed external encoding setter, allow parser
+ to be reused.
+ * ext/psych/lib/psych/parser.rb: added external encoding setter.
+ * test/psych/test_parser.rb: test parser reuse
- * ext/curses/extconf.rb: restore function check for init_color.
- [ruby-list:38905]
+Fri Feb 10 01:30:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * Makefile.in: need to specify $(MAINLIBS) for the miniruby
- generation rule.
+ * ext/dl/dl.h (ALIGN_OF): use offsetof().
- * configure.in: better FreeBSD -lc_r support.
+ * ext/dl/dl.h (DLALIGN): round up at once and get rid of overflow.
-Wed Dec 17 00:16:14 2003 Minero Aoki <aamine@loveruby.net>
+Fri Feb 10 00:47:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/strscan/strscan.c: new method
- StringScanner#beginning_of_line? (alias #bol?)
+ * test/ruby/envutil.rb (assert_no_memory_leak): new assertion to
+ check memory leak by invoking child ruby process and watch its
+ memory size.
- * ext/strscan/strscan.c: new method StringScanner#concat and #<<.
+Thu Feb 9 23:41:44 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * ext/strscan/strscan.c: StringScanner#new(str) does not duplicate
- nor freeze STR (allow destructive modification).
+ * test/pathname/test_pathname.rb (test_binread): add assertion to
+ check encoding.
- * test/strscan/test_stringscanner.rb: test new methods above.
+Thu Feb 9 16:48:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/strscan/test_stringscanner.rb: test destructive string
- modification.
+ * ext/dl/dl.c (Init_dl): fix mangled document.
-Tue Dec 16 21:20:47 2003 Tanaka Akira <akr@m17n.org>
+Thu Feb 9 16:10:34 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/pp.rb: don't use local variable `pp'.
+ * test/ruby/memory_status.rb (Memory::Win32): 64bit support.
- * lib/prettyprint.rb: ditto.
+Thu Feb 9 16:08:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Dec 16 13:20:43 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/dl/lib/value.rb (DL::ValueUtil.{unsigned_value,signed_value}):
+ currently pack/unpack does not accept "q!" and "Q!".
- * ext/tk/lib/tk.rb: condition bug of if statement on
- {pack,grid}_propagate methods
+Thu Feb 9 16:01:29 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Dec 16 03:17:29 2003 why the lucky stiff <why@ruby-lang.org>
+ * ext/fiddle/conversions.c (value_to_generic): src is not guaranteed as
+ a Bignum if the type is LONG_LONG. it may be a Fixnum if the value
+ is small.
- * lib/yaml/rubytypes.rb: comments in strings. [ruby-talk:88012]
+Thu Feb 9 11:32:36 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/yaml/test_yaml.rb: add test.
+ * ext/dl/lib/types.rb: Win64 support.
-Tue Dec 16 01:14:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Feb 9 04:12:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * eval.c (catch_timer): check rb_thread_crtical in main native
- thread.
+ * test/pathname/test_pathname.rb: not read but binread.
+ patched by Benoit Daloze, [ruby-core:42440] [Bug #5984]
- * eval.c (thread_timer): just sends signals periodically, to
- prevent main native thread from receiving them in critical
- section. [ruby-core:01959]
+Wed Feb 8 22:29:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 15 13:32:22 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_str_modify_expand): fix memory leak.
- * dir.c (check_dirname): check string safety and remove extraneous
- trailing directory separators. [ruby-dev:22279]
+Wed Feb 8 14:06:59 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
- * file.c: renamed and externalized rb_path_next,
- rb_path_skip_prefix, rb_path_last_separator, rb_path_end.
+ * ext/openssl/ossl_ssl.c: Add SSL constants and allow to unset SSL
+ option to prevent BEAST attack. See [Bug #5353].
- * intern.h: prototypes for rb_path_next, rb_path_skip_prefix,
- rb_path_last_separator, rb_path_end.
+ In OpenSSL, OP_DONT_INSERT_EMPTY_FRAGMENTS is used to prevent
+ TLS-CBC-IV vulnerability described at
+ http://www.openssl.org/~bodo/tls-cbc.txt
+ It's known issue of TLSv1/SSLv3 but it attracts lots of attention
+ these days as BEAST attack. (CVE-2011-3389)
-Mon Dec 15 09:27:46 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ Until now ossl sets OP_ALL at SSLContext allocation and call
+ SSL_CTX_set_options at connection. SSL_CTX_set_options updates the
+ value by using |= so bits set by OP_ALL cannot be unset afterwards.
- * ext/openssl/ossl_pkcs12.c (ossl_pkcs12_initialize): first argument
- of rb_protect should take an argument of VALUE.
+ This commit changes to call SSL_CTX_set_options only 1 time for each
+ SSLContext. It sets the specified value if SSLContext#options= are
+ called and sets OP_ALL if not.
-Sun Dec 14 18:46:48 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ To help users to unset bits in OP_ALL, this commit also adds several
+ constant to SSL such as
+ OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS. These constants were
+ not exposed in Ruby because there's no way to unset bits in OP_ALL
+ before.
- * ext/socket/socket.c (Init_socket): IPv6 is not supported although
- AF_INET6 is defined on MinGW.
+ Following is an example to enable 0/n split for BEAST prevention.
- * lib/ipaddr.rb (AF_INET6): workaround in the environment which does
- not support IPv6.
+ ctx.options = OP_ALL & ~OP_DONT_INSERT_EMPTY_FRAGMENTS
-Sat Dec 13 18:55:16 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/openssl/test_ssl.rb: Test above option exists.
- * ext/iconv/charset_alias.rb: preserve original order.
+Wed Feb 8 13:12:02 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/iconv/extconf.rb: remove wrapper file at clean.
+ * ext/openssl/ossl_x509name.c: Use the numerical representation of
+ unrecognized OIDs instead of the sn "UNDEF".
-Sat Dec 13 18:09:42 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/openssl/test_x509name.rb: Add tests for the fixed behavior.
- * eval.c (thread_timer): use timer by sub-thread and nanosleep.
- [ruby-talk:87519]
+ Patch provided by Paul Kehrer, thank you!
+ [ruby-core:41769] [Feature #5787]
- * gc.c (Init_stack): no stack adjustment for THREAD_SAFE.
+Wed Feb 8 09:49:58 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Dec 13 17:17:59 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/merger.rb: don't abort, update first.
- * eval.c (proc_alloc): cache the created object at first time.
- [ruby-talk:61288], [ruby-dev:22240]
+Wed Feb 8 09:47:33 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Sat Dec 13 09:01:23 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_asn1.c: Call INT2NUM only once for GeneralString.
+ Thanks to Mantas Mikulenas for noticing and providing a patch!
+ [ruby-core:42358] [Bug #5972]
- * configure.in: check ucontext.h.
+Wed Feb 8 09:19:00 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * eval.c: use getcontext/setcontext() instead of setjmp/longjmp()
- on ia64 or with native thread enabled. [ruby-core:01932]
+ * ext/openssl/ossl_cipher.c: Add warning about key as IV.
-Sat Dec 13 03:09:14 2003 why the lucky stiff <why@ruby-lang.org>
+Tue Feb 7 20:08:12 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/yaml/rubytypes.rb: anonymous struct fix. [ruby-core:01946]
+ * error.c (exc_inspect): Fix typo. patch from Trent Ogren
+ via https://github.com/ruby/ruby/pull/90
- * test/yaml/test_yaml.rb: add test.
+Tue Feb 7 19:37:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Dec 12 22:36:44 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * st.c: refactor packed entries using structs.
- * lib/csv.rb: add Cell#to_str and Cell#to_s for /.../ =~ aCell,
- "#{aCell}" and so on.
+Tue Feb 7 14:52:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/csv/test_csv.rb: add tests.
+ * st.c (st_update): table can be unpacked in the callback.
-Fri Dec 12 19:33:06 2003 Minero Aoki <aamine@loveruby.net>
+ * st.c (st_foreach): should not yield same pair when checking
+ after unpacking.
- * lib/fileutils.rb (mkdir): remove trailing `/' from pathes.
+Mon Feb 6 21:55:13 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/fileutils.rb (rmdir): ditto. [ruby-dev:22238]
+ * tool/merger.rb: abort if the working directory is dirty.
- * lib/fileutils.rb (rmdir_r): ditto.
+ * tool/merger.rb: update the working directory after commit.
- * lib/fileutils.rb (fu_copy_dir): check if it is a directory after
- mkdir(2).
+Mon Feb 6 00:16:27 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Dec 12 06:06:09 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * encoding.c (rb_enc_compatible): return ASCII-8BIT even if 2nd string
+ is ascii only string. [ruby-core:42354] [Bug #5968]
- * eval.c (proc_invoke): fix class name in warning message for
- define_method. [ruby-dev:22235]
+Fri Feb 3 07:16:47 2012 Eric Hodel <drbrain@segment7.net>
-Thu Dec 11 21:24:43 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/webrick.rb: Moved proxy rewriting to WEBrick::HTTPProxy.
+ * lib/webrick/httpproxy.rb: Add examples of creating a proxy server
+ and response rewriting using HTTPProxy.
- * ext/openssl/ossl_pkcs12.[ch]: new files. add OpenSSL::PKCS12.
+Fri Feb 3 06:53:22 2012 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl.[ch]: ditto.
+ * ext/openssl/ossl_x509store.c: Add class documentation for
+ OpenSSL::X509::Store
- * ext/openssl/MANIFEST: add ossl_pkcs12.[ch].
+Thu Feb 2 22:28:13 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Thu Dec 11 20:54:28 2003 Minero Aoki <aamine@loveruby.net>
+ * test/net/http/test_https_proxy.rb
+ (HTTPSProxyTest#test_https_proxy_authentication):
+ add workaround to avoid to hang up without openssl.
+ see [ruby-dev:45021][Bug #5786]
- * lib/fileutils.rb (mkdir_p): remove trailing `/' befere mkdir(2).
- mkdir("nonexistdir/") does not work on NetBSD/Alpha 1.6.1.
+ * test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
+ ditto.
+
+Thu Feb 2 21:48:18 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/baseparser.rb: use meaningful names.
+
+Thu Feb 2 21:38:52 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/baseparser.rb, test/rexml/test_namespace.rb:
+ fix the default xml namespace URI validation.
+ [ruby-dev:45169] [Bug #5956]
+ Reported by Miho Hiramatsu. Thanks!!!
+
+Thu Feb 2 17:51:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (argf_next_argv): reset ARGF.next_p on ARGV.replace.
+ r34409 breaks replacing ARGV.
+ [ruby-dev:45160] [Bug #5952]
+
+Thu Feb 2 16:21:01 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/net/http/test_http.rb (TestNetHTTPKeepAlive#*): remove debug
+ output.
+
+Thu Feb 2 01:24:34 2012 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * parse.y (debug_lines, coverage): set file path encoding for coverage
+ result. [ruby-dev:44950]
+
+Wed Feb 1 14:38:31 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/tempfile.rb (Tempfile#unlink, Tempfile::Remover#call): Just
+ call File.unlink and ignore ENOENT because existence check
+ before unlinking does not help in terms of race condition.
+
+ * lib/tempfile.rb (Tempfile#unlink, Tempfile::Remover#call): My
+ comment about thread safeness is obsolete.
+
+Wed Feb 1 09:50:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * doc/re.rdoc (Repetition): fix typo. reported by Ori Avtalion
+ and patched by Zachary Scott. [Bug #5947]
+
+Wed Feb 1 06:38:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (argf_close): skip stdin, which should be readable again.
+ [ruby-dev:45160] [Bug #5952]
+
+ * io.c (argf_readlines): reinitialize after all read to be
+ readable again.
+
+Tue Jan 31 21:27:43 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * configure.in (HEAP_ALIGN_LOG): HEAP_ALIGN_LOG should be page
+ size in OpenBSD. [ruby-core:42158][Bug #5901]
+
+ * gc.c : avoid to redefine.
+
+Tue Jan 31 14:27:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/envutil.rb (EnvUtil.invoke_ruby): yield also child pid
+ in block form.
+
+Mon Jan 30 19:08:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/fileutils.rb (fu_list): call to_str for all arguments.
+ * vm_eval.c (vm_call0): should pass block to enumerators. patched
+ by Kazuki Tsujimoto. [ruby-dev:44961][Bug #5731]
-Thu Dec 11 20:07:01 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * vm_eval.c (method_missing), vm_insnhelper.c (vm_call_method):
+ ditto. patched by satoshi shiba.
- * lib/ftools.rb (makedirs): sync with fileutils.
+Mon Jan 30 12:31:05 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Dec 11 19:53:03 2003 Minero Aoki <aamine@loveruby.net>
+ * file.c (append_fspath): need to set the encoding to result always.
- * lib/fileutils.rb (mkdir_p): catch all SystemCallErrors.
- (mkdir("C:\") causes EACCESS on Windows 2000/NTFS)
+Mon Jan 30 10:38:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Dec 11 19:08:02 2003 Minero Aoki <aamine@loveruby.net>
+ * test/irb/test_completion.rb: skip if cannot load irb/completion
+ (maybe readline does not exist).
- * lib/fileutils.rb (mkdir_p): check if it is a directory after
- mkdir(2) instead of before mkdir(2), to avoid race condition.
- [ruby-talk:87730]
- Refer: mkinstalldirs sh script, GNU mkdir(1) (coreutils 5.0)
+Sun Jan 29 22:47:19 2012 Yutaka Kanemoto <kanemoto@ruby-lang.org>
-Thu Dec 11 18:49:30 2003 Minero Aoki <aamine@loveruby.net>
+ * tool/config.{guess,sub}: updated to automake-1.11.2.
- * lib/fileutils.rb: def m( arg ) -> def m(arg).
+Sun Jan 29 12:17:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 11 11:39:43 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ respect encodings. [Bug #5941]
- * configure.in (ieeefp.h), numeric.c: needed for finite() on
- Solaris. [ruby-core:01921]
+Sat Jan 28 09:33:33 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * file.c (rb_stat_inspect): adjust format specifier.
+ * win32/win32.c (rb_w32_read): fix an issue that $stdin.read doesn't
+ terminate by CTRL-C on Windows.
+ [ruby-dev:45149] [Bug #5812]
- * parse.c (arg_prepend): nodetype() is for debug use.
+Sat Jan 28 08:18:11 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * ruby.h (ISASCII, etc): cast to int to get rid of warning.
+ * test/ruby/test_thread.rb
+ (TestThreadGroup#test_thread_timer_and_interrupt): skip exit status
+ assertion because we cannot get signal status on Windows.
- * ruby.h (alloca.h): include even in GCC. [ruby-core:01925]
+ * win32/win32.c (CreateChild): create process group to receive the
+ signal by GenerateConsoleCtrlEvent().
- * ext/bigdecimal/bigdecimal.c (GetVpValue): adjust format
- specifier.
+ * win32/win32.c (kill): use CTRL_BREAK_EVENT instead of CTRL_C_EVENT
+ if a process group is specified. CTRL_C_EVENT signal cannot be
+ generated for process groups for the specification.
+ [ruby-dev:45149] [Bug #5812]
- * ext/bigdecimal/bigdecimal.c (BigDecimal_prec, BigDecimal_coerce,
- BigDecimal_divmod): use rb_assoc_new() to suppress memory usage.
+Sat Jan 28 07:46:03 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_split): ditto.
+ * thread_win32.c (rb_w32_wait_events_blocking): use
+ ruby_thread_from_native() instead of GET_THREAD() because
+ GET_THREAD() doesn't always return the current thread and
+ WaitForMultipleObjects() at rb_w32_read() doesn't return by
+ Thread#kill. This fixes TestQueue#test_thr_kill failure on
+ Windows.
- * ext/dl/sym.c (rb_dlsym_guardcall): guard itself should be
- volatile.
+ * thread_win32.c (rb_w32_wait_events): use ruby_thread_from_native()
+ instead of GET_THREAD() for consistency with the above change.
- * ext/iconv/iconv.c (iconv_convert): ensure actual parameter with
- format specifier.
+ * thread_win32.c (rb_w32_sleep): ditto.
- * ext/pty/pty.c (MasterDevice, SlaveDevice, deviceNo): do not
- define unless used.
+ * thread_win32.c (rb_w32_Sleep): ditto.
+ [ruby-dev:45149] [Bug #5812]
- * ext/pty/pty.c (getDevice): get rid of warning.
+Sat Jan 28 07:28:48 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * ext/socket/socket.c (port_str, sock_s_getaddrinfo,
- sock_s_getnameinfo): FIX2INT() now returns long.
+ * test/zlib/test_zlib.rb (TestZlibGzipReader#test_reader_wrap): set
+ binmode explicitly for fixing test error on Windows. This is consistent
+ with r34243.
+ [ruby-dev:45149] [Bug #5812]
- * ext/socket/socket.c (init_inetsock_internal): uninitialized
- variable.
+Sat Jan 28 05:53:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/syck/rubyext.c (syck_parser_assign_io): add prototype.
+ * lib/irb/completion.rb (IRB::InputCompletor::CompletionProc):
+ ignore non-string name modules. [ruby-core:42244][Bug #5938]
- * ext/syck/rubyext.c (rb_syck_mktime, yaml_org_handler): use
- ISDIGIT() instead of isdigit() to avoid warnings and for
- platforms which don't support non-ascii charater.
+Fri Jan 27 16:31:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 10 19:28:56 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (HEAP_ALIGN, HEAP_ALIGN_MASK): DRY, let compiler calculate
+ from HEAP_ALIGN_LOG.
- * ext/stringio/stringio.c (strio_read): set EOF flag at short read.
- [ruby-dev:22223], [ruby-dev:22224]
+Thu Jan 26 11:03:37 2012 Eric Hodel <drbrain@segment7.net>
-Wed Dec 10 18:07:25 2003 Minero Aoki <aamine@loveruby.net>
+ * lib/matrix.rb: Clean up extra whitespace in output documentation.
- * lib/erb.rb: new method ERB#filename(=). [ruby-dev:22208]
+Thu Jan 26 03:24:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 10 17:54:51 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/io/console/console.c (io_getch): default delegating method
+ for StringIO. https://github.com/nobu/io-console/issues/4
- * ext/stringio/stringio.c (strio_read): do not set EOF flag when
- requested length is zero. [ruby-dev:22214]
+ * ext/stringio/stringio.c: moved some methods to hidden modules.
-Wed Dec 10 17:17:18 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jan 25 13:27:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (read_all): should return given string even if data read is
- empty. [ruby-dev:22207]
+ * file.c (rb_file_s_basename): ignore non-ascii extension in
+ different encoding, which cannot match.
-Wed Dec 10 17:16:06 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * file.c (rmext): no extension to strip if empty string.
- * ext/stringio/stringio.c (strio_read): adjust behavior at reading
- beyond EOF to IO. [ruby-dev:22205]
+ * file.c (rb_enc_path_next, rb_enc_path_skip_prefix)
+ (rb_enc_path_last_separator, rb_enc_path_end)
+ (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware
+ path handling functions.
- * test/ruby/ut_eof.rb (TestEOF::Seek): test behaviors at reading
- beyond EOF.
+ * file.c (rb_home_dir, file_expand_path, rb_realpath_internal)
+ (rb_file_s_basename, rb_file_dirname, rb_file_s_extname)
+ (rb_file_join): should respect the encodings of arguments than
+ file system encoding. [ruby-dev:45145] [Bug #5919]
- * test/ruby/test_file.rb, test/stringio/test_stringio.rb: include
- TestEOF::Seek test case.
+ * dir.c (check_dirname, ruby_glob0): ditto.
-Wed Dec 10 15:01:19 2003 Shugo Maeda <shugo@ruby-lang.org>
+ * ext/pathname/pathname.c (path_sub_ext): ditto.
- * test/monitor/test_monitor.rb (test_cond): use Queue#deq
- instead of sleep.
+Tue Jan 24 14:20:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 10 14:45:39 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * vm.c (rb_iter_break_value): new function to break a block with
+ the value. [ruby-dev:45132] [Feature #5895]
- * ext/pty/pty.c (HAVE_SYS_IOCTL_H): need to include <sys/ioctl.h>
- for TIOCSCTTY on *BSD. based on gotoyuzo's patch.
- (ruby-bugs:PR#1211)
+Tue Jan 24 12:58:41 2012 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/pty/pty.c (establishShell): should close descriptors if fork
- failed.
+ * object.c (rb_Hash): add Kernel#Hash conversion method like
+ Array() or Float(). a patch from Run Paint Run Run. Fix #3131
-Wed Dec 10 12:53:05 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Tue Jan 24 11:38:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/win32.h: define execv() using do_aspawn().
+ * lib/uri/common.rb (URI.encode_www_form_component): initialize on
+ requiring to support JRuby, which runs parallel multithreads.
+ [ruby-core:42222] [Bug #5925]
- * process.c (proc_exec_v): remove #ifdef's which stopped needing.
+ * lib/uri/common.rb (URI.decode_www_form_component): initialize on
-Tue Dec 9 23:32:23 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Mon Jan 23 20:33:11 2012 Jason Kay <geniture@me.com>
- * ext/tk/lib/tk.rb, ext/tk/lib/tkcanvas.rb, ext/tk/lib/tkdialog.rb,
- ext/tk/lib/tkentry.rb, ext/tk/lib/tkscrollbox.rb, ext/tk/lib/tktext.rb,
- ext/tk/sample/tkalignbox.rb, ext/tk/sample/tkcombobox.rb,
- ext/tk/sample/tkmultilistbox.rb, ext/tk/sample/tkoptdb.rb, ext/tk/sample/tktextframe.rb,
- ext/tk/sample/demos-en/dialog1.rb, ext/tk/sample/demos-en/dialog2.rb,
- ext/tk/sample/demos-jp/dialog1.rb, ext/tk/sample/demos-jp/dialog2.rb:
- overrided instance methods, which are private methods on the super
- class, are changed to 'private'
+ * lib/net/http.rb (Net::HTTP#connect): Writing entire packet at
+ once to avoid incomplete transmission. Current code using
+ writeline was causing sub-optimal conversing with a proxy due to
+ the connect tunnel request headers being split over multiple
+ packets. The modification I made allows the connect request to
+ be written as one packet, avoiding problems and optimizing the
+ conversation.
-Tue Dec 9 19:53:02 2003 akira yamada <akira@ruby-lang.org>
+ https://github.com/ruby/ruby/pull/72
+ [Feature #5460]
- * lib/uri/generic.rb (URI::Generic#route_from0): make case insensitive
- for host-part.
+Mon Jan 23 17:06:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/uri/test_generic.rb (test_route): added tests for the above
+ * lib/uri/mailto.rb (URI::MailTo.build): follow Array#to_s change of
+ Ruby 1.9; use Array#join. [Bug #5840]
+
+Mon Jan 23 16:42:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (extract_binmode): raise an exception if binmode/textmode
+ is specified with both vmode and opthash.
+ [ruby-core:42199] [Bug #5918]
+
+Mon Jan 23 16:35:27 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (rb_io_extract_modeenc): set ASCII-8BIT if binmode is specified
+ with opthash. [ruby-core:42197] [Bug #5917]
+
+Mon Jan 23 10:08:00 2012 Kenta Murata <mrkn@cookpad.com>
+
+ * test/cgi/test_cgi_util.rb (test_cgi_escape_preserve_encoding):
+ add a test for CGI::escape to preserve encoding.
+
+ * test/cgi/test_cgi_util.rb (test_cgi_unescape_preserve_encoding):
+ add a test for CGI::unescape to preserve encoding.
+
+Mon Jan 23 00:45:34 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/rdoc-mode.el (rdoc-imenu-create-index): Add imenu support
+ to rdoc-mode.
+
+ * misc/rdoc-mode.el (rdoc-mode): Fix regexp patterns containing
+ "\s " where CR/LF is not supposed to match.
+
+Sun Jan 22 15:41:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_intern3): split to registration check and new
+ registration.
+
+ * parse.y (rb_intern_str): make interned string shared with the
+ given string.
+
+ * parse.y (rb_intern3, rb_intern_str): check the coderange first.
+
+Sat Jan 21 22:21:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (FIXNUM_P): simple flag should be int.
+
+Sat Jan 21 21:51:19 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * encoding.c (rb_enc_compatible): fix segv on symbols.
+ [ruby-core:42204] [Bug #5921]
+
+Sat Jan 21 11:43:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (dir_chdir, check_dirname): get rid of optimization-out.
+
+Fri Jan 20 20:47:37 2012 Kenta Murata <mrkn@cookpad.com>
+
+ * lib/cgi/util.rb (CGI.escape): support a string with invalid byte
+ sequence. [Bug #5913]
+
+ * test/cgi/test_cgi_util.rb
+ (test_cgi_escape_with_invalid_byte_sequence): test for the above
change.
-Tue Dec 9 14:10:48 2003 Tanaka Akira <akr@m17n.org>
+Fri Jan 20 17:37:37 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c (rb_io_check_readable): don't call io_seek if EOF flag is set,
- to avoid clearing EOF flag.
- (rb_io_check_writable): ditto.
+ * vm.c (vm_exec): remove workaround for LLVM because r34278 fixes it.
-Tue Dec 9 02:53:55 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm_insnhelper.c (vm_call_cfunc): ditto.
- * ext/tk/sample/tkalignbox.rb: new sample script
+Fri Jan 20 14:31:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Dec 9 00:45:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * lib/net/http.rb (Net::HTTP#transport_request): retry a idempotent
+ request automatically. [ruby-dev:45030] [Bug #5790]
+ [ruby-core:41821] [Bug #5813]
- * lib/test/unit/assertions.rb: renamed #assert_raises to #assert_raise
- and made the former call the latter. [ruby-core:01890]
+ * lib/net/http.rb (Net::HTTP#keep_alive_timeout=): added to specify
+ the second to reconnect the TCP connection on Keep-Alive.
+ The default value is 2 second because current servers uses 2 sec.
+ http://ftp-admin.blogspot.com/2009/09/keepalivetimeout2.html
- * test/testunit/test_assertions.rb: ditto.
+ * lib/net/http.rb (Net::HTTP#begin_transport): reconnect TCP
+ connection on keep-alive timeout.
-Tue Dec 9 00:07:35 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Thu Jan 19 07:53:09 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/soap/rpc/standaloneServer.rb: add 'shutdown' and 'status'
- methods as delegates to WEBrick.
+ * ext/date/date_strptime.c: moved detector of leftover.
- * test/soap/calc/{test_calc.rb,test_calc2.rb},
- test/soap/helloworld/test_helloworld.rb,
- test/wsdl/datetime/test_datetime.rb, test/wsdl/raa/test_raa.rb:
- follow the change.
+Thu Jan 19 07:10:47 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Mon Dec 8 22:48:03 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/date/date_parse.c: [ruby-core:42173].
- * lib/test/unit/autorunner.rb: remove dependency to a particular
- runner. [ruby-core:01901], [ruby-list:38869]
+Wed Jan 18 18:11:02 2012 Akinori MUSHA <knu@iDaemons.org>
- * lib/test/unit/ui/testrunnerutilities.rb: moved output level
- constants from Console.
+ * misc/rdoc-mode.el (rdoc-mode): Add provide so that requiring
+ this library succeeds.
- * lib/test/unit/ui/console/testrunner.rb: ditto.
+Wed Jan 18 18:06:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/ui/{fox,gtk,gtk2,tk}/testrunner.rb (initialize):
- accept output_level.
+ * ext/curses/curses.c (cWindow, cMouseEvent): made typed data.
-Mon Dec 8 15:03:30 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 18 12:49:15 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/syck/syck.c (syck_io_str_read): get rid of buffer overflow.
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Added support for loading
+ subclasses of String with ivars
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: Added support for dumping
+ subclasses of String with ivars
+ * test/psych/test_string.rb: corresponding tests
-Mon Dec 8 13:02:11 2003 Minero Aoki <aamine@loveruby.net>
+Wed Jan 18 10:39:47 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/uri/common.rb: new method URI.regexp. [ruby-dev:22121]
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Added ability to load array
+ subclasses with ivars.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: Added ability to dump
+ array subclasses with ivars.
+ * test/psych/test_array.rb: corresponding tests
- * test/uri/test_common.rb: add test for URI.regexp.
+Tue Jan 17 17:18:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 8 12:44:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in (SPT_TYPE): enable as SPT_REUSEARGV on Darwin.
- * pack.c: define swap16 and swap32 only if they are not
- defined. OpenBSD defines these macros. [ruby-dev:22181]
+ * missing/setproctitle.c (ruby_init_setproctitle): changed prefix.
-Sun Dec 7 20:54:17 2003 Tanaka Akira <akr@m17n.org>
+Tue Jan 17 12:32:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/iconv/iconv.c (map_charset): make case sensitive.
- ext/iconv/charset_alias.rb (charset_alias): don't ignore
- config.charset's information. sort aliases.
+ * gc.c (aligned_malloc, aligned_free): covered missing defined
+ operators and fixes for cygwin.
-Sat Dec 6 22:58:03 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Jan 17 10:54:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_ssl.c (ossl_start_ssl): new function to wrap
- SSL_connect and SSL_accept; if SSL_connect (or SSL_accept) returned
- but not finished the handshake process, we should retry it.
+ * st.c (do_hash): it's the time to remove cast to unsigned int.
- * ext/openssl/ossl_ssl.c (ossl_ssl_connect): call ossl_start_ssl.
+Tue Jan 17 07:30:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl_ssl.c (ossl_ssl_accept): ditto.
+ * st.c (unpack_entries): Fix r34310: on unpacking, the position of
+ a hash must be do_hash-ed value.
- * ext/openssl/ossl_ssl.c (ossl_ssl_read): allow signal traps.
+ * st.c (add_packed_direct): ditto.
-Sat Dec 6 21:45:10 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Mon Jan 16 16:41:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (flush_before_seek): flush before seek on any platform.
+ * lib/optparse.rb (Regexp): fix incorrect options when casting to
+ a Regexp, and suppress encoding option warnings.
+ https://github.com/ruby/ruby/pull/82
- * configure.in: ditto.
+Mon Jan 16 11:22:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 6 17:23:00 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * win32/win32.c (rb_chsize): no need to get the current file size.
- * lib/soap/soap.rb(SOAP::Env.getenv): allow upcase environment variable
- as well as downcase one.
+Mon Jan 16 00:41:33 2012 Sokolov Yura <funny.falcon@gmail.com>
- * lib/soap/netHttpClient.rb(SOAP::NetHttpClient#proxy=): check URI.
+ * st.c: st use function instead of macro. In my current
+ environment (Ubuntu 11.04 32bit gcc-4.5.2) it gives 4%
+ performance improvement.
-Fri Dec 5 23:22:30 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ https://github.com/ruby/ruby/pull/77
- * lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_raises,
- Test::Unit::Assertions::assert_nothing_raised): use the last
- argument as message unless class object.
+Sun Jan 15 14:09:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/testunit/test_assertions.rb (test_assert_raises): test for
- multiple exception list. [ruby-core:01891]
+ * object.c (rb_inspect): raise the result is not compatible with
+ the default external encoding. [ruby-core:42095] [Bug #5848]
+ If the default external encoding is ASCII compatible, the encoding of
+ inspected result must be compatible with it.
+ If the default external encoding is ASCII incompatible,
+ the result must be ASCII only.
- * test/testunit/test_assertions.rb (test_assert_nothing_raised): test
- for non-exception classes.
+Sun Jan 15 13:21:50 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Dec 5 22:23:04 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/json/parser/parser.rl (json_string_unescape): workaround fix
+ for over optimization of GCC 4.7. [ruby-core:42085] [Bug #5888]
+ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51862
- * lib/soap/netHttpClient.rb: proxy support did not work. fixed.
+Sat Jan 14 22:24:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/soap/property.rb: add class methods for loading property from
- stream/file/propertyfile. propertyfile is a file which is located at
- somedir in $:.
+ * ext/dl/callback/mkcallback.rb (gencallback): suppress unused
+ variables.
- * lib/soap/soap.rb, lib/soap/wsdlDriver.rb, lib/soap/rpc/driver.rb,
- lib/wsdl/importer.rb: load property from propertyfile 'soap/property'
- e.g. /usr/local/lib/ruby/site_ruby/1.8/soap/property.
+Sat Jan 14 21:56:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/soap/test_property.rb, test/soap/test_streamhandler.rb: new file.
+ * iseq.c (iseq_data_to_ary): check line info table boundary. line
+ number 0 means no line number info is needed. [ruby-dev:45130]
+ [Bug #5894]
-Fri Dec 5 17:26:23 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jan 14 18:24:13 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * eval.c (rb_exec_end_proc): maintain tmp_end_procs.
- [ruby-dev:22154]
+ * error.c (exc_equal): clear rb_thread_t::errinfo when ignore
+ an exception under rb_protect(). [ruby-core:41979] [Bug #5865]
-Fri Dec 5 13:36:59 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Jan 14 12:02:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_exec_end_proc): should not clear end_procs and
- ephemeral_end_procs before execution. [ruby-dev:22144]
+ * sprintf.c (rb_enc_vsprintf): relaxed the restriction. since the
+ implementation deeply depends on plain char, so wchar_t based
+ encodings are not supported.
- * eval.c (rb_obj_extend): call Module#extended hook after
- extended_object. [ruby-list:38866]
+Sat Jan 14 12:00:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * object.c (Init_Object): Module#extended defined.
+ * error.c (exc_equal): ignore exceptions during implicit
+ conversion. [ruby-core:41979] [Bug #5865]
-Fri Dec 5 13:17:30 2003 Tanaka Akira <akr@m17n.org>
+Sat Jan 14 05:58:54 2012 Eric Hodel <drbrain@segment7.net>
- * test/ruby/test_pipe.rb: use IO.pipe instead of IO.popen.
+ * io.c (rb_io_s_read): Fix formatting of open_args comment. Reported
+ by Adam Prescott.
-Fri Dec 5 11:54:45 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jan 13 18:41:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/stringio/stringio.c (strio_read): follow IO#read.
+ * sprintf.c (rb_enc_vsprintf): can be used for ASCII compatible
+ encodings only.
- * test/ruby/ut_eof.rb, test/ruby/test_file.rb, test/ruby/test_pipe.rb,
- test/stringio/test_stringio.rb: add EOF test.
+Fri Jan 13 18:29:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Dec 5 02:49:35 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (rb_mutex_unlock_th): simplified.
- * lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_raises):
- allow multiple exception list. [ruby-core:01884]
+ * thread.c (rb_barrier_waiting): fix potential overflows.
- * lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_nothing_raised):
- check whether arguments are subclass of Exception.
+Fri Jan 13 17:23:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 4 23:54:00 2003 Rick Ohnemus <rick.ohnemus@systemware.com>
+ * load.c (load_unlock): update loading table at once.
- * dln.c (aix_loaderror): should not use member named 'errno' which
- might be a macro (e.g. on AIX).
+Fri Jan 13 16:44:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 4 23:32:26 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * error.c (exc_equal): try implicit conversion for delegator.
+ [ruby-core:41979] [Bug #5865]
- * io.c (read_all): do not depend on lseek position.
- [ruby-dev:22026]
+Fri Jan 13 03:46:53 2012 Akinori MUSHA <knu@iDaemons.org>
-Thu Dec 4 22:37:26 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/shellwords.rb (Shellwords#shellescape): shellescape() now
+ stringifies the given object using to_s.
- * eval.c (rb_eval): preserve $! value when retry happens in the
- rescue clause. [ruby-talk:86697]
+ * lib/shellwords.rb (Shellwords#shelljoin): shelljoin() accepts
+ non-string objects in the given array, each of which is
+ stringified using to_s.
-Thu Dec 4 21:50:07 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/shellwords.rb: Fix rdoc markups.
- * lib/drb/drb.rb (DRb::DRbMessage::send_request, send_reply):
- should rescue errors and re-raise DRbConnError on write too.
- [ruby-dev:22132]
+Fri Jan 13 03:38:36 2012 Akinori MUSHA <knu@iDaemons.org>
-Thu Dec 4 16:41:17 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/shellwords.rb (Shellwords#shellsplit): Fix a bug where
+ consecutive backslashes in double quotes are all removed except
+ the one at the tail.
- * parse.y (exc_list): allow expanding list. [ruby-dev:22134]
+Fri Jan 13 03:28:00 2012 Luis Lavena <luislavena@gmail.com>
-Thu Dec 4 14:09:24 2003 Minero Aoki <aamine@loveruby.net>
+ * ext/socket/extconf.rb (if ipv6): only define _WIN32_WINNT if was not
+ previously defined. This solve warnings with multiple defines in
+ command line with GCC 4.6.1
- * test/fileutils/test_fileutils.rb (test_cp): test if the error is
- kind of SystemCallError. It is needless details that which errno
- is set on each systems.
+Thu Jan 12 18:44:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 4 13:24:13 2003 Shugo Maeda <shugo@ruby-lang.org>
+ * lib/mkmf.rb: fix r33904 and revert r33905. initialize global
+ variables with init_mkmf before initializing constants.
+ [ruby-dev:45124] [Bug #5879]
- * lib/monitor.rb: use Object#__send__ instead of Object#send.
+Thu Jan 12 13:51:00 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Dec 4 13:17:45 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * cont.c (cont_restore_0): prevent optimizing out `sp'. sp is used for
+ reserving a memory space with ALLOCA_N for restoring machine stack
+ stored in cont->machine_stack, but clang optimized out it (and
+ maybe #5851 is also caused by this).
+ This affected TestContinuation#test_check_localvars.
- * lib/soap/streamHandler.rb: support latest released version of
- http-access2.
+ * cont.c (cont_restore_1): revert workaround introduced in r32201.
-Thu Dec 4 13:04:44 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Thu Jan 12 02:14:43 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/soap/soap.rb: add SOAP::Env module for environment repository
- such as HTTP_PROXY.
+ * object.c: Added examples for Object#is_a? and
+ Object#instance_of? patched from Manoj Kumar.
+ [Bug #5880] [ruby-core:42057]
- * lib/soap/property.rb: property implementation.
+Thu Jan 12 00:57:48 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/soap/streamHandler.rb, lib/soap/wsdlDriver.rb,
- lib/soap/rpc/driver.rb: use soap/property.rb.
+ * lib/mkmf.rb: verbose-mode can use by RM, RMDIRS, etc.
+ (e.g. make V=1 realclean)
- * lib/wsdl/importer.rb, lib/soap/wsdlDriver.rb, lib/soap/rpc/driver.rb:
- use SOAP::Env.
+Wed Jan 11 23:40:21 2012 Naohisa Goto <ngoto@gen-info.osaka-u.ac.jp>
- * lib/soap/netHttpClient.rb: add basic_auth, ssl_config, and cookie
- management interface, but ignored for now.
+ * string.c (rb_str_concat): set array element after definition
+ to fix compile error with Fujitsu C Compiler 5.6 on Solaris 10
+ on Sparc. [Bug #5878] [ruby-dev:45123]
- * lib/xsd/charset.rb: add XSD::Charset.encoding= interface to set
- wiredump charset explicitly. it was fixed to 'utf-8' when iconv or
- uconv module was found.
+Wed Jan 11 22:52:51 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Thu Dec 4 10:43:58 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * gc.c (ruby_mimmalloc): don't set allocated size to header.
+ ruby_mimmalloc() doesn't increment allocated_size/allocations and
+ decrement them in ruby_xfree() cause inconsistency.
- * ext/dl/sym.c (rb_dlsym_guardcall): __declspec(noinline) is VC7
- feature.
+ * gc.c (ruby_xfree): don't decrement allocated_size/allocations if
+ allocated size record is 0.
-Thu Dec 4 10:27:12 2003 Minero Aoki <aamine@loveruby.net>
+Wed Jan 11 22:36:43 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * lib/net/http.rb: update hyperlink to the Japanese document.
+ * test/readline/test_readline.rb (test_completion_proc_empty_result):
+ ensure clearance of Readline's line_buffer after the test.
-Thu Dec 4 09:12:43 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Jan 10 21:57:38 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * ext/openssl/ossl_asn1.c (asn1time_to_time): should check that
- the underlying value of ASN1_TIME isn't NULL. [ruby-core:01881]
+ * ext/dbm/dbm.c (Init_dbm): fix a build error on mswin32.
+ use `extern __declspec(dllimport)` for dll link with VC.
+ [ruby-core:41996] [Bug #5869]
-Thu Dec 4 08:29:43 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Jan 10 15:31:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/webrick/server.rb (GenericServer#start): should rescue
- Exception to avoid unexpected aborting. [ruby-core:01853]
+ * vm.c (vm_exec): refix r34162; suppress warning and add description.
- * lib/webrick/server.rb (GenericServer#start_thread): should check
- that peeraddr isn't nil before printing.
+Tue Jan 10 15:13:58 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/webrick/httpresponse.rb (HTTPResponse#start_thread): should
- rescue Exception to avoid unexpected aborting of thread.
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ use rb_memerror().
-Thu Dec 4 03:48:59 2003 Tanaka Akira <akr@m17n.org>
+Tue Jan 10 12:49:42 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/pathname.rb (Pathname#link, Pathname#symlink): obsoleted.
- (Pathname#make_link, Pathname#make_symlink): new method.
+ * gc.c: in fact, i686-linux doesn't need to define _XOPEN_SOURCE 600.
-Thu Dec 4 01:45:24 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Jan 10 12:44:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c (argf_read): should not terminate on empty string; wait
- until real EOF. [ruby-dev:21969]
+ * gc.c (ruby_mimmalloc): defined for objects need not rb_objspace,
+ but should return pointer suitable for ruby_xfree;
+ main vm and main thread.
+ patched by Sokolov Yura. https://github.com/ruby/ruby/pull/79
- * io.c (argf_read): should adjust length to read, when length is
- specified and read spans command line argument files.
+ * internal.h: ditto.
-Wed Dec 3 19:38:36 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * vm.c (Init_BareVM): use ruby_mimmalloc.
- * lib/drb/drb.rb: correct fcntl parameter. [ruby-dev:22120]
+ * ext/dl/cfunc.c: #include <ruby/util.h>.
-Wed Dec 3 13:49:07 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/syslog/syslog.c: use xfree because it is allocated by
+ ruby_strdup.
- * ext/tk/lib/tk.rb: 'format'==>'Kernel.format' (avoid override trouble)
+Tue Jan 10 12:13:56 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * ext/tk/lib/tkafter.rb: ditto.
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ fix compile error.
- * ext/tk/lib/tkcanvas.rb: ditto.
+Tue Jan 10 10:41:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tkdialog.rb: ditto.
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ empty completion result does not mean memory error.
- * ext/tk/lib/tktext.rb: ditto.
+Tue Jan 10 02:19:22 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Wed Dec 3 13:28:13 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_io.rb (test_autoclose_true_closed_by_finalizer,
+ test_autoclose_true_closed_by_finalizer): skip if IO objects are
+ not recycled yet. [ruby-dev:45098] [Bug #5850]
- * Makefile.in (lex.c): try gperf first, and copy from the source
- directory if failed. [ruby-dev:22123]
+Tue Jan 10 00:41:28 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * ext/extmk.rb (MTIMES): let makefiles depend to mkmf.rb.
+ * lib/tempfile.rb (Tempfile#_close): clear @tempfile and @data[1] even
+ when exception is raised at @tempfile.close. [ruby-dev:45113]
- * lib/mkmf.rb (configuration): DLDFLAGS was duplicated.
+ * lib/tempfile.rb (Tempfile#unlink): fix a typo.
-Tue Dec 2 23:18:12 2003 Minero Aoki <aamine@loveruby.net>
+Tue Jan 10 00:32:17 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * lib/net/http.rb: wrote the warning about HTTP_PROXY environment
- variable.
+ * gc.c (run_finalizer): clear rb_thread_t::errinfo when ignore
+ an exception under rb_protect(). [ruby-dev:45113]
-Tue Dec 2 21:31:42 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 9 23:37:43 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * bin/testrb: new test runner. [ruby-core:01845]
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ fix typos.
- * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner.run,
- Test::Unit::AutoRunner#process_args): take test list to run and
- options.
+Mon Jan 9 20:55:34 2012 Narihiro Nakamura <authornari@gmail.com>
- * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::RUNNERS,
- Test::Unit::AutoRunner#run): should not exit inside a library,
- just return the result instead.
+ * gc.c : don't embed struct heaps_slot to a heap block because it
+ can causes copy-on-write of memory page on heap block when its
+ free_next is rewritten.
- * lib/test/unit.rb: ditto.
+Mon Jan 9 20:26:33 2012 Tanaka Akira <akr@fsij.org>
- * test/runner.rb: exit with the test result.
+ * ext/pathname/pathname.c (path_entries): add document suggested by
+ the thread [ruby-core:41959] [Bug #5859].
-Tue Dec 2 20:18:48 2003 Eric Sunshine <sunshine@sunshineco.com>
+Mon Jan 9 20:14:13 2012 Tanaka Akira <akr@fsij.org>
- * configure.in (AC_PROG_YACC): AC_DEFINE(OLD_YACC) if Yacc is found
- instead of Bison or byacc.
+ * ext/socket/lib/socket.rb (family_addrinfo): don't require protocol
+ equality. For example, protocol 0 and IPPROTO_TCP is not problem
+ for TCP.
- * parse.y: If OLD_YACC is defined, ensure that YYMAXDEPTH is at least
- 10000 (Bison's default) since some old versions of Yacc define it as
- low as 150 by default, which is too low for Ruby to parse some files,
- such as date/format.rb. Among other issues, the parse problem causes
- "make test" to fail.
+Mon Jan 9 20:08:52 2012 Tanaka Akira <akr@fsij.org>
-Tue Dec 2 20:03:20 2003 Minero Aoki <aamine@loveruby.net>
+ * ext/socket/lib/socket.rb (family_addrinfo): return the given
+ addrinfo object.
+ Patch by Ippei Obayashi. [ruby-dev:45095] [Bug #5845]
- * test/fileutils/test_fileutils.rb: check if Pathnames are usable
- for arguments.
+Mon Jan 9 19:40:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Dec 2 04:22:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * test/zlib/test_zlib.rb (TestZlibGzipWriter#test_writer_wrap): set
+ binmode explicitly.
- * lib/test/unit/assertions.rb: fixed #assert_no_match message.
+Mon Jan 9 14:42:41 2012 Narihiro Nakamura <authornari@gmail.com>
- * test/testunit/test_assertions.rb: ditto.
+ * gc.c: free_slots is changed Singly linked list. clear
+ free_slots before sweep.
-Tue Dec 2 00:43:00 2003 why the lucky stiff <why@ruby-lang.org>
+Mon Jan 9 07:46:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/syck/syck.c: string buffering bug. decrementing by full
- max_size now. [ruby-core:01834]
+ * gc.c: i686-linux needs to define _XOPEN_SOURCE 600 for posix_memalign.
-Mon Dec 1 21:33:08 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jan 9 04:24:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * numeric.c (num_sadded): prohibit singleton method definition for
- Numerics. fill yet another gap between Fixnum and Bignum.
+ * gc.c (rb_objspace_free): global_List is allocated with xmalloc.
+ patched by Sokolov Yura. https://github.com/ruby/ruby/pull/78
-Mon Dec 1 17:33:47 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * dln_find.c: remove useless replacement of free.
- * pack.c (htov16): converts endian using swap16. htov32(), hton16,
- hton32 as well. [ruby-talk:85377]
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ strings for readline must allocated with malloc.
- * pack.c (swap16): swap 2 bytes no matter how big short is on the
- platform. swap32() is also prepared.
+ * process.c (run_exec_dup2): use free; see also r20950.
- * numeric.c (rb_num2int): returns long to preserve information.
- rb_fix2int(), rb_num2uint(), rb_fix2uint() as well.
- [ruby-talk:85377]
+ * re.c (onig_new_with_source): use malloc for oniguruma.
- * numeric.c (rb_num2uint): should not check for value range if the
- source value is negative.
+ * vm.c (ruby_vm_destruct): use free for VMs.
-Mon Dec 1 17:14:34 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (thread_free): use free for threads.
- * sample/optparse/opttest.rb: added.
+Mon Jan 9 04:24:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Dec 1 16:10:52 2003 Dave Thomas <dave@pragprog.com>
+ * dln_find.c: remove useless replacement of free.
- * lib/rdoc/rdoc.rb: (etc) initial merge into main tree.
+ * ext/readline/readline.c (filename_completion_proc_call):
+ matches should use xfree.
-Mon Dec 1 14:17:49 2003 Minero Aoki <aamine@loveruby.net>
+ * ext/readline/readline.c (username_completion_proc_call): ditto.
- * lib/fileutils.rb (fu_each_src_dest0): call #to_str to allow
- Pathname for arguments. [ruby-core:01795]
+Mon Jan 9 01:12:35 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/fileutils/test_fileutils.rb: does much strict test on
- "same" files detecting.
+ * numeric.c (rb_enc_uint_char): raise RangeError when added codepoint
+ is invalid. [Feature #5855] [Bug #5863] [Bug #5864]
-Mon Dec 1 09:28:14 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * string.c (rb_str_concat): ditto.
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub
- (XCFLAGS): re-export $(XCFLAGS).
+ * string.c (rb_str_concat): set encoding as ASCII-8BIT when the string
+ is US-ASCII and the argument is an integer greater than 127.
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub
- (ARCH_FLAG): export $(ARCH_FLAG) (perhaps empty value).
+ * regenc.c (onigenc_mb2_code_to_mbclen): rearrange error code.
-Mon Dec 1 01:03:27 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * enc/euc_jp.c (code_to_mbclen): ditto.
- * lib/mkmf.rb (TRY_LINK, link_command): added support for DLDFLAGS
- and ARCH_FLAG. [ruby-dev:22085]
+ * enc/shift_jis.c (code_to_mbclen): ditto.
-Sun Nov 30 20:18:07 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Sun Jan 8 20:31:45 2012 Narihiro Nakamura <narihiro@netlab.jp>
- * configure.in: keep ARCH_FLAG separate. export ARCH_FLAG.
- [ruby-core:01819]
+ * gc.c : consider header bytes which are used by malloc.
- * Makefile.in: add ARCH_FLAG to CFLAGS.
+Sun Jan 8 11:54:43 2012 Narihiro Nakamura <authornari@gmail.com>
- * Makefile.in: add @CPPFLAGS@ to CPPFLAGS.
+ * gc.c (aligned_free): support MinGW. Patch by Hiroshi Shirosaki.
- * lib/mkmf.rb (link_command, cc_command): use ARCH_FLAG.
+Sun Jan 8 11:43:05 2012 Narihiro Nakamura <authornari@gmail.com>
- * lib/mkmf.rb (configuration): add ARCH_FLAG to DLDFLAGS.
+ * gc.c (slot_sweep): add a assertion instead of a debug print.
- * Makefile.in: add ARCH_FLAG to DLDFLAGS.
+Sun Jan 8 01:18:19 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * configure.in: should put getcwd in AC_CHECK_FUNCS, not
- AC_REPLACE_FUNCS. [ruby-core:01826]
+ * test/-ext-/old_thread_select/test_old_thread_select.rb:
+ avoid platform bug. [Bug #5858] [ruby-dev:45108]
-Sun Nov 30 18:22:48 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Sun Jan 8 00:46:34 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * configure.in: do not override CCDLDFLAGS, LDFLAGS, XLDFLAGS,
- DLDFLAGS and LDSHARED.
+ * gc.c: get rid of implicit narrowing conversion.
- * configure.in: XCFLAGS for compiling ruby itself. ARCH_FLAG is
- reflected in CFLAGS.
+Sun Jan 8 00:10:10 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/mkmf.rb: ditto. do not import XCFLAGS from config.status.
+ * configure.in: check posix_memalign(3) and memalign(3).
-Sun Nov 30 17:37:36 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * gc.c (aligned_malloc): use configure's result instead of
+ _POSIX_C_SOURCE and _XOPEN_SOURCE because they can't be used
+ to check availability at least on FreeBSD.
- * ext/tk/lib/tk.rb: bug fix [ruby-talk:86746]
+Sat Jan 7 22:25:50 2012 Narihiro Nakamura <authornari@gmail.com>
-Sun Nov 30 13:02:00 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * gc.c: use Bitmap Marking algorithm to avoid copy-on-write of
+ memory pages. See [ruby-dev:45085] [Feature #5839]
+ [ruby-core:41916].
- * lib/soap/encodingstyle/soapHandler.rb: refactoring - Simplifying
- Conditional Expressions.
+ * include/ruby/ruby.h : FL_MARK rename to FL_RESERVED1.
- * lib/wsdl/soap/definitions.rb: refactoring - Move Method.
+ * node.h : ditto.
- * test/xsd/{test_noencoding.rb,noencoding.xml}: new files. test for
- encoding unspecified XML file parsing.
+ * debug.c : ditto.
- * test/wsdl/{test_fault.rb,map,datetime}: new files. test of
- SOAPFault, dateTime and Apache's Map.
+ * object.c (rb_obj_clone): FL_MARK move to a bitmap.
-Sun Nov 30 09:35:14 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * class.c (rb_singleton_class_clone): ditto.
- * string.c (rb_str_update): get rid of SEGV at just allocated String.
- [ruby-core:01812]
+Sat Jan 7 00:47:07 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Fri Nov 28 23:19:34 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in: always define CANONICALIZATION_FOR_MATHN.
+ [ruby-dev:45100] [Bug #5852]
- * gc.c (gc_mark): explicitly check mark recursion levels, instead
- of unreliable stack length.
+Fri Jan 6 23:11:20 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Fri Nov 28 22:49:56 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * include/ruby/version.h: RUBY_API_VERSION 2.0.0
- * lib/rinda/rinda.rb: fix TupleSpaceProxy#read, read_all.
+Fri Jan 6 12:24:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Nov 28 21:44:40 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * object.c (rb_inspect): raises Encoding::CompatibilityError if the
+ result is incompatible with the default external encoding.
+ [ruby-core:41931] [Bug #5848]
- * test/fileutils/test_fileutils.rb (test_ln_s): should be a file, not
- a directory for FreeBSD.
+Thu Jan 5 15:26:15 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Nov 28 19:37:56 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (check_valid_dir): strict checking of root.
+ GetDriveType() succeeds with non root directory as the argument,
+ even if MSDN says that the API needs the root directory.
+ this patch fixes a failure of test/ruby/test_file_exhaustive.rb.
- * hash.c (env_has_value, env_index): must match exactly.
+Thu Jan 5 12:15:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/ruby/test_env.rb (test_has_value, test_index): condition for
- aboves.
+ * file.c (rb_file_join): separator is appended by array length - 1
+ times. patched by Benoit Daloze [ruby-core:41901] [Bug #5841]
-Fri Nov 28 17:59:20 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Jan 5 11:47:54 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/ruby/test_env.rb: add tests for ENV.
+ * lib/uri/common.rb (URI::Parser#initialize_regexp):
+ use \A \z instead of ^ $. [Bug #5843]
-Fri Nov 28 17:47:46 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed Jan 4 17:55:53 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/drb/drb.rb (DRbMessage#load): rescue Errno::* and raise
- DRbConnError.
+ * array.c (rb_ary_sample): add example for Array#sample
+ based on patch from https://github.com/ruby/ruby/pull/74
-Fri Nov 28 15:41:15 2003 Tanaka Akira <akr@m17n.org>
+Wed Jan 4 14:24:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/pathname.rb (Pathname#realpath): obsolete the force_absolute
- argument.
+ * string.c (str_nth_len): count ascii-only run at the end. this
+ bug appears only when single-byte-optimization is disabled due
+ to unknown coderange. [ruby-core:41896] [Bug #5836]
-Fri Nov 28 14:41:52 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Wed Jan 4 11:32:07 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/soap/streamHandler.rb: drop unused http parameters.
+ * win32/win32.c (check_valid_dir): special case for a root directory.
+ Reported by Masateru OKAMOTO at [Bug #5819].
- * lib/soap/encodingstyle/soapHandler.rb, lib/soap/mapping/factory.rb,
- lib/soap/mapping/mapping.rb, lib/soap/mapping/registry.rb,
- lib/wsdl/soap/complexType.rb: ApacheSOAP's map support was broken
- under WSDL dynanic client environment. fixed.
+Wed Jan 4 00:19:54 2012 Kouhei Sutou <kou@cozmixng.org>
- * test/wsdl/raa/*: add tests.
+ * lib/rexml/parsers/baseparser.rb: use private instead of _xxx
+ method name. This is Ruby code not Python code.
+ refs #5696
- * lib/xsd/datatypes.rb: dateTime precision bug fix (at least, I hope.)
- bug of soap4r. XSDDateTimeImple.to_time passed a Float to
- Time.local/Time.gm as an usec, and NUM2LONG(rb_num2long for Float)
- causes rounding error.
+Tue Jan 3 23:57:37 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * test/soap/test_basetype.rb, test/xsd/test_xsd.rb: add tests.
+ * lib/rexml/parsers/baseparser.rb: rexml BaseParser uses
+ instance_eval unnecessarily on listener add.
+ patch from Charles Nutter. [Bug #5696] [ruby-core:41437]
-Fri Nov 28 04:15:24 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jan 3 20:44:13 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * eval.c (method_arity): used wrong Proc object. [ruby-talk:86504]
+ * README: add comment for Git user. patch from Arun Agrawal.
+ * README.ja: ditto.
-Fri Nov 28 00:47:29 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jan 3 15:58:22 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * eval.c (rb_f_exit), process.c (rb_f_exit_bang): treat true as
- success, false as failure. [ruby-dev:22067]
+ * thread.c: changed documentation for "thread-local" variables.
+ patch from Julien Ammous.
- * eval.c (rb_f_abort, rb_thread_switch), process.c (rb_f_system): use
- ANSI macro instead of hard coded value.
+Tue Jan 3 15:50:12 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * eval.c (rb_f_exit), process.c (rb_f_exit_bang): use VALUEs not but
- TYPEs.
+ * process.c: Fix typo. patch from Aviv Ben-Yosef.
-Thu Nov 27 22:05:48 2003 Akinori MUSHA <knu@iDaemons.org>
+Tue Jan 3 13:43:37 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c, gc.c: FreeBSD/ia64 currently does not have a way for a
- process to get the base address for the RSE backing store, so
- hardcode it for the moment.
- [submitted by: Marcel Moolenaar <marcel@FreeBSD.org>]
+ * tool/merger.rb: allow r0123 style revision number.
-Thu Nov 27 17:36:42 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Jan 3 11:17:55 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/tk/lib/tkafter.rb: bug fix on TkTimer#cancel_on_exception=(mode).
- TkTimer#wait recieves the exception of the callback.
- The exception is kept on @return_value.
+ * tool/merger.rb (#version_up): version.h date should be Japanese
+ locale date.
-Thu Nov 27 16:58:48 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Mon Jan 2 22:08:00 2012 Akinori MUSHA <knu@iDaemons.org>
- * win32/win32.c (rb_w32_stat): remove _fullpath() for NUL: device.
+ * tool/file2lastrev.rb (VCS::detect): Add support for Subversion
+ 1.7 which adopted a whole new working directory structure.
-Wed Nov 26 15:38:47 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * tool/file2lastrev.rb (VCS::detect): Simply use .each instead of
+ .sort.reverse_each which looks too arbitrary. If you want SVN
+ to be tried first, then you just have to register it first as it
+ is right now.
- * test/fileutils/test_fileutils.rb (test_ln_s): should take the
- existing symbolic link for OpenBSD.
+Mon Jan 2 20:53:36 2012 Tanaka Akira <akr@fsij.org>
-Wed Nov 26 04:48:42 2003 why the lucky stiff <why@ruby-lang.org>
+ * lib/securerandom.rb (random_bytes): use IO#read instead of
+ IO#readpartial to make the intent more clear.
- * ext/syck/token.c: removed YYTOKTMP references which
- were causing buffer overflows on large block scalars,
- comments, quoted scalars and plain scalars.
+Mon Jan 2 15:26:39 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * ext/syck/rubyext.c: dynamic changing of buffer size.
+ * test/ruby/test_object.rb (test_send_with_block): add a normal case.
- * ext/syck/syck.h: default buffer size of 4k.
+Mon Jan 2 15:18:54 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Wed Nov 26 00:55:30 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/ruby/test_object.rb (test_send_with_block): moved from
+ bootstraptest/test_flow.rb.
- * lib/webrick/httpresponse.rb: add HTTPResponse#keep_alive=.
+Mon Jan 2 15:10:11 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/webrick/httpserver.rb (HTTPServer#run): should pass the
- request's keep_alive flag to the response.
+ * lib/test/unit/parallel.rb: use pack("m0") instead of
+ pack("m").gsub("\n","").
+ * lib/test/unit.rb (Test::Unit::Runner::Worker#run): ditto.
-Tue Nov 25 21:41:35 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jan 2 15:05:09 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * defines.h (ENV_IGNORECASE): should define when DOSISH without
- human68k. [ruby-dev:22047]
+ * lib/test/unit.rb (Test::Unit::Runner::Worker#run): use
+ File.basename with suffix instead of gsub.
- * hash.c (env_has_value, env_index): don't ignore case of value.
- [ruby-dev:22048]
+Mon Jan 2 14:55:28 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Tue Nov 25 21:39:37 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): find may
+ return nil and nil can not dup.
- * file.c (path_check_1): honor sticky bits always.
- [ruby-talk:86273]
+Sun Jan 1 12:23:10 2012 Akinori MUSHA <knu@iDaemons.org>
-Tue Nov 25 20:02:14 2003 Minero Aoki <aamine@loveruby.net>
+ * lib/shellwords.rb (Shellwords#shellescape): Drop the //n flag
+ that only causes warnings with no real effect. [Bug #5637]
- * test/fileutils/test_fileutils.rb: do test in more deep
- directory.
+Sat Dec 31 06:28:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * test/fileutils/test_nowrite.rb: ditto.
+ * thread.c (rb_barrier_waiting): save the number of waiting threads
+ in RBASIC()->flags. [ruby-dev:45002] [Bug #5768]
-Tue Nov 25 19:04:23 2003 Tanaka Akira <akr@m17n.org>
+ * thread.c (rb_barrier_wait): increment and decrement around
+ rb_mutex_lock, and use rb_barrier_waiting().
- * lib/open-uri.rb (URI::Generic#find_proxy): ENV case sensitivity test
- refined.
+ * thread.c (rb_barrier_release): use rb_barrier_waiting().
-Tue Nov 25 18:13:30 2003 Minero Aoki <aamine@loveruby.net>
+ * thread.c (rb_barrier_destroy): ditto.
- * test/fileutils/test_fileutils.rb: chdir Dir.tmpdir before each
- test. [ruby-dev:22045]
+Mon Dec 26 17:20:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * test/fileutils/test_nowrite.rb: ditto.
+ * vm.c (vm_exec): add guard to prevent optimization for LLVM clang.
-Tue Nov 25 17:52:11 2003 Tanaka Akira <akr@m17n.org>
+Fri Dec 30 17:01:12 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/open-uri.rb (URI::Generic#find_proxy): use http_proxy under CGI
- if the environment variable is case sensitive.
+ * vm_eval.c (rb_f_send): fix obj.send() documentation issue.
+ [Bug #5125] [ruby-core:38633]
-Tue Nov 25 16:41:33 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Thu Dec 29 22:36:16 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * test/wsdl/multiplefault.wsdl, test/wsdl/test_multiplefault.rb:
- removed. this test requires extra libraries in soap4r/1.5.*.
+ * lib/test/unit.rb (Test::Unit::Runner::Worker#_run_parallels): fix
+ premature exit when all workers' status are :ready or :prepare.
+ [ruby-dev:45061] [Bug #5822]
-Tue Nov 25 16:24:42 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Thu Dec 29 01:51:13 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * lib/soap/**/*.rb, lib/wsdl/**/*.rb, lib/xsd/**/*.rb: changed license;
- GPL2 -> Ruby's.
+ * include/ruby/ruby.h: fix #error pragma. LLP64 platform is supported.
- * lib/soap/rpc/driver.rb, lib/soap/wsdlDriver.rb,
- lib/soap/streamHandler.rb: add interface to streamhandler.
+ * include/ruby/st.h: ditto.
- * lib/soap/marshal.rb: raise error if parse fails.
+Wed Dec 28 11:22:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/soap/netHttpClient.rb: add https support. Patched by
- Oliver M. Bolzer.
+ * lib/fileutils.rb (FileUtils::Entry_#entries): use utility method
+ instead of typoed regexp. [ruby-core:41829] [Bug #5817]
- * lib/soap/netHttpClient.rb: dump HTTP response message body by itself.
+Wed Dec 28 02:08:04 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * lib/soap/rpc/driver.rb, lib/soap/rpc/proxy.rb,
- lib/soap/wsdlDriver.rb: add driver#mandatorycharset interface to foce
- using charset for parsing response from buggy server.
+ * vm_insnhelper.c (unknown_keyword_error): add GC guard to prevent
+ intermediate object from GC.
- * lib/soap/encodingstyle/soapHandler.rb: support Apache Axis's half
- typed multi-ref array.
+Tue Dec 27 22:34:54 2011 Shota Fukumori <sorah@tubusu.net>
- * lib/soap/mapping/factory.rb, lib/soap/mapping/registry.rb: map
- SOAPStruct which has multi-accessors which name are the same, to an
- array.
+ * lib/test/unit.rb (Worker#close): "closing IO if IO is closed"
+ should be "closing IO if IO isn't closed"
- * lib/soap/rpc/element.rb: fixed illegal parameter order.
+Tue Dec 27 22:04:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/soap/rpc/element.rb: element name of response message could have
- the name other than 'return'.
+ * st.c (st_update): new function to lookup the given key and
+ update the value. [ruby-dev:44998]
- * lib/wsdl/operation.rb, lib/wsdl/operationBinding.rb,
- lib/wsdl/soap/classDefCreator.rb, lib/wsdl/soap/methodDefCreator.rb,
- lib/wsdl/soap/methodDefCreatorSupport.rb: WSDL/1.1 allows plural
- fault definition in a operation. [ruby-talk:84948]
+Tue Dec 27 21:17:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/wsdl/multiplefault.wsdl, test/wsdl/test_multiplefault.rb: add
- test for above fix.
+ * node.h (rb_args_info): change pre_args_num and post_args_num as
+ int, to match with rb_iseq_t.
- * lib/wsdl/soap/complexType.rb: support WSDL array definition with
- maxOccures="unbound".
+ * parse.y (new_args_gen): check overflow.
- * lib/xsd/charset.rb: use cp932 under emx. Patched by
- Siena. / SHINAGAWA, Norihide in [ruby-dev:21972]
+Mon Dec 26 22:38:35 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * lib/xsd/xmlparser/parser.rb: set @charset nil by default. Nil means
- 'follow encoding declaration in XML'.
+ * vm_insnhelper.c (unknown_keyword_error): make it kind a error
+ message when unknown keyword is given. It require more work.
+ See [ruby-core:40518] and [ruby-core:40541] in detail.
- * sample/soap/digraph.rb, sample/wsdl/amazon/wsdlDriver.rb,
- sample/wsdl/googleSearch/sampleClient.rb,
- sample/wsdl/googleSearch/wsdlDriver.rb,
- test/wsdl/test_emptycomplextype.rb,
- test/wsdl/marshal/test_wsdlmarshal.rb,
- test/xsd/test_xmlschemaparser.rb: use File.open(...) { |f| f.read }
- instead of File.open(...).read. [ruby-dev:21964]
+Mon Dec 26 22:31:07 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * test/wsdl/emptycomplextype.wsdl, test/wsdl/test_emptycomplextype.rb:
- simplify the test case.
+ * vm_core.h (struct rb_iseq_struct), compile.c (iseq_set_arguments),
+ iseq.c (rb_iseq_parameters), vm_insnhelper.c
+ (vm_callee_setup_arg_complex): support Method#parameters for keyword
+ arguments. The provisional spec is what Benoit Daloze proposed.
+ [ruby-core:40541]
- * test/wsdl/axisArray/*: add tests for axis's array encoding.
+ * test/ruby/test_keyword.rb: add a test for above.
-Tue Nov 25 16:15:29 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Mon Dec 26 22:15:27 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * ruby.h: don't treat Cygwin as Windows.
+ * vm_core.h (struct rb_iseq_struct), compile.c (iseq_set_arguments,
+ iseq_compile_each), vm_insnhelper.c (vm_callee_setup_arg_complex):
+ implement keyword arguments. See [ruby-core:40290]
+ The feature is promised to be included in 2.0, but the detail spec
+ is still under discussion; this commit is a springboard for further
+ discussion. Please try it and give us feedback.
+ This commit includes fixes for some problems reported by Benoit
+ Daloze <eregontp AT gmail.com> [ruby-core:40518] and Marc-Andre
+ Lafortune <ruby-core-mailing-list AT marc-andre.ca>
+ [ruby-core:41772].
-Tue Nov 25 15:18:28 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * iseq.c (iseq_free, prepare_iseq_build): bookkeeping.
- * configure.in: change default value of --enable-pthread (default: no)
+ * test/ruby/test_keyword.rb: add tests for keyword arguments.
-Tue Nov 25 07:31:16 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ripper/dummyparser.rb (class DummyParser): temporal fix for
+ ripper test.
- * parse.y (primary): allow newlines just before right argument
- parenthesis. (ruby-bugs:PR#1221)
+Mon Dec 26 22:00:17 2011 Yusuke Endoh <mame@tsg.ne.jp>
-Mon Nov 24 23:32:06 2003 Tanaka Akira <akr@m17n.org>
+ * node.h, node.c, parse.y: implement a parser part for keyword
+ arguments.
+ This is a preparation for keyword argument (see [ruby-core:40290]).
- * lib/open-uri.rb (OpenURI.open_loop, URI::HTTP#proxy_open): use
- catch/throw for redirection instead of exception.
- (OpenURI.open_loop, OpenURI.redirectable?): restrict redirection.
+ * gc.c (gc_mark_children): bookkeeping.
-Mon Nov 24 19:59:48 2003 Tanaka Akira <akr@m17n.org>
+Mon Dec 26 21:03:18 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * lib/open-uri.rb (URI::Generic#find_proxy): use CGI_HTTP_PROXY
- instead of HTTP_PROXY in the CGI environment.
+ * node.h, parse.y (new_args_gen), compile.c (iseq_set_arguments): use
+ struct rb_args_info instead of NODEs.
+ This is a preparation for keyword argument (see [ruby-core:40290]).
-Mon Nov 24 19:32:55 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * node.c (dump_node), gc.c (gc_mark_children, obj_free): bookkeeping.
- * ext/etc/extconf.rb: check for pw_passwd in struct passwd and
- gr_passwd in struct group for DJGPP.
+Mon Dec 26 20:59:51 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * ext/etc/etc.c: ditto.
+ * node.h, parse.y (lambda, f_larglist): remove NEW_LAMBDA hack.
+ This is a preparation for keyword argument (see [ruby-core:40290]).
- * ext/Setup.dj: support for curses, etc, zlib.
+Mon Dec 26 22:01:19 2011 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Mon Nov 24 17:00:00 2003 Tanaka Akira <akr@m17n.org>
+ * io.c (rb_sys_fail_path): move the definition.
+ Move above for using it in set_binary_mode_with_seek_cur().
- * lib/open-uri.rb: validate option names.
- :content_length_proc and :progress_proc option implemented.
+ * io.c (set_binary_mode_with_seek_cur): fix improper seek cursor.
+ Seeking file cursor with setting binary mode has possibility to
+ cause infinite loop. Fixed the bug and refined error handling.
+ Introduced at r34043.
-Mon Nov 24 14:53:10 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ And cleanups as below.
+ Remove unnecessary parentheses of `fptr`.
+ Use return value of setmode().
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub
- (XCFLAGS): output empty value instead of `-DRUBY_EXPORT'.
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_seek_with_setting_binmode): add a test for above.
+ [ruby-core:41671] [Bug #5714]
-Sat Nov 22 23:09:45 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Mon Dec 26 17:01:14 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: set enable_pthread to no on MinGW.
+ * common.mk (LIBRUBY_A): depends on main.o since r33774.
+ [ruby-core:41786] [Bug #5796]
-Sat Nov 22 22:56:20 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Mon Dec 26 13:07:08 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in: add --enable-pthread option (default: yes)
+ * test/ruby/test_io.rb (TestIO#test_autoclose): Tempfile.new doesn't
+ accept the block argument.
-Sat Nov 22 22:48:46 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Mon Dec 26 13:06:52 2011 Shota Fukumori <sorah@tubusu.net>
- * ext/tk/lib/tk.rb: add Tk.grab_release and fix bug of TkComposite
+ * lib/test/unit.rb: Avoid zombie processes on "--separate" option
+ added at r34121.
- * ext/tk/lib/tkafter.rb: bug fix of TkAfter#start
+Mon Dec 26 04:01:23 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/tk/sample/tkcombobox.rb: new sample script
+ * ext/openssl/ossl_cipher.c: Update and complete documentation.
- * ext/tcltklib/tcltklib.c: add native thread check
+Sun Dec 25 23:16:11 2011 Shota Fukumori <sorah@tubusu.net>
-Sat Nov 22 18:49:47 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/testunit/test_parallel.rb (test_separate): Test for "--separate"
+ option (r34121)
- * ext/curses/curses.c (window_nodelay): nodelay() of NetBSD's
- libcruses returns no value, just like keypad().
+Sun Dec 25 22:39:49 2011 Shota Fukumori <sorah@tubusu.net>
-Sat Nov 22 17:36:36 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/test/unit.rb (_run_parallel):
+ New option "--separate" for test/unit; when running tests with this
+ option, a job process will be restarted after one test file has done.
+ This means all test files will run with separated process.
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub
- (HAVE_GETCWD): output to config.h.
+ * lib/test/unit/parallel.rb: Fix for above. Now parallel.rb puts
+ "ready!" for first ready, "ready" for afters.
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub
- (XCFLAGS): output to config.status.
+Sun Dec 25 00:02:15 2011 Luis Lavena <luislavena@gmail.com>
-Sat Nov 22 13:10:10 2003 Minero Aoki <aamine@loveruby.net>
+ * configure.in: change --with-ntver to --with-winnt-ver to be more
+ descriptive in the context. [ruby-core:41794]
- * lib/fileutils.rb (have_st_ino?): djgpp has valid st_ino.
+Sat Dec 24 23:25:15 2011 Luis Lavena <luislavena@gmail.com>
-Sat Nov 22 11:28:48 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in: add --with-ntver option to match win32/configure.bat
+ functionality. Set 0x0501 as default. [ruby-core:35010]
+ [ruby-core:35035]
- * gc.c (Init_stack): stack region is far smaller than usual if
- pthread is used.
+Sat Dec 24 12:38:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 22 07:30:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * proc.c (proc_call): get rid of optimization-out by clang.
- * lib/test/unit/util/backtracefilter.rb: fixed a bug that occurred
- when an exception had no backtrace.
+ * proc.c (rb_proc_call, rb_proc_call_with_block): ditto.
- * test/testunit/util/test_backtracefilter.rb: ditto.
+Sat Dec 24 10:56:32 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Nov 21 16:44:18 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/readline/readline.c (readline_readline): check if outstream
+ is closed to get rid of a bug of readline 6. [ruby-dev:45043]
+ [Bug #5803]
- * ext/tk/lib/tkentry.rb: fix the encoding trouble of percent
- substitutions on validatecommand option of TkEntry widget
+Sat Dec 24 06:59:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk.rb: fix bug on {pack|grid}_propagate() method
+ * test/readline/test_readline.rb (test_line_buffer__point): use
+ lambda not to exit entire method by "return". or "next" for
+ proc. [ruby-dev:45042] [Bug #5802]
-Fri Nov 21 16:12:11 2003 Akinori MUSHA <knu@iDaemons.org>
+Sat Dec 24 01:20:39 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * ruby.1: Fix markups and grammar.
+ * vm_eval.c (send_internal): PASS_PASSED_BLOCK_TH must be placed
+ just before calling rb_call0.
-Fri Nov 21 14:49:42 2003 Minero Aoki <aamine@loveruby.net>
+ * bootstraptest/test_flow.rb: add a test for above.
- * ruby.1: wrote about ruby related environment variables.
+Sat Dec 24 00:55:16 2011 Tanaka Akira <akr@fsij.org>
-Fri Nov 21 12:28:03 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/tempfile.rb (Tempfile#initialize): warn if a block is given.
- * marshal.c (w_extended): singleton methods should not be checked
- when dumping via marshal_dump() or _dump(). [ruby-talk:85909]
+Fri Dec 23 16:14:30 2011 TAKAO Kouji <kouji@takao7.net>
-Fri Nov 21 01:40:00 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ in Readline module with GNU Readline 6 case, Readline module
+ resets completion_append_character to " ", after it executes
+ completion. So, Readline module stores
+ completion_append_character, and Readline module always sets it
+ after Readline module executes completion. [ruby-dev:43456]
+ [Feature #4635]
- * configure.in: check <pthread.h>
+Fri Dec 23 15:59:05 2011 TAKAO Kouji <kouji@takao7.net>
- * ruby.h: include pthread.h if existence.
- define is_ruby_native() macro when not HAVE_NATIVETHREAD
+ * ext/readline/readline.c (Init_readline): libedit check
+ rl_getc_function only when rl_initialize() is called, and
+ using_history() call rl_initialize(). This assignment should be
+ placed before using_history(). [ruby-core:40641] [Bug #5539]
- * eval.c: undef is_ruby_native() function when not HAVE_NATIVETHREAD
+Fri Dec 23 10:14:47 2011 Tanaka Akira <akr@fsij.org>
-Fri Nov 21 00:43:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * test/thread/test_queue.rb (test_thr_kill): show the number of loop
+ run when the test failed.
- * lib/test/unit/assertions.rb: use #__send__ instead of #send.
+Fri Dec 23 09:23:48 2011 Tanaka Akira <akr@fsij.org>
- * lib/test/unit/testcase.rb: ditto.
+ * test/test_pty.rb (test_pty_check_default): call PTY.check until
+ "cat" command is finished.
-Thu Nov 20 19:19:22 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Fri Dec 23 06:03:00 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * configure.in: don't find the Cygwin's pthread library on MinGW.
+ * common.mk: add "check succeeded" message.
-Thu Nov 20 19:15:50 2003 Minero Aoki <aamine@loveruby.net>
+ * README, README.ja: follow above change.
- * lib/fileutils.rb (have_st_ino?): emx (OS/2 with EMX) does not
- have st_ino (always 0). [ruby-dev:21972]
+Fri Dec 23 06:00:39 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/fileutils.rb (rename_cannot_overwrite_file?): emx does not
- allow overwriting files by rename(2).
+ * ext/bigdecimal/bigdecimal.h: add satisfy cc-mode comment.
+ * util.c: ditto.
- * test/fileutils/test_fileutils.rb: windows? ->
- have_drive_letter?, have_file_perm?
+Fri Dec 23 00:08:25 2011 Tanaka Akira <akr@fsij.org>
-Thu Nov 20 17:50:58 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/test_pty.rb (test_pty_check_default): "cat" may not terminated
+ in the 0.1 second.
- * ext/tk/sample/tkballoonhelp.rb: new sample script
+Thu Dec 22 23:37:25 2011 Tanaka Akira <akr@fsij.org>
- * ext/tk/sample/tkmultilistbox.rb: ditto
+ * test/ruby/test_thread.rb (test_condvar_timed_wait): don't test the
+ maximum sleep time. Ruby is not a real-time system.
- * ext/tk/sample/tktextframe.rb: ditto
+Thu Dec 22 22:37:45 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Thu Nov 20 13:37:34 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * thread_pthread.c (ping_signal_thread_list): remove return value.
+ * thread_pthread.c (check_signal_thread_list): add a new function to
+ check if signal thread list is empty.
+ * thread_pthread.c (thread_timer): check signal thread list after
+ timer_thread_function(). main thread might be added into signal thread
+ list during timer_thread_function().
- * ruby.h: define is_ruby_native_thread() for no native thread
- environment
+Thu Dec 22 00:40:24 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * eval.c: ditto
+ * ext/bigdecimal/bigdecimal.c (VpMult, VpCtoV, VpSqrt): remove assigned
+ but unused variables.
-Thu Nov 20 12:42:47 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Dec 21 18:28:22 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in: always check existence of the pthread library
+ * common.mk (newline.c, miniprelude.c): revert r33949 because the change
+ broke mswin build, and the changer said no reason about the change.
+ [ruby-dev:45016] [Bug #5783]
- * ruby.h: define macros for ruby's native thread check
+Wed Dec 21 12:35:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c: add ruby's native thread check
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_s_allocate): follow
+ Allocation Framework. [Bug #5775]
- * gc.c: ditto
+Wed Dec 21 02:25:36 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Nov 19 14:45:18 2003 Minero Aoki <aamine@loveruby.net>
+ * ext/psych/emitter.c: fixing clang warnings. Thanks Joey!
- * lib/net/http.rb (to_ary): print more friendly warning message.
+Wed Dec 21 01:06:00 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Wed Nov 19 14:32:08 2003 Minero Aoki <aamine@loveruby.net>
+ * ext/bigdecimal/README: Update redmine.ruby-lang.org to bugs.ruby-lang.org
+ * ext/socket/ancdata.c: ditto
+ * test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb: ditto
+ * test/syck/test_yaml.rb: ditto
+ * doc/ChangeLog-1.9.3: ditto
- * lib/fileutils.rb (fu_same?): add djgpp and wince.
+Tue Dec 20 23:50:12 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * lib/fileutils.rb (cannot_overwrite_file?): add wince.
+ * PStore content update perf optimization. Patch by Masaki Matsushita.
+ See #5248.
-Wed Nov 19 11:04:47 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/pstore.rb (save_data):
- * lib/fileutils.rb (cannot_overwrite_file?, have_st_ino?): bccwin32
- is same as mswin32.
+ * Delete inadequate Marshal check.
-Wed Nov 19 07:54:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * Deferred file truncation: when writing the new content, truncate
+ the saved file to the data size after writing the data, instead of
+ truncating whole bytes before writing data.
- * lib/test/unit.rb: do not run tests if $! is set.
+ * Deferred MD5 calculation: when comparing MD5 hash to check the
+ content modification, calculate MD5 hash of new data iif the
+ content length is differ from the old one.
- * lib/test/unit/assertionfailederror.rb: extend StandardError instead
- Exception (irb catches the former but not the latter).
+ * Compare content size with String#bytesize instead of String#size.
-Tue Nov 18 23:31:36 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Tue Dec 20 21:00:30 2011 Tadayoshi Funaba <tadf@dotrb.org>
- * missing/memmove.c (memmove): take void *, not char *.
+ * ext/date/date_core.c: uses to_integer instead.
+ * test/date/test_switch_hitter.rb: added a test.
- * missing.h (memmove): ditto.
+Tue Dec 20 15:04:18 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * missing.h (strchr, strrchr): return char *, not int.
+ * Make sure to clear $! when ignoring an exception
-Tue Nov 18 22:20:10 2003 Minero Aoki <aamine@loveruby.net>
+ * ext/openssl/ossl.c (ossl_pem_passwd_cb0, ossl_verify_cb):
+ pem_passwd_cb and verify_cb ignores the exception raised in a
+ callback proc so it should clear $! for subsequent execution.
- * lib/fileutils.rb (fu_same?): temporal fix for windows.
+ That's said, both subsequent processes for pem_passwd_cb and
+ verify_cb raises another exception before leaking $! to Ruby world.
+ We cannot test this fix in Ruby land.
-Tue Nov 18 19:05:04 2003 Minero Aoki <aamine@loveruby.net>
+ * test/openssl/test_pkey_rsa.rb
+ (test_read_private_key_pem_pw_exception): Test for pem_passwd_cb +
+ exception.
- * lib/fileutils.rb (fu_same?): check by inode instead of path
- name, to detect two hard links pointing to the same content.
+Tue Dec 20 11:49:13 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/fileutils.rb: did not create correctly looped symlinks.
+ * test/date/test_date_base.rb (test_jd): tests for
+ [ruby-dev:45008].
-Tue Nov 18 18:23:05 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 20 10:20:48 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/stringio/stringio.c (strio_read): behave as IO at empty string.
- [ruby-dev:21939], [ruby-dev:21941]
+ * ext/date/date_core.c (wholenum): fix the type of the return value.
- * ext/stringio/stringio.c (strio_getc, strio_getline): set EOF flag.
+Tue Dec 20 05:03:24 2011 Eric Hodel <drbrain@segment7.net>
- * ext/stringio/stringio.c (strio_rewind, strio_seek, strio_ungetc):
- clear EOF flag.
+ * README.ja: Update redmine.ruby-lang.org to bugs.ruby-lang.org
+ * README: ditto
+ * common.mk: ditto
+ * man/erb.1: ditto
+ * man/irb.1: ditto
+ * man/ri.1: ditto
+ * man/ruby.1: ditto
+ * sparc.c: ditto
+ * tool/install-sh: ditto
- * test/stringio/test_stringio.rb: imported from [ruby-dev:21941].
+Tue Dec 20 02:15:18 2011 Tadayoshi Funaba <tadf@dotrb.org>
-Tue Nov 18 14:06:35 2003 Minero Aoki <aamine@loveruby.net>
+ * ext/date/date_core.c: [ruby-dev:45008].
- * lib/fileutils.rb (fu_each_src_dest): raise if src==dest.
- [ruby-talk:85344] [ruby-core:01699]
+Sun Dec 18 18:52:37 2011 Naohisa Goto <ngotogenome@gmail.com>
- * lib/fileutils.rb: use Object#is_a? instead of Class#=== to allow
- e.g. remote objects for receivers.
+ * vm.c (vm_define_method): improve guard of iseq from GC. Fix
+ failure or segmentation fault in test_singleton_method(TestGc)
+ on sparc Solaris10 compiled with Oracle Solaris Studio 12.2.
+ [Bug #5762] [ruby-dev:45000] [Bug #4178]
- * lib/fileutils.rb: FileTest -> File.
+Sun Dec 18 14:34:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/fileutils.rb: put parentheses for arguments of File.xxxx?
+ * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): does not follow
+ allocation framework right now. [ruby-core:41710] [Bug #5773]
- * test/fileutils/test_fileutils.rb (test_cp): test "cp a a".
+Sun Dec 18 12:42:48 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * test/fileutils/test_fileutils.rb (test_mv): test "mv a a".
+ * ext/psych/lib/psych/visitors/to_ruby.rb: BigDecimals can be restored
+ from YAML.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: BigDecimals can be dumped
+ to YAML.
+ * test/psych/test_numeric.rb: tests for BigDecimal serialization
- * test/fileutils/test_fileutils.rb (test_ln): test "ln a a".
+Sun Dec 18 12:03:13 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * test/fileutils/test_fileutils.rb (test_ln_s): test "ln_s a a".
+ * ext/psych/lib/psych/scalar_scanner.rb: Strings that look like dates
+ should be treated as strings and not dates.
- * test/fileutils/test_fileutils.rb (test_install): test "install a a".
+ * test/psych/test_scalar_scanner.rb: corresponding tests.
- * test/fileutils/fileasserts.rb: new method assert_symlink.
+Sun Dec 18 09:43:21 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * test/fileutils/fileasserts.rb: assert_is_directory -> assert_directory.
+ * test/thread/test_queue.rb (test_thr_kill): extend timeout.
+ this test takes a long time at slow machine.
-Mon Nov 17 19:38:49 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Dec 18 09:36:51 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * file.c (getcwdofdrv): avoid using getcwd() directly, use
- my_getcwd() instead.
+ * test/ruby/envutil.rb (invoke_ruby): remove :timeout option before
+ pass it to Kernel#spawn.
- * merged NeXT, OpenStep, Rhapsody ports patch from Eric Sunshine
- <sunshine@sunshineco.com>. [ruby-core:01596]
+Fri Dec 16 17:18:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Nov 17 10:50:27 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * README, README.ja: 'make check' is preferable to 'make test'.
- * lib/optparse.rb (OptionParser::Completion::complete): allow least
- common completion for three or more candidates.
+Thu Dec 15 23:16:13 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Mon Nov 17 09:41:38 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * error.c (builtin_type_name): don't return pointer to the buffer of
+ temporary String object.
- * lib/test/unit/ui/tk/testrunner.rb,
- lib/test/unit/ui/gtk/testrunner.rb:
- run GUI main loop in sub thread.
+Thu Dec 15 17:56:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/ui/gtk2/testrunner.rb: imported from rough.
+ * io.c (argf_type): make typed data.
- * lib/test/unit/autorunner.rb (keyword_display): sort keywords.
+Thu Dec 15 17:40:28 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Nov 16 18:10:57 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * error.c (rb_check_type): fix typo.
- * eval.c (rb_eval): iterator should return value from next inside
- begin/rescue/end. (ruby-bugs:PR#1218)
+Thu Dec 15 14:48:35 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Nov 16 13:26:07 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/strscan/strscan.c: use typed data with
+ onig_region_memsize().
- * marshal.c (w_object): LINK check earlier than anything else,
- i.e. do not dump TYPE_IVAR for already dumped objects.
- (ruby-bugs:PR#1220)
+Thu Dec 15 14:33:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_eval): call "inherited" only when a new class is
- generated; not on reopening.
+ * error.c (rb_check_typeddata): refine error message with
+ including expected struct name.
- * eval.c (eval): prepend error position in evaluating string to
- "mesg" attribute string only when it's available and is a
- string.
+Thu Dec 15 13:15:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Nov 16 12:16:10 2003 Minero Aoki <aamine@loveruby.net>
+ * regcomp.c (onig_region_memsize): implemented for memsize_of().
- * lib/net/protocol.rb: logging response body. [experimental]
- [ruby-list:38800]
+ * ext/objspace/objspace.c (memsize_of): use it.
-Sun Nov 16 10:49:38 2003 Gavin Sinclair <gsinclair@soyabean.com.au>
+Thu Dec 15 10:44:54 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/thread.rb (Thread.exclusive): wrap method definition in
- class Thread to enable rdoc to process.
+ * array.c (rb_ary_reject_bang, rb_ary_delete_if): update rdoc.
+ documentation from Thomas Leitner <t_leitner AT gmx.at> in
+ [ruby-core:41616]. [Bug #5752]
-Sun Nov 16 09:45:23 2003 Minero Aoki <aamine@loveruby.net>
+Thu Dec 15 10:10:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/http.rb (set_debug_output): warn if method is called
- after #start. [ruby-dev:38798]
+ * test/ruby/test_require.rb (test_race_exception): get rid of
+ not-guaranteed timing issue. [ruby-core:41655] [Bug #5754]
-Sun Nov 16 04:41:33 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 14 21:58:42 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (eval): do not re-raise exception to avoid unnecessary
- exception copying, instead modify exception and internal
- information to adjust eval().
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_{read_with_binmode_and_get[cs]}): only for Windows.
- * eval.c (backtrace): can return the current frame information
- only if lev < -1.
+Wed Dec 14 19:57:23 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Nov 15 22:16:42 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * common.mk,Makefile.in,win32/Makefile.sub (ECHO1): move platform
+ specific hack from common.mk to Makefile.in (and win32/Makefile.sub).
+ [Bug #5711]
- * /ext/openssl/ossl_x509ext.c (ossl_x509extfactory_create_ext):
- refine error message.
+ * lib/mkmf.rb: we can generate Makefile as we like.
-Sat Nov 15 10:05:40 2003 Tanaka Akira <akr@m17n.org>
+Wed Dec 14 19:22:33 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/open-uri.rb (OpenURI.open_loop, OpenURI::HTTP#proxy_open):
- refactored to support options.
- (Buffer): maintain size by this class.
+ * win32/win32.c, include/ruby/win32.h (rb_w32_fd_is_text): new function.
-Sat Nov 15 07:40:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * win32/win32.c (init_stdhandle): set default mode of stdin as binmode.
- * eval.c (rb_method_node): new API to retrieve method body.
+ * io.c (set_binary_mode_with_seek_cur): new function to replace
+ SET_BINARY_MODE_WITH_SEEK_CUR macro. now returns previous mode of the
+ fd and take care of LF in rbuf.
-Fri Nov 14 13:21:30 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * io.c (do_writeconv): set text mode when needed.
- * ext/tcltklib/tcltklib.c: fix (en-bugged at 2003/11/07)
+ * io.c (io_read): need to change the mode of the IO to binmode
+ temporally when the length for IO#read, because IO#read with length
+ must behave so.
- * ext/tk/lib/tkdialog.rb: TkDialog.new accepts a parent widget
- argument [ruby-talk:85066]
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{read_with_length,
+ read_with_length_binmode,get[cs]_and_read_with_binmode,
+ read_with_binmode_and_get[cs],read_write_with_binmode}): tests for
+ above changes.
-Thu Nov 13 20:53:35 2003 Tanaka Akira <akr@m17n.org>
+ all patches are written by Hiroshi Shirosaki. [ruby-core:41496]
+ [Feature #5714]
- * lib/open-uri.rb (Kernel[#.]open): hard coded URI schemes removed.
- [ruby-ext:02251]
+Wed Dec 14 15:28:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 13 19:17:00 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * transcode.c (str_encode): about the extension of :fallback
+ option since 1.9.3.
- * lib/test/unit/ui/tk/testrunner.rb: use grid and panedwindow
- (if available)
+Wed Dec 14 12:19:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 13 17:56:41 2003 Tanaka Akira <akr@m17n.org>
+ * load.c (load_unlock): release loading barrier and then remove it
+ from loading_table if it is not in-use. [Bug #5754]
- * lib/open-uri.rb (OpenURI.open_uri): use File::RDONLY.
- reported by Take_tk <ggb03124@nifty.ne.jp>.
- [ruby-ext:02245]
+ * thread.c (rb_barrier_release, rb_barrier_destroy): return
+ whether any other threads are waiting on it.
-Thu Nov 13 16:45:53 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Wed Dec 14 11:23:45 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl_x509req.c (ossl_x509req_to_der): add function for
- X509::Request#to_der.
+ * thread_pthread.c (ubf_select): call rb_thread_wakeup_timer_thread()
+ only when it is not timer_thread. [Bug #5757] [ruby-dev:44985]
+ patched by Tomoyuki Chikanaga.
-Thu Nov 13 11:31:14 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 14 10:20:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/optparse.rb (OptionParser::Completion#complete): prior shorter
- name to containing longer name.
+ * load.c (load_lock): delete the loading barrier if it has been
+ destroyed.
-Thu Nov 13 06:08:54 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * thread.c (rb_barrier_wait): return nil for recursive lock
+ instead of false, to distinguish it from destroyed barrier.
- * ext/tk/lib/tk.rb: stop freezing some classes
+Wed Dec 14 01:24:55 2011 okkez <okkez000@gmail.com>
- * ext/tk/lib/multi-tk.rb: ditto.
+ * thread_pthread.c (rb_thread_create_timer_thread): fix memory
+ leak. [ruby-dev:44904] [Bug #5688]
-Wed Nov 12 17:32:49 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 14 00:01:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/assertions.rb (assert_throws, assert_nothing_thrown):
- uncaught throw in sub thread raises ThreadError.
+ * parse.y (primary): point method name line. [ruby-core:40936]
+ [Bug #5614]
- * lib/test/unit/ui/tk/testrunner.rb (setup_ui): "expand" is not
- necessary.
+Tue Dec 13 23:43:48 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Wed Nov 12 14:09:43 2003 Shugo Maeda <shugo@ruby-lang.org>
+ * error.c (name_err_mesg_to_str): clear rb_thread_t::errinfo when
+ ignore exception under rb_protect(). [ruby-core:41612] [Bug #5755]
- * test/monitor/test_monitor.rb: fix the timing problem by Queue.
+ * test/ruby/test_exception.rb (test_exception_in_name_error_to_str):
+ add a corresponding test.
-Wed Nov 12 12:59:44 2003 Shugo Maeda <shugo@ruby-lang.org>
+Tue Dec 13 16:13:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/monitor/test_monitor.rb: added.
+ * load.c (load_unlock): all threads requiring one file should
+ share same loading barrier, so it must be kept alive while those
+ are waiting on it. [ruby-core:41618] [Bug #5754]
-Wed Nov 12 10:14:28 2003 Shugo Maeda <shugo@ruby-lang.org>
+Tue Dec 13 07:30:14 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/monitor.rb: refactored. Thanks, Gennady Bystritsky.
+ * lib/webrick/httpresponse.rb (setup_header): 1xx responses
+ are allowed to have Keep-Alive connections.
-Wed Nov 12 06:11:39 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/webrick/test_httpresponse.rb: corresponding test.
- * ext/openssl/ossl.c (ossl_x509_sk2ary, ossl_x509crl_sk2ary):
- add functions to convert STACK into Array.
+Tue Dec 13 07:13:28 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/openssl/ossl.h: add prototypes.
+ * lib/webrick/httpresponse.rb (setup_header): 204 and 304 responses
+ are allowed to have a Keep-Alive connection. [ruby-core:41581]
- * ext/openssl/ossl_pkcs7.c (ossl_pkcs7_set_certificates,
- ossl_pkcs7_get_certificates, ossl_pkcs7_get_crls,
- ossl_pkcs7_set_crls): add functions for PKCS7#certificates=
- PKCS7#certificates, PKCS7#crls= and PKCS7#crls.
+ * test/webrick/test_httpresponse.rb: corresponding test.
-Wed Nov 12 00:47:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Tue Dec 13 06:29:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/ui/testrunnermediator.rb: should require 'test/unit'.
+ * parse.y (parser_magic_comment): should pass the proper value.
+ [ruby-dev:44984][Bug #5753]
-Tue Nov 11 23:54:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Tue Dec 13 05:50:07 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/ui/gtk/testrunner.rb: added a rescue clause to handle
- the case when the requested font is not available.
+ * vm_insnhelper.c (vm_yield_setup_block_args): splat single
+ argument if optional arguments are defined not only mandatory or
+ post arguments. [ruby-core:41557] [Bug #5730]
-Tue Nov 11 22:44:08 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Dec 12 22:35:39 2011 Shugo Maeda <shugo@ruby-lang.org>
- * io.c (appendline): file may not end with newline. a bug if
- READ_DATA_PENDING_PTR is defined. [ruby-talk:84925]
+ * parse.y (stmt_or_begin): changed the error message for BEGIN not
+ at toplevel. [ruby-dev:44963] [Bug #5738]
-Tue Nov 11 10:42:41 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Mon Dec 12 17:29:01 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/lib/tk.rb: raise an exception when creating TkWindow
- object, because TkWindow class is an abstract class.
+ * README: Fixed SupportedPlatforms URL in the README.
+ patched by eMxyzptlk. https://github.com/ruby/ruby/pull/62
-Tue Nov 11 03:30:43 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Dec 12 17:26:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/ext/openssl/ossl_conf.c (ossl_config_get_value): return nil
- if the specified value doesn't exist.
+ * load.c (rb_feature_p): lazy assigned load_path searched in
+ loading_table were not expanded, but all features, pushed to
+ loading table, are expanded. a patch by Yura Sokolov
+ <funny.falcon AT gmail.com> in [ruby-core:41545]. [Bug #5727]
- * lib/ext/openssl/ossl_conf.c (ossl_config_get_section): return
- a empty hash if the specified section doesn't exist.
+Mon Dec 12 15:41:03 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Nov 10 11:40:29 2003 Shugo Maeda <shugo@ruby-lang.org>
+ * ext/stringio/stringio.c (strio_truncate): fix typo. patched by
+ Nick Howard <ndh AT baroquebobcat.com>.
+ https://github.com/ruby/ruby/pull/65
- * lib/monitor.rb (wait): return true on signal/broadcastfalse and
- false on timeout. Thanks Gennady Bystritsky.
+Sun Dec 11 12:19:17 2011 Shugo Maeda <shugo@ruby-lang.org>
-Mon Nov 10 00:07:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/imap.rb: includes the sequence number of UID in a error
+ message. suggested by art lussos.
+ [ruby-core:41413] [Feature #5692]
- * parse.y (primary): primary_value may be 0 when syntax error.
- [ruby-talk:84893]
+Sun Dec 11 11:42:10 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Sun Nov 9 02:05:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * ext/syslog/syslog.c: fix a typo. [ruby-core:41585] [Bug #5740]
- * lib/test/unit/assertions.rb: un-deprecated #assert_not_nil to
- maintain symmetry with #assert_nil. Also added better output for
- #assert_kind_of.
+Sun Dec 11 10:48:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/testunit/tc_assertions.rb: ditto.
+ * error.c (exit_initialize): deal with true and false as well as
+ Kernel#exit. [ruby-dev:44951] [Bug #5728]
-Sat Nov 8 18:50:20 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sun Dec 11 10:37:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/wsdl/raa/*: add new testcase for WSDL loading, parsing and
- reading.
+ * object.c (rb_check_to_int): new function to convert a VALUE to
+ an Integer if possible, but returns nil instead of raising an
+ exception otherwise.
- * test/soap/marshal/*: backport from soap4r/1.5.1. all differences are
- for ruby/1.6.
+Sun Dec 11 10:34:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/soap/*: backport from soap4r/1.5.1. all differences are for
- ruby/1.6.
+ * process.c (rb_exit_status_code): extract from rb_f_exit_bang and
+ rb_f_exit. assume 0 to be success in Kernel#exit! too.
- * lib/wsdl/data.rb, lib/wsdl/xmlSchema/data.rb: move definition of
- ArrayTypeAttrName from ::WSDL::XMLSchema::* to ::WSDL::*.
- [ruby-talk:84813]
+Fri Dec 9 19:24:31 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/wsdl/soap/definitions.rb: element name typo in custom exception
- struct definition which is needed for wsdlDriver; camelCase ->
- underscore_name.
+ * enc/trans/iso-8859-16-tbl.rb: add ISO-8859-16 converter.
-Sat Nov 8 13:49:50 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * enc/trans/single_byte.trans: ditto.
- * configure.in: improvement of pthread check
+Fri Dec 9 14:28:40 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Nov 8 13:28:46 2003 Takaaki Tateishi <ttate@ttsky.net>
- * ext/dl/sym.c: Add DL.win32_last_error and DL.last_error.
- Thanks, Kaoru Shirai.
+ * file.c (file_path_convert): don't convert it when the path string is
+ ascii only. [ruby-core:41556] [Bug #5733]
+ tests are contributed by nobu.
-Sat Nov 8 06:19:38 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri Dec 9 08:00:15 2011 Luis Lavena <luislavena@gmail.com>
- * ext/tcltklib/tcltklib.c: To fix 'pthread-enabled Tcl/Tk' problem,
- TclTkIp#_eval calls Tcl_Eval() on the mainloop thread only
- (queueing a handler to the EventQueue).
+ * include/ruby/win32.h: undef stat to silence mingw-w64 stat
+ redefinition warnings (GCC 4.6.3).
- * ext/tcltklib/README.1st: edit the description of '--with-pthread-ext'
+Thu Dec 8 23:38:24 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Fri Nov 7 23:23:04 2003 Tanaka Akira <akr@m17n.org>
+ * variable.c (set_const_visibility): clear inline-cache when constant's
+ visibility is modified. [ruby-dev:44929]
- * lib/pathname.rb (Pathname#+): if self or the argument is `.', return
- another.
- (Pathname#parent): if self is `.', return `..'.
- (Pathname#children): if self is `.', don't prepend self for a
- pathname in a result.
- (Pathname#join): re-implemented using Pathname#+.
- (Pathname#find): if self is `.', remove `./' prefix of yielding
- pathname.
+ * test/ruby/test_module.rb (test_private_constants_clear_inlinecache):
+ add test for it.
-Fri Nov 7 10:23:24 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 8 23:26:11 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/socket/socket.c (make_hostent): get rid of SEGV on aliases
- lookup failure. (ruby-bugs:PR#1215)
+ * ext/extmk.rb (extract_makefile): should sort after map, not before
+ it. in this case there is no difference, but we should write better
+ code. this bad smell was caught by nagachika.
-Fri Nov 7 04:08:05 2003 UENO Katsuhiro <katsu@blue.sky.or.jp>
+Thu Dec 8 22:31:13 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/zlib/zlib.c (Init_zlib): define Zlib::GzipReader#each_line as
- an alias of Zlib::GzipReader#each.
+ * ext/extmk.rb (extract_makefile): need to sort the array of current
+ srcs before comparing to the sorted old srcs.
+ fixed the problem that the configuring stage of exts were always
+ run, introduced at r33801.
-Fri Nov 7 01:03:16 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Dec 8 13:26:24 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (rb_load): save and restore rb_prohibit_interrupt.
- [ruby-dev:21857]
+ * test/rexml/test_order.rb (OrderTester#test_more_ordering): use
+ Zlib::GzipReader.open instead of Zlib::GzipReader.new with File.new.
+ fixed a test error on Windows introduced at r33946.
-Thu Nov 6 18:05:07 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 8 13:11:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * io.c (rb_io_inspect): show the path also at a closed file.
- [ruby-dev:21851]
+ * test/ruby/test_process.rb (TestProcess#test_sete[gu]id): silently
+ skip if not implemented such functions (such as, on Windows).
+ fixed test errors on Windows introduced at r33953.
-Thu Nov 6 11:42:07 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 8 12:57:50 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/stringio/stringio.c (strio_set_string, strio_reopen): check
- tainted.
+ * ext/socket/extconf.rb: forgotten to define HAVE_SOCKETPAIR for
+ windows.
+ fixed test errors on Windows introduced at r33947.
- * ext/stringio/stringio.c (strio_copy, strio_ungetc, strio_write,
- strio_putc): add infection.
+Thu Dec 8 12:11:06 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/stringio/stringio.c (strio_path): just nil. [ruby-dev:21846]
+ * configure.in (RUBY_WERROR_FLAG): append all warning flags which
+ are enabled to compile, so that printf format modifiers properly
+ fail. [ruby-core:41351] [Bug #5679]
- * ruby.c (proc_options): reserve searched script path in the
- source file name table. [ruby-list:38765]
+Thu Dec 8 07:20:15 2011 Eric Hodel <drbrain@segment7.net>
- * lib/optparse.rb (OptionParser::Completion#complete): default not to
- ignore case on completion. [ruby-talk:84726]
+ * doc/re.rdoc: Document difference between match and =~, options with
+ Regexp.new and global variables. Patch by Sylvain Daubert.
+ [Ruby 1.9 - Bug #5709]
- * win32/win32.c (make_cmdvector): process backslashes even if a quote
- is not enclosed.
+Thu Dec 8 06:53:10 2011 Eric Hodel <drbrain@segment7.net>
-Wed Nov 5 23:49:45 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * doc/re.rdoc: Fix example code to match documentation. Patch by
+ Jarno Lamberg. [Ruby 1.9 - Bug #5624]
- * sample/openssl/gen_csr.rb: there (at least) is a CA which does not
- accept DN in UTF8STRING format. it's a sample.
+Wed Dec 7 19:04:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 5 22:55:16 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * configure.in (rpath): fix typo in the help string. a patch from
+ Yuji Yamano <yyamano AT kt.rim.or.jp> in [ruby-list:48568].
- * configure.in, eval.c, signal.c: : add '--with-pthread-ext'
- option to fix the pthread trouble on 'tcltklib'
+Wed Dec 7 18:55:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tcltklib/README.1st: add the description of '--with-pthread-ext'
+ * vm.c (vm_set_top_stack, vm_set_eval_stack): check for stack
+ overflow with stack_max before push new frame. [ruby-core:41520]
+ [Bug #5720]
- * ext/tk/lib/tktext.rb : add TkText#text_copy, text_cut, text_paste
- to support Tcl/Tk8.4's tk_textCopy, tk_textCut, tk_textPaste
+ * vm.c (vm_set_main_stack): no stack overflow chances after
+ vm_set_eval_stack().
- * ext/tk/lib/tk.rb : add TkMenu#set_focus support Tcl/Tk's
- tk_menuSetFocus
+Wed Dec 7 09:58:15 2011 Eric Hodel <drbrain@segment7.net>
-Wed Nov 5 17:33:45 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.c: Document +@, -@, hash, INFINITY, Nan.
+ Patch by Sylvain Daubert. [Ruby 1.9 - Feature #5622]
- * eval.c (rb_load): allow interrupt during loaded program
- evaluation. [ruby-dev:21834]
+Wed Dec 7 09:48:00 2011 Eric Hodel <drbrain@segment7.net>
- * hash.c (rb_hash_fetch): always warn if default argument and a
- block are supplied at the same time. [ruby-dev:21842]
+ * io.c (Init_IO): Mention io/console methods. [Ruby 1.9 - Bug #5602]
+ * ext/io/console/console.c: Mention that io/console must be required
+ similar to lib/time.rb
- * hash.c (env_fetch): ditto.
+Wed Dec 7 08:04:31 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * array.c (rb_ary_fetch): ditto.
+ * ext/psych/lib/psych.rb (module Psych): parse and load methods take
+ an optional file name that is used when raising Psych::SyntaxError
+ exceptions
+ * ext/psych/lib/psych/syntax_error.rb (module Psych): allow nil file
+ names and handle nil file names in the exception message
+ * test/psych/test_exception.rb (module Psych): Tests for changes.
-Wed Nov 5 19:08:47 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 6 18:26:33 2011 Tanaka Akira <akr@fsij.org>
- * lib/optparse.rb (OptionParser::Switch::PlacedArgument::parse):
- do not remove next argument if empty value is placed.
+ * ext/dbm/dbm.c: use db_version() instead of DB_VERSION_STRING to
+ detect runtime Berkeley DB version.
+ use dpversion instead of _QDBM_VERSION to detect runtime QDBM
+ version.
+ [ruby-dev:44948]
- * test/optparse: added.
+Tue Dec 6 12:30:41 2011 Tanaka Akira <akr@fsij.org>
-Wed Nov 5 17:05:18 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dbm/extconf.rb: detect gdbm_version in libgdbm.
- * lib/test/unit/ui/gtk/testrunner.rb: typo.
+ * ext/dbm/dbm.c: make DBM::VERSION more informative for gdbm, qdbm and
+ Berkeley DB 1.x. [ruby-dev:44944]
-Wed Nov 5 11:13:32 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Dec 6 07:26:37 2011 Eric Hodel <drbrain@segment7.net>
- * string.c: add #include "version.h". this file still depends on it.
+ * range.c: Improve documentation for Range. Patch by Chris Zetter.
+ [Ruby 1.9 - Bug #5656]
- * Makefile.in, bcc32/Makefile.sub, win32/Makefile.sub,
- wince/Makefile.sub: add version.h dependency to string.c.
+Mon Dec 5 19:08:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 5 09:14:23 2003 Shugo Maeda <shugo@ruby-lang.org>
+ * regparse.c (PFETCH_READY): separate gcc specific trick.
- * lib/monitor.rb: revert to the previous revision.
+Mon Dec 5 19:01:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 5 08:39:51 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * process.c (proc_seteuid_m): fix argument.
- * lib/webrick/https.rb (HTTPRequest#parse): set @client_cert_chain.
+ * test/ruby/test_process.rb (test_geteuid): fix typo.
- * lib/webrick/https.rb (HTTPRequest#meta_vars): create
- SSL_CLIENT_CERT_CHAIN_n from @client_cert_chain.
+ * test/ruby/test_process.rb (test_getegid, test_set[eg]uid): add.
- * ext/openssl/ossl_ssl.c (ossl_ssl_get_peer_cert_chain): return nil
- if no cert-chain was given.
+Mon Dec 5 18:56:55 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 4 23:44:48 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * bignum.c (big_rshift), compile.c (validate_label,
+ iseq_build_from_ary_exception), cont.c (cont_capture), dir.c
+ (dir_open_dir), gc.c (objspace_each_objects), io.c (pipe_open)
+ (rb_io_advise), parse.y (parser_compile_string)
+ (rb_parser_compile_file), proc.c (binding_free), process.c
+ (rb_proc_exec_n, rb_seteuid_core, proc_setegid, rb_setegid_core)
+ (p_uid_exchange, p_gid_exchange), regparse.c (strdup_with_null),
+ signal.c (sig_dfl), vm.c (rb_iseq_eval, rb_iseq_eval_main),
+ vm_insnhelper.c (vm_expandarray): suppress
+ unused-but-set-variable warnings.
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub:
- remove needless version.h dependency.
+ * class.c (rb_obj_methods), compile.c (iseq_compile_each),
+ iseq.c(iseq_load, rb_iseq_parameters), pack.c (pack_pack),
+ regcomp.c (is_not_included, update_string_node_case_fold),
+ transcode.c (rb_econv_open0, make_replacement),
+ vm_eval.c (raise_method_missing): remove unused variable.
-Tue Nov 4 23:38:43 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * signal.c (reserved_signal_p): static.
- * class.c, hash.c, string.c: remove #include "version.h".
+Mon Dec 5 14:27:23 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * Makefile.in: remove needless version.h dependency.
+ * include/ruby/{subst.h,win32.h}, ext/socket/rubysocket.h: revert
+ r33876. [ruby-core:41475] [Bug #5706]
-Tue Nov 4 06:54:52 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/socket/extconf.rb: the alternative hack for [Bug #5675].
- * io.c (read_all): fptr->f may be NULL, if IO is closed in the
- signal handler.
+Mon Dec 5 10:18:45 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * io.c (io_read): ditto.
+ * ext/zlib/zlib.c (rb_gzreader_initialize): revert a part of r33937.
+ 1st, to change the mode of an IO is very sensitive problem, so
+ the maintainer of this library should judge it.
+ 2nd, usually Zlib::GzipReader.new is not called directly. #initialize
+ is called via .open, and in the method the I/O is opened in binary
+ mode, so there is no problem without changing the mode in #initialize.
- * string.c (get_pat): remove 1.8.0 warning code.
+Sun Dec 4 22:53:12 2011 Tanaka Akira <akr@fsij.org>
- * string.c (rb_str_match): extend warning until 1.8.2.
+ * lib/tempfile.rb: don't use lock directory. [ruby-dev:39197]
- * string.c (rb_str_match2): ditto.
+Sun Dec 4 22:34:43 2011 Tanaka Akira <akr@fsij.org>
- * class.c (class_instance_method_list): remove 1.8.0 warnings.
- method_list now recurs. [ruby-dev:21816]
+ * lib/tempfile.rb (Tempfile::MAX_TRY): remove unused constant.
- * class.c (rb_obj_singleton_methods): ditto.
+Sun Dec 4 12:11:28 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * array.c (rb_ary_select): remove select with block.
- [ruby-dev:21824]
+ * lib/pp.rb: fix rdoc.
- * hash.c (rb_hash_select): ditto.
+Sun Dec 4 12:03:16 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * hash.c (env_select): ditto.
+ * lib/delegate.rb (Delegator#methods): Kernel#methods receives
+ zero or one argument. [ruby-core:37118] [Bug #4882]
- * re.c (match_select): ditto.
+Sun Dec 4 10:15:00 2011 Luis Lavena <luislavena@gmail.com>
- * struct.c (rb_struct_select): ditto.
+ * ext/zlib/zlib.c (rb_gzreader_initialize): use binary mode by default
+ under Windows. Patch by Hiroshi Shirosaki. [ruby-core:40706]
+ [Feature #5562]
-Mon Nov 3 22:53:21 2003 Minero Aoki <aamine@loveruby.net>
+ * include/ruby/encoding.h (void rb_econv_binmode): define NEWLINE
+ decorator.
- * lib/racc/parser.rb: synchronize with Racc 1.4.4.
+ * io.c (rb_cloexec_fcntl_dupfd): Introduce NEED_READCONV and
+ NEED_WRITECONV to replace universal newline decorator by CRLF only
+ when required to improve file reading and writing under Windows.
+ Patch by Hiroshi Shirosaki. [ruby-core:40706] [Feature #5562]
+ * io.c (do_writeconv): adjust binary mode if required.
+ * io.c (read_all, appendline, swallow, rb_io_getline_1): ditto.
+ * io.c (io_getc, rb_io_each_codepoint, rb_io_ungetc): ditto.
+ * io.c (rb_io_binmode, rb_io_ascii8bit_binmode): ditto.
+ * io.c (rb_io_extract_modeenc, rb_sysopen): ditto.
+ * io.c (pipe_open, prep_stdio, io_encoding_set): ditto.
+ * io.c (rb_io_s_pipe, copy_stream_body): ditto.
- * ext/racc/cparse/cparse.c: ditto.
+ * test/ruby/test_io_m17n.rb (EOT): add test for pipe and stdin in
+ binary mode.
- * ext/racc/cparse/cparse.c (parse_main): should abort when
- the length of LR state stack <=1, not ==0.
+ * win32/win32.c (init_stdhandle): remove O_BINARY from stdhandle
+ initialization.
+ * win32/win32.c (rb_w32_write): use FTEXT mode accordingly.
-Mon Nov 3 08:50:47 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 3 20:49:16 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * process.c (check_uid_switch): remove duplicated error messages.
+ * variable.c (set_const_visibility): print a warning when no argument
+ is passwd to Module#private_constant. [ruby-list:48558]
- * process.c (check_gid_switch): ditto.
+ * vm_method.c (set_method_visibility): ditto for
+ Module#private_class_method.
-Sun Nov 2 02:28:33 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Dec 3 20:43:14 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * lib/webrick/ssl.rb: new option :SSLExtraChainCert.
+ * variable.c (set_const_visibility): Module#private_constant has
+ changed the visibility of only the first argument. Now it changes
+ all of them. [ruby-list:48558]
-Sun Nov 2 01:02:04 2003 Akinori MUSHA <knu@iDaemons.org>
+ * test/ruby/test_module.rb: add a test for above.
- * string.c (rb_str_hash): Update the HASH_PERL alternative hash
- algorithm in sync with Perl 5.8.
+Sat Dec 3 07:17:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * st.c (strhash): Ditto.
+ * Makefile.in (CFLAGS): append ARCH_FLAG.
-Sat Nov 1 18:21:09 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * configure.in (ARCH_FLAG): exclude from CFLAGS.
- * ext/openssl/ossl_ssl.c (ossl_ssl_peer_cert_chain): add new method
- SSLSocket#peer_cert_chain.
+ * configure.in (UNIVERSAL_INTS): include short int. fix for
+ test/mkmf.
- * ext/openssl/ossl_x509req.c (GetX509ReqPtr): new function
- which returns underlying X509_REQ.
+Fri Dec 2 15:48:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_x509ext.c (ossl_x509extfactory_set_issuer_cert,
- ossl_x509extfactory_set_subject_cert, ossl_x509extfactory_set_crl,
- ossl_x509extfactory_set_subject_req, ossl_x509extfactory_set_config):
- use underlying C struct without duplication not to leak momory.
+ * ext/bigdecimal/bigdecimal.c (VpAllocReal): reduce extra frac.
-Sat Nov 1 01:49:03 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Fri Dec 2 15:41:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/soap/mapping/factory.rb: mark marshalled basetype objects when
- @allow_original_mapping is true. multi-referencing basetype node is
- prohibited in SOAP/1.1 encoding but soap4r's original ruby object
- mapping requires basetype to be marked to detect self referencing
- loop. e.g. o = 1; o.instance_eval { @iv = o } soap4r's original
- mapping is only used through soap/marshal API.
+ * configure.in: check whether -pie or -Wl,-pie is valid as
+ LDFLAGS. [ruby-core:41438] [Bug#5697]
- * test/soap/marshal/test_marshal.rb: add tests for self referencing
- immutable objects.
+ * configure.in: use $linker_flag for LDFLAGS option which is not
+ limited to particular platforms.
- * test/soap/calc/test_calc_cgi.rb: fix test name.
+Thu Dec 1 23:21:58 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Fri Oct 31 22:26:29 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
+ * thread_pthread.c (thread_timer): call prctl(PR_SET_NAME) only if
+ PR_SET_NAME is available.
- * wince/string_wce.c (strrchr): should decrement pointer.
+Thu Dec 1 22:31:16 2011 Tanaka Akira <akr@fsij.org>
- * wince/Makefile.sub: correct a range of isdigit().
+ * io.c (linux_get_maxfd): change local variable name.
-Fri Oct 31 12:55:24 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Thu Dec 1 16:59:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in, lib/mkmf.rb: add RPATHFLAG for NetBSD.
- [ruby-dev:21791]
+ * ext/socket/extconf.rb: add arguments for macro calls.
+ [ruby-core:41370] [Bug#5681]
- * bcc32/Makefile.sub, win32/Makefile.sub, win32/Makefile.sub: ditto.
+Thu Dec 1 16:20:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Oct 31 01:38:14 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/mkmf.rb (MakeMakefile#try_func): fix broken patch at r33834.
- * wince/Makefile.sub, win32/Makefile.sub (.y.c): allow white spaces
- at the beginning of line to remove by sed. (ruby-bugs-ja:PR#580)
+Thu Dec 1 14:43:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Oct 31 01:02:24 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.h (Real): suppress false warning from
+ clang. [ruby-core:41418] [Bug#5693]
- * compar.c (cmp_equal): protect exceptions from <=> comparison
- again. returns nil if any exception or error happened during
- comparison.
+Thu Dec 1 10:31:55 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (search_required): should update *featurep when DLEXT2 is
- defined. (ruby-bugs-ja:PR#581)
+ * configure.in (LDFLAGS): -fstack-protector is always needed to
+ link static library created with it. [ruby-core:41387]
+ [Bug#5686]
-Thu Oct 30 23:41:04 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Thu Dec 1 07:03:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/drb/drb.rb: add DRbArray
+ * configure.in: add sys/prctl.h test.
+ * thread_pthread.c (thread_timer): call prctl(PR_SET_NAME) to change
+ thread name. It may help to debug.
- * lib/drb/invokemethod.rb: fix Hash#each problem. [ruby-dev:21773]
+Wed Nov 30 23:35:45 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/drb/unix.rb: add LoadError. [ruby-dev:21743]
+ * variable.c (rb_path2class): don't raise NameError when the middle
+ constant of the path is not defined but defined on toplevel.
+ [ruby-core:41410] [Bug #5691]
-Thu Oct 30 23:19:11 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Wed Nov 30 20:02:02 2011 Martin Duerst <duerst@it.aoyama.ac.jp>
- * lib/soap/generator.rb: better XML pretty printing.
+ * transcode.c: Simplified rb_econv_binmode, avoided a warning on cygwin.
- * lib/soap/encodingstyle/soapHandler.rb: remove unnecessary namespace
- assignment in the element which has "encodingStyle" attribute, and
- add necessary namespace assignment for "arrayType" attribute.
+Wed Nov 30 08:57:07 2011 Eric Hodel <drbrain@segment7.net>
- * test/soap/calc/test_calc_cgi.rb: take over $DEBUG to ruby process
- through CGI.
+ * lib/mkmf.rb: Use MakeMakefile's rm_f to avoid conflict with Rake or
+ FileUtils.
+ * test/ruby/test_module.rb: Hide MakeMakefile's inclusion in Object
-Thu Oct 30 22:59:39 2003 why the lucky stiff <why@ruby-lang.org>
+Wed Nov 30 09:12:43 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/syck/yaml2byte.c: HASH const too long. Thanks, matz.
+ * lib/rdoc/encoding.rb (RDoc::Encoding.read_file): fixup newline chars
+ on Windows.
+ see https://github.com/rdoc/rdoc/issues/87
-Thu Oct 30 19:13:53 2003 Akinori MUSHA <knu@iDaemons.org>
+ * test/rdoc/test_rdoc_markup_pre_process.rb
+ (TestRDocMarkupPreProcess#test_include_file,
+ TestRDocMarkupPreProcess#test_include_file_encoding_incompatible):
+ follow above change.
- * ext/syck/MANIFEST: Add yamlbyte.h.
+Wed Nov 30 09:09:37 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Oct 30 14:25:31 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/psych/parser.c (parse): parse method can take an option file
+ name for use in exception messages.
+ * test/psych/test_parser.rb: corresponding tests.
- * io.c (READ_DATA_BUFFERED): new macro to detect whether stdio
- buffer filled.
+Tue Nov 29 09:07:59 2011 Eric Hodel <drbrain@segment7.net>
- * io.c (rb_io_fptr_cleanup): move path deallocation to
- rb_io_fptr_finalize (finalizer called by GC).
+ * lib/mkmf.rb: Fix indentations of constants at end of module.
+ Document some constants.
-Thu Oct 30 13:23:39 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 29 09:58:23 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (logop): left may be NULL. [ruby-talk:84539]
+ * io.c (rb_write_error2): suppress unused variable warning.
- * eval.c (rb_eval): NODE_CASE nd_head may be NULL.
+Tue Nov 29 07:45:26 2011 Eric Hodel <drbrain@segment7.net>
-Thu Oct 30 10:14:51 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/mkmf.rb: Wrap comments to 78 columns and clean up formatting.
- * lib/test/unit/autorunner.rb: make fox runner work.
+Tue Nov 29 05:54:18 2011 Eric Hodel <drbrain@segment7.net>
-Thu Oct 30 09:32:26 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/mkmf.rb: Wrap mkmf.rb in module MakeMakefile to clean up Object
+ documentation. [Ruby 1.9 - Feature #5658]
+ * ext/extmk.rb: Use MakeMakefile::CONFIG instead of Object::CONFIG
+ * test/mkmf/base.rb: ditto
- * process.c (rb_f_system): fixed lack of security check before
- calling do_spawn() on win32. [ruby-talk:84555]
+Tue Nov 29 00:08:57 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-Thu Oct 30 02:46:35 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * common.mk (INSTRUBY_ARGS): added --mantype to apply mdoc2man.rb
+ to man pages. Fixes #5598.
+ (do-install-nodoc, do-install-local, do-install-man,
+ dont-install-nodoc, dont-install-local, dont-install-man):
+ No longer needs --mantype.
- * eval.c (proc_invoke): single array value to normal Proc#call
- (i.e. not via lambda call), should be treated just like yield.
- [ruby-dev:21726]
+ Reported by Rainer Orth <ro AT cebitec.uni-bielefeld.de>,
+ patch by George Koehler <xkernigh AT netscape.net>.
-Thu Oct 30 02:25:48 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Nov 28 22:26:31 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl/lib/openssl/buffering.rb (Buffering#initialize):
- add new method to inherit @sync from @io.sync.
+ * test/rake/test_rake_directory_task.rb
+ (TestRakeDirectoryTask#test_directory_win32): shouldn't create any
+ file/directory on root directory. create on @tempdir (= Dir.pwd).
+ see https://github.com/jimweirich/rake/issues/91
- * ext/openssl/lib/net/protocols.rb (SSLIO#ssl_connect): no need to
- set sync flag explicitly.
+Mon Nov 28 12:57:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_ssl.c (ossl_sslctx_initialize): call super.
+ * io.c (rb_write_error2): fwrite() returns ssize_t.
- * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): set extra chain
- certificates in @extra_chain_cert.
+Mon Nov 28 12:47:19 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Oct 29 22:02:04 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * parse.y (nodetype, nodeline): static. these functions are for
+ debugging, and not intend to be public.
- * test/drb/drbtest.rb: use rbconfig.rb to make the path of ruby
- interpreter to exec, instead of test/ruby/envutil.rb,
+Mon Nov 28 12:37:54 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Oct 29 19:58:59 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * gc.c (initial_params): static. it seems to be forgotten at r33501.
- * ext/tcltklib/tcltklib.c (CONST84): define CONST84 when it is not
- defined and TCL_MAJOR_VERSION >= 8.
+Mon Nov 28 12:32:24 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tcltklib/tcltklib.c (VwaitVarProc, WaitVariableProc,
- rb_threadVwaitProc): use CONST84 instead of CONST.
+ * include/ruby/win32.h, win32/win32.c (GetCurrentThreadHandle): remove
+ unused old API.
- * ext/tcltklib/tcltklib.c (ip_rbTkWaitCommand,
- ip_rb_threadTkWaitCommand): use CONST84 always.
+Mon Nov 28 12:29:20 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Oct 29 17:27:05 2003 Tanaka Akira <akr@m17n.org>
+ * win32/mkexports.rb (Exports#initialize): remove old symbol name.
- * re.c (rb_reg_s_union, Init_Regexp): new method `Regexp.union'.
+Mon Nov 28 12:15:28 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/pathname.rb (realpath): examine Dir.pwd because it may have
- symlinks.
+ * win32/mkexports.rb (Exports#read_substitution): need to read
+ from subst.h too. [Bug #5675]
-Wed Oct 29 17:16:31 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 28 11:46:35 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (rb_longjmp): must not disturb original jump.
- [ruby-dev:21733]
+ * io.c (rb_io_flush): release GVL during fsync() on Windows.
-Wed Oct 29 15:28:34 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Nov 28 11:00:25 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (Init_Proc): taint preallocated exception object
- sysstack_error. [ruby-talk:84534]
+ * include/ruby/subst.h: typo of r33876.
-Wed Oct 29 11:27:39 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Nov 28 10:36:00 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (ret_args): node may be NULL. [ruby-talk:84530]
+ * include/ruby/subst.h: moved Windows specific substitutions from
+ win32.h.
-Tue Oct 28 15:20:12 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/socket/rubysocket.h: include ruby/subst.h. [Bug #5675]
- * ext/tcltklib/tcltklib.c (VwaitVarProc, ip_rbVwaitObjCmd,
- WaitVariableProc, WaitVisibilityProc, WaitWindowProc,
- ip_rbTkWaitObjCmd, ip_rbTkWaitCommand, rb_threadVwaitProc,
- rb_threadWaitVisibilityProc, rb_threadWaitWindowProc,
- ip_rb_threadVwaitObjCmd, ip_rb_threadTkWaitObjCmd): prototype;
- avoid VC++ warnings.
+Mon Nov 28 10:20:58 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Oct 27 19:19:55 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/{Makeilfe.sub,win32.c} (FILE_COUNT, FILE_READPTR): move the
+ definitions from config.h to win32.c. I dared to have left such
+ macros, for other future compiler support.
+ [ruby-core:41313] [Bug #5674]
- * eval.c (rb_longjmp): ignore reentering error while warning.
- [ruby-dev:21730]
+Mon Nov 28 09:28:30 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Oct 27 00:23:50 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * win32/win32.c (rb_w32_uchmod): typo. [Bug#5671] [ruby-dev:44898]
- * ext/tcltklib/tcltklib.c (ip_ruby): bug fix on Win : hang-up when
- calling 'exit' in the Tk callback procedure. [ruby-list:38656]
+ * test/ruby/test_file.rb (TestFile#test_chmod_m17n): test of above bug.
-Sat Oct 25 09:18:04 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Nov 27 21:25:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (rb_method_missing): protect exception from within
- "inspect". (ruby-bugs:PR#1204)
+ * configure.in: added -fno-strict-overflow. it suppress annoying
+ -Wstrict-overflow warning.
-Fri Oct 24 23:26:34 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Nov 27 20:58:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * hash.c (rb_hash_each): Hash#each should yield single value.
- [ruby-talk:84420]
+ * io.c (rb_write_error2): get rid of warning on linux. fwrite
+ of glibc is tagged __attribute__ ((__warn_unused_result__))
+ if _FORTIFY_SOURCE != 0.
+ * vm_dump.c (rb_vm_bugreport): ditto.
- * hash.c (env_each): ditto for ENV.each.
+Sun Nov 27 19:09:02 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Oct 23 20:25:32 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * configure.in (stack_protector): disable on mingw. [Bug#5676]
- * lib/webrick/server.rb (GenericServer#start): should rescue
- IOError from IO::accept. [ruby-dev:21692]
+ * Makefile.in (DLDFLAGS): also needs -fstack-protector.
+ [Bug#5676]
-Thu Oct 23 17:59:36 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 27 14:13:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (ruby_cleanup): initialize stack bottom for embedding.
- [ruby-dev:21686]
+ * configure.in: add -fstack-protector into XLDFLAGS as well as
+ XCFLAGS if stack-protector is used.
- * ext/dl/extconf.rb: move list of files to clean from DEPEND file,
- to get rid of macro redefinitions.
+Sun Nov 27 13:09:25 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Oct 23 13:44:00 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: workaround to avoid MacOS X build error.
+ Maybe autoconf 2.61 is slightly buggy. [ruby-core:41316]
- * parse.y: integrate operations for stack_type. [ruby-dev:21681]
+Sun Nov 27 04:57:11 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Oct 23 00:41:45 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * configure.in (--no-undefined): r33840 breaks FreeBSD and DragonFly
+ with gcc 4.4 or later. Their environ is in /usr/libexec/ld-elf.so.1,
+ so it will be false negative.
- * test/soap/calc/*, test/soap/helloworld/*: set logging threshold
- to ERROR.
+Sun Nov 27 04:55:45 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Oct 22 12:53:31 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/http.rb (Net::HTTP::SSL_IVNAMES): rerefix 33701.
+ SSL_ATTRIBUTES stores names for set_params, they are symbol.
+ SSL_IVNAMES stores instance variable names.
- * lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir#collect_file):
- ignore tests which raised LoadError.
+Sun Nov 27 00:16:07 2011 Tanaka Akira <akr@fsij.org>
- * test/drb/drbtest.rb, test/ruby/test_beginendblock.rb,
- test/ruby/test_system.rb: avoid requiring same file twice.
+ * io.c (copy_stream_body): use 0666 for permission argument for open.
+ [ruby-core:40865]
- * test/drb/test_drbssl.rb, test/drb/test_drbunix.rb: should not use
- ARGV unless invoked directly. do not create test cases unless
- required libraries are available.
+Sat Nov 26 23:01:38 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Wed Oct 22 02:31:34 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/openssl/test_engine.rb: remove side effect of generic engine
+ load by explicitly loading software-based "openssl" engine for
+ all tests.
- * eval.c (ruby_cleanup): should not ignore exit_value in END
- execution. [ruby-dev:21670]
+Sat Nov 26 20:41:48 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Oct 21 23:16:26 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/net/http.rb (Net::HTTP.get_response): enable use_ssl
+ if given URI object is https.
+ patched by Mark Ferlatte [ruby-core:40665] [Bug #5545]
- * eval.c (ruby_cleanup): call finalizers and exit procs before
- terminating threads.
+ * lib/net/http.rb (Net::HTTP.post_form): ditto.
- * eval.c (ruby_cleanup): preserve ruby_errinfo before ruby_finalize_0().
+Sat Nov 26 20:01:18 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Oct 21 15:57:11 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/http.rb (Net::HTTP::SSL_ATTRIBUTES): refix 33701.
+ store instance variable symbol names.
- * lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir#collect_file):
- prepend the directory of target file to the load path.
+Sat Nov 26 15:40:25 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
-Tue Oct 21 15:08:53 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * .travis.yml (script): should be ./configure
- * win32/win32.c (do_spawn, do_aspawn): should wait child process even
- if callded with P_OVERLAY.
+Sat Nov 26 15:39:18 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * win32/win32.c (do_spawn, do_aspawn): should return child's exit
- status to parent.
+ * .travis.yml (before_script): wrong name, sorry.
-Tue Oct 21 00:35:02 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sat Nov 26 15:31:34 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * test/soap/calc/*, test/soap/helloworld/*: catch the exception from
- test server thread and recover.
+ * .travis.yml (before-script): autoconf required.
-Tue Oct 21 00:22:57 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat Nov 26 15:24:05 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * test/drb/*: import drb/runit.
+ * .travis.yml: Travis enable.
-Mon Oct 20 23:55:47 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 26 10:47:50 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * eval.c (rb_eval): set current node after arguments evaluation.
- [ruby-dev:21632]
+ * ext/openssl/extconf.rb: remove checks for available functions.
+ * ext/openssl/missing.h: ditto.
+ Thanks, Tim Mooney for reporting this!
+ [Bug #5432] [ruby-core:40088]
- * eval.c (rb_yield_0): set current node and keep it at local jump.
+Sat Nov 26 10:22:28 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Mon Oct 20 22:01:18 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_ssl.c: add comment on where to find implementation
+ of OpenSSL::SSL::SSLSocket#session.
- * eval.c (rb_thread_cleanup): keep thread group for main thread.
- [ruby-dev:21644]
+Sat Nov 26 05:00:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 20 18:28:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (--no-undefined): RUBY_TRY_CFLAGS does nothing for
+ linker flags. use RUBY_TRY_LDFLAGS.
- * eval.c (rb_catch): backout.
+Fri Nov 25 11:37:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon Oct 20 17:31:46 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * io.c (ioctl_narg_len, linux_iocparm_len): reinstantiate linux
+ specific narg length calculation.
+ * test/ruby/test_io.rb (test_ioctl_linux2): add new test for old and
+ unstructured ioctl.
- * eval.c (PUSH_FRAME): generate unique number to be TAG_JUMP()
- destination.
+Fri Nov 25 10:39:14 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (localjump_destination): use unique number in ruby_frame
- for localjump destination.
+ * Makefile.in (EXTLDFLAGS): export it.
+ * configure.in: add --no-undefined if --enable-shared is specified.
+ Gentoo enabled this option long time. Also, export EXTLDFALGS.
-Mon Oct 20 11:31:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Nov 25 08:48:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/ruby/test_signal.rb (test_signal): restore old trap.
+ * configure.in: turn on PIE if --enable-shared is not specified.
-Mon Oct 20 11:00:46 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 25 08:05:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (gc_sweep): loosen page free condition to avoid add_heap()
- race condition. [ruby-dev:21633]
+ * configure.in: add -fstack-protector. It help to protect us from
+ stack smashing attack.
- * gc.c (gc_sweep): do not update malloc_limit when malloc_increase
- is smaller than malloc_limit.
+Fri Nov 25 08:03:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon Oct 20 09:45:12 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * configure.in: add -D_FORTIFY_SOURCE=2. It provide some compile
+ time and runtime check for security.
- * lib/debug.rb (debug_command): remove debug print.
+Fri Nov 25 08:00:23 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Oct 20 00:25:41 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb: get rid of warnings of mkmf.rb if -Wmissing-declarations
+ and/or -Wold-style-definition warnings if specified.
+ Patch by Nikolai Weibull. Thank you! [Bug #5459] [ruby-core:40200]
- * eval.c (search_required): required name must not be changed before
- loading. [ruby-dev:24492]
+Fri Nov 25 07:46:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun Oct 19 13:12:30 2003 Tanaka Akira <akr@m17n.org>
+ * configure.in: add -Wall always.
- * lib/pathname.rb (foreachline, dir_foreach): add obsolete warning.
+Thu Nov 24 20:02:40 2011 Tanaka Akira <akr@fsij.org>
-Sun Oct 19 00:14:22 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * test/openssl/test_engine.rb: use IO#reopen to restore stderr.
- * test/soap/calc/*, test/soap/helloworkd/*: changed port# of test
- server. (17171)
+Thu Nov 24 19:59:56 2011 Tanaka Akira <akr@fsij.org>
-Sat Oct 18 23:01:32 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * io.c (rb_io_reopen): re-initialize buffering mode for stdout and
+ stderr.
- * missing/acosh.c (DBL_MANT_DIG): typo fix(ifdef -> ifndef).
+Thu Nov 24 11:12:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Oct 18 05:48:59 2003 why the lucky stiff <why@ruby-lang.org>
+ * io.c (rb_io_fsync,rb_io_fdatasync): release GVL during fsync().
+ fsync() and fdatasync() may take a long time on slow disks and/or
+ if there is much dirty data.
+ Patch by Eric Wong. [Feature #5665] [ruby-core:41247]
- * ext/syck/rubyext.c: YAML::Syck::compile method.
+Thu Nov 24 10:05:02 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/syck/syck.c: Buffer edge bug.
+ * test/openssl/test_engine.rb: Suppress output from 'openssl'
+ engine's RC4 cipher.
+ [Bug #5633] [ruby-core:41026]
- * ext/syck/yaml2byte.c: YAML to bytecode converter.
+Thu Nov 24 08:05:02 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/syck/yamlbyte.h: Ditto.
+ * ext/openssl/ossl_pkey_dsa.c: remove redundant colon from error
+ message.
+ * ext/openssl/ossl_ssl.c: ditto.
+ * ext/openssl/ossl_pkey_rsa: ditto.
+ patched by Eric Hodel [Bug #5604] [ruby-core:40896]
- * ext/syck/bytecode.c: Bytecode parser fixes to empty collections
- and empty strings.
+Wed Nov 23 20:03:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/syck/token.c: Ditto.
+ * io.c (ioctl_narg_len): don't use _IOC_SIZE macro on Linux.
+ On Linux some constants for ioctl(2) doesn't include the size of
+ its return value and 16bit value; for example FIONREAD 0x541B.
+ Moreover the manual, ioctl_list(2), says "Note that the size
+ bits are very unreliable: in lots of cases they are wrong,
+ either because of buggy macros using sizeof(sizeof(struct)),
+ or because of legacy values."
+ So we shouldn't use it.
-Fri Oct 17 23:07:38 2003 Akinori MUSHA <knu@iDaemons.org>
+Tue Nov 22 18:07:32 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/enumerator/enumerator.c, ext/enumerator/enumerator.txt:
- Provide Kernel#to_enum as an alias for Kernel#enum_for. Maybe
- this is a better name.
+ * win32/win32.c (_pioinfo): need to declare _pioinfo() before using
+ _osfhnd and other macros which uses _pioinfo() internally.
-Fri Oct 17 23:00:30 2003 Akinori MUSHA <knu@iDaemons.org>
+Tue Nov 22 17:49:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/generator.rb: Add rdoc documentation.
+ * win32/win32.c (_pioinfo): make an inline function.
-Fri Oct 17 22:16:42 2003 Akinori MUSHA <knu@iDaemons.org>
+Tue Nov 22 11:26:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/set.rb: Reword and fix Overview.
+Tue Nov 22 11:33:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/set.rb: It is not necessary to require
- 'test/unit/ui/console/testrunner'.
+ * win32/win32.c (dupfd): argument of _osfhnd and so on should not
+ have side effect.
-Fri Oct 17 11:15:22 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Nov 22 11:26:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * test/ruby/test_range.rb: added.
+ * bignum.c (rb_big_divide): refix of r33536. Don't change behavior of Bignum#/.
+ [ruby-core:40429] [Bug #5490]
- * MANIFEST: add test/ruby/test_range.rb.
+Tue Nov 22 10:46:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Oct 17 03:21:23 2003 William Sobel <will.sobel@barra.com>
+ * numeric.c (ruby_float_step): improve floating point calculations.
+ [ruby-core:35753] [Bug #4576]
- * ext/socket/socket.c (make_hostent): h_aliases may be NULL.
- (ruby-bugs:PR#1195)
+ * numeric.c (ruby_float_step): correct the error of floating point
+ numbers on the excluding case.
+ patched by Masahiro Tanaka [ruby-core:39608]
- * ext/socket/socket.c (sock_s_gethostbyaddr): ditto.
+ * numeric.c (ruby_float_step): use the end value when the current
+ value is greater than or equal to the end value.
+ patched by Akira Tanaka [ruby-core:39612]
-Fri Oct 17 00:12:41 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Nov 22 06:59:21 2011 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk.rb: (bug fix) instance variable @frame was used
- without initializing on TkComposite module.
+ * test/ruby/test_io.rb (test_fcntl_dupfd): there is no known platform
+ which don't have F_DUPFD. [ruby-dev:44874]
-Thu Oct 16 23:51:04 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Nov 22 04:46:22 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/tk/lib/tk.rb: If $DEBUG == true and some exception is caused
- in a callback operation, Ruby/Tk shows a (verbose) backtrace
- information on the callback process.
+ * ext/psych/lib/psych.rb: remove autoload from psych
+ * ext/psych/lib/psych/json.rb: ditto
-Thu Oct 16 17:09:19 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 22 00:44:59 2011 Tanaka Akira <akr@fsij.org>
- * lib/debug.rb (DEBUGGER__::Context::debug_command): do not call
- debug_silent_eval() when $1 is not set. (ruby-bugs:PR#1194)
+ * test/ruby/test_io.rb (test_fcntl_dupfd): the argument of F_DUPFD is
+ minimum file descriptor.
-Thu Oct 16 16:54:57 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 22 00:25:17 2011 Tanaka Akira <akr@fsij.org>
- * string.c (rb_str_upto): ("a"..."a").to_a should return [].
- [ruby-core:01634]
+ * io.c (linux_get_maxfd): get rid of a warning.
-Thu Oct 16 16:40:51 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Mon Nov 21 23:39:14 2011 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk.rb:
- Add Tk::EncodedString and Tk::UTF8_String class to support
- characters using the \uXXXX escape to the UNICODE string.
+ * io.c (linux_get_maxfd): new function to find maximum fd on Linux.
+ (rb_close_before_exec): use linux_get_maxfd.
- * ext/tk/sample/{demos-en,demos-jp}/unicodeout.rb
- new demo-scripts (samples of Tk::UTF8_String)
+Mon Nov 21 06:16:24 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/sample/{demos-en,demos-jp}/widget
- add entries for 'unicodeout.rb'
+ * cont.c (fiber_switch): ignore fiber context switch
+ because destination fiber is same as current fiber.
+ With out this, it may segv on FreeBSD 9.
+ patched by Koichi Sasada.
-Thu Oct 16 08:38:06 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 20 23:22:42 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/digest/test_digest.rb (test_eq): show failed class.
+ * ext/extmk.rb (extract_makefile, extmake): regenerate makefiles
+ if globbed source file list is changed.
- * test/ruby/test_iterator.rb (test_break, test_return_trace_func):
- test localjump destination.
+ * lib/mkmf.rb (create_makefile): store ORIG_SRCS.
-Wed Oct 15 20:22:31 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sun Nov 20 22:43:03 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/soap/netHttpClient.rb: use URI::HTTP#request_uri instead of
- instance_eval('path_query'). [ruby-list:38575]
+ * enc/unicode.c (PROPERTY_NAME_MAX_SIZE): +1.
+ reported by Ken Takata. [ruby-dev:44894][Bug #5652]
-Wed Oct 15 17:24:45 2003 URABE Shyouhei <root@mput.dip.jp>
+Sun Nov 20 11:01:28 2011 Tanaka Akira <akr@fsij.org>
- * lib/cgi.rb (CGI::Cookie): tiny typo fix.
+ * lib/set.rb (SortedSet.setup): remove old_init after initialize
+ method is redefined. The remove before redefinition makes the
+ warning prevention fragile. [ruby-dev:44892]
-Wed Oct 15 15:00:54 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 20 04:01:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (ruby_run): just return FAILURE instead of parse error
- count. [ruby-list:38569]
+ * Makefile.in (enc/unicode/name2ctype.h): remove duplicated
+ ifdefs.
-Wed Oct 15 13:17:02 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Nov 19 19:31:47 2011 Tanaka Akira <akr@fsij.org>
- * ext/digest/digest.c (rb_digest_base_alloc): need to initialize
- buffer. [ruby-dev:21622]
+ * time.c (TIME_COPY_GMT): copy vtm.utc_offset and vtm.zone too.
+ patch by Tomoyuki Chikanaga.
+ [ruby-dev:44827] [Bug #5586]
-Wed Oct 15 11:23:05 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Nov 19 16:36:57 2011 Tanaka Akira <akr@fsij.org>
- * marshal.c (w_object): dump extended modules as well.
+ * test/net/http/test_http.rb: remove temporally files in ensure clause.
- * marshal.c (r_object0): TYPE_USRMARSHAL should restore extended
- modules before invoking marshal_load. these two fixes are done
- by Masatoshi Seki <m_seki@mva.biglobe.ne.jp>.
+Sat Nov 19 08:18:41 2011 Tanaka Akira <akr@fsij.org>
-Wed Oct 15 09:30:34 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/net/http/test_http.rb: remove temporally files.
- * ext/enumerator/enumerator.c (enumerator_each): avoid VC++ warning.
+Fri Nov 18 17:18:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/syck/syck.h: include stdio.h for definition of FILE.
+ * ext/io/console/console.c (console_raw, console_set_raw)
+ (console_getch): optional parameters. [EXPERIMENTAL]
-Wed Oct 15 08:09:07 2003 why the lucky stiff <why@ruby-lang.org>
+Fri Nov 18 16:12:11 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/syck/bytecode.c: Checkin of YAML bytecode support.
+ * ext/io/console/console.c (console_cooked, console_set_cooked):
+ new methods to reset cooked mode. [EXPERIMENTAL]
- * ext/syck/gram.c: Ditto.
+Fri Nov 18 13:20:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/syck/syck.c: Ditto.
+ * test/unit/assertions.rb (MINI_DIR): quick dirty hack to get rid of
+ warnings when using assert/assert_respond_to.
- * ext/syck/token.c: Ditto.
+Fri Nov 18 13:03:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/syck/handler.c: Ditto.
+ * io.c (rb_cloexec_open): set O_NOINHERIT instead of O_CLOEXEC if it is
+ available (for Windows).
- * ext/syck/handler.c: Now using 'tag' rather than 'taguri' in type URIs.
+ * win32/win32.c (fcntl): on F_DUPFD, determine the inheritance of the
+ new handle by O_NOINHERIT flag of original fd.
- * ext/syck/rubyext.c: Ditto (on both counts).
+Fri Nov 18 08:00:41 2011 Ryan Davis <ryand-ruby@zenspider.com>
-Wed Oct 15 05:05:53 2003 Akinori MUSHA <knu@iDaemons.org>
+ * lib/minitest/*: Imported minitest 2.8.1 (r6750)
+ * test/minitest/*: ditto
+ * configure.in: Improved gcc-llvm error message to help people migrate.
- * lib/generator.rb: A new library which converts an internal
- iterator to an external iterator.
+Thu Nov 17 20:43:34 2011 Tanaka Akira <akr@fsij.org>
- * lib/abbrev.rb: A new library which creates an abbreviation table
- from a list.
+ * ext/dbm/extconf.rb: revert a part of the patch in [ruby-dev:41531].
+ don't use db.h with other headers. [ruby-dev:44884].
-Wed Oct 15 04:31:51 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Nov 17 20:23:03 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/sample/demos-en/entry3.rb, ext/tk/sample/demos-jp/entry3.rb :
- new demo-scripts
+ * benchmark/bm_io_select[23].rb: use Process::RLIMIT_NOFILE only when
+ it is defined. if it is not defined, assume 64 as the max of fds.
- * ext/tk/sample/demos-en/widget, ext/tk/sample/demos-jp/widget :
- add entries for 'entry3.rb'
+Thu Nov 17 10:36:46 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Oct 15 04:31:47 2003 Akinori MUSHA <knu@iDaemons.org>
+ * ext/psych/lib/psych.rb (load_file): make sure opened yaml files are
+ also closed. [ruby-core:41088]
- * test/digest/test_digest.rb: Moved from ext/digest/test.rb.
+Wed Nov 16 18:13:52 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Oct 15 03:53:20 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * Makefile.in (LIBRUBY_A): check if generated linked library is
+ valid for extconf.
- * ext/tk/lib/tk.rb: fixed trouble on auto-load Tcl commands (enbug
- on the last commit).
+Wed Nov 16 13:51:40 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Oct 15 00:25:00 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * bignum.c (rb_big2ulong): need to calc in unsigned long, because
+ the range of VALUE is larger than it on LLP64 platform, such as Win64.
+ this change fixes the failures of test/-ext-/num2int.
- * parse.y (yylex): argument parentheses preceded by spaces should
- be warned; not error. [ruby-talk:84103]
+Wed Nov 16 12:02:47 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Oct 15 00:20:15 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/webrick/test_cgi.rb (TestWEBrickCGI#start_cgi_server): there are
+ no guarantee of existence of RbConfig::CONFIG['LIBPATHENV'].
+ it only exists in Unix-like environments.
- * ext/tcltklib/tcltklib.c: replace Tcl/Tk's vwait and tkwait to
- switch on threads smoothly and avoid seg-fault.
+ * test/webrick/test_filehandler.rb
+ (WEBrick::TestFileHandler#test_script_disclosure): ditto.
- * ext/tcltklib/tcltklib.c: add TclTkIp._thread_vwait and
- _thread_tkwait for waiting on a thread. (Because Tcl/Tk's vwait
- and tkwait command wait on an eventloop.)
+Wed Nov 16 11:34:20 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/lib/multi-tk.rb: support TclTkIp._thread_vwait and
- _thread_tkwait.
+ * io.c (argf_next_argv): wrong timing of setting ecflags.
+ fixed the failure of TestArgf#test_textmode introduced at r33662.
- * ext/tk/lib/tk.rb: now, TkVariable#wait has 2 arguments.
- If 1st argument is true, waits on a thread. If false, waits on
- an eventloop. If 2nd argument is true, checks existence of
- rootwidgets. If false, doesn't. Default is wait(true, false).
+Wed Nov 16 10:45:00 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/lib/tk.rb: add TkVariable#tkwait(arg) which is equal to
- TkVariable#wait(arg, true). wait_visibility and wait_destroy
- have an argument for waiting on a thread or an eventloop.
+ * ext/-test-/num2int/num2int.c: remove an unnecessary and wrong decl
+ of rb_stdout. it's declared in ruby.h correctly.
- * ext/tk/lib/tk.rb: improve of accessing Tcl/Tk's special variables.
+Wed Nov 16 10:26:41 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/lib/tkafter.rb: support 'wait on a thread' and 'wait on
- an eventloop'.
+ * bignum.c (rb_big2ull): add a cast to get rid of a VC++ warning.
-Wed Oct 15 00:10:24 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Wed Nov 16 09:39:27 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/soap/baseData.rb: Introduce SOAPType as the common ancestor of
- SOAPBasetype and SOAPCompoundtype.
+ * lib/minitest/unit.rb (assert_raises): experimental fix to run
+ correctly on chkbuild over 64bit linux. call exception_details only
+ when the detail is really needed to avoid create needless inspect
+ under ulimit-ed environment.
- * lib/soap/generator.rb, lib/soap/element.rb, lib/soap/encodingstyle/*:
- Encoding methods signature change. Pass SOAPGenerator as a parameter.
+Wed Nov 16 06:34:30 2011 Tanaka Akira <akr@fsij.org>
- * lib/soap/mapping/*, test/soap/marshal/test_marshal.rb: Refactoring
- for better marshalling/unmarshalling support. Now I think SOAP
- marshaller supports all kind of object graph which is supported by
- Ruby's original marshaller. Of course there could be bugs as always.
- Find it. :-)
+ * test/ruby/test_thread.rb (test_condvar_timed_wait): use
+ assert_operator.
- * lib/soap/rpc/standaloneServer.rb: Set severity threshould to INFO.
- DEBUG is too noisy.
+Tue Nov 15 21:56:25 2011 Tanaka Akira <akr@fsij.org>
- * lib/xsd/datatypes.rb: DateTime#of is obsoleted. Use DateTime#offset.
+ * test/ruby/test_sleep.rb (test_sleep_5sec): 0.1sec tolerance is too
+ small for busy environment.
- * test/wsdl/emptycomplextype.wsdl, test/xsd/xmlschema.xml: Avoid
- useless warning.
+Tue Nov 15 20:08:55 2011 Tanaka Akira <akr@fsij.org>
-Tue Oct 14 19:09:35 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c, thread.c, ext/pty/pty.c, ext/fiddle/closure.c: use
+ __linux__ macro for consistency.
- * eval.c (ruby_finalize_0): return the given exit status unless
- SystemExit got raised.
+Tue Nov 15 14:45:15 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Oct 14 11:53:49 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/ruby.h(NUM2LONG, NUM2INT, NUM2SHORT, NUM2LL,
+ INT2NUM, UINT2NUM, LONG2NUM, ULONG2NUM, NUM2CHR): wrap by
+ macros.
- * intern.h (ruby_stop): never return.
+Tue Nov 15 13:38:14 2011 Naohisa Goto <ngotogenome@gmail.com>
- * ruby.h (ruby_run): ditto.
+ * include/ruby/defines.h (FLUSH_REGISTER_WINDOWS): move sparc asm code
+ to a separate file sparc.c for preventing inlining optimization.
+ Patched by Jurij Smakov. [Bug #5244] [ruby-core:40685]
+ * sparc.c (rb_sparc_flush_register_windows): ditto.
+ * configure.in: ditto.
-Tue Oct 14 04:43:55 2003 Tanaka Akira <akr@m17n.org>
+Tue Nov 15 13:11:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/pathname.rb (realpath): make ELOOP check bit more robust.
- (children): prepend self by default.
- (chroot): obsoleted.
+ * include/ruby/ruby.h: get rid of gcc specific rb_long2int(),
+ NUM2LONG(), NUM2INT(), NUM2SHORT(), NUM2LL(), INT2NUM(),
+ UINT2NUM(), LONG2NUM(), ULONG2NUM() and NUM2CHR()
+ implementation. Because 1) They don't make any better code
+ at all. 2) Inline function have a better debugger supoort.
-Tue Oct 14 02:29:31 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 15 09:58:25 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (rb_require_safe): segfault after loading .so.
+ * test/ruby/test_io.rb (TestIO#test_fcntl_dupfd): fix OpenBSD test
+ failure. [ruby-dev:44872]
-Tue Oct 14 02:05:23 2003 Akinori MUSHA <knu@iDaemons.org>
+Tue Nov 15 09:50:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/Setup*, ext/enumerator/*: Add ext/enumerator, a helper
- module for the Enumerable interface.
+ * regcomp.c (print_indent_tree): fix double printing of ENCLOSE_OPTION
+ children bug. patched by Suraj Kurapati. [ruby-core:40964]
-Mon Oct 13 23:55:59 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Tue Nov 15 01:53:48 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * test/ruby/envutil.rb: use Config::CONFIG["ruby_install_name"],
- not "ruby".
+ * test/ruby/test_io.rb (test_fcntl_dupfd): fix test error on
+ SnowLeopard. Pointed out by CHIKANAGA Tomoyuki. [ruby-dev:44866]
-Mon Oct 13 23:57:29 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 14 22:06:02 2011 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_feature_p): match by classified suffix.
+ * ext/openssl/ossl_pkey.c (ossl_pkey_new_from_file): set close-on-exec
+ flag.
- * eval.c (rb_require_safe): require library in the specified safe
- level.
+ * ext/openssl/ossl_x509cert.c (rb_fd_fix_cloexec): ditto.
- * variable.c (rb_autoload, rb_autoload_load): restore safe level
- when autoload was called. [ruby-dev:21338]
+Mon Nov 14 14:54:17 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * intern.h: prototypes; rb_require_safe.
+ * bignum.c (rb_big2ull): fix 32bit platform breakage. we must
+ not assume sizeof(VALUE) == sizeof(LONG_LONG).
+ * test/-ext-/num2int/test_num2int.rb (class TestNum2int):
+ fix false assumption on 32bit platform.
- * test/runner.rb: accept non-option arguments.
+Mon Nov 14 14:52:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon Oct 13 20:49:51 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * numeric.c (rb_fix2ushort): fix typo. use num rb_num2ushort()
+ instead of num2uint().
- * string.c (str_new4): should not preserve FL_TAINT status in the
- internal shared string. [ruby-dev:21601]
+Sun Nov 13 10:31:03 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * string.c (rb_str_new4): ditto.
+ * include/ruby/ruby.h: add #ifdef comment.
- * eval.c: use EXIT_SUCCESS and EXIT_FAILURE for exit values.
+Sun Nov 13 10:28:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * process.c: ditto. [ruby-list:38521]
+ * include/ruby/ruby.h: add NUM2SHORT(), NUM2USHORT() macros.
+ * numeric.c: ditto.
-Mon Oct 13 19:51:02 2003 Koji Arai <jca02266@nifty.ne.jp>
+ * test/-ext-/num2int/test_num2int.rb: add testcases for NUM2SHORT().
+ * ext/-test-/num2int/num2int.c: ditto.
- * lib/debug.rb (debug_command): should enter emacs mode when
- assigned any value to the environment variable "EMACS".
- On Meadow, (getenv "EMACS") is "meadow".
+Sun Nov 13 10:23:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun Oct 12 14:45:03 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * bignum.c (rb_big2ull): fix off-by-twice bug of NUM2ULL.
+ * test/-ext-/num2int/test_num2int.rb (class TestNum2int):
+ fix a testcase too.
- * ext/win32ole/extconf.rb: check "windows.h", not "windows".
- [ruby-talk:84051]
+Sun Nov 13 10:22:44 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Oct 11 20:41:03 2003 Corinna Vinschen <corinna@vinschen.de>
+ * test/-ext-/num2int/test_num2int.rb (class TestNum2int):
+ add FIXNUM tests.
- * file.c (eaccess): Use access(2) on Cygwin.
+Sun Nov 13 09:57:29 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Oct 11 17:09:21 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * numeric.c (check_uint): fix off-by-one bug of NUM2UINT.
+ * bignum.c (rb_big2ulong): fix off-by-one bug of NUM2ULONG.
- * lib/rexml/quickpath.rb (REXML::QuickPath::match):
- escape '[' to avoid warning.
+ * test/-ext-/num2int/test_num2int.rb: add a testcase for NUM2INT()
+ NUM2UINT(), NUM2LONG(), NUM2ULONG(), NUM2LL and NUM2ULL().
+ * ext/-test-/num2int/depend: ditto.
+ * ext/-test-/num2int/extconf.rb: ditto.
+ * ext/-test-/num2int/num2int.c: ditto.
-Sat Oct 11 16:08:41 2003 Tanaka Akira <akr@m17n.org>
+Sun Nov 13 23:47:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/pathname.rb (realpath): check existence of the file.
+ * ext/dbm/extconf.rb: use convertible_int.
- * lib/pathname.rb (realpath): re-implemented.
- (realpath_root?, realpath_rec): removed
+Sun Nov 13 23:45:57 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Oct 11 10:19:39 2003 Shugo Maeda <shugo@ruby-lang.org>
+ * lib/mkmf.rb (checking_for): should not modify the result.
- * lib/monitor.rb: handle exceptions correctly. Thanks, Gennady
- Bystritsky.
+ * lib/mkmf.rb (have_struct_member): accept compiler options.
-Fri Oct 10 07:50:54 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb (convertible_int): add restricted support of struct
+ member, and TYPEOF_ macro.
- * eval.c (is_defined): inheritance line adjustment as like as
- rb_call_super().
+Sun Nov 13 23:21:24 2011 Tanaka Akira <akr@fsij.org>
-Fri Oct 10 01:19:00 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ext/gdbm/gdbm.c (fgdbm_reorganize): set close-on-exec flag after
+ gdbm_reorganize(). gdbm_reorganize() opens a new database internally.
- * ext/openssl/ossl_x509name.c (ossl_x509name_initialize): add
- optional argument to specify the DirectoryString type
- (ASN1::UTF8STRING by default). RFC3280 deprecates PrintableString
- for DirectoryString, and strongly requires to use UTF8String for
- all certificates issued after December, 31 2003.
+Sun Nov 13 19:57:18 2011 Tanaka Akira <akr@fsij.org>
- * ext/openssl/lib/openssl/x509.rb (X509::Name::parse): ditto.
+ * ext/dbm/extconf.rb: rollback for each headers for each libraries.
-Thu Oct 9 23:50:21 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 13 16:24:48 2011 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_thread_start_0): prevent thread from GC.
- [ruby-dev:21572]
+ * ext/dbm/extconf.rb: treat libc as a choice for a library which
+ provide ndbm API.
-Thu Oct 9 19:11:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 13 15:40:43 2011 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_thread_start_0): non-volatile should be restored from
- volatile.
+ * ext/dbm/extconf.rb: duplicate $libs and $defs when save them.
-Thu Oct 9 17:43:36 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 13 12:43:48 2011 Tanaka Akira <akr@fsij.org>
- * eval.c (proc_save_safe_level, proc_get_safe_level,
- proc_set_safe_level): save/restore safe level 1..4.
+ * ext/dbm/extconf.rb: rollback $libs and $defs when db detection is
+ failed. It fixes -lgdbm -lqdbm when the system has qdbm and gdbm
+ without gdbm_compat.
-Thu Oct 9 16:33:23 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Nov 12 21:14:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * marshal.c (r_object0): remove unnecessary iv restoration for
- USRMARSHAL. [ruby-dev:21582]
+ * test/webrick/test_cgi.rb (class TestWEBrickCGI): respect
+ RbConfig::CONFIG["LIBPATHENV"]. [Bug #5135] [ruby-core:38653]
+ * test/webrick/test_filehandler.rb (class WEBrick): ditto.
- * marshal.c (w_object): dump generic instance variables from
- a string from '_dump'.
+Sat Nov 12 20:57:29 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * variable.c (rb_generic_ivar_table): return 0 if obj's FL_EXIVAR
- is not set.
+ * test/ruby/test_io.rb (test_fcntl_dupfd): skip if Fcntl::DUPFD
+ is not defined. Pointed out by CHIKANAGA Tomoyuki. Thanks.
- * time.c (time_dump): copy instance variables to dumped string, to
- be included in the marshaled data.
+Sat Nov 12 17:26:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (rb_big2ulong): add range check to ensure round trip.
+ * io.c (do_ioctl, ioctl_narg_len, setup_narg, rb_ioctl): use
+ ioctl_req_t.
-Thu Oct 9 15:45:27 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Nov 12 17:01:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * pack.c (uv_to_utf8): change message to "out of range", since
- negative values are not "too big". [ruby-dev:21567]
+ * ext/dbm/extconf.rb (headers.db_check): reduce duplicated code.
-Thu Oct 9 14:05:38 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 12 15:59:42 2011 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_set_end_proc, rb_exec_end_proc): restore safe level.
- [ruby-dev:21557]
+ * ext/dbm/extconf.rb: dbm_clearerr should be available in all ndbm
+ implementation. If it is not available, it is caused by
+ header/library mismatch such that Berkeley DB header & gdbm library.
-Thu Oct 9 10:51:04 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dbm/dbm.c (fdbm_store): use dbm_clearerr() unconditionally.
+ gdbm 1.9 provides it as a real function instead of a empty macro.
- * eval.c (rb_yield_0): no error if block is empty.
+Sat Nov 12 13:35:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Oct 9 06:43:33 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bootstraptest/runner.rb: don't suppress SIGINT.
+ [Feature #5612] [ruby-dev:44856]
- * eval.c (localjump_error): id should be ID.
+Sat Nov 12 11:20:36 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (rb_eval): nd_rval is set in copy_node_scope().
+ * io.c (fcntl_narg_len): introduce narg calculation for fcntl instead
+ of hard coded 256.
+ * io.c (setup_narg): ditto.
- * eval.c (rb_yield_0): unused variable.
+Sat Nov 12 11:19:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (rb_yield_0): nothing to do for empty node.
+ * test/ruby/test_io.rb (test_fcntl_dupfd): add another fcntl test.
- * eval.c (call_end_proc, proc_invoke): adjust backtrace in END.
- [ruby-dev:21551]
+Sat Nov 12 11:18:17 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (rb_thread_start_0): set the value by break as the result.
- [ruby-dev:21552]
+ * test/ruby/test_io.rb (test_fcntl_lock_freebsd): add a testcase
+ of fcntl lock for freebsd.
- * eval.c (rb_thread_start_0, rb_thread_raise, rb_callcc): save
- variables across THREAD_SAVE_CONTEXT.
+Sat Nov 12 11:16:32 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Oct 9 12:05:46 2003 Eric Sunshine <sunshine@sunshineco.com>
+ * io.c (ioctl_narg_len): Linux doesn't have IOCPARM_LEN macro, but
+ has _IOC_SIZE. support it.
- * configure.in: revived NextStep, OpenStep, and Rhapsody ports which
- had become unbuildable; enhanced --enable-fat-binary option so that
- it accepts a list of desired architectures (rather than assuming a
- fixed list), or defaults to a platform-appropriate list if user does
- not provide an explicit list; made the default list of architectures
- for MAB (fat binary) more comprehensive; now uses -fno-common even
- when building the interpreter (in addition to using it for
- extensions), thus allowing the interpreter to be embedded into a
- plugin module of an external project (in addition to allowing
- embedding directly into an application); added checks for
- <netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now
- ensures that -I/usr/local/include is employed when extensions'
- extconf.rb scripts invoke have_header() since extension checks on
- NextStep and OpenStep will fail without it if the desired resource
- resides in the /usr/local tree; fixed formatting of --help message.
+Sat Nov 12 11:13:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * Makefile.in: $(LIBRUBY_A) rule now deletes the archive before
- invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives
- (see configure's --enable-fat-binary option); added rule for new
- missing/getcwd.c.
+ * io.c (rb_ioctl): don't expose our sanity check value to ruby script.
+ It may change string value meaning if the value is string.
+ (e.g. MacOS X has F_GETPATH ioctl)
+ * io.c (rb_fcntl): ditto.
- * defines.h: fixed endian handling during MAB build (see configure's
- --enable-fat-binary option) to ensure that all portions of the
- project see the correct WORDS_BIGENDIAN value (some extension modules
- were getting the wrong endian setting); added missing constants
- GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep
- and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H
- define in NeXT section.
+Sat Nov 12 11:06:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on
- NextStep since, on some installations, this value always resolves
- uselessly to zero.
+ * io.c (ioctl_req_t): Type of req argument of ioctl() depend on platform.
+ Moreover almost all linux ioctl can't be represented by 32bit integer
+ (i.e. MSB is 1). We need wrap ioctl argument type.
+ [Bug #5429] [ruby-dev:44589]
+ * io.c (struct ioctl_arg): ditto.
+ * io.c (rb_ioctl): ditto.
+ * test/ruby/test_io.rb (test_ioctl_linux): add a testcase for ioctl
- * dln.c: added error reporting to NextStep extension loader since the
- previous behavior of failing silently was not useful; now ensures
- that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined
- for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice
- on Rhapsody since this header lacks multiple-include protection,
- which resulted in "redefinition" compilation errors.
+Sat Nov 12 11:00:42 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * main.c: also create hard reference to objc_msgSend() on NeXT
- platforms (in addition to Apple platforms).
+ * io.c (struct io_cntl_arg): remove io_p member.
+ * io.c (nogvl_fcntl, do_fcntl, rb_fcntl): separated from ioctl functions.
+ * io.c (nogvl_io_cntl): remove fcntl depended logic.
+ * io.c (io_cntl): ditto.
+ * io.c (rb_io_ctl): ditto.
+ * io.c (rb_io_ioctl): ditto.
- * lib/mkmf.rb: now exports XCFLAGS from configure script to extension
- makefiles so that extensions can be built MAB (see configure's
- --enable-fat-binary option); also utilize XCFLAGS in cc_command()
- (but not cpp_command() because MAB flags are incompatible with
- direct invocation of `cpp').
+Sat Nov 12 10:59:49 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/curses/extconf.rb: now additionally checks for presence of these
- curses functions which are not present on NextStep or Openstep:
- bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(),
- setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(),
- wscrl(), wsetscrreg()
+ * io.c (setup_narg): fix off by one bug.
- * ext/curses/curses.c: added appropriate #ifdef's for additional set of
- curses functions now checked by extconf.rb; fixed curses_bkgd() and
- window_bkgd() to correctly return boolean result rather than numeric
- result; fixed window_getbkgd() to correctly signal an error by
- returning nil rather than -1.
+Sat Nov 12 10:56:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/etc/etc.c: setup_passwd() and setup_group() now check for null
- pointers before invoking rb_tainted_str_new2() upon fields extracted
- from `struct passwd' and `struct group' since null pointers in some
- fields are common on NextStep/OpenStep (especially so for the
- `pw_comment' field) and rb_tainted_str_new2() throws an exception
- when it receives a null pointer.
+ * io.c (+setup_narg): factor out length calculation logic.
+ * io.c (rb_io_ctl): ditto.
- * ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for
- platforms such as NextStep and OpenStep which lack strdup().
+Sat Nov 12 10:52:17 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/socket/getaddrinfo.c: cast first argument of getservbyname(),
- gethostbyaddr(), and gethostbyname() from (const char*) to non-const
- (char*) for older platforms such as NextStep and OpenStep.
+ * io.c (+ioctl_narg_len) new helper function.
+ * io.c (rb_io_ctl): don't use ioctl specific length check
+ if caller is fcntl.
- * ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for
- platforms such as NextStep and OpenStep which lack strdup(); include
- <netinet/in_systm.h> if present for NextStep and OpenStep; cast first
- argument of gethostbyaddr() and getservbyname() from (const char*) to
- non-const (char*) for older platforms.
+Fri Nov 11 23:00:46 2011 Tanaka Akira <akr@fsij.org>
- * ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for
- platforms such as NextStep and OpenStep which lack strdup().
+ * ext/dbm/extconf.rb: db_prefix is not required now.
-Wed Oct 8 22:19:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Fri Nov 11 21:13:30 2011 Tanaka Akira <akr@fsij.org>
- * lib/test/unit.rb: removed installation instructions.
+ * ext/gdbm/gdbm.c (fgdbm_initialize): use GDBM_CLOEXEC if available.
- * lib/test/unit/ui/testrunnermediator.rb: moved the run flag to a more
- central location.
+Fri Nov 11 21:00:05 2011 Tanaka Akira <akr@fsij.org>
- * lib/test/unit.rb: ditto.
+ * ext/dbm/extconf.rb: fix dbm_pagfno and dbm_dirfno detection with
+ Berkeley DB. Macro definitions needs arguments to detect correctly.
+ SIZEOF_DSIZE needs -DDB_DBM_HSEARCH because db.h defines datum type
+ only if DB_DBM_HSEARCH is defined.
- * lib/test/unit.rb: extracted the running code in to AutoRunner.
+Fri Nov 11 18:41:57 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/autorunner.rb: added.
+ * process.c (proc_seteuid): separate an internal wrapper function
+ from the method implementation.
- * lib/test/unit/collector/objectspace.rb: extracted common test
- collection functionality in to a module.
+Fri Nov 11 17:21:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/collector.rb: ditto; added.
+ * lib/mkmf.rb (have_library, find_library, have_func): allow
+ arguments of function to be checked.
- * test/testunit/collector/test_objectspace.rb: ditto.
+Fri Nov 11 17:09:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/collector/dir.rb: added. Supports collecting tests out
- of a directory structure.
+ * vm_dump.c (HAVE_BACKTRACE): fallback to 0.
- * test/testunit/collector/test_dir.rb: added.
+ * vm_dump.c (rb_vm_bugreport): show "Other runtime information"
+ header only when available.
- * test/runner.rb: simplified to use the new capabilities.
+ * vm_dump.c (rb_vm_bugreport): get rid of modifying the content of
+ VM directly.
-Tue Oct 7 15:23:09 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * vm_dump.c (rb_vm_bugreport): check if vm is non-null.
+ Pointed out by Ikegami Daisuke <ikegami.da@gmail.com>.
+ Thank you.
- * test/ruby/test_beginendblock.rb: add tests for nested BEGIN/END.
+Fri Nov 11 12:36:37 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/ruby/beginmainend.rb: add tests for nested BEGIN/END.
+ * io.c (pipe_open): Remove fflush(stdin). it's no effect.
+ Pointed out by Ikegami Daisuke <ikegami.da@gmail.com>.
+ Thank you.
- * test/ruby/endblockwarn.rb: new file added to test of END-in-method
- warning.
+Fri Nov 11 07:33:30 2011 Eric Hodel <drbrain@segment7.net>
-Tue Oct 7 12:23:47 2003 Tanaka Akira <akr@m17n.org>
+ * lib/net/http.rb (Net::HTTP::SSL_ATTRIBUTES): Use symbol keys instead
+ of string keys to avoid duplicating parameters in
+ OpenSSL::SSL:SSLContext#set_params.
- * ext/fcntl/fcntl.c (Init_fcntl): define Fcntl::O_ACCMODE.
+Thu Nov 10 15:02:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/extconf.rb: useless assignment removed.
+ * lib/mkmf.rb (have_library, have_func, have_var, have_header):
+ add compiler option parameter.
-Tue Oct 7 09:13:24 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 10 07:45:16 2011 Eric Hodel <drbrain@segment7.net>
- * test/ruby/test_beginendblock.rb (test_endinmethod): END{} is now
- allowed in eval.
+ * ext/openssl/lib/openssl/ssl.rb (class OpenSSL::SSL::SSLContext):
+ Document #set_params.
-Tue Oct 7 04:15:25 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 9 11:36:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * parse.y (stmt): should not expand mrhs if lhs is solely starred.
+ * thread_pthread.c (gvl_yield): don't prevent concurrent sched_yield().
+ [Bug #5130] [ruby-core:38647]
-Tue Oct 7 02:57:53 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Nov 9 23:20:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (stmt): rhs of multiple assignment should not be
- expanded using "to_a". [ruby-dev:21527]
+ * io.c (rb_update_max_fd): fstat(2) can fail with other than
+ EBADF. [ruby-dev:44837] [Bug #5593]. Cf.
+ http://pubs.opengroup.org/onlinepubs/9699919799/functions/fstat.html
-Tue Oct 7 01:42:34 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * io.c (rb_sysopen): max fd is updated in rb_sysopen_internal()
+ already.
- * ext/openssl/ossl_asn1.c (ossl_asn1_get_asn1type): use appropriate
- free function for ASN1_OBJECT.
+Wed Nov 9 22:13:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl/ossl_asn1.c (ossl_asn1obj_get_sn): add new function for
- ASN1::ObjectId#sn; it returns short name text representation of OID.
+ * test/ruby/test_file.rb (TestFile#test_utime_with_minus_time_segv):
+ fixed previous commit.
- * ext/openssl/ossl_asn1.c (ossl_asn1obj_get_ln): add new function for
- ASN1::ObjectId#ln; it returns long name text representation of OID.
+Wed Nov 9 19:53:45 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl/ossl_asn1.c (ossl_asn1obj_get_oid): add new function for
- ASN1::ObjectId#oid; it returns numerical representation of OID.
+ * test/ruby/test_file.rb (TestFile#test_utime_with_minus_time_segv):
+ add test for r33685.
-Mon Oct 6 22:59:46 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Wed Nov 9 19:00:44 2011 Koichi Sasada <ko1@atdot.net>
- * lib/csv.rb (IOReader, BasicWriter): call binmode when a given IO
- respond_to?(:binmode). record separator was wrong when you gave
- text mode IO to Reader.parse and Writer.generate.
+ * test/ruby/test_fiber.rb: add tests for r33684 (Fiber#resume).
- * test/csv/test_csv.rb: add tests for above change.
+Wed Nov 9 16:40:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Oct 5 23:27:09 2003 Tanaka Akira <akr@m17n.org>
+ * win32/win32.c (unixtime_to_filetime): should check the return value
+ of localtime(). reported by snowjail at gmail.com.
+ [ruby-dev:44838] [Bug #5596]
- * ext/socket/extconf.rb: check recvmsg even if sendmsg is exists.
+Thu Nov 9 13:17:25 2011 Koichi Sasada <ko1@atdot.net>
- * ext/socket/socket.c (thread_read_select): restored.
+ * cont.c (rb_fiber_m_transfer, rb_fiber_resume): prohibit using
+ "resume" after "transfer" method are used. You should not mix
+ "resume" fiber and "transfer" fiber.
+ [Bug #5526]
-Mon Oct 6 16:23:38 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * NEWS: add information about this change.
- * marshal.c (w_object): wrong method name in the message.
+Wed Nov 9 11:40:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 6 16:02:05 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * template/Doxyfile.tmpl (INCLUDE_PATH): add srcdir and include.
+ [ruby-core:40843] [Bug #5597]
- * parse.y (stmt): END in method should cause warning.
- [ruby-dev:21519]
+Wed Nov 9 11:02:54 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Oct 6 15:17:23 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * thread.c (do_select): fix cast, tv_sec is time_t.
- * test/ruby/test_iterator.rb (test_block_argument_without_paren):
- added. (follows sample/test.rb)
+Wed Nov 9 10:32:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 6 11:57:06 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * configure.in: should not use test -e for portability.
+ [ruby-core:40841] [Bug #5594]
- * test/ruby/test_beginendblock.rb, test/ruby/beginmainend.rb: added
- test for eval-ed BEGIN END order.
+Wed Nov 9 04:52:16 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Mon Oct 6 09:19:54 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/psych/lib/psych/tree_builder.rb: dump complex numbers,
+ rationals, etc with reference ids.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
+ * ext/psych/lib/psych/visitors/to_ruby.rb: loading complex numbers,
+ rationals, etc with reference ids.
+ * test/psych/test_object_references.rb: corresponding tests
- * marshal.c (w_object): should pass "weak" value to next level.
- [ruby-dev:21496]
+Tue Nov 8 23:34:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (proc_alloc): should not use cached object if klass is
- different. [ruby-talk:83685]
+ * ext/dbm/dbm.c (fdbm_fetch, fdbm_key, fdbm_delete, fdbm_store)
+ (fdbm_has_key, fdbm_has_value): get rid of overflow.
-Sun Oct 5 23:27:09 2003 Tanaka Akira <akr@m17n.org>
+ * ext/gdbm/gdbm.c (rb_gdbm_fetch2, rb_gdbm_nextkey)
+ (rb_gdbm_delete, fgdbm_store, fgdbm_has_key): ditto.
- * lib/pathname.rb: version information is added in document.
+ * ext/dbm/dbm.c (fdbm_delete_if): hide intermediate objects.
-Sun Oct 5 23:07:03 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/gdbm/gdbm.c (fgdbm_delete_if): ditto.
- * eval.c (rb_f_END): block should be given. [ruby-dev:21497]
+ * ext/dbm/extconf.rb: check size of datum.dsize to get rid of
+ overflow.
-Sun Oct 5 22:51:23 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Nov 8 23:30:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/ext/openssl/extconf.rb: add check for some engine functions
- unavailable in OpenSSL-0.9.6.
+ * addr2line.c (PATH_MAX): define if not defined. [ruby-core:40840]
- * lib/ext/openssl/ossl_engine.c: ditto.
+Tue Nov 8 23:26:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Oct 5 17:56:30 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/tk/tcltklib.c (rb_thread_critical): fix type.
- * eval.c (rb_eval): fix evaluation order. [ruby-list:38431]
+ * ext/tk/tcltklib.c (eventloop_sleep, lib_eventloop_core): int is
+ enough for micro seconds. may need to check overflow in the
+ setter though.
-Sun Oct 5 15:05:06 2003 akira yamada <akira@ruby-lang.org>
+ * ext/tk/tcltklib.c (RSTRING_LENINT): check overflow if necessary.
- * test/uri/*: translated RUNIT to Test::Unit.
+ * ext/tk/tcltklib.c (RbTk_ALLOC_N): wrapper for ckalloc() which
+ takes an int.
-Sun Oct 5 14:37:39 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/tk/tcltklib.c (ip_ruby_cmd_receiver_get, tcltklib_compile_info):
+ get rid overflow.
- * lib/xsd/datatypes.rb: Rational -> Decimal string bug fix.
+ * ext/tk/tcltklib.c (tcltklib_compile_info): constified.
- * test/soap/marshal/test_marshal.rb: ditto.
+Tue Nov 8 20:50:45 2011 Tanaka Akira <akr@fsij.org>
- * test/soap/calc/test_calc_cgi.rb: add Config::CONFIG["EXEEXT"] to
- RUBYBIN.
+ * test/dbm/test_dbm.rb: split tests for read only database.
-Sun Oct 5 13:47:22 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * test/gdbm/test_gdbm.rb: ditto.
- * test/ruby/test_beginendblock.rb, test/ruby/beginmainend.rb: add tests
- about scope, order and allowed syntax.
+Tue Nov 8 18:59:07 2011 Tanaka Akira <akr@fsij.org>
-Sun Oct 5 11:54:29 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/pty/pty.c (MasterDevice): define only when used.
+ (SlaveDevice): ditto.
+ (deviceNo): ditto.
- * test/ruby/envutil.rb: added. split "rubybin" from test_system.rb.
+Tue Nov 8 17:59:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_system.rb: use envutil.rb
+ * include/ruby/ruby.h (rb_long2int): define as a macro always, so
+ that cpp conditionals can tell if it is provided.
- * test/ruby/test_beginendblock.rb: added.
+Tue Nov 8 17:30:50 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/beginmainend.rb: added. used in test_beginendblock.rb.
+ * lib/mkmf.rb (cpp_command): remove multiple -arch flags since cpp
+ cannot work.
-Sun Oct 5 11:23:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Tue Nov 8 14:50:55 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/testunit/runit/test_testresult.rb: removed some unnecessary
- cruft.
+ * io.c (io_fwrite): call rb_w32_write_console() only if FMODE_TTY is
+ set. this is the one of the reason of IO writing slowness of Windows
+ in 1.9.3 or later.
-Sun Oct 5 11:14:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Tue Nov 8 11:01:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rubyunit.rb: aliasing TestCase into the top level is
- problematic.
+ * ext/pty/pty.c (get_device_once): FreeBSD 8 supported O_CLOEXEC flag
+ for posix_openpt, but FreeBSD 9's posix_openpt doesn't support
+ O_CLOEXEC and fails if specified.
- * lib/runit/assert.rb: fixed a couple of bugs caused by recent
- refactoring in Test::Unit.
+Tue Nov 8 02:36:45 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/testunit/runit/*: added.
+ * include/ruby/encoding.h (ECONV_NEWLINE_DECORATOR_READ_MASK,
+ ECONV_NEWLINE_DECORATOR_WRITE_MASK): new macro.
-Sun Oct 5 10:55:29 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * io.c (rb_io_extract_modeenc, pipe_open, prep_stdio, argf_next_argv):
+ set TEXTMODE_NEWLINE_DECORATOR_ON_WRITE for textmode on creating IO
+ if the flag is available.
- * lib/open-uri.rb (URI::Generic#find_proxy): no_proxy support did not
- work. [ruby-dev:21484]
+ * io.c (make_writeconv): drop decorators for reading.
-Sun Oct 5 09:52:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * io.c (make_readconv): drop decorators for writing.
- * lib/test/unit/assertions.rb: will use pp for output if available.
- Can be disabled by setting Assertions.use_pp = false.
+ * io.c (do_writeconv): existing writeconv is not the condition to raise
+ ArgumentError. should check textmode or not.
- * test/testunit/test_assertions.rb: made a small change to exception
- formatting.
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_{cr,lf,crlf}_decorator_on_stdout): test above
+ changes.
-Sun Oct 5 07:42:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Mon Nov 7 22:03:47 2011 Tanaka Akira <akr@fsij.org>
- * lib/test/unit/assertions.rb: made small improvements to assertion
- messages. Deprecated Assertions#assert_not_nil; use #assert instead.
+ * ext/gdbm/gdbm.c (fgdbm_initialize): set close-on-exec flag.
- * test/testunit/test_assertions.rb: ditto.
+Mon Nov 7 20:31:52 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * test/testunit/util/test_procwrapper.rb: use #assert instead of
- #assert_not_nil.
+ * ext/psych/lib/psych/scalar_scanner.rb: make sure strings that look
+ like base 60 numbers are serialized as quoted strings.
+ * test/psych/test_string.rb: test for change.
-Sun Oct 5 04:10:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Mon Nov 7 20:26:37 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/test/unit/assertions.rb: refactored message building.
+ * test/psych/test_yamlstore.rb: make test case inherit from MiniTest,
+ load psych/helper so that psych is loaded.
-Sun Oct 5 03:40:22 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Nov 7 20:18:29 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/openssl/ossl_asn1.h: global symbols should be declared
- as external.
+ * test/psych/test_yamldbm.rb: Test case should inherit from MiniTest,
+ load psych/helper so that psych and friends are loaded.
-Sun Oct 5 03:03:20 2003 akira yamada <akira@ruby-lang.org>
+Mon Nov 7 20:15:44 2011 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_exception.rb (test_else): added.
+ * ext/dbm/extconf.rb: check dbm_pagfno() and dbm_dirfno().
-Sun Oct 5 02:12:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * ext/dbm/dbm.c: use above to set close-on-exec flag.
- * lib/test/unit/assertions.rb: changed assertion messages to rely more
- heavily on #inspect. Added backtrace filtering for exceptions in
- assertion messages.
+Mon Nov 7 20:05:16 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/testunit/test_assertions.rb: ditto.
+ * io.c (io_fflush): remove fsync().
-Sun Oct 5 02:12:00 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * io.c (rb_io_flush, rb_io_rewind): fsync() here.
- * lib/drb/acl.rb, lib/drb/ssl.rb: added.
+ these changes reduces fsync() calls to improve performance.
+ first reported at [ruby-list:48515] by ak7 at mail.goo.ne.jp .
+ [Bug #5585]
- * lib/drb/drb.rb: exit from a thread using 'break'.
+Mon Nov 7 19:43:10 2011 Tanaka Akira <akr@fsij.org>
-Sat Oct 4 21:49:14 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * io.c (rb_close_before_exec): use F_MAXFD if available.
+ F_MAXFD is available on NetBSD since NetBSD 2.0.
- * gc.c (Init_stack): the type of space is changed to unsigned int
- from double. [ruby-dev:21483]
+Mon Nov 7 19:25:16 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Oct 4 17:52:59 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_default_stdout_stderr_mode): new test for
+ r33627-33629. see [backport #5565]
- * lib/soap/netHttpClient.rb: follow http-access2. hosts which matches
- ENV['no_proxy'] or ENV['NO_PROXY'] are not proxyed.
- - [,:] separated. ("ruby-lang.org:rubyist.net")
- - no regexp. (give "ruby-lang.org", not "*.ruby-lang.org")
- - if you want specify host by IP address, give full address.
- ("192.168.1.1, 192.168.1.2")
+Mon Nov 7 01:14:22 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/soap/rpc/cgistub.rb: return "Status: XXX MMM" line.
+ * lib/debug.rb: add help for 'pp' and 'r[estart]'. patch
+ from Sho Hashimoto. [Bug #5093] [ruby-dev:44222]
- * test/runner.rb: give testsuite name.
+Sun Nov 6 14:49:58 2011 Tanaka Akira <akr@fsij.org>
-Sat Oct 4 15:16:02 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/socket/rubysocket.h (rsock_recvmsg): declared.
- * marshal.c (w_object): instance variable dump do not cause error
- for objects that cannot be dumped, if they traversed from
- marshal_dump. they are just ignored.
+ * ext/socket/ancdata.c (rsock_recvmsg): extracted from
+ nogvl_recvmsg_func.
+ (nogvl_recvmsg_func): use rsock_recvmsg.
- * gc.c (Init_stack): cast "space" (doble value) into unsigned
- int. should run on PowerPC.
+ * ext/socket/unixsocket.c (recvmsg_blocking): use rsock_recvmsg.
- * eval.c (rb_eval): should not execute else part if any exception
- is caught. [ruby-dev:21482]
+Sun Nov 6 03:22:36 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * parse.y (f_args): should allow unparenthesized block argument.
+ * test/openssl/test_engine.rb: add test for engine cipher. RC4 is used
+ because AES is not supported by the "openssl" engine currently.
- * parse.y (f_rest_arg): should allow unparenthesized rest
- argument.
+Sun Nov 6 00:11:52 2011 Tanaka Akira <akr@fsij.org>
-Sat Oct 4 14:59:51 2003 Tanaka Akira <akr@m17n.org>
+ * lib/test/unit.rb (Test::Unit::Options#non_options): options[:ruby]
+ should be an array. This fixes
+ "./ruby test/runner.rb test/testunit/test_parallel.rb"
+ [ruby-dev:44782]
- * lib/pathname.rb (initialize): raise ArgumentError if argument has
- '\0' character.
- (relative_path_from): new method.
- (each_entry): new method for replacement of dir_foreach.
- (foreach, foreachline, dir_foreach, chdir): obsoleted.
+Sat Nov 5 20:30:30 2011 Martin Duerst <duerst@it.aoyama.ac.jp>
-Sat Oct 4 12:58:48 2003 akira yamada <akira@ruby-lang.org>
+ * insns.def: Some fixes and tweaks to English explanations
- * test/uri/* (6 files): added.
+Sat Nov 5 19:11:50 2011 Tanaka Akira <akr@fsij.org>
-Sat Oct 4 12:44:45 2003 akira yamada <akira@ruby-lang.org>
+ * io.c (rb_cloexec_fcntl_dupfd): don't clear try_dupfd_cloexec if
+ fcntl(F_DUPFD) failed as fcntl(F_DUPFD_CLOEXEC).
- * lib/uri/ftp.rb, lib/uri/mailto.rb: renamed to #to_s from #to_str.
+Sat Nov 5 18:05:12 2011 Tanaka Akira <akr@fsij.org>
-Sat Oct 4 07:33:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * ext/socket/socket.c (rsock_socketpair0): refactored.
- * lib/test/unit/testsuite.rb: changed #<< to return self, and added
- #delete.
+Sat Nov 5 17:55:52 2011 Tanaka Akira <akr@fsij.org>
- * test/testunit/test_testsuite.rb: ditto. Also slightly refactored
- #test_size.
+ * ext/socket/init.c (rsock_socket0): don't clear try_sock_cloexec if
+ SOCK_CLOEXEC is not a reason for EINVAL.
- * lib/test/unit/collector/objectspace.rb: collector now preserves the
- hierarchy of suites.
+Sat Nov 5 16:27:52 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * test/testunit/collector/test_objectspace.rb: ditto.
+ * ext/pathname/lib/pathname.rb, ext/tk/lib/multi-tk.rb,
+ ext/tk/sample/demos-en/widget, lib/benchmark.rb, lib/irb/cmd/fork.rb,
+ lib/mkmf.rb, lib/net/ftp.rb, lib/net/smtp.rb, lib/open3.rb,
+ lib/pstore.rb, lib/rexml/element.rb, lib/rexml/light/node.rb,
+ lib/rinda/tuplespace.rb, lib/rss/maker/base.rb,
+ lib/rss/maker/entry.rb, lib/scanf.rb, lib/set.rb, lib/shell.rb,
+ lib/shell/command-processor.rb, lib/shell/process-controller.rb,
+ lib/shell/system-command.rb, lib/uri/common.rb: remove unused block
+ arguments to avoid creating Proc objects.
-Sat Oct 4 04:48:49 2003 why the lucky stiff <why@ruby-lang.org>
+Sat Nov 5 15:45:04 2011 Tanaka Akira <akr@fsij.org>
- * ext/syck/rubyext.c: default keys handled.
+ * ext/socket/init.c (rsock_socket0): extract single socket() call with
+ CLOEXEC handling from rsock_socket.
- * ext/syck/syck.h: lowered default buffer size to 16k for increased
- performance.
+Sat Nov 5 13:49:40 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * test/yaml: checkin of basic unit tests.
+ * lib/pathname.rb (Pathname#find): return an enumerator if
+ no block is given.
-Sat Oct 4 04:24:19 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/pathname/test_pathname.rb: add tests for above.
- * ext/openssl/extconf.rb: add check for X509V3_set_nconf.
+ [ruby-dev:44797] [Feature #5572]
- * ext/openssl/ossl_x509ext.c (ossl_x509extfactory_set_config):
- cannot implement if X509V3_set_nconf doesn't exist.
+Sat Nov 5 11:18:12 2011 Tanaka Akira <akr@fsij.org>
-Sat Oct 4 02:12:44 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/socket/socket.c (rsock_socketpair0): don't clear
+ try_sock_cloexec if SOCK_CLOEXEC is not a reason for EINVAL.
- * lib/xsd/datatypes.rb: dump sign by itself. under the problematic
- platform, sprintf("%+.10g", -0.0) => +0. sigh.
+Fri Nov 4 14:08:19 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * sample/wsdl/amazon/*: update schema ver2 to ver3.
+ * ext/openssl/ossl_pkey_rsa.c (rsa_generate): [SECURITY] Set RSA
+ exponent value correctly. Awful bug. This bug caused exponent of
+ generated key to be always '1'. By default, and regardless of e
+ given as a parameter.
-Sat Oct 4 01:33:46 2003 Tanaka Akira <akr@m17n.org>
+ !!! Keys generated by this code (trunk after 2011-09-01) must be
+ re-generated !!! (ruby_1_9_3 is safe)
- * lib/pathname.rb (initialize): duplicate and freeze argument.
- (to_s): return duplicated string.
- (children): new method.
- (each_line): new alias to foreachline.
+ * test/openssl/test_pkey_rsa.rb: Add tests for default exponent and
+ specifying exponent by a parameter.
-Fri Oct 3 16:13:19 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Nov 4 01:31:25 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/openssl/ossl_asn1.c: add DER encoder and decoder.
+ * test/openssl/test_engine.rb: add first tests for builtin "openssl"
+ engine.
- * ext/openssl/ossl_asn1.h: add OpenSSL::ASN1 module.
+Fri Nov 4 08:41:26 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/openssl/ossl.c (Init_openssl): call Init_ossl_asn1.
+ * ext/openssl/extconf.rb:
+ * ext/openssl/ossl_engine.c: add some missing OpenSSL engines.
+ Thanks, Yui Naruse, for providing the patch!
+ [Bug #5548] [ruby-core:40670]
- * ext/openssl/extconf.rb: check if X509_ATTRIBUTE has field "single".
+Fri Nov 4 04:54:10 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl/ossl_x509attr.c (ossl_x509attr_set_value): accept
- DER encoded data argument.
+ * win32/configure.bat: disable delayed expansion of enironment variable.
+ [Bug #5517] [ruby-core:40531]
- * ext/openssl/ossl_x509attr.c (ossl_x509attr_get_value): return
- DER encoded data in OpenSSL::ASN1 types.
+Fri Nov 4 03:45:22 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Oct 3 13:02:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * io.c (make_writeconv): fixed typo of previous commit.
- * lib/test/unit.rb: refactored to use optparse.
+Fri Nov 4 01:56:30 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/test/unit.rb: added support for selecting the output
- level from the command-line.
+ * io.c (make_writeconv): unversal_newline converter is for reading.
+ so, if the io is text mode and has ECONV_UNIVERSAL_NEWLINE_DECORATOR
+ flag, use crlf_newline converter for writing.
+ this change fixes the problem about the luck of CR up Kernel.p and
+ Kernel.puts to stdout/stderr on Windows.
- * lib/test/unit.rb: added a command-line switch to stop processing
- the command-line, allowing arguments to be passed to tests.
+Fri Nov 4 01:04:48 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/test/unit.rb: changed the method for specifying a runner or a
- filter from the command-line.
+ * ext/readline/readline.c (Init_readline): like r18313, libedit's
+ replace_history_entry may use offset instead of which.
+ so introduce history_replace_offset_func and initialize it.
- * lib/test/unit/collector/objectspace.rb: fixed a bug causing all
- tests to be excluded when the filter was set to an empty array.
+ * ext/readline/readline.c (hist_set): use history_replace_offset_func.
- * test/testunit/collector/test_objectspace.rb: ditto.
+Fri Nov 4 00:53:35 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Oct 3 08:14:32 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/readline/readline.c (Init_readline): fix wrong condition.
- * lib/irb/ruby-lex.rb (RubyLex::identify_identifier): support
- 'class ::Foo' syntax. [ruby-talk:83514]
+Thu Nov 3 23:53:04 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Oct 3 08:01:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * encoding.c (rb_locale_charmap): ignore calling nl_langinfo_codeset()
+ on Windows except cygwin. [experimental]
- * lib/test/unit/assertions.rb: added a default message for #assert,
- #assert_block, and #flunk.
+Thu Nov 3 22:45:09 2011 Tanaka Akira <akr@fsij.org>
- * test/testunit/test_assertions.rb: ditto.
+ * ext/socket/socket.c (rsock_socketpair0): extracted from
+ rsock_socketpair to set close-on-exec flag for each socketpair()
+ call.
- * lib/test/unit/failure.rb: failures now show a better trace of where
- they occurred.
+Thu Nov 3 22:12:41 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * test/testunit/test_failure.rb: ditto (added).
+ * ext/socket/init.c (rsock_socket): set close-on-exec flag when
+ SOCK_CLOEXEC is not available.
- * lib/test/unit/testcase.rb: ditto.
+Thu Nov 3 08:36:00 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * test/testunit/test_testcase.rb: ditto.
+ * test/openssl/test_engine.rb: call Engine::cleanup on exit.
+ Patch provided by Yui Naruse, thanks!
+ [Bug #5547] [ruby-core:40669]
- * lib/test/unit/util/backtracefilter.rb: added.
+Wed Nov 2 21:36:00 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/testunit/util/test_backtracefilter.rb: added.
+ * complex.c (nucomp_rationalize): fix function. [ruby-core:40667]
+ [Bug #5546]
- * lib/test/unit/error.rb: changed to use BacktraceFilter and improved
- output.
+Wed Nov 2 08:16:45 2011 Tanaka Akira <akr@fsij.org>
- * test/testunit/test_error.rb: ditto.
+ * lib/webrick/utils.rb: fix fcntl call.
-Thu Oct 2 20:33:49 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/drb/unix.rb: ditto.
- * ext/iconv/iconv.c (iconv_failure_initialize): conform with
- orthodox initialization method.
+Wed Nov 2 00:43:59 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * ext/iconv/iconv.c (iconv_fail): initialize exception instance
- from the class, and do not share instance variables with the
- others. [ruby-dev:21470]
+ * test/psych/test_yamldbm.rb: avoid platform dependency.
+ patch by Naohisa Goto. [ruby-dev:44763] [Bug #5535]
+ * test/syck/test_yamldbm.rb: ditto.
-Thu Oct 2 18:20:27 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 2 00:14:15 2011 Shugo Maeda <shugo@ruby-lang.org>
- * time.c (Init_Time): define initialize. [ruby-dev:21469]
+ * test/ruby/test_marshal.rb: renamed methods duplicated with those
+ of marshaltestlib.rb.
-Thu Oct 2 17:39:38 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Nov 1 22:08:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_engine.c: add a new module OpenSSL::Engine.
- it supports OpenSSL hardware cryptographic engine interface.
+ * configure.in: reject llvm-gcc.
- * ext/openssl/ossl_engine.h: ditto.
+Tue Nov 1 21:39:00 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/MANIFEST: add ossl_engine.c and ossl_engine.h.
+ * io.c (rb_cloexec_pipe): remove workaround of r33587.
+ The bug of NetBSD is fixed on Mon Oct 31 21:31:29 UTC 2011.
+ http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45545
- * ext/openssl/extconf.rb: add check for openssl/engine.h.
+Tue Nov 1 19:49:08 2011 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl.c: call Init_ossl_engine().
+ * io.c (rb_io_reopen): call rb_fd_fix_cloexec instead of
+ rb_maygvl_fd_fix_cloexec.
- * ext/openssl/ossl.h: include openssl/engine.h.
+Tue Nov 1 19:00:30 2011 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_pkey_{rsa,dsa,dh}.c: check if underlying
- EVP_PKEY referes engine.
+ * io.c (rb_io_reopen): call rb_maygvl_fd_fix_cloexec after freopen().
-Thu Oct 2 17:22:37 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 1 17:17:26 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * time.c (time_load): restore instance variables (if any) before
- loading from marshaled data.
+ * file.c (file_expand_path): reset coderange after expanding path.
-Thu Oct 2 14:19:15 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 1 14:55:29 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/iconv/iconv.c (iconv_fail): now yield erred substring, and
- set error object to $!.
+ * io.c (nogvl_io_cntl): rb_cloexec_fcntl_dupfd's 2nd argument is int.
- * ext/iconv/iconv.c (iconv_convert): error handler block should
- return appended part and the rest. if rest is nil, the
- conversion stops.
+ * process.c (move_fds_to_avoid_crash): ditto.
-Thu Oct 2 12:00:18 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 1 13:14:33 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * variable.c (rb_const_defined_0): look up constants in Object as
- well. [ruby-dev:21458]
+ * vsnprintf.c (BSD_vfprintf): support 'll' prefix.
- * test/ruby/test_defined.rb (TestDefined::test_defined): test for
- constants.
+ * vsnprintf.c (__sfeof): rename to avoid the collision with NetBSD's
+ one.
-Thu Oct 2 11:17:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * vsnprintf.c (__sferror): ditto.
- * lib/test/unit/assertions.rb: should not capture an
- AssertionFailedError unless explicitly requested.
+ * vsnprintf.c (__sclearerr): ditto.
- * test/testunit/test_assertions.rb: ditto.
+ * vsnprintf.c (__sfileno): ditto.
- * test/testunit/collector/test_objectspace.rb: fixed a test failure
- caused by methods being returned in different orders on different
- platforms by moving test sorting from TestSuite into the locations
- where suites are constructed. [ruby-talk:83156]
+Tue Nov 1 12:36:16 2011 Tanaka Akira <akr@fsij.org>
- * lib/test/unit/testcase.rb: ditto.
+ * internal.h (rb_maygvl_fd_fix_cloexec): change the visibility for
+ ext/socket.
- * lib/test/unit/testsuite.rb: ditto.
+Tue Nov 1 12:00:53 2011 Tanaka Akira <akr@fsij.org>
- * lib/test/unit/collector/objectspace.rb: ditto.
+ * io.c (rb_maygvl_fd_fix_cloexec): renamed from fd_set_cloexec.
-Thu Oct 2 03:25:01 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * internal.h (rb_maygvl_fd_fix_cloexec): declared.
- * eval.c (rb_thread_raise): prototype; avoid VC++ warning.
+ * ext/socket/init.c (cloexec_accept): use rb_maygvl_fd_fix_cloexec.
+ (rsock_s_accept_nonblock): use rb_update_max_fd.
+ (rsock_s_accept): use rb_update_max_fd.
-Thu Oct 2 01:37:34 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 1 08:24:40 2011 Tanaka Akira <akr@fsij.org>
- * time.c (time_mdump): new marshal dumper. _dump is still
- available for compatibility.
+ * ext/socket/init.c (cloexec_accept): new function to use accept4 if
+ available.
+ (rsock_s_accept_nonblock): use cloexec_accept.
+ (accept_blocking): ditto.
- * time.c (time_mload): new marshal loader.
+ * ext/socket/extconf.rb: check accept4.
- * marshal.c (w_object): preserve instance variables for objects
- with marshal_dump.
+Tue Nov 1 07:31:55 2011 Tanaka Akira <akr@fsij.org>
- * marshal.c (r_object0): restore instance variables before calling
- marshal_load.
+ * ext/socket/ancdata.c (nogvl_recvmsg_func): use MSG_CMSG_CLOEXEC if
+ available.
- * error.c (rb_warn_m): always return nil.
+ * ext/socket/unixsocket.c (recvmsg_blocking): ditto.
-Thu Oct 2 01:32:46 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 1 05:59:41 2011 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_f_block_given_p): real required condition is
- ruby_frame->prev->iter == ITER_CUR.
+ * ext/socket/socket.c (rsock_socketpair): use SOCK_CLOEXEC if
+ available.
- * eval.c (rb_block_given_p): ditto.
+Tue Nov 1 02:56:17 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (block_pass): update ruby_frame->iter only when previous
- value is ITER_NOT.
+ * ruby.c (load_file_internal): convert the encoding of load path if
+ needed by platform. calling open() was replaced by rb_cloexec_open()
+ at r33549, but the function expected UTF-8 pathname on Windows.
+ (open() expected "locale" pathname.)
+ reported by taco via IRC.
-Thu Oct 2 01:02:35 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ruby.c (load_file): change the type of the 2nd parameter to pass its
+ encoding to load_file_internal().
- * variable.c (rb_const_defined_at): should exclude constants from
- Object when TYPE(klass) == T_MODULE *and* exclude is on.
- [ruby-dev:21458]
+ * ruby.c (process_options, rb_load_file): follow above change.
+ NOTE: we should pass encoding information to rb_load_file().
- * variable.c (rb_const_get_0): do not lookup constants from Object
- when TYPE(klass) == T_MODULE *and* exclude is on.
+Mon Oct 31 23:49:38 2011 Tanaka Akira <akr@fsij.org>
-Thu Oct 2 00:21:11 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/socket/socket.c (rsock_socketpair): extracted from
+ rsock_sock_s_socketpair.
- * test/logger/test_logger.rb: unlinking file before close causes
- problem under win32 box.
+Mon Oct 31 23:31:53 2011 Tanaka Akira <akr@fsij.org>
- * lib/xsd/datatypes.rb(XSDFloat, XSDDouble): add +/- sign explicitly
- when stringified and embedded into XML instance. Ruby's sprintf may
- format -0.0 as "0.0" (no minus sign) depending on underlying C
- sprintf implementation.
+ * ext/socket/init.c (rsock_socket): use SOCK_CLOEXEC if available.
- * test/xsd/test_xsd.rb, test/soap/test_basetype.rb: follow above change.
+Mon Oct 31 21:47:44 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * test/soap/calc/*: give httpd config param "CGIInterpreter".
- "/usr/bin/env ruby" thing does not work under non-Unix boxes.
+ * io.c (rb_cloexec_pipe): NetBSD 6.0 will support pipe2(2),
+ but its return value is -1 or larger than 0.
-Sat Oct 2 00:42:20 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Oct 31 22:04:54 2011 Tanaka Akira <akr@fsij.org>
- * marshal.c (r_byte): retrieve pointer from string value for each
- time. [ruby-dev:24404]
+ * ext/dbm/dbm.c (fdbm_initialize): use O_CLOEXEC if available.
- * marshal.c (r_bytes0): ditto.
+Mon Oct 31 21:47:48 2011 Tanaka Akira <akr@fsij.org>
- * enum.c (sort_by_i): re-entrance check added. [ruby-dev:24399]
+ * include/ruby/intern.h (rb_fd_fix_cloexec): renamed from
+ rb_fd_set_cloexec.
- * io.c (io_read): should freeze all reading buffer.
- [ruby-dev:24400]
+ * io.c: follow the above renaming.
- * string.c (rb_str_sum): should use bignums when bits is greater
- than or equals to sizeof(long)*CHAR_BITS. [ruby-dev:24395]
+ * ext/pty/pty.c: ditto.
- * eval.c (specific_eval): defer pointer retrieval to prevent
- unsafe sourcefile string modification. [ruby-dev:24382]
+ * ext/socket/init.c: ditto.
- * string.c (rb_str_sum): wrong cast caused wrong result.
- [ruby-dev:24385]
+ * ext/socket/socket.c: ditto.
- * enum.c (enum_sort_by): hide temporary array from
- ObjectSpace.each_object. [ruby-dev:24386]
+ * ext/socket/ancdata.c: ditto.
- * string.c (rb_str_sum): check was done with false pointer.
- [ruby-dev:24383]
+ * ext/socket/unixsocket.c: ditto.
- * string.c (rb_str_sum): string may be altered. [ruby-dev:24381]
+Mon Oct 31 21:02:43 2011 Tanaka Akira <akr@fsij.org>
-Thu Oct 2 00:25:21 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/resolv.rb (Resolv::DNS): retry IO.select for premature wakeup.
- * signal.c (ruby_signal_name): adjust to the prototype.
+Mon Oct 31 20:14:22 2011 Tanaka Akira <akr@fsij.org>
- * process.c (pst_inspect): ditto.
+ * io.c (fd_set_cloexec): clear CLOEXEC flag for standard file
+ descriptors.
+ (rb_cloexec_dup): use rb_cloexec_fcntl_dupfd.
+ (rb_cloexec_fcntl_dupfd): use F_DUPFD_CLOEXEC if available.
- * ext/etc/etc.c (etc_getgrent, Init_etc): typo.
+Mon Oct 31 19:14:11 2011 Tanaka Akira <akr@fsij.org>
-Wed Oct 1 20:49:41 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/resolv/test_dns.rb: don't check maximum slept time.
+ ruby doesn't guarantee the maximum time because it is not a
+ realtime application.
- * gc.c (heaps): manage slots and limits together. [ruby-dev:21453]
+Mon Oct 31 13:10:06 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * gc.c (add_heap): should not clear heaps slot even if realloc()
- failed.
+ * win32/win32.c (setfl): extract from fcntl().
-Wed Oct 1 20:36:49 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * win32/win32.c (dupfd): new function to support F_DUPFD. based on a
+ patch written by akr.
- * MANIFEST: add wince/mkconfig_wce.rb.
+ * win32/win32.c (fcntl): use above functions.
-Wed Oct 1 17:22:33 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/win32.h (F_DUPFD): define. [experimental]
- * ext/etc/etc.c: add new functions: setpwent, getpwent, endpwent,
- setgrent, getgrent, endgrent.
+ * include/ruby/win32.h (F_SETFL): change the value to correspond with
+ other platforms.
- * ext/socket/socket.c (sock_s_gethostbyname): do not reverse lookup.
+Mon Oct 31 12:37:50 2011 Tanaka Akira <akr@fsij.org>
-Wed Oct 1 17:01:30 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/pty/pty.c (get_device_once): use O_CLOEXEC for posix_openpt if
+ available.
- * eval.c (rb_load): Object scope had priority over required file
- scope. [ruby-dev:21415]
+Mon Oct 31 12:05:24 2011 Tanaka Akira <akr@fsij.org>
-Wed Oct 1 14:09:53 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
+ * io.c (rb_cloexec_dup2): check oldfd == newfd at first.
+ pointed by KOSAKI Motohiro. [ruby-dev:44713]
- * wince/mkconfig_wce.rb: sorry, forget to commit.
+Mon Oct 31 10:50:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Oct 1 10:08:42 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
+ * io.c (rb_cloexec_fcntl_dupfd): this function needs F_DUPFD.
- * wince/setup.mak: add sigmarionIII SDK support.
+ * io.c (nogvl_io_cntl): use rb_cloexec_fcntl_dupfd() only if the
+ platform has F_DUPFD.
- * wince/Makefile.sub: ditto.
+Mon Oct 31 00:50:00 2011 Luis Lavena <luislavena@gmail.com>
- * wince/mkexports.rb: fix linker error in SH4.
+ * configure.in: check -fno-omit-frame-pointer acceptance and usage
+ under MinGW. [ruby-core:39957] [Bug #5407]
- * wince/mkconfig_wce.rb: camouflage RUBY_PLATFORM for compiling ext.
+Mon Oct 31 00:16:11 2011 Tanaka Akira <akr@fsij.org>
-Wed Oct 1 08:02:52 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
+ * include/ruby/intern.h (rb_cloexec_fcntl_dupfd): declared.
- * wince/time_wce.c (time): add zero check.
+ * io.c (rb_cloexec_fcntl_dupfd): new function.
+ (nogvl_io_cntl): use rb_cloexec_fcntl_dupfd.
-Tue Sep 30 16:11:05 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (move_fds_to_avoid_crash): use rb_cloexec_fcntl_dupfd.
- * Makefile.in: copy lex.c from $(srcdir) if it's not the current
- directory. [ruby-dev:21437]
+Sun Oct 30 22:46:46 2011 Tanaka Akira <akr@fsij.org>
-Tue Sep 30 11:29:23 2003 Tanaka Akira <akr@m17n.org>
+ * configure.in: check pipe2.
- * process.c (pst_inspect): describe stopped process "stopped".
+ * io.c (rb_cloexec_pipe): use pipe2 if available.
-Tue Sep 30 09:31:56 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Oct 30 22:32:44 2011 Tanaka Akira <akr@fsij.org>
- * test/runner.rb: glob for directories.
+ * ruby.c (fill_standard_fds): use fstat() instead of fcntl(F_GETFD)
+ for MinGW. reported by Luis Lavena. [ruby-core:40526] [Bug #5516]
-Tue Sep 30 09:11:43 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Oct 30 21:12:47 2011 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_eval): while/until should not capture break unless
- they are destination of the break.
+ * include/ruby/intern.h (rb_cloexec_pipe): declared.
-Tue Sep 30 03:12:02 2003 Minero Aoki <aamine@loveruby.net>
+ * io.c (rb_cloexec_pipe): new function.
+ (rb_pipe): use rb_cloexec_pipe.
- * lib/net/http.rb (finish): revert to 1.93.
+ * thread_pthread.c (rb_thread_create_timer_thread): use
+ rb_cloexec_pipe.
- * lib/net/pop.rb (finish): revert to 1.60.
+Sun Oct 30 20:06:07 2011 Tanaka Akira <akr@fsij.org>
- * lib/net/smtp.rb (finish): revert to 1.67.
+ * io.c (rb_cloexec_dup): refine control flow.
+ (rb_cloexec_dup2): ditto.
- * lib/net/http.rb (do_start): ensure to close socket if failed to
- start session.
+Sun Oct 30 18:45:50 2011 Tanaka Akira <akr@fsij.org>
- * lib/net/pop.rb (do_start): ditto.
+ * ruby.c (fill_standard_fds): new function to open closed standard
+ file descriptors.
+ (ruby_sysinit): call fill_standard_fds.
- * lib/net/smtp.rb (do_start): ditto.
+Sun Oct 30 10:50:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/smtp.rb: SMTP#started? wrongly returned false always.
+ * tool/rbinstall.rb (install_recursive, bin-comm): split mere
+ string not path name. [ruby-core:40462] [Bug #5492]
-Tue Sep 30 02:54:49 2003 Minero Aoki <aamine@loveruby.net>
+Sun Oct 30 10:47:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_iterator.rb: new test
- test_break__nested_loop[123].
+ * io.c (rb_cloexec_dup, rb_cloexec_dup2): CLOEXEC has been set if
+ dup3 succeeded.
-Mon Sep 29 23:39:13 2003 Minero Aoki <aamine@loveruby.net>
+Sun Oct 30 09:58:48 2011 Tanaka Akira <akr@fsij.org>
- * lib/net/http.rb (finish): does not raise IOError even if
- !started?, to allow closing socket which was opened before
- session started.
+ * io.c (rb_cloexec_dup): don't allocate standard file descriptors.
- * lib/net/pop.rb (finish): ditto.
+Sun Oct 30 08:29:51 2011 Tanaka Akira <akr@fsij.org>
- * lib/net/smtp.rb (finish): ditto.
+ * io.c (rb_cloexec_dup2): don't set CLOEXEC for standard file
+ descriptors.
-Mon Sep 29 19:06:51 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Sun Oct 30 07:47:10 2011 Tanaka Akira <akr@fsij.org>
- * ext/win32ole/extconf.rb: add windows.h checking.
- (ruby-bugs:PR#1185)
+ * configure.in: check dup3.
-Mon Sep 29 16:18:30 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * io.c (rb_cloexec_dup2): use dup3 if available.
- * lib/logger.rb: check if the given logdevice object respond_to :write
- and :close, not is_a? IO. duck duck.
+Sat Oct 29 22:06:37 2011 Tanaka Akira <akr@fsij.org>
- * test/logger/test_logger.rb: self IO.pipe reading/writing may be
- locked by the flood. use tempfile.
+ * include/ruby/intern.h (rb_cloexec_dup2): declared.
- * lib/wsdl/xmlSchema/data.rb: wrong constant reference.
+ * io.c (rb_cloexec_dup2): new function.
+ (io_reopen): use rb_cloexec_dup2.
-Mon Sep 29 16:11:23 2003 Minero Aoki <aamine@loveruby.net>
+Sat Oct 20 21:08:18 2011 Tajima Akio <artonx@yahoo.co.jp>
- * test/fileutils/test_fileutils.rb: clean up temporary symlink.
- Patched by NaHi. [ruby-dev:21420]
+ * win32/Makefile.sub (CONFIG_H): have stdint.h if VC2010.
+ [Bug #5243]
-Mon Sep 29 11:16:55 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Oct 29 20:59:08 2011 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_thread_atfork): wrong format specifier.
- [ruby-dev:21428]
+ * io.c (rb_cloexec_dup): use F_DUPFD_CLOEXEC if available.
- * process.c (pst_inspect): better description.
+Sat Oct 29 20:00:26 2011 Tanaka Akira <akr@fsij.org>
-Mon Sep 29 02:31:44 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * include/ruby/intern.h (rb_cloexec_dup): declared.
- * lib/webrick/utils.rb (Utils::su): use setgid and setuid to
- set real and effective IDs. and setup group access list by
- initgroups.
+ * io.c (rb_cloexec_dup): new function.
+ (ruby_dup): use rb_cloexec_dup.
-Sun Sep 28 11:14:19 2003 Koji Arai <jca02266@nifty.ne.jp>
+ * ext/pty/pty.c (pty_getpty): use rb_cloexec_dup.
- * ext/digest/digest.c (Init_digest): `copy_object' was deprecated.
- `initialize_copy' should be defined.
+ * ext/openssl/ossl_bio.c (ossl_obj2bio): ditto.
- * ext/stringio/stringio.c (Init_stringio): ditto.
+Sat Oct 29 16:11:34 2011 Tanaka Akira <akr@fsij.org>
-Sat Sep 27 18:25:13 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/sdbm/_sdbm.c (sdbm_prep): use O_CLOEXEC if available.
- * lib/xsd/charset.rb: XSD::Charset.is_ces did return always true under
- $KCODE = "NONE" environment. check added.
+Sat Oct 29 14:26:56 2011 Tanaka Akira <akr@fsij.org>
- * test/xsd/test_xsd.rb: add tests for above fix.
+ * io.c (rb_cloexec_open): use O_CLOEXEC if available.
-Sat Sep 27 15:58:50 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sat Oct 29 12:57:15 2011 Tanaka Akira <akr@fsij.org>
- * lib/soap/rpc/cgistub.rb: make logging severity threshold higher.
+ * process.c (ruby_setsid): use rb_cloexec_open.
+ (rb_daemon): ditto.
- * lib/soap/rpc/standaloneServer.rb: defer WEBrick server start to give
- a chance to reset logging severity threshold.
+ * ruby.c (load_file_internal): ditto.
- * test/soap/calc/test_*, test/soap/helloworld/test_helloworld.rb: run
- silent.
+ * file.c (rb_file_s_truncate): ditto.
+ (file_load_ok): ditto.
-Sat Sep 27 09:44:18 2003 Minero Aoki <aamine@loveruby.net>
+ * random.c (fill_random_seed): ditto.
- * test/fileutils/test_fileutils.rb: clear all errors on Windows.
- [ruby-dev:21417]
+ * ext/pty/pty.c (chfunc): ditto.
+ (get_device_once): ditto.
- * test/fileutils/test_nowrite.rb: ditto.
+ * ext/io/console/console.c (console_dev): ditto.
-Mon Sep 27 09:14:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Oct 29 10:40:19 2011 Tanaka Akira <akr@fsij.org>
- * array.c (rb_ary_delete): comparison may change the capacity.
- [ruby-dev:24348]
+ * include/ruby/intern.h (rb_cloexec_open): declared.
- * array.c (rb_ary_fill): fill should honor length argument.
- [ruby-dev:24346]
+ * io.c (fd_set_cloexec): extracted from rb_fd_set_cloexec.
+ (rb_cloexec_open): new function.
+ (sysopen_func): use rb_cloexec_open.
+ (rb_sysopen_internal): use rb_update_max_fd instead of
+ rb_fd_set_cloexec.
- * array.c (rb_ary_replace): should not use ptr from shared array.
- [ruby-dev:24345]
+Sat Oct 29 09:05:07 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c (s_accept): don't retry for EWOULDBLOCK.
- [ruby-talk:113807]
+ * thread_pthread.h: no Structured Exception Handling like macros.
+ [ruby-core:40432] [Bug #5491]
-Sat Sep 27 04:57:07 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Fri Oct 28 22:05:34 2011 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_file.rb: new file. only asserts unlink-before-close
- behaviour now.
+ * ext/sdbm/_sdbm.c: RCS $Id$ removed.
- * test/soap/marshal/test_digraph.rb: should close before unlink.
- unlink-before-close pattern is not needed here.
+Thu Oct 27 18:58:00 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Sep 27 03:32:37 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * parse.y (parser_nextc): set encoding for the buffer of ripper.
- * test/soap/*, test/wsdl/*, test/xsd/*: move TestCase classes into
- each module namespace. TestMarshal in
- test/soap/marshal/test_marshal.rb crashed with
- test/ruby/test_marshal.rb.
+Fri Oct 28 06:06:08 2011 Tanaka Akira <akr@fsij.org>
-Sat Sep 27 01:30:59 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/sdbm/_sdbm.c (sdbm_prep): set FD_CLOEXEC flags for file
+ descriptors.
+ (fd_set_cloexec): new function.
- * ext/socket/socket.c (ruby_connect): on win32, type of the 4th
- argument of getsockopt is char *.
+Fri Oct 28 03:01:27 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Sep 26 18:35:40 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_cfunc): adding back useless hack. For some
+ reason, this fixes CFP errors on OS X 10.7.
- * lib/resolv-replace.rb: 1.8 compliance. [ruby-talk:82946]
+Fri Oct 28 00:09:31 2011 Tanaka Akira <akr@fsij.org>
-Fri Sep 26 17:39:27 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/sdbm/_sdbm.c (sdbm_prep): refactored for less nesting.
- * test/ruby/test_marshal.rb: add test for ruby's objects.
+Thu Oct 27 18:28:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Sep 26 09:52:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (RUBY_DEFINE_IF): revert r33534 partially to get
+ rid of AS_ECHO which is not available in autoconf 2.61.
+ [ruby-dev:44702]
- * defines.h (flush_register_windows): use volatile only for gcc on
- Solaris. [ruby-dev:21403]
+Thu Oct 27 16:10:46 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (xsystem): use system directly to honor shell meta
- charaters.
+ * bignum.c (rb_big_divide): raise ZeroDivisionError if divisor is
+ zero, as well as Fixnum. [ruby-core:40429] [Bug #5490]
-Fri Sep 26 00:10:13 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Thu Oct 27 14:56:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/README: updated.
+ * configure.in (RUBY_FUNC_ATTRIBUTE): unset temporary variable.
-Thu Sep 25 17:48:10 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * configure.in (RUBY_STACK_GROW_DIRECTION): substitute CPU name as
+ shell variable name. based on the patch by The Written Word Inc. at
+ [ruby-core:40421]. [Bug #5488]
- * ext/openssl/ossl.c (ossl_buf2str): fix type of 1st argument for
- rb_protect.
+Thu Oct 27 09:57:56 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl_hmac.c (ossl_hmac_digest): should return meaningful
- value.
+ * include/ruby/ruby.h (SIZE_MAX): define SIZE_MAX if not defined.
+ patched by The Written Word Inc. [ruby-core:40422] [Bug #5489]
-Thu Sep 25 09:00:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Thu Oct 27 08:47:38 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * lib/ostruct.rb: Added OpenStruct#==.
+ * ext/psych/parser.c: remove unused variable.
- * test/ostruct/test_ostruct.rb: Added.
+Thu Oct 27 08:38:41 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Thu Sep 25 07:55:26 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/extconf.rb: add -Wall flag by default when compiler is
+ GCC.
- * ext/win32ole/win32ole.c, ext/openssl/ossl_pkey_dsa.c,
- ext/openssl/ossl_pkey_rsa.c, ext/bigdecimal/bigdecimal.h: must
- not use C++ or C99 style comment yet. (ruby-bugs:PR#1184)
+Wed Oct 26 15:24:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Sep 25 00:23:22 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * file.c (rb_file_join): honor input encodings than ASCII-8BIT.
+ [ruby-core:40338] [Bug #5483]
- * MANIFEST: add SOAP4R.
+Tue Oct 25 21:52:31 2011 Tanaka Akira <akr@fsij.org>
-Thu Sep 25 00:13:15 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * include/ruby/defines.h: use "__sparc" instead of "sparc" and
+ "__sparc__".
- * lib/soap/* (29 files): SOAP4R added.
+ * dln.c: ditto.
- * lib/wsdl/* (42 files): WSDL4R added.
+ [ruby-dev:44694]
- * lib/xsd/* (12 files): XSD4R added.
+Tue Oct 25 06:34:39 2011 Eric Hodel <drbrain@segment7.net>
- * test/soap/* (16 files): added.
+ * re.c (match_aref): Use <code> around indexing examples to prevent
+ hyperlinks. [ruby-talk:389396]
- * test/wsdl/* (2 files): added.
+Mon Oct 24 23:55:31 2011 Tanaka Akira <akr@fsij.org>
- * test/xsd/* (3 files): added.
+ * complex.c: use "__sun" instead of "__sun__" to detect SunOS.
- * sample/soap/* (27 files): added.
+ * math.c: ditto.
- * sample/wsdl/* (13 files): added.
+ * hash.c: ditto.
-Wed Sep 24 02:08:11 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * atomic.h: ditto.
- * lib/webrick/httpservlet/cgihandler.rb: conform to mswin32.
- [ruby-talk:82735], [ruby-talk:82748], [ruby-talk:82818]
+ * ext/io/wait/wait.c: ditto.
-Tue Sep 23 23:10:16 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ [ruby-dev:44693]
- * lib/logger.rb: add Logger#<<(msg) for writing msg without any
- formatting.
+Mon Oct 24 22:45:37 2011 Tanaka Akira <akr@fsij.org>
- * test/logger/test_logger.rb: ditto.
+ * io.c: use "__sun" instead of "sun" to detect SunOS.
-Tue Sep 23 20:47:51 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * dln.c: ditto.
- * error.c (rb_warn_m): should not warn if -W0 is specified.
- [ruby-talk:82675]
+ * cont.c: ditto.
-Mon Sep 22 21:28:57 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * ext/sdbm/_sdbm.c: ditto.
- * MANIFEST: updated.
+ [ruby-dev:44693]
-Mon Sep 22 19:22:26 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Oct 24 22:38:08 2011 Tanaka Akira <akr@fsij.org>
- * configure.in (AC_CHECK_FUNCS): add setuid and setgid.
+ * ext/pty/pty.c (get_device_once): delay rb_fd_set_cloexec() until
+ grantpt() on Solaris. grantpt() doesn't work with CLOEXEC on
+ Solaris 10.
+ reported by Naohisa GOTO. [ruby-dev:44688] [Bug #5475]
-Mon Sep 22 12:34:55 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Oct 24 08:18:14 2011 Tanaka Akira <akr@fsij.org>
- * util.c (ruby_strtod): skip preceding zeros before counting
- digits in the mantissa. (ruby-bugs:PR#1181)
+ * io.c (copy_stream_fallback_body): check nil for EOF of read method.
+ patch by Eric Wong. [ruby-core:39134] [Bug #5237]
-Sun Sep 21 04:12:36 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Oct 23 18:21:23 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * ext/openssl/ossl_ocsp.c (ossl_ocspreq_initialize): the argument
- should be a String.
+ * ext/tk/MANUAL_tcltklib.eng: fix typo.
- * ext/openssl/ossl_ocsp.c (ossl_ocspres_initialize): ditt.
+Sun Oct 23 18:03:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): ditto.
+ * numeric.c (rb_infinity, rb_nan): aggregated member initializers
+ need braces.
- * ext/openssl/ossl_x509ext.c (ossl_x509ext_initialize): ditto.
+Sun Oct 23 16:43:43 2011 Naohisa Goto <ngotogenome@gmail.com>
- * ext/openssl/ossl_x509ext.c (ossl_x509ext_set_value): ditto.
+ * ext/io/wait/wait.c: ioctl(2) is declared in unistd.h on Solaris.
-Sat Sep 20 11:49:05 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sun Oct 23 16:33:35 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/logger.rb: typo fixed.
+ * ext/tk/MANUAL_tcltklib.eng: fix typo. reported by Mimura-san.
+ [ruby-dev:44683] [Bug #5471]
- * test/logger/test_logger.rb: new file.
+Sun Oct 23 08:01:29 2011 Tanaka Akira <akr@fsij.org>
-Fri Sep 19 11:39:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * io.c (rb_fd_set_cloexec): set close-on-exec flag only if F_GETFD is
+ defined. reported by Luis Lavena. [ruby-core:40281] [Bug #5470]
- * test/testunit/*: Added.
+Sat Oct 22 19:48:50 2011 Tanaka Akira <akr@fsij.org>
- * lib/test/unit.rb: Documentation update.
+ * test/openssl/test_ssl.rb (test_multibyte_read_write): start server
+ for each length to avoid race condition.
- * lib/test/unit/ui/console/testrunner.rb (TestRunner#initialize):
- Ditto.
+Sat Oct 22 18:49:24 2011 Tanaka Akira <akr@fsij.org>
- * lib/test/unit.rb: Factored out an ObjectSpace collector.
+ * include/ruby/intern.h (rb_fd_set_cloexec): declared.
- * lib/test/unit/collector/objectspace.rb: Ditto.
+ * io.c (rb_fd_set_cloexec): new function.
+ (ruby_dup): call rb_fd_set_cloexec to set close-on-exec flag.
+ (rb_sysopen_internal): ditto.
+ (rb_pipe): ditto.
+ (io_reopen): ditto.
+ (io_cntl): ditto.
- * sample/testunit/*: Added.
+ * process.c (rb_f_exec): change the default :close_others option to
+ true.
+ (rb_f_system): ditto.
+ (move_fds_to_avoid_crash): call rb_fd_set_cloexec to set
+ close-on-exec flag.
+ (ruby_setsid): ditto.
+ (rb_daemon): ditto.
-Fri Sep 19 01:00:48 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * thread_pthread.c (rb_thread_create_timer_thread): call
+ rb_fd_set_cloexec to set close-on-exec flag.
- * lib/webrick/log.rb (BasicLog#log): get rid of as ineffectual
- condition.
+ * ruby.c (load_file_internal): ditto.
- * lib/webrick/log.rb (BasicLog#format): add "\n" to message.
+ * file.c (rb_file_s_truncate): ditto.
+ (file_load_ok): ditto.
-Thu Sep 18 22:43:20 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * random.c (fill_random_seed): ditto.
- * eval.c (proc_invoke): should push PROT_PCALL tag for orphans.
+ * ext/pty/pty.c (chfunc): ditto.
+ (get_device_once): ditto.
- * eval.c (proc_invoke): should update "result" for orphans.
+ * ext/openssl/ossl_bio.c (ossl_obj2bio): ditto.
-Thu Sep 18 20:33:03 2003 Tietew <tietew-ml-ruby-list@tietew.net>
+ * ext/socket/init.c (rsock_socket): ditto.
+ (rsock_s_accept_nonblock): ditto.
+ (rsock_s_accept): ditto.
- * parse.y (str_xquote): do not prepend escapes in
- backqoute literals. [ruby-list:38409]
+ * ext/socket/socket.c (rsock_sock_s_socketpair): ditto.
-Thu Sep 18 20:30:17 2003 Tanaka Akira <akr@m17n.org>
+ * ext/socket/ancdata.c (discard_cmsg): ditto.
+ (make_io_for_unix_rights): ditto.
- * lib/pathname.rb: update document.
+ * ext/socket/unixsocket.c (unix_recv_io): ditto.
-Thu Sep 18 15:27:05 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/io/console/console.c (console_dev): ditto.
- * lib/logger.rb: new file. Logger, formerly called devel-logger or
- Devel::Logger.
+ [ruby-core:38140] [Feature #5041]
- * sample/logger/*: new file. samples of logger.rb.
+Sat Oct 22 17:46:27 2011 Tanaka Akira <akr@fsij.org>
-Wed Sep 17 23:41:45 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/resolv.rb: fix a exception name in previous patch.
- * eval.c (localjump_destination): should not raise ThreadError
- exception for "break". [ruby-dev:21348]
+Sat Oct 22 17:43:33 2011 Tanaka Akira <akr@fsij.org>
- * eval.c (proc_invoke): use result instead of prot_tag->retval.
- retval is no longer propagated to the ancestors.
+ * lib/resolv.rb: make timeout configurable for DNS query.
+ patch by Eric Wong. [ruby-core:38533] [Feature #5100]
-Wed Sep 17 20:34:00 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Oct 22 02:07:48 2011 Naohisa Goto <ngotogenome@gmail.com>
- * parse.y (tokadd_string, parse_string, yylex): escaped terminator
- is now interpreted as is. [ruby-talk:82206]
+ * numeric.c (rb_infinity, rb_nan): use union to prevent bus error
+ caused by misalignment. [Bug #5469] [ruby-dev:44657]
-Wed Sep 17 18:52:36 2003 Minero Aoki <aamine@loveruby.net>
+ * include/ruby/missing.h (INFINITY, NAN): ditto
- * test/fileutils/fileassertions.rb: new file.
+Fri Oct 21 22:02:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/fileutils/test_fileutils.rb: new file.
+ * gc.c (initial_params): pack in a struct.
- * test/fileutils/test_nowrite.rb: new file.
+ * gc.c (rb_gc_set_params): set parameters always.
+ [ruby-dev:44648] [Bug #5467]
-Wed Sep 17 18:51:02 2003 Minero Aoki <aamine@loveruby.net>
+Fri Oct 21 12:10:20 2011 Naohisa Goto <ngotogenome@gmail.com>
- * test/strscan/test_stringscanner.rb: require test/unit.
+ * atomic.h: change Solaris checking macro because atomic_ops can work
+ not only with Sun Studio but also with Fujitsu C Compiler.
-Wed Sep 17 18:35:34 2003 Minero Aoki <aamine@loveruby.net>
+Fri Oct 21 02:11:00 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * test/strscan/test_stringscanner.rb: new file.
+ * ext/openssl/ossl_ns_spki.c: Complete documentation.
+ * test/openssl/test_ns_spki.rb: Integrate SPKI#to_text.
-Wed Sep 17 18:03:30 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Oct 20 22:47:28 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl: all files are reviewed to simplify and avoid memory leak.
+ * win32/win32.c (socklist_insert, socklist_lookup, socklist_delete):
+ new functions to wrap of st_insert(), st_lookup() and st_delete() to
+ socklist.
+ allocating socklist is deferred until it is really needed.
- * ext/openssl/extconf.rb: add check for assert.h.
+ * win32/win32.c (exit_handler): delete socklist only if it is
+ initialized.
- * ext/openssl/ossl.c (ossl_buf2str): new function to convert
- C buffer to String and free buffer.
+ * win32/win32.c (rb_w32_sysinit, StartSockets): refactoring: move
+ initialization of select_mutex to StartSockets().
- * ext/openssl/ossl.c (ossl_x509_ary2sk): new function to convert
- Array of OpenSSL::X509 to STACK_OF(X509) with exception safe.
+ * win32/win32.c (exit_handler): refactoring: delete select_mutex only
+ if winsock is used.
- * ext/openssl/ossl.c (ossl_to_der, ossl_to_der_if_possible): new
- functions to convert object to DER string.
+Thu Oct 20 22:38:53 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/openssl/ossl.h: ditto.
+ * ext/openssl/ossl_pkcs5.c: add note on timing attacks and general
+ documentation.
- * ext/openssl/ossl_bio.c (ossl_membio2str): new function to convert
- BIO to String object and free BIO.
+Thu Oct 20 21:19:15 2011 Naohisa Goto <ngotogenome@gmail.com>
- * ext/openssl/ossl_bio.h: ditto.
+ * vm_eval.c (check_funcall): set array elements one-by-one to fix
+ compile error with Fujitsu C Compiler 5.6 on Solaris 10 on Sparc.
+ [Bug #5464] [ruby-dev:44632]
- * ext/openssl/ossl_pkcs7.c (ossl_pkcs7_to_der): add for "to_der".
+Thu Oct 20 13:09:35 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_x509name.c (ossl_x509name_to_der): ditto.
+ * include/ruby/defines.h (flush_register_windows): use software
+ trap on Debian Sparc 32-bit userspace. [Bug #5244]
- * ext/openssl/ossl_x509ext.c (ossl_x509ext_to_der): ditto.
+Thu Oct 20 12:28:22 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/openssl/ossl_x509ext.c (create_ext_from_array): removed
- and reimplement in openssl/x509.rb.
+ * test/openssl/test_pkcs5.rb: add RFC 6070 tests for PBKDF2 with
+ HMAC-SHA1
- * ext/openssl/ossl_x509attr.c: reimplemented and disable some
- method temporarily. this class doesn't work fine without ASN.1
- data support;-) I'll rewrite in near future.
+Thu Oct 20 11:42:23 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/lib/openssl/x509.c (X509::Attribute): get rid off
- unused code.
+ * util.c (mmprepare): fix for fragmental size.
- * ext/openssl/lib/openssl/x509.c (X509::ExtensionFactory): refine all.
+ * util.c (mmswap_, mmrot3_): portability improvement.
-Tue Sep 16 22:25:06 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Thu Oct 20 05:58:02 2011 Eric Hodel <drbrain@segment7.net>
- * test/csv/test_csv.rb: add negative tests of row_sep.
+ * ext/openssl/ossl_ns_spki.c (Init_ossl_ns_spki): Stub documentation
+ for Netscape SPKI.
-Tue Sep 16 18:02:36 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Oct 20 05:13:39 2011 Ryan Davis <ryand-ruby@zenspider.com>
- * regex.c (re_compile_pattern): should not translate character
- class range edge. [ruby-list:38393]
+ * lib/minitest/*: Imported minitest 2.6.2 (r6712)
+ * test/minitest/*: ditto
-Tue Sep 16 16:47:56 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Thu Oct 20 06:55:32 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * MANIFEST: add test/csv/mac.csv.
+ * lib/openssl/buffering.rb: Force multi-byte strings to be treated as
+ binary data.
+ * test/openssl/test_ssl.rb: Add test for it.
- * win32/Makefile.sub, bcc32/Makefile.sub (test): add phony NUL target.
+ Thanks to Niklas Baumstark for reporting the issue!
-Mon Sep 15 19:02:52 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ [Ruby 1.9 - Bug #5233] [ruby-core:39120]
- * lib/csv.rb: add extra pamameter to specify row(record) separater
- character. To parse Mac's CR separated CSV, do like this.
- CSV.open("mac.csv", "r", ?,, ?\r) { |row| p row.to_a }
- The 3rd parameter in this example ?, is for column separater and the
- 4th ?\r is for row separater. Row separater is nil by default. Nil
- separater means "\r\n" or "\n".
+Wed Oct 19 17:06:54 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
- * test/csv/test_csv.rb: add tests for above feature.
+ * version.h (RUBY_VERSION): finally declare start of 2.0 work!
- * test/csv/mac.csv: added. Sample CR separated CSV file.
+Wed Oct 19 11:48:44 2011 Eric Hodel <drbrain@segment7.net>
-Fri Sep 12 22:41:48 2003 Michal Rokos <m.rokos@sh.cvut.cz>
+ * error.c (Init_Exception): Document $! and $@. Provide
+ recommendations for creating exceptions for a library.
- * ext/openssl/ossl.c: move ASN.1 stuff to ossl_asn1.[ch]
+Wed Oct 19 11:25:46 2011 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl.c: move BIO stuff to ossl_bio.[ch]
+ * error.c (Init_Exception): Add hierarchy of Exception subclasses.
+ Based on patch by Sylvain Daubert. [Ruby 1.9 - Bug #5438]
- * ext/openssl/ossl_asn1.[ch]: new files
+Wed Oct 19 11:04:47 2011 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_bio.[ch]: new files
+ * enum.c: Reformat block args to a single standard, { |args| ... }.
+ Patch by b t. [Ruby 1.9 - Bug #5393]
-Fri Sep 12 12:30:41 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Oct 19 12:11:26 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * intern.h (rb_disable_super, rb_enable_super): replace with dummy
- expressions instead of prototypes. the functions remain yet for
- binary compatibility. [ruby-talk:81758]
+ * ext/openssl/ossl_ssl.c: Remove set, but unused variables.
+ ext/openssl/ossl_pkey.c: ditto
-Fri Sep 12 12:09:54 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/openssl/ossl_pkey_dh.c: Make functions passed to
+ rb_thread_blocking_region return VALUE instead of void.
+ ext/openssl/ossl_pkey_dsa.c: ditto
+ ext/openssl/ossl_pkey_rsa.c: ditto
- * bignum.c (rb_big_and): convert argument using 'to_int'.
+Tue Oct 18 23:28:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (rb_big_or): ditto.
+ * hash.c (identhash): share with type_numhash.
- * bignum.c (rb_big_xor): ditto.
+ * st.c (st_hashtype_num): rename from type_numhash.
-Fri Sep 12 07:06:14 2003 David Black <dblack@superlink.net>
+Tue Oct 18 23:07:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/scanf.rb: Took out useless @matched_item variable; some small
- refactoring.
+ * vm_core.h (ruby_current_thread): probeprofiler has been removed
+ long ago.
-Thu Sep 11 08:43:44 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Oct 18 23:05:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_f_require): allow "require" on $SAFE>0, if feature
- name is not tainted.
+ * ext/ripper/eventids2.c (ripper_init_eventids2): separate
+ initializations of IDs and objects.
- * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::stream):
- Supports StringIO.
+ * ext/ripper/tools/generate.rb (generate_eventids1): ditto.
-Wed Sep 10 22:47:30 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * parse.y (Init_ripper, InitVM_ripper): fix inversed roles.
- * ext/openssl/ossl.h: add a workaround for win32 platform.
- libeay32.dll doesn't export functions defined in conf_api.h.
+Sun Oct 16 19:46:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_config.c (ossl_config_initialize): ditto.
+ * ext/bigdecimal/bigdecimal.gemspec (files): fixed typo, and
+ removed nonexistent file.
- * ext/openssl/ossl_config.c (ossl_config_add_value): ditto.
+ * ext/bigdecimal/bigdecimal.gemspec (homepage): added.
- * ext/openssl/ossl_config.c (set_conf_section_i): should check
- if the argument is Array.
+ * ext/io/console/io-console.gemspec (homepage): ditto.
-Wed Sep 10 22:41:54 2003 Tietew <tietew@tietew.net>
+Fri Oct 14 12:13:57 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (win32_get_exception_list): avoid VC7 warning.
- [ruby-win32:577]
+ * ext/pty/pty.c (pty_check): should return nil until the child
+ terminates or stops. [ruby-dev:44600] [Bug #2642]
-Tue Sep 9 10:39:51 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Oct 14 11:19:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (struct tag): dst should be VALUE.
+ * include/ruby/intern.h (rb_ary_rotate): export.
-Tue Sep 9 10:39:51 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Oct 14 05:58:05 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (localjump_destination): stop at the scope where the current
- block was created. [ruby-dev:21353]
+ * atomic.h (ATOMIC_INC, ATOMIC_DEC): return old values.
+ [ruby-dev:44596] [Bug #5439]
-Tue Sep 9 05:17:04 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * signal.c (ruby_atomic_exchange): no needs to define on the
+ platforms where atomic.h is available.
- * ext/openssl/ossl_config.rb: avoid compile error in OpenSSL-0.9.6.
+Thu Oct 13 19:29:40 2011 Naohisa Goto <ngotogenome@gmail.com>
-Tue Sep 9 02:41:35 2003 Michal Rokos <m.rokos@sh.cvut.cz>
+ * atomic.h (ATOMIC_*): use atomic_ops(3C) when SunStudio on Solaris.
+ [ruby-dev:44596] [Bug #5439]
- * ext/openssl/ossl_config.c: Refine compatibility.
+Thu Oct 13 18:13:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Sep 9 01:50:45 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * atomic.h(ATOMIC_SET): add cast to void to prevent misuse.
+ [ruby-dev:44596] [Bug #5439]
- * lib/webrick/httpserver.rb (HTTPServer#access_log): add "\n" to
- the message.
+Thu Oct 13 18:04:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/log.rb (BasicLog#log): add "\n" only if needed.
+ * gc.c (rb_gc_finalize_deferred, rb_objspace_call_finalizer):
+ should use ATOMIC_EXCHANGE() to check the previous value.
+ [ruby-dev:44596] [Bug #5439]
-Mon Sep 8 22:15:33 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Oct 12 23:39:58 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * ext/tk/lib/multi-tk.rb: modify security check at creating
- a new interpreter
+ * test/openssl/test_ssl.rb: Move duplicated tests for SSL::Session to
+ test_ssl_session.rb
-Mon Sep 8 20:00:12 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 11 08:49:40 2011 Eric Hodel <drbrain@segment7.net>
- * lib/optparse.rb, lib/optparse/version.rb: search also all
- capital versions.
+ * array.c (rb_ary_initialize): Improve explanation of Array.new
+ parameters. Patch by Alvaro Pereyra Rabanal. [Ruby 1.9 - Bug #5425]
+ * array.c (rb_ary_s_try_convert): Fix typo (try => tries)
+ * array.c (rb_ary_rindex): Add spacing for block.
+ * array.c (rb_ary_uniq_bang): Describe block
+ * array.c (rb_ary_uniq): ditto
-Mon Sep 8 19:26:33 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Oct 11 07:55:38 2011 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl.h: include openssl/conf.h and openssl/conf_api.h.
+ * array.c: Add a description to Array, minor cleanups. Patch by
+ Andrea Singh. [Ruby 1.9 - Bug #5412]
- * ext/openssl/ossl_config.c: refine all with backward compatibility.
+Tue Oct 11 06:09:52 2011 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_config.h: export GetConfigPtr() and DupConfigPtr().
+ * lib/pp.rb: Move PP documentation to top of class PP. Patch by
+ Sylvain Daubert. [Ruby 1.9 - Bug #5430]
- * ext/openssl/ossl_x509.c: added new constants under X509 module.
- DEFAULT_CERT_AREA, DEFAULT_CERT_DIR, DEFAULT_CERT_FILE,
- DEFAULT_CERT_DIR_ENV, DEFAULT_CERT_FILE_ENV and DEFAULT_PRIVATE_DIR.
+Tue Oct 11 06:06:29 2011 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_x509ext.c (ossl_x509extfactory_free): don't free
- the members of the struct. it's left to GC.
+ * ext/coverage/coverage.c (Init_coverage): Change list format and
+ describe Coverage.result output. Patch by Sylvain Daubert.
+ [Ruby 1.9 - Bug #5428]
- * ext/openssl/ossl_x509ext.c (ossl_x509_set_config): add for config=.
+Tue Oct 11 05:53:23 2011 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_x509ext.c (Xossl_x509extfactory_initialize):
- add attr readers: issuer_certificate, subject_certificate,
- subject_request, crl and config.
+ * object.c (Init_Object): Add reference to BasicObject, brief
+ explanation of constant lookup. Based on patch by Alvaro Pereyra
+ Rabanal.
+ [Ruby 1.9 - Bug #5426]
-Mon Sep 8 18:26:41 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Oct 9 11:06:52 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * lib/webrick/accesslog.rb (AccessLog::setup_params): use req.port
- instead of config[:Port] or req.request_uri.port.
+ * test/psych/test_yamldbm.rb: don't run test if the system
+ don't support yaml/dbm.
- * lib/webrick/httprequest.rb (HTTPRequest#meta_vars): ditto.
+ * test/syck/test_yamldbm.rb: ditto.
- * lib/webrick/httpservlet/filehandler.rb (FileHandler#dir_list): ditto.
+Sat Oct 8 08:54:56 2011 Eric Hodel <drbrain@segment7.net>
- * lib/webrick/config.rb: :Listen option never be used.
+ * enum.c (group_by): Improve group_by description. Patch by b t.
+ [#5411]
- * lib/webrick/server.rb (GenericServer#initialize): don't use :Listen
- option and add warning message.
+Sat Oct 8 03:17:51 2011 Eric Hodel <drbrain@segment7.net>
- * lib/webrick/log.rb (BasicLog#<<): shortcut of log(INFO, ...).
+ * lib/shell.rb: Document some methods of Shell. Patch by Carol
+ Nichols. [Ruby 1.9 - Bug #5417]
- * lib/webrick/httpserver.rb (HTTPServer#accesslog): use << for logging.
+Fri Oct 7 17:54:28 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Sep 7 16:08:28 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/test/unit/assertions.rb (assert_send, assert_not_send):
+ parenthesize non-empty arguments.
- * ext/tcltklib/tcltklib.c (lib_mainloop_core): fixed signal-trap bug
+Fri Oct 7 06:35:50 2011 Eric Hodel <drbrain@segment7.net>
- * ext/tk/lib/*.rb : Ruby/Tk works at $SAFE == 4
+ * array.c: Use + for arguments described in documentation to allow
+ rdoc -C2 to work better. Remove <code> from method references to
+ allow cross-references in HTML documentation.
-Sat Sep 6 02:26:34 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Thu Oct 6 18:46:23 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * test/ruby/test_*.rb: assert_same, assert_match, and so on.
+ * vm_eval.c (make_no_method_exception): fix typo.
-Sat Sep 6 18:45:46 2003 Mauricio Fernandez <batsman.geo@yahoo.com>
+ * vm_insnhelper.c, vm_insnhelper.h: ditto.
- * parse.y (assignable): call rb_compile_error(), not rb_bug().
- [ruby-core:01523]
+Thu Oct 6 16:29:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Sep 6 17:40:41 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * vm_eval.c (make_no_method_execption): extract from
+ raise_method_missing().
- * ext/openssl/ruby_missing.c: rid of unnecessary backward
- compatibility stuff. and remove DEFINE_ALLOC_WRAPPER from
- all sources.
+ * vm_eval.c (send_internal): remove inadvertent symbol creation
+ from public_send. based on a patch by Jeremy Evans <code AT
+ jeremyevans.net> in [ruby-core:38576]. [Feature #5112]
- * ext/openssl/ossl_x509ext.c (X509::Extension.new): new method.
+ * vm_insnhelper.c (vm_call_method): remove inadvertent symbol
+ creation from send and __send__, too.
- * ext/openssl/ossl_x509ext.c (X509::Extension#oid=): new method.
+Thu Oct 6 14:59:11 2011 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_x509ext.c (X509::Extension#value=): new method.
+ * lib/time.rb: Clean up Time documentation. Patch by Jake Goulding.
+ [Ruby 1.9 - Bug #5416]
- * ext/openssl/ossl_x509ext.c (X509::Extension#critical=): new method.
+Thu Oct 6 10:00:54 2011 Eric Hodel <drbrain@segment7.net>
-Sat Sep 6 01:23:22 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * enum.c (group_by): Improve documentation based on patch by b t.
- * win32/win32.c (CreateChild): need to quote cmd if RUBYSHELL is set.
+Thu Oct 6 09:56:30 2011 Eric Hodel <drbrain@segment7.net>
- * win32/win32.c (CreateChild): fix condition about whether to call
- shell or not.
+ * enum.c: Clean up wording in Enumerable documentation. Patch by b t.
+ [Ruby 1.9 - Bug #5411]
-Sat Sep 6 00:36:20 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+Thu Oct 6 09:17:18 2011 Eric Hodel <drbrain@segment7.net>
- * Makefile.in (test): phony target.
+ * time.c (Init_Time): Remove editorial comments from Time
+ documentation, fix link.
- * lib/mkmf.rb (have_library, find_library): configure by library
- name.
+Thu Oct 6 09:14:20 2011 Eric Hodel <drbrain@segment7.net>
- * lib/optparse.rb (OptionParser#order, #permute, #parse): allow an
- array as argument.
+ * time.c (Init_Time): Improve Time documentation. Patch by Shane
+ Emmons. [Ruby 1.9 - Bug #5404]
+ * lib/time.rb: Improve time.rb documentation including Time.strptime.
+ Patch by Shane Emmons. [Ruby 1.9 - Bug #5402]
- * test/ruby/test_*.rb: moved invariants to left side in
- assert_equal, and use assert_nil, assert_raises and so on.
+Thu Oct 6 08:54:05 2011 Eric Hodel <drbrain@segment7.net>
- * win32/win32.c (isInternalCmd): distinguish command.com and
- cmd.exe.
+ * random.c: Improve documentation of Random. Patch by Gregory
+ Parkhurst. [Ruby 1.9 - Bug #5410]
- * win32/win32.c (make_cmdvector): a character just after wildcard
- was ignored. [ruby-core:01518]
+Thu Oct 6 01:44:51 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Fri Sep 5 20:27:08 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * cont.c (cont_mark): mark original Thread object from saved_thread.
+ [ruby-dev:44571] [Bug #5386]
- * test/ruby/test_*.rb: replace 'assert(a == b)' with assert_equal(a, b)'
+Wed Oct 5 16:33:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Sep 5 18:00:51 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * vm_insnhelper.c (vm_call_cfunc): remove useless hack.
- * ext/openssl/lib/openssl/x509.rb: new method X509::Name::parse.
+Wed Oct 5 05:56:39 2011 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_digest.c: add ossl_digest_new().
+ * hash.c (Init_Hash): Improve Hash documentation. Patch by Alvaro
+ Pereyra Rabanal. [Ruby 1.9 - Bug #5405]
- * ext/openssl/ossl_digest.h: ditto.
+Wed Oct 5 05:47:59 2011 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_cipher.c: add ossl_cipher_new().
+ * random.c (Init_Random): Add a top-level comment for Random. Patch
+ by Brett Bim. [Ruby 1.9 - Bug #5403]
- * ext/openssl/ossl_cipher.h: ditto.
+Wed Oct 5 02:50:27 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Sep 5 15:32:04 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/lib/psych/syntax_error.rb: Add file, line, offset, and
+ message attributes during parse failure.
+ * ext/psych/parser.c: Update parser to raise exception with correct
+ values.
+ * test/psych/test_exception.rb: corresponding tests.
- * misc/ruby-mode.el (ruby-font-lock-maybe-here-docs): should not
- search delimiter forward if found in backward.
+Wed Oct 5 01:52:16 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Sep 5 13:32:48 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/parser.c (parse): Use context_mark for indicating error
+ line and column.
- * test/runner.rb: arguments should be keys.
+Wed Oct 5 01:22:08 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Sep 5 12:09:55 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * ext/psych/lib/psych/scalar_scanner.rb: use normal begin / rescue
+ since postfix rescue cannot receive the exception class. Thanks
+ nagachika!
- * test/ruby/test_system.rb (test_system): check existence of ruby
- interpreter.
+Tue Oct 4 21:10:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Sep 5 11:32:17 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * class.c (class_alloc): allocate extra memory after containing
+ object setup to get rid of rare-but-potential memory leak.
- * lib/optparse.rb (--version): fix assignment/reference order.
+ * gc.c (gc_mark_children): skip marking extended members if ptr is
+ NULL.
- * lib/optparse.rb (OptionParser#help): new; OptionParser#to_s may
- be deprecated in future.
+Tue Oct 4 16:17:50 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/optparse/version.rb (OptionParser#show_version): hide Object.
+ * lib/time.rb (Time.strptime): use Time.at if d[:seconds] is set.
+ Reported by Christopher Eberz. [ruby-core:39903] Bug #5399
- * test/runner.rb: fix optparse usage.
+Tue Oct 4 11:44:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * test/runner.rb: glob all testsuits if no tests given.
+ * gc.c (rb_gc_set_params): ruby_verbose can be Qnil, so use RTEST.
-Fri Sep 5 10:42:58 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Tue Oct 4 08:33:41 2011 Eric Hodel <drbrain@segment7.net>
- * test/runner.rb: added. gets testcases from command line and runs it.
+ * ext/etc/etc.c: Document Etc, Etc.sysconfdir, Etc.systmpdir. Patch
+ by mathew murphy. [Ruby 1.9 - Bug #5396]
- * test/ruby/test_gc.rb: remove useless part which was for dumping test
- result.
+Tue Oct 4 08:21:51 2011 Eric Hodel <drbrain@segment7.net>
-Fri Sep 5 09:28:59 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/shellwords.rb: Update toplevel comment with an example. Patch
+ by Samnang Chhun. [Ruby 1.9 - Bug #5388]
- * test/ruby/test_gc.rb: added. splitter.rb which I made to split
- sample/test.rb into test/ruby/test_* kindly removed GC test (the
- last section in the original test) to reduce things to be worried.
+Tue Oct 4 08:15:50 2011 Eric Hodel <drbrain@segment7.net>
-Fri Sep 5 03:00:04 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * proc.c (proc_call): Update documentation to match argument handling
+ of proc/Proc.new/lambda/->()
- * test/ruby/test_iterator.rb (test_block_in_arg): add no block
- given tests.
+Tue Oct 4 07:59:16 2011 Eric Hodel <drbrain@segment7.net>
- * test/ruby/test_iterator.rb (test_ljump): uncomment LocalJumpError
- test.
+ * proc.c (proc_call): Fix documentation of Proc#call vs Proc#===.
+ [Ruby 1.9 - Bug #5349]
-Fri Sep 5 01:10:11 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Tue Oct 4 07:43:18 2011 Eric Hodel <drbrain@segment7.net>
- * test/ruby: tests for ruby itself.
+ * array.c (rb_ary_initialize): Make Array.new description match
+ call-seq. Patch by Henry Maddocks. [Ruby 1.9 - Bug #5344]
- * test/ruby/test_*.rb: split sample/test.rb into 28 test/unit testcases.
- some tests could not be translates... search '!!' mark to see it.
+Tue Oct 4 07:35:23 2011 Eric Hodel <drbrain@segment7.net>
- * test/csv/test_csv.rb: should require 'csv', not '../lib/csv'. test
- runner should set load path correctly.
+ * array.c (rb_ary_initialize): Add output for examples. Patch by
+ Jonathan Mukai. [Ruby 1.9 - Bug #5216]
-Fri Sep 5 01:03:59 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Tue Oct 4 07:30:50 2011 Eric Hodel <drbrain@segment7.net>
- * test/csv/test_csv.rb: close opened files for CSV::IOBuf explicitly.
- opened file cannot be removed under win32 box.
+ * array.c (rb_ary_s_create): Add example results for Array::[]. Patch
+ by Jonathan Mukai. [Ruby 1.9 - Bug #5215]
-Thu Sep 4 23:59:40 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 4 07:15:17 2011 Eric Hodel <drbrain@segment7.net>
- * parse.y (tokadd_string): newlines have no special meanings in
- %w/%W, otherwise they are ignored only when interpolation is
- enabled. [ruby-dev:21325]
+ * lib/rubygems: Update to RubyGems 1.8.11. Move Deprecate into the
+ Gem namespace.
-Thu Sep 4 19:38:25 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Tue Oct 4 06:43:47 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/io/wait/.cvsignore: added.
+ * ext/psych/lib/psych.rb: update psych version.
+ * ext/psych/psych.gemspec: generate new gemspec for new version.
- * ext/openssl/.cvsignore: added.
+Tue Oct 4 06:29:55 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Sep 4 19:28:24 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/psych/lib/psych.rb: calling `yaml` rather than `to_yaml`.
+ * ext/psych/lib/psych/nodes/node.rb: Rename `to_yaml` to just `yaml`
+ in order to avoid YAML::ENGINE switching from replacing this method.
+ * test/psych/helper.rb: fix tests for method name change.
+ * test/psych/test_document.rb: ditto
+ * test/psych/visitors/test_emitter.rb: ditto
- * sample/openssl: added. Sample of standard distribution library
- should be locate in sample/{module_name}/*.
+Tue Oct 4 06:20:19 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/openssl/sample/*: removed. move to sample/openssl/*.
+ * ext/psych/lib/psych/scalar_scanner.rb: Match values against the
+ floating point spec defined in YAML to avoid erroneous parses.
+ * test/psych/test_numeric.rb: corresponding test.
-Thu Sep 4 18:02:15 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Tue Oct 4 05:59:24 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * test/csv/test_csv.rb: use remove_const to reduce warnings. use
- Dir.tmpdir to locate working files.
+ * ext/psych/lib/psych/visitors/to_ruby.rb: ToRuby visitor can be
+ constructed with a ScalarScanner.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ScalarScanner can be
+ passed to the YAMLTree visitor.
-Thu Sep 4 17:41:31 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 4 05:47:23 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * misc/ruby-mode.el (ruby-here-doc-beg-re): underscore also is
- valid delimiter.
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Define Regexp::NOENCODING
+ for 1.9.2 backwards compatibility.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: Fix Date string
+ generation for 1.9.2 backwards compatibility.
- * misc/ruby-mode.el (ruby-here-doc-end-match): must quote
- arbitrary string to use as regexp.
+Mon Oct 3 23:56:39 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * misc/ruby-mode.el (ruby-font-lock-maybe-here-docs): must not
- call `ruby-here-doc-end-match' unless `ruby-here-doc-beg-re'
- matched.
+ * gc.c (rb_gc_set_params): output GC parameter change messages only
+ if -w/-v options are specified. these messages are output to stderr,
+ not to stdout. [ruby-core:39795] [Bug #5380]
-Thu Sep 4 15:40:07 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * test/ruby/test_gc.rb (test_gc_parameter): add test for it.
- * test/csv/test_csv.rb: run on test/unit original layer.
+Sun Oct 2 20:05:32 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Thu Sep 4 12:54:50 2003 why the lucky stiff <why@ruby-lang.org>
+ * vm.c (rb_thread_mark), cont.c (cont_mark): revert r33369 and r33371
+ that may cause SEGV in certain environments.
- * ext/syck/token.c: headerless documents with root-level spacing now
- honored.
+Sun Oct 2 12:14:06 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Thu Sep 4 00:06:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/psych/test_yamldbm.rb: add test case.
+ * test/syck/test_yamldbm.rb: ditto.
- * eval.c (mark_frame_adj): need to adjust argv pointer if using
- system's alloca. [ruby-core:01503]
+Sun Oct 2 11:28:09 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Sep 3 21:33:20 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/yaml/store.rb: make initialize method signature match the
+ superclass signature.
- * test: add test directory. Test::Unit aware testcases and needed
- files should be located in this directory. dir/file name convention;
- test/{module_name}/test_{testcase_name}.rb
- test/{module_name}/{needed_files}
- someday, someone will write testrunner which searches test_*.rb and
- run testcases automatically.
+Sun Oct 2 10:44:01 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * test/csv/*: add testcase for lib/csv.rb.
+ * io.c: fix documentation of ARGF.lineno=.
-Wed Sep 3 01:37:09 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Oct 1 20:03:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (rb_f_gets): should call next_argv() before type check
- current_file. [ruby-list:38336]
+ * lib/mkmf.rb (have_framework): try as Objective-C.
+ https://twitter.com/nagachika/status/120294447660539904
-Tue Sep 2 20:37:15 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Oct 2 08:43:25 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * ext/openssl/lib/net/protocols.rb (SSLIO#ssl_connect): warning
- for skipping server verification.
+ * vm.c (rb_thread_mark), cont.c (cont_mark): self pointer should not
+ be marked by itself. Patch by Koichi Sasada.
+ [ruby-dev:44567] [Bug #5386]
-Tue Sep 2 23:36:57 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Oct 2 00:42:14 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * eval.c (proc_invoke): should retrieve retval when pcall is true.
+ * vm.c (rb_thread_mark): rb_thread_t needs self to be marked.
+ [ruby-dev:44566] [Bug #5386]
-Tue Sep 2 14:09:20 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Oct 1 09:48:53 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * ext/socket/extconf.rb: check s6_addr8 in in6_addr (Tru64 UNIX).
- the patch is submitted by nmu <nmu@users.sourceforge.jp>.
+ * gc.c (add_heap_slots, init_heap): reset heaps_inc zero when
+ heap slots are expanded by environment variable RUBY_HEAP_MIN_SLOTS.
+ [ruby-core:39777] [Bug #5380]
- * ext/socket/getaddrinfo.c (getaddrinfo): should use in6_addr8 on
- some platforms.
+ * test/ruby/test_gc.rb (test_gc_parameter): add test for it.
- * ext/socket/getnameinfo.c (getnameinfo): ditto.
+ * test/ruby/envutil.rb (assert_normal_exit): add :child_env option to
+ enable pass environment variables to child process.
-Tue Sep 2 14:02:19 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Sep 29 13:17:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tcltklib/tcltklib.c (ip_invoke): fixed bug on passing a exception
+ * array.c (ary_join_1): should not copy the encoding of non-string
+ element after string element. [ruby-core:39776] [Bug #5379]
- * ext/tk/lib/{tk.rb, tkcanvas.rb, tkfont.rb, tktext.rb} :
- bug fix and improvement of font control
+Thu Sep 29 11:53:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Sep 2 09:51:36 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (slot_sweep, rb_gc_finalize_deferred)
+ (rb_objspace_call_finalizer, rb_gc): run finalizers
+ sequentially. [ruby-dev:44562]
- * eval.c (rb_eval): should not handle exceptions within rescue
- argument. [ruby-talk:80804]
+Thu Sep 29 20:37:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Sep 2 00:44:37 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/gdbm/gdbm.c (rb_gdbm_fatal): adjust argument type.
- * re.c (rb_memsearch): fix overrun. [ruby-talk:80759]
+Thu Sep 29 20:10:42 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Sep 2 00:41:27 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (is_id_value, is_live_object): extract from id2ref().
- * ext/iconv/iconv.c (map_charset): use lower case keys.
+ * gc.c (run_finalizer): use object instead of object id.
- * ext/iconv/iconv.c (iconv_fail): just yield error and return the
- result if a block is given.
+Thu Sep 29 20:07:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/iconv/iconv.c (iconv_convert): yield error and append the
- result if a block is given.
+ * use RB_TYPE_P which is optimized for constant types, instead of
+ comparison with TYPE.
- * ext/iconv/charset_alias.rb (charset_alias): optional third
- argument.
+Wed Sep 28 09:20:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/iconv/charset_alias.rb (charset_alias): use CP932 instead of
- SHIFT_JIS on cygwin.
+ * configure.in (pthread_np.h): needs pthread.h to be included
+ previously on OpenBSD. a patch by George Koehler <xkernigh AT
+ netscape.net> at [ruby-core:39752]. [Bug #5376]
-Mon Sep 1 18:34:25 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Sep 28 04:41:35 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * eval.c (rb_eval): make tail recursion in ELSE clause of
- RESCUE a jump.
+ * test/psych/test_yamlstore.rb: use tmpdir for tmpfile.
+ * test/syck/test_yamlstore.rb: ditto.
-Mon Sep 1 18:00:02 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Sep 28 04:10:46 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * parse.y (aref_args): forgot to call NEW_SPLAT(). reported by
- Dave Butcher.
+ * ext/bigdecimal/README: update report to.
- * eval.c (Init_Thread): protect thgroup_default. suggested by Guy
- Decoux in [ruby-talk:80623]
+Tue Sep 28 04:05:00 2011 Kenta Murata <mrkn@mrkn.jp>
-Mon Sep 1 16:59:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal_en.html: removed because this file isn't
+ maintained now.
- * eval.c (rb_thread_switch): add RESTORE_EXIT; exit by another
- thread termination.
+ * ext/bigdecimal/bigdecimal_ja.html: ditto.
- * eval.c (rb_thread_start_0): should not error_print() within
- terminated thread, because $stderr used by it might be
- overriden now. [ruby-dev:21280]
+Tue Sep 27 09:55:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun Aug 31 22:46:55 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * thread_pthread.c: make native_fd_select().
+ * thread.c (do_select): remove #ifdef _WIN32. Instead, use
+ native_fd_select() always.
- * eval.c (TAG_DST()): take no argument.
+Tue Sep 27 09:44:59 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * process.c (p_gid_sw_ensure): return VALUE.
+ * thread.c (do_select): remove cygwin specific hack. It's layer
+ violation and too large hack.
+ * thread.c (cmp_tv, subtract_tv): removed.
-Sun Aug 31 22:27:10 2003 Hidetoshi NAGAI <nagai@dumbo.ai.kyutech.ac.jp>
+Tue Sep 27 03:50:19 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * process.c (p_gid_sw_ensure): lack of function type
+ * test/rexml/test_sax.rb: add require 'rexml/document'.
-Sun Aug 31 12:25:06 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+Tue Sep 27 03:32:27 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/optparse.rb: --version takes an optional argument; "all" or
- a list of package names.
+ * test/psych/test_yamldbm.rb: fix #setup and #teardown.
+ [Bug #5370] [ruby-core:39730]
+ * test/syck/test_yamldbm.rb: ditto.
-Sun Aug 31 10:17:02 2003 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Sep 26 11:27:38 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/date/format.rb: yyyy/mm is not an acceptable format.
+ * lib/webrick/httputils.rb: Add MIME Type definition of .js and .svg.
+ patched by Hal Brodigan. [ruby-core:39704] [Bug #5365]
- * lib/time.rb: follow above.
+Mon Sep 26 09:20:44 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Aug 30 14:25:43 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in: remove DJGPP support. It's not longer supported
+ since ruby 1.9.0.
- * eval.c (rb_iter_break): should not call TAG_JUMP directly.
+Mon Sep 26 09:07:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Aug 30 03:58:21 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/defines.h: remove NextStep, OpenStep, Rhapsody
+ support. Last activity of their OSes are 7 years ago.
+ * configure.in: ditto.
+ * dir.c: ditto.
+ * ext/tk/extconf.rb: ditto.
- * eval.c (struct BLOCK): remove BLOCKTAG, use scope instead.
+Mon Sep 26 09:02:49 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (POP_TAG): no longer propagate retval. retval is now set
- directly by localjump_destination().
+ * configure.in: remove a code for human68k. it's no longer
+ supported since r19677.
- * eval.c (localjump_destination): new function to cast
- return/break local jump.
+Sun Sep 25 23:43:32 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * eval.c (rb_yield_0): stop TAG_RETURN/TAG_BREAK escaping.
+ * ext/openssl/ossl_asn1.c: fix int_ossl_asn1_decode0_cons when being
+ fed arbitrary string values.
+ Clearly distinguish between the cases "universal, infinite and
+ not a SEQUENCE or SET" and "universal SEQUENCE or SET, possibly
+ infinite". Raise error for universal tags that are not infinite.
+ * test/openssl/test_asn1.rb: add a test for this.
-Fri Aug 29 22:35:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
+ Thanks to Hiroshi Yoshida for reporting this bug.
+ [Bug #5363] [ruby-dev:44542]
- * bigdecimal.c *.html: The 2nd arg. for add,sub,mult, and div is 0,
- then result will be the same as +,-,*,/ respectively.
+Sun Sep 25 20:57:18 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Fri Aug 29 17:30:15 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/syck/test/yamldbm.rb: add test for Syck::DBM.
+ * test/psych/test_yamldbm.rb: add test for Psych::DBM.
+ * test/psych/test_yamlstore.rb: add test for Psych::PStore.
- * process.c: bug fix
+Sun Sep 25 20:54:10 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * process.c: add rb_secure(2) to methods of Process::{UID,GID,Sys}
+ * lib/yaml/dbm/dbm.rb: fix #update, add #key for using instead #index.
+ [Bug #5305][ruby-dev:44485]
- * process.c: deny handling IDs during evaluating the block given to
- the Process::{UID,GID}.switch method
+Sun Sep 25 16:54:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tcltklib/tcltklib.c : some methods have no effect if on slave-IP
+ * encoding.c (require_enc): reject only loading from untrusted
+ load paths. [ruby-dev:44541] [Bug #5279]
- * ext/tcltklib/tcltklib.c : can create a interpreter without Tk
+ * transcode.c (load_transcoder_entry): ditto.
- * ext/tcltklib/tcltklib.c : bug fix on handling exceptions
+Sun Sep 25 16:45:05 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tcltklib/MANUAL.euc : modify
+ * configure.in: ignore all warnings from an arbitrary
+ header in /usr/local/include.
- * ext/tk/lib/tk.rb : freeze some core modules
+Sun Sep 25 03:43:03 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/lib/multi-tk.rb : more secure
+ * enum.c (slice_before_i): use rb_attr_get to suppress wrong warning
+ for internal instance variable slicebefore_initial_state.
- * ext/tk/lib/tk.rb: TkVariable.new(array) --> treat the array as the
- Tk's list
+Fri Sep 23 14:20:14 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/tk/lib/tk.rb: improve accessibility of TkVariable object
+ * ext/openssl/ossl_asn1.c: remove unused variable.
- * ext/tk/lib/tk.rb, ext/tk/lib/tkfont.rb, ext/tk/lib/tkcanvas.rb,
- ext/tk/lib/tktext.rb : fix bug of font handling
+Fri Sep 23 13:46:59 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/tk/lib/tkfont.rb TkFont.new() accepts compound fonts
+ * test/openssl/test_ssl_session.rb: execute test_session_exts_read
+ only for OpenSSL versions >= 0.9.8k. Thanks, Eric Wong, for
+ reporting this.
+ [Bug #4961] [ruby-core:37726]
-Thu Aug 28 22:07:12 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Sep 23 11:59:08 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * variable.c (rb_autoload_load): call const_missing if autoloading
- constant is not defined to allow hook.
+ * test/openssl/test_ssl_session.rb: ensure server calls callbacks in
+ test_ctx_server_session_cb. Thanks to Eric Wong for the patch.
+ [Bug #5336] [ruby-core:39619]
- * eval.c (rb_eval): use rb_const_get_from() instead of
- rb_const_get_at().
+Thu Sep 22 02:53:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (is_defined): forgot to check NODE_COLON3.
+ * vm_insnhelper.c (vm_call_cfunc): suppress a warning. note that
+ `volatile type *var' doesn't make var itself volatile.
-Thu Aug 28 17:30:24 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Sep 22 01:52:48 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * variable.c (rb_const_get_0): should check constants defined in
- included modules, if klass is Object. [ruby-talk:79302]
+ * thread_pthread.c (ubf_select): activate timer thread when interrupt
+ blocking thread.
+ A patch created by Koichi Sasada. [ruby-core:39634] [Bug #5343]
+ to cover race condition, timer thread periodically send SIGVTARLM to
+ threads in signal thread list. so you should activate timer thread
+ when interrupt a thread.
- * numeric.c (check_uint): check should be done using UINT_MAX, not
- INT_MAX. this fix is submitted by Lyle Johnson
- <lyle@knology.net> in [ruby-core:01486]
+Wed Sep 21 16:55:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Aug 28 05:02:52 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/io/wait/test_io_wait.rb (TestIOWait#setup): of course, the
+ behavior of mingw is just same with mswin.
- * parse.y (singleton): typo fixed (ruby-bugs-ja:PR#562)
+Tue Sep 20 18:08:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 28 02:37:45 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_insnhelper.c (vm_get_cvar_base): reduce duplicated checks and
+ move a warning outside the loop.
- * eval.c (rb_eval): *a = [1,2] now assigns [[1,2]] to a.
- consistent with *a = [1], which set [[1]] to a.
+Mon Sep 19 18:55:51 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * node.h: merge NODE_RESTARY to NODE_SPLAT.
+ * lib/fileutils.rb (module FileUtils): improve performance of
+ FileUtils.compare_stream. a patch by Masaki Matsushita.
+ [Feature #5337] [ruby-core:39622]
- * parse.y: rules simplified a bit by removing NODE_RESTARY.
+Mon Sep 19 18:42:58 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * sample/test.rb: updated for new assignment behavior.
+ * test/-ext-/old_thread_select/test_old_thread_select.rb:
+ select() with timeout may return early in old Linux kernels
+ with 250 Hz tickrate and no dynticks, so skip everything older
+ than 2.6.32 (which has long term support).
+ And, Make the timing assertions consistently use assert_operator with
+ timing difference in error message
+ Patch by Eric Wong. [Bug #5335] [ruby-core:39618]
-Wed Aug 27 22:33:24 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Sep 19 09:28:06 2011 Eric Hodel <drbrain@segment7.net>
- * error.c (rb_bug): should not use other methods; this function is
- not for ordinary use. [ruby-dev:21259]
+ * test/openssl/test_ssl.rb (class OpenSSL): Test
+ OpenSSL::SSL::SSLSocket#session and #session=.
-Wed Aug 27 15:07:57 2003 Minero Aoki <aamine@loveruby.net>
+Mon Sep 19 07:54:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/smtp.rb (check_response): AUTH CRAM-MD5 returns 334
- response. [ruby-list:38279]
+ * object.c (rb_obj_clone): singleton class should be attached
+ singleton object to. a patch by Satoshi Shiba <shiba AT rvm.jp>
+ at [ruby-dev:44460]. [Bug #5274]
-Wed Aug 27 05:10:15 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Sep 17 23:34:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (map_errno): support winsock error.
+ * parse.y (parser_data_type): inherit the core type in ripper so
+ that checks in core would work. [ruby-core:39591] [Bug #5331]
- * win32/win32.c (pipe_exec, CreateChild, poll_child_status, waitpid,
- kill, link, rb_w32_rename, unixtime_to_filetime, rb_w32_utime):
- pass errno to map_errno().
+Sat Sep 17 12:44:04 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * win32/win32.c (rb_w32_select, rb_w32_accept, rb_w32_bind,
- rb_w32_connect, rb_w32_getpeername, rb_w32_getsockname,
- rb_w32_getsockopt, rb_w32_ioctlsocket, rb_w32_listen, rb_w32_recv,
- rb_w32_recvfrom, rb_w32_send, rb_w32_sendto, rb_w32_setsockopt,
- rb_w32_shutdown, rb_w32_socket, rb_w32_gethostbyaddr,
- rb_w32_gethostbyname, rb_w32_gethostname, rb_w32_getprotobyname,
- rb_w32_getprotobynumber, rb_w32_getservbyname, rb_w32_getservbyport,
- rb_w32_fclose, rb_w32_close): use map_errno().
+ * lib/find.rb (Find.find): add documentation that Find.find
+ without block returns an enumerator.
- * win32/win32.h: add winsock errors.
+Thu Sep 15 11:39:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 26 23:53:23 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c (mark_entry, mark_key, mark_keyvalue): adjust callback
+ argument types.
- * lib/ostruct.rb (OpenStruct::method_missing): prohibit modifying
- frozen OpenStruct. [ruby-talk:80214]
+Thu Sep 15 01:44:10 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Tue Aug 26 20:03:50 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/tk/*: Change encoding from EUC-JP to UTF-8
- * lib/mkmf.rb (create_tmpsrc): add the hook for source.
- [ruby-list:38122]
+Wed Sep 14 11:43:37 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Aug 26 15:59:53 2003 why the lucky stiff <why@ruby-lang.org>
+ * thread.c (rb_fd_rcopy): added an argument guard.
+ Patch by NAKAMURA Usaku. [Bug #5306] [ruby-core:39435]
- * implicit.c (syck_type_id_to_taguri): corrected detection of
- x-private types.
+Tue Sep 13 20:21:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Aug 24 01:02:48 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/pstore.rb, test/test_pstore.rb: suppress warnings with -v.
- * file.c (file_expand_path): performance improvement.
- [ruby-talk:79748]
+ * lib/pstore.rb (PStore): always open in binary mode even if
+ default encodings are set. [Bug #5311] [ruby-core:39503]
-Sat Aug 23 23:41:16 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Sep 13 05:37:15 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
- * file.c (rb_file_s_expand_path): avoid calling rb_scan_args() for
- apparent cases. [ruby-talk:79748]
+ * io.c (Init_IO): update BINARY comment. it should not change the
+ encoding of the result to ASCII-8BIT. [ruby-talk:387719]
-Sat Aug 23 18:56:53 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Sep 12 19:55:00 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/nkf/nkf.c (rb_nkf_putchar): should use rb_str_resize() to just
- resize a string, rb_str_cat() disallows NULL. [ruby-dev:21237]
+ * thread.c (rb_thread_select): fix to ignore an argument
+ modification of rb_thread_fd_select().
+ based on a patch by Eric Wong. [Bug #5306] [ruby-core:39435]
+ * thread.c (rb_fd_rcopy): New. for reverse fd copy.
-Sat Aug 23 16:48:41 2003 Keiju Ishitsuka <keiju@ishitsuka.com>
+ * test/-ext-/old_thread_select/test_old_thread_select.rb
+ (test_old_select_false_positive): test for bug5306.
- * lib/irb/ruby-lex.rb: bug fix for "foo" !~ /bar/. [ruby-talk:79942]
+ * ext/-test-/old_thread_select/old_thread_select.c (fdset2array):
+ New. convert fdsets to array.
+ * ext/-test-/old_thread_select/old_thread_select.c (old_thread_select):
+ return 'read', 'write', 'except' argument of rb_thread_select()
+ to ruby script.
-Sat Aug 23 15:59:58 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Sep 12 13:38:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_eval, rb_iterate, block_pass): reduce PUSH/POP_TAG and
- EXEC_TAG() for retry. [ruby-dev:21216]
+ * README.EXT, README.EXT.ja (2.2.2), parse.y (rb_check_id): add
+ documents for rb_check_id().
-Sat Aug 23 02:32:33 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Sep 12 12:53:39 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (rb_yield_splat): should check if "values" is array.
+ * lib/rake/file_list.rb (Rake::FileList#egrep): there is no need to
+ open files in binary mode.
+ see more details in https://github.com/jimweirich/rake/issues/74
- * enum.c (each_with_index_i): typo.
+Mon Sep 12 12:42:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Aug 22 17:07:05 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_exception.rb (TestException#test_exit_success_p):
+ assert also the cases when exiting with true and false.
- * enum.c (inject_i): use rb_yield_values.
+ * lib/test/unit/assertions.rb (assert_send): make arguments in
+ the default message clearer.
- * enum.c (each_with_index_i): ditto.
+Sun Sep 11 05:23:14 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * eval.c (rb_yield_splat): new function to call "yield *values".
+ * lib/matrix.rb: Deal with subclasses of Matrix [redmine #5307]
- * string.c (rb_str_scan): use rb_yield_splat().
+Sat Sep 10 13:38:20 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Fri Aug 22 06:13:22 2003 why the lucky stiff <why@ruby-lang.org>
+ * dir.c (dir_s_aref):
+ * dir.c (dir_entries): Two small documentation fixes.
+ A patch from Aaron Lerch. [Bug #5302] [ruby-core:39404]
- * ext/syck/rubyext.c: refactoring of the transfer method
- dispatch. added yaml_org_handler for faster dispatch of
- transfers to base types.
+Sat Sep 10 08:30:03 2011 Koichi Sasada <ko1@atdot.net>
- * lib/yaml/rubytypes.rb: removed handling of builtins from
- Ruby library.
+ * gc.c (GC_PROFILE_MORE_DETAIL, CALC_EXACT_MALLOC_SIZE):
+ define macros only if they are not defined.
+ fixes: [Ruby 1.9 - Feature #5291]
- * ext/syck/token.c: quoted and block scalars are now implicit !str
+Sat Sep 10 08:25:47 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/syck/implicit.c: empty string detected as !null.
+ * parse.y (bv_decls): parse.y relies on $$ = $1 before action
+ routines. a patch from Michael Edgar. [Bug #5303]
+ [ruby-core:39429]
-Fri Aug 22 01:00:31 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Sep 10 01:37:55 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * eval.c (block_pass): improve passing current block.
+ * sample/drb/dhasenc.rb: coding cookie of Emacs is coding,
+ not encoding.
-Fri Aug 22 00:13:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
+ * sample/mine.rb: ditto.
- * ext/bigdecimal/bigdecimal.c: Int. overflow bug in multiplication
- fixed, and VpNmlz() speed up.
+Fri Sep 9 21:56:40 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Wed Aug 20 16:44:49 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_sqrt): Fix comment.
+ BigDecimal#sqrt requires argument. Reported by Makoto Kishimoto.
+ Thanks for your contribution. [Bug #5267] [ruby-dev:44452]
- * ext/socket/socket.c (ruby_connect): many systems seem to have
- a problem in select() after EINPROGRESS. [ruby-list:38080]
+Fri Sep 9 11:00:55 2011 Shota Fukumori <sorah@tubusu.net>
-Wed Aug 20 01:31:17 2003 why the lucky stiff <why@ruby-lang.org>
+ * test/rubygems/test_gem_commands_help_command.rb: Add one
+ `require` because if run test-all with test/unit parallel
+ running, sometimes this test fails by some constants not found.
+ The error reason is some worker doesn't require the file needed by
+ this test. This issue is related to [ruby-core:36168].
- * ext/syck/syck.h: Parser definition problems on HP-UX.
- [ruby-talk:79389]
+Fri Sep 9 10:22:03 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/syck/handler.c (syck_hdlr_get_anchor): Memory leak.
+ * thread.c (rb_thread_select): fix a typo to initialize efds
+ properly. [Bug #5299] [ruby-core:39380]
- * ext/syck/syck.s (syck_io_file_read): Bad arguments to fread.
+Fri Sep 9 02:02:09 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * ext/syck/rubyext.c: Tainting issues.
+ * template/yarvarch.ja:
+ Change encoding from Shift_JIS to UTF-8
-Tue Aug 19 23:20:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
+Thu Sep 9 01:14:00 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * ext/bigdecimal/bigdecimal.c .h .html: to_s("+") implemented.
+ * sample/drb/README.rd.ja:
+ * sample/drb/dhasenc.rb:
+ * sample/mine.rb:
+ Change encoding from EUC-JP to UTF-8
- * ext/bigdecimal/lib/bigdecimal/math.rb: E implemented.
+Thu Sep 8 21:03:22 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Aug 19 07:47:09 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ext/nkf/nkf-utf8/nkf.c: import nkf 2.1.2 (be9c280)
+ Bump version number/release date only.
- * lib/webrick/ssl.rb: new file; SSL/TLS enhancement for GenericServer.
+Thu Sep 8 12:43:18 2011 Narihiro Nakamura <authornari@gmail.com>
- * lib/webrick/https.rb: SSLSocket handling is moved to webrick/ssl.rb.
+ * gc.c (Init_GC): defined GC::Profiler.raw_data. based on the
+ patch by Eric Hodel. [ruby-core:37857] [Bug #4991]
- * lib/webrick/compat.rb (File::fnmatch): remove old migration code.
+Thu Sep 8 09:02:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/httpserver.rb (HTTPServer#run): ditto.
+ * gc.c (id2ref): objects which are unmarked but not in sweep_slots
+ are not dead.
- * lib/webrick/server.rb (GenericServer#listen): the body of this
- method is pull out as Utils::create_lisnteners.
+Thu Sep 8 07:44:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/utils.rb (Utils::create_lisnteners): new method.
+ * transcode.c (rb_declare_transcoder, load_transcoder_entry): no
+ longer need to limit the length of transcoder library name.
- * lib/webrick/server.rb (GenericServer#start): should rescue
- unknown errors. and refine comments.
+Thu Sep 8 07:36:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/lib/openssl/ssl.rb (SSLServer#accept): should close
- socket if SSLSocket raises error.
+ * ext/syck/lib/syck/types.rb: use toplevel Syck.
+ for the case someone define Syck::Syck (or YAML::Syck).
-Tue Aug 19 11:19:33 2003 Shugo Maeda <shugo@ruby-lang.org>
+Thu Sep 8 07:33:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (next_argv): should not call GetOpenFile() if rb_stdout is
- not a IO (T_FILE).
+ * gc.c (id2ref): unmarked object is already dead while lazy
+ sweeping, and to it cannot come back since other objects
+ referred from it might have been freed already.
-Tue Aug 19 07:47:09 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Wed Sep 8 03:48:00 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * ext/openssl/ossl_ssl.c: sync_close is moved to SSLSocket as
- a builtin.
+ * ext/readline/README.ja:
+ Change encoding from EUC-JP to UTF-8
- * ext/openssl/lib/openssl/buffering.rb (Buffering#close): ditto.
+Wed Sep 8 02:59:00 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * ext/openssl/lib/openssl/buffering.rb (Buffering#puts): should
- add a return to the tails of each line.
+ * test/rexml/test_encoding.rb:
+ Add require 'require 'rexml/document'
- * ext/openssl/lib/openssl/ssl.rb: new class OpenSSL::SSL::SSLServer.
+Wed Sep 8 02:53:00 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * ext/openssl/lib/net/protocols.rb (SSLIO#ssl_connect): use sync_close.
+ * ext/nkf/nkf-utf8/nkf.c:
+ Change encoding from ISO-2022 to UTF-8
- * ext/openssl/sample/echo_svr.rb: use SSLServer.
+Wed Sep 7 23:41:24 2011 Kouhei Sutou <kou@cozmixng.org>
- * ext/openssl/sample/echo_cli.rb: add example of SSLSocket#sync_close.
+ * lib/rexml/parsers/baseparser.rb, test/rexml/test_comment.rb:
+ allow a single hyphen in comment. [Bug #5278] [ruby-core:39289]
+ Reported by Thomas Fritzsche. Thanks!!!
-Tue Aug 19 01:24:34 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Sep 7 17:27:18 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/curses/curses.c (_XOPEN_SOURCE_EXTENDED): Mac OS X standard
- headers are inconsistent at this macro. [ruby-core:01432]
+ * lib/yaml.rb: explicitly specify ::Object to avoid the collision with
+ Syck::Object.
- * ext/curses/extconf.rb: check if _XOPEN_SOURCE_EXTENDED breaks.
+Tue Sep 6 21:06:49 2011 Shota Fukumori <sorah@tubusu.net>
- * ext/tcltklib/stubs.c: Status macro in X11/Xthreads.h bothers
- winspool.h
+ * lib/test/unit.rb (_run_suites): Now reports are written the
+ following order: Skip, Failure, Error. [Feature #5282]
- * instruby.rb: make list at first instead of iterator.
- [ruby-talk:79347]
+ * test_sorting.rb: test for above.
-Mon Aug 18 11:23:11 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test4test_sorting.rb: Ditto.
- * dir.c (glob_helper): preserve raw order for **.
+ * lib/test/unit.rb (run): Put RUBY_DESCRIPTION before quitting.
+ [Feature #5282]
-Sun Aug 17 23:39:55 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Sep 6 21:13:47 2011 Masaya Tarui <tarui@ruby-lang.org>
- * ext/openssl/extconf.rb (HAVE_VA_ARGS_MACRO): need to compile.
+ * win32/Makefile.sub (INSNS): change command line option -Ks to -Ku
+ for generate *.inc. because insns.def encoding has been changed SJIS
+ to UTF-8. if $BASERUBY is 1.9, -Ks cause an error. [Feature #5128]
+ (same as r33194)
-Sun Aug 17 17:10:03 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Sep 6 15:55:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/lib/openssl/ssl.rb (SSLSocket#sync_close=): add a
- method to specify if the underlying IO will be closed in
- SSLSocket#close.
+ * transcode.c (load_transcoder_entry): concatenate paths directly.
- * ext/openssl/lib/openssl/buffering.rb: add forwarders to
- setsockopt, getsockopt and fcntl.
+ * encoding.c (load_encoding): predefined encoding names are safe.
+ [ruby-dev:44469] [Bug #5279]
- * ext/openssl/lib/net/protocols.rb: enable sync for SSLSocket.
+ * transcode.c (load_transcoder_entry): ditto.
-Sun Aug 17 11:32:04 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Sep 6 12:07:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/extmk.rb (extmake): should not force to remake Makefile when
- installation and so on.
+ * transcode.c: enabled econv newline option.
-Sat Aug 16 23:58:18 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Sep 6 06:44:57 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * marshal.c (w_symbol, w_object): get rid of warnings.
+ * numeric.c (dbl2ival): Fix Float#divmod and #round for 32 bit
+ platform. part 1 of [bug #5276]
- * re.c (rb_memsearch): ditto.
+Tue Sep 6 06:44:25 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * time.c (time_dump): ditto.
+ * numeric.c (flo_round): Fix criteria for 32 bits platform
+ part 2 of [bug #5276]
- * ext/extmk.rb (extmake): not continue making when extconf.rb
- failed.
+Tue Sep 6 05:37:11 2011 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * ext/openssl/extconf.rb: check __VA_ARGS__ macro more precisely.
+ * test/rinda/test_rinda.rb (test_core_03_notify): Fixed test failures
+ [ruby-dev:44430] [Ruby 1.9 - Bug #372]
- * ext/openssl/ossl.h: remove version.h dependency.
+Mon Sep 5 20:59:30 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * ext/openssl/ruby_missing.h: ditto.
+ * insns.def: change encoding pragma for emacs (shift_jis to utf-8).
- * lib/mkmf.rb (pkg_config): use --libs output except with
- only-L for other options. [ruby-list:38099]
+Mon Sep 5 19:32:15 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * lib/mkmf.rb (create_makefile): separate rule for static
- library from shared object.
+ * Makefile.in (INSNS): change command line option -Ks to -Ku for
+ generate *.inc. because insns.def encoding has been changed SJIS to
+ UTF-8. if $BASERUBY is 1.9, -Ks cause an error. [Feature #5128]
- * win32/Makefile.sub, bcc32/Makefile.sub, wince/Makefile.sub:
- define exec_prefix and libdir.
+Mon Sep 5 18:10:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Aug 15 23:15:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
+ * transcode.c (rb_econv_binmode): newline decorators are
+ exclusive.
- * ext/bigdecimal/bigdecimal.c .h: Bug in combination of limit & div
- method fixed.
+Mon Sep 5 15:03:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/bigdecimal/lib/bigdecimal/math.rb: atan() & sqrt() added.
+ * test/rubygems/test_gem_security.rb
+ (test_class_build_self_signed_cert): reset opt[:trust_dir] to apply
+ temporary Gem.user_home.
-Fri Aug 15 12:01:43 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Sep 5 10:04:35 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * configure.in (HUGE_ST_INO): check whether struct stat.st_ino
- is larger than long. [ruby-dev:21194]
- http://www.geocities.co.jp/SiliconValley-PaloAlto/1409/ruby/beos.html
+ * README.ja, README.EXT.ja: resolve conflicts. [ruby-dev:44459]
- * error.c (syserr_eqq): errno might exceed Fixnum limit.
+Mon Sep 5 05:13:22 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * error.c (Init_Exception): moved base initialization from
- init_syserr().
+ * numeric.c (flo_round): Make Float#round round big values [bug
+ #5272]
- * inits.c (rb_call_inits): postpone initializing errnos until
- Bignum is available.
+Mon Sep 5 04:28:25 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Fri Aug 15 12:01:43 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * numeric.c (int_round): Integer#round always returns an Integer [Bug
+ #5271]
- * ext/curses/curses.c (_XOPEN_SOURCE_EXTENDED): needed to let
- keyname() and so on be declared.
+Sun Sep 4 22:28:50 2011 Shugo Maeda <shugo@ruby-lang.org>
- * ext/curses/curses.c (curses_resizeterm, window_resize):
- arguments conflicted with macros in term.h.
+ * lib/net/imap.rb (default_port, default_imap_port,
+ default_tls_port, default_ssl_port, default_imaps_port):
+ added methods for consistency with Net::POP.
+ based on the patch by art lussos. [ruby-core:38997] [Bug #5198]
- * ext/curses/curses.c (Curses module methods): ensure
- initialized. [ruby-dev:21191]
+Sun Sep 4 21:19:19 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Fri Aug 15 02:08:53 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * Change encoding from EUC-JP to UTF-8. [Feature #5128]
- * gc.c (id2ref): recycle check should be done by klass == 0.
- [ruby-core:01408]
+Sun Sep 4 00:47:39 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Fri Aug 15 01:34:23 2003 Michal Rokos <m.rokos@sh.cvut.cz>
+ * test/ruby/test_fiber.rb (TestFiber#test_no_valid_cfp):
+ add a test. Unlike TestThread#test_no_valid_cfp,
+ this test succeeds even if win32ole is required (see r33153).
- * ext/openssl/ossl_pkey.c: move generate_cb here
+Sun Sep 4 00:11:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_pkey_{dh|dsa|rsa}.c: adapt to this cb
+ * variable.c (rb_const_set): show the previous definition
+ location. [EXPERIMENTAL]
- * ext/openssl/openssl_missing.[ch]: add (0.9.6x, x<j) missing BN funcs
+Sat Sep 3 23:56:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_bn.c: use supplied funcs from openssl_missing.c
+ * configure.in (sizeof_struct_dirent_too_small): check if struct
+ dirent.d_name is too small.
-Fri Aug 15 00:38:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
+ * configure.in (RUBY_MINGW32): take tool prefix from CC.
- * ext/bigdecimal/bigdecimal.c: Bug in div method fixed.
+Sat Sep 3 23:52:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/bigdecimal/lib/bigdecimal/math.rb: Newly added.
+ * io.c (argf_next_argv): open in default text mode.
+ [ruby-core:39234] [Bug #5268]
- * ext/bigdecimal/sample/pi.rb: Changed so as to use math.rb.
+Sat Sep 3 18:40:57 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Thu Aug 14 21:19:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/thread.rb (SizedQueue#max=): raise ArgumentError if max is not
+ positive number. patch by Masaki Matsushita.
+ [ruby-dev:44449] [Bug #5259]
- * eval.c (Init_Thread): Continuation#[] added. [ruby-talk:79028]
+ * test/thread/test_queue.rb (test_sized_queue_initialize,
+ test_sized_queue_assign_max): add tests for it.
-Thu Aug 14 20:03:34 2003 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Fri Sep 2 21:11:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/win32ole/win32ole.c (OLE_FREE): should not call
- ole_message_loop.
+ * io.c (validate_enc_binmode, prep_stdio): default to text mode on
+ dosish platforms. [ruby-core:38822] [Bug #5164]
- * ext/win32ole/win32ole.c (ole_event_free): ditto.
+ * transcode.c (rb_econv_prepare_options): keep default ecflags
+ unchanged if no options.
- * ext/win32ole/win32ole.c (ole_initialize): stop calling
- OleUninitialize at exit.
+Fri Sep 2 14:36:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 14 11:27:37 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_insnhelper.c (vm_search_const_defined_class): search
+ ancestors only when global scope. [ruby-core:39227] [Bug #5264]
- * gc.c (rb_data_object_alloc): check type of 1st argument.
- [ruby-dev:21192]
+Fri Sep 2 09:58:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 14 00:21:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * parse.y (parser_tokadd_string, parser_yylex): ignore a backslash
+ which prefixes an non-ascii character, which has no escape
+ syntax. [ruby-core:39222] [Ruby 1.9 - Bug #5262]
- * parse.y (mlhs_node): should allow "::Foo" (colon3) as lhs.
+Fri Sep 2 04:05:25 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * parse.y (lhs): ditto.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: emit strings tagged as
+ ascii-8bit as binary in YAML.
+ * test/psych/test_string.rb: corresponding test.
- * parse.y (yylex): should return tCOLON3 right after kCLASS.
- [ruby-talk:78918]
+Fri Sep 2 01:07:14 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * error.c (exc_initialize): was converting argument to string too
- eagerly. Only check was needed. [ruby-talk:78958]
+ * numeric.c (flo_round): substitute machine dependent magic number.
-Wed Aug 13 23:31:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
+Thu Sep 1 17:31:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.c .h .html: Ambiguity of
- BigDecimal::limit removed.
+ * insns.def (defineclass), vm_insnhelper.c (vm_get_cvar_base): see
+ also inherited constants for classes without superclass and
+ modules. [ruby-core:37698] [Bug #3423]
-Wed Aug 13 19:21:34 2003 Christian Neukirchen <chneukirchen@yahoo.de>
+Thu Sep 1 16:18:44 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * lib/webrick/https.rb (HTTPServer#run): should set syncing-mode
- to SSLSocket. [ruby-talk:78919]
+ * Release GVL while OpenSSL's public key generation.
-Wed Aug 13 18:13:49 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ t = Thread.new { print "."; sleep 0.1 }
+ key = OpenSSL::PKey::RSA.new(2048)
+ #=> Thread t works in parallel with public key generation if
+ OS/machine allows it.
- * eval.c (POP_BLOCK): turn on BLOCK_LEFT flag when leaving block.
+ This works with OpenSSL >= 0.9.8. From this version, it has new
+ public key generation function which allows us to interrupt the
+ execution while pkey generation iterations.
- * eval.c (proc_invoke): unpack return/break destination when block
- is already left.
+ * ext/openssl/extconf.rb: Check existence of OpenSSL's new public key
+ generation function. (DH_generate_parameters_ex,
+ DSA_generate_parameters_ex and RSA_generate_key_ex.
-Wed Aug 13 15:58:31 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * ext/openssl/ossl_pkey.{h,c} (ossl_generate_cb_2,
+ ossl_generate_cb_stop): Added new callback function for OpenSSL pkey
+ generation which handles Thread interruption by Ruby.
+ ossl_generate_cb_stop is the unblock function(ubf) for Ruby which
+ sets a stop flag. New pkey generation callback ossl_generate_cb_2
+ checks the stop flag at each iterations of OpenSSL and interrupts
+ pkey generation when the flag is set.
- * object.c (rb_class_s_alloc): add function prototype to avoid VC++
- warning.
+ * ext/openssl/ossl_pkey_dsa.c (dsa_generate): Call
+ rb_thread_blocking_region with the above unblock function to release
+ GVL while pkey generation.
-Wed Aug 13 13:50:59 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/openssl/ossl_pkey_rsa.c (rsa_generate): ditto.
- * ext/Win32API/Win32API.c (Win32API_initialize): should pass some
- class to first argument of Data_Wrap_Struct(). (ruby-bugs:PR#1109)
+ * ext/openssl/ossl_pkey_dh.c (dh_generate): ditto.
-Tue Aug 12 16:55:11 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/openssl/test_pkey_{dh,dsa,rsa}.rb: Test it.
- * Makefile.in: static link libraries to LIBRUBY_SO with static linked
- ext. [ruby-dev:21157]
+Thu Sep 1 14:06:54 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/extmk.rb (extmake): sort extension library initialization order.
+ * test/ruby/test_thread.rb (TestThread#test_no_valid_cfp): skip when
+ win32ole is required. in such case, win32ole redefines
+ Thread#initialize, and the block argument becomes to be not the top
+ of the thread, then this testcase always fails.
- * ext/extmk.rb (extmake): compact $extlibs.
+Thu Sep 1 10:20:50 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Aug 12 02:48:56 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
+ default_mode_on_unix,text_mode,binary_mode}): sorry for wrong test
+ committed in r33144. I'd misunderstood the spec of ruby's universal
+ newline.
- * eval.c (THREAD_SAVE_CONTEXT): should explicitly turn off the
- flag before calling getcontext(2).
+Thu Sep 1 09:27:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * eval.c (struct thread): add member to save backing store on
- IA64. (ruby-bugs PR1086)
+ * variable.c (rb_autoloading_value): Fix the order of definitions.
+ It is used by autoload_defined_p.
- * eval.c (thread_mark): mark IA64 backing store region.
+Wed Aug 31 17:28:23 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * eval.c (thread_free): free saved IA64 backing store.
+ * variable.c (rb_autoload): There was a chance to run GC (from
+ rb_str_new2()) before finishing autoload_data_i construction. It
+ caused SEGV at rb_gc_mark() at autoload_i_mark.
- * eval.c (rb_thread_save_context): save IA64 backing store as well.
+ * variable.c (rb_autoload_load): Move RB_GC_GUARD() to proper
+ position based on suggestion by CHIKANAGA Tomoyuki at
+ http://d.hatena.ne.jp/nagachika/20110826/ruby_trunk_changes_33070_33078
- * eval.c (rb_thread_restore_context): restore IA64 backing store.
+ * variable.c (autoload_defined_p): Fix incompatible autoload behavior
+ that causes Rails crash. Class definition instruction defined in
+ 'defineclass' in insns.def always invokes rb_autoload_load for a
+ constant. It's invoked for every class definition regardless of
+ existence of autoload definition. rb_autoload_load checks if a
+ constant is defined as autoloaded, but new thread-safe autoload
+ returned different value if the constant is under autoloading.
- * eval.c (THREAD_ALLOC): initialize IA64 members.
+Wed Aug 31 17:20:56 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Mon Aug 11 22:31:50 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
- * lib/debug.rb(debug_command): inspection command should inspect
- resulting value even if it's nil. [ruby-dev:21180] by OMAE, jun
- <jun66j5@ybb.ne.jp>.
+ * Re-apply r33078, thread-safe autoload which is reverted at r33093.
- * lib/debug.rb(debug_command): incomplete regexp.
+Wed Aug 31 16:28:04 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Aug 11 17:33:07 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
+ default_mode_on_unix,text_mode,binary_mode}): tests for [Bug #5164].
- * eval.c (rb_call_super): do not use rb_block_given_p() for
- check. [ruby-talk:78656]
+Wed Aug 31 15:54:11 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * eval.c (BEGIN_CALLARGS): push ITER_NOT only when ITER_PRE.
+ * ext/json: Merge json gem v1.5.4 (3dab4c5a6a97fac03dac).
-Sun Aug 10 10:43:05 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Wed Aug 31 13:09:41 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * ext/openssl/lib/openssl/buffering.rb: increase BLOCK_SIZE
- from 1k to 16k bytes. [ruby-talk:78603]
+ * numeric.c (flo_round): Avoid overflow by optimizing for trivial
+ cases [Bug #5227]
- * ext/openssl/ossl_ssl.c (ossl_sslctx_s_alloc): enable
- partial write to allow interruption in SSLSocket#write.
+Wed Aug 31 00:50:01 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Aug 10 00:34:16 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * win32/win32.c (rb_w32_select_with_thread): and my typo. we all must
+ be more careful.
- * cygwin/GNUmakefile: remove unnecessary '--drive-name=$(CC)'
- for ccache.
+Wed Aug 31 00:48:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Aug 9 10:36:21 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread.c (rb_thread_select): critical typo in r33117.
- * marshal.c (w_object): do not dump generic instance variable when
- marshal_dump is defined.
+Wed Aug 31 00:30:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Aug 9 00:35:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
+ * test/-ext-/old_thread_select/test_old_thread_select.rb
+ (TestOldThreadSelect#test_old_select_read_timeout): if the machine
+ is fast enough, the time used by code around IO.select may be smaller
+ than Time implement threshold.
- * ext/bigdecimal.c: F style output(like 1234.56789) implemented
- to to_s method.
- * ext/bigdecimal_??.html: F style output(like 1234.56789)
- implemented to to_s method.
+Wed Aug 31 00:04:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Aug 8 12:33:17 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * ext/-test-/old_thread_select/old_thread_select.c (old_thread_select):
+ typo.
- * bcc32/Makefile.sub: rubyw.exe should be a Windows GUI program.
- add the -aa option to WLDFLAGS.
+ * test/-ext-/old_thread_select/test_old_thread_select.rb
+ (TestOldThreadSelect#test_old_select_signal_safe): use SIGINT instead
+ of SIGUSR1 because the former is general and the latter is platform
+ dependent.
-Fri Aug 8 11:29:26 2003 Koji Arai <jca02266@nifty.ne.jp>
+Tue Aug 30 23:59:36 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * marshal.c (w_object): should set `c_arg' at first.
+ * win32/win32.c, include/ruby/intern.h (rb_w32_fd_copy): implement
+ for rb_thread_select() in thread.c. the use of rb_fd_copy() is
+ introduced in r33117.
+ [Bug #5251] [ruby-core:39195]
-Fri Aug 8 03:22:28 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * thread.c (rb_thread_select): must call rb_fd_init() before using
+ rb_fdset_t. see the implementations of rb_fd_init()s if you want to
+ know the reason.
- * lib/webrick/httputils.rb (FormData#list): should not take
- a side effect for the receiver.
+Tue Aug 30 22:34:45 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Thu Aug 7 14:40:37 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * test/dl/test_callback.rb (test_callback_with_string): prevents
+ temporary string from GC.
- * cygwin/GNUmakefile: better --disbale-shared option support.
+Tue Aug 30 22:25:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * cygwin/GNUmakefile: add forwarding DLL target for cygwin.
+ * vm_insnhelper.c (vm_call_cfunc): revert r33112. RB_GC_GUARD macro
+ protect a VALUE from GC. It's not for general anti-optimizing
+ purpose.
-Thu Aug 7 14:21:05 2003 Corinna Vinschen <vinschen@redhat.com>
+Tue Aug 30 11:06:19 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in: Fix Cygwin specific naming of libraries to
- be net distribution compliant. (ruby-bugs:PR#1077)
- cygwin-ruby18.dll -> cygruby18.dll
+ * ext/json: Merge json gem 1.5.4+ (2149f4185c598fb97db1).
+ [Bug #5173] [ruby-core:38866]
-Thu Aug 7 12:51:38 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Aug 30 09:57:50 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (rb_f_at_exit): should not be called without a block.
- block_given check added.
+ * lib/thread.rb (Queue#pop): fix a race against Thread.wakeup.
+ Patch by Masaki Matsushita <glass.saga at gmail dot com>
+ [Bug #5195] [ruby-dev:44400]
-Thu Aug 7 06:46:06 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Aug 30 09:48:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (rb_call0): forgot to pop ruby_class.
+ * cont.c (fiber_entry): fix stack allocation failure on Debian
+ GNU/kFreeBSD.
+ Patch by Lucas Nussbaum <lucas at lucas-nussbaum dot net>.
+ [Bug #5241] [ruby-core:39147]
- * eval.c (rb_call0): update ruby_class as well as ruby_cref.
- (ruby-bugs-ja:PR#540)
+Tue Aug 30 09:28:01 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Aug 7 04:52:50 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread.c (rb_thread_select): rewrite by using
+ rb_thread_fd_select(). old one is EINTR unsafe.
+ Patch by Eric Wong. [Bug #5229] [ruby-core:39102]
- * eval.c (rb_yield_0): remove ruby_frame->cbase and unify to
- ruby_cref. [ruby-talk:78141]
+ * test/-ext-/old_thread_select/test_old_thread_select.rb:
+ a testcase for rb_thread_select().
+ * ext/-test-/old_thread_select/old_thread_select.c: ditto.
+ * ext/-test-/old_thread_select/depend: ditto.
+ * ext/-test-/old_thread_select/extconf.rb: ditto.
-Thu Aug 7 04:19:15 2003 Akinori MUSHA <knu@iDaemons.org>
+Tue Aug 30 09:08:22 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c: FreeBSD/ia64's mcontext_t is a bit different from that of
- Linux/ia64. This makes gc.c compile but miniruby coredumps for
- the moment.
+ * configure.in: fix a build failure on GNU Hurd.
+ Patch by Samuel Thibault <sthibault at debian dot org>. Thank you!
+ [Bug #5250] [ruby-core:39185]
-Thu Aug 7 00:15:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
+Sun Aug 29 23:22:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * ext/bigdecimal.c: Comparison results adjusted to Float's.
- * ext/bigdecimal.c: Use rb_num_coerce_????(x,y) instead of own.
+ * test/ruby/test_numeric.rb (test_num2long): modify a test against the
+ change by r33108.
-Wed Aug 6 22:58:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Sun Aug 29 09:58:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * lib/test/unit/testcase.rb: Added equality checking.
- * lib/test/unit/testsuite.rb: Added equality checking.
- * lib/test/unit/assertions.rb: Fixed a warning.
+ * numeric.c (bit_coerce): A Fixnum and a Bignum are only permitted for
+ bitwise arithmetic with a Fixnum. #1792
-Wed Aug 6 17:28:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_fixnum.rb: add tests for the above change.
- * ext/extmk.rb (extmake): pass LIBPATH to make ruby. [ruby-dev:21137]
+ * bignum.c (bit_coerce): A Fixnum and a Bignum are only permitted for
+ bitwise arithmetic with a Bignum. #1792
- * ext/extmk.rb (extmake): set library name as source file name in
- Init_ext(). [ruby-dev:21137]
+ * test/ruby/test_bignum.rb: add tests for the above change.
- * lib/mkmf.rb (Logging::postpone): postpone logging messages after
- heading message as the result of the block.
+Sun Aug 28 15:38:17 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * lib/mkmf.rb (macro_defined?): append newline to src unless ended
- with it.
+ * ext/date/date_parse.c (date_zone_to_diff): keep a temporary string
+ stored in variable while the contents buffer is being used.
- * lib/mkmf.rb (have_library): treat nil function name as "main".
- (ruby-bugs:PR#1083)
+ * ext/date/date_parse.c (date_zone_to_diff): get rid of out of bounds
+ memory read. [ruby-dev:44409] [Bug #5213]
- * lib/mkmf.rb (pkg_config): should append additional libraries to
- $libs but not $LIBS. [ruby-dev:21137]
+Sun Aug 28 05:29:50 2011 Ryan Davis <ryand-ruby@zenspider.com>
- * ext/io/wait/extconf.rb: check DOSISH macro instead of platform.
+ * lib/minitest/*: Imported minitest 2.5.1 (r6596)
+ * test/minitest/*: ditto
- * ext/digest/sha1/extconf.rb: have_library already appends library
- name.
+Sat Aug 27 20:46:05 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Wed Aug 6 17:23:57 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm.c (rb_vm_rewrite_dfp_in_errinfo): change return type
+ to suppress a warning.
- * eval.c: initialize /* OK */ variables by Qnil to stop warnings.
+ * vm_core.h: ditto.
-Wed Aug 6 04:58:32 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Aug 27 19:04:06 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/Setup*: add io/wait and openssl.
+ * internal.h (rb_strftime_timespec): moved from time.c and define only
+ if ruby/encoding.h is included.
-Wed Aug 6 01:13:38 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h (rb_strftime): ditto.
- * eval.c (rb_f_autoload): use ruby_cbase instead of ruby_class.
+Sat Aug 27 18:53:51 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * eval.c (rb_f_autoload_p): ditto.
+ * proc.c (proc_new): force to rewrite errinfo when calling Proc.new in ensure.
+ [Bug #5234] [ruby-core:39125]
+ This code will be removed after changing throw mechanism (see r33064).
- * class.c (rb_mod_init_copy): no longer implements independent
- clone and dup methods. override "initialize_copy" instead.
- [ruby-core:01352]
+ * vm.c (rb_vm_rewrite_dfp_in_errinfo): new function.
- * object.c (rb_class_s_alloc): define Class allocation function.
- this makes Classes to follow clone framework that uses
- initialize_copy.
+ * vm.c (vm_make_env_each): changed accordingly.
- * object.c (rb_class_initialize): separate instantiation and
- initialization.
+ * vm_core.h: ditto.
+
+ * bootstraptest/test_flow.rb: add tests for above.
+
+Sat Aug 27 18:44:06 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * internal.h (rb_strftime_timespec): move to time.c because it depends
+ encoding.h.
+
+Sat Aug 27 18:17:58 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * strftime.c (rb_strftime_with_timespec): get enc argument to specify
+ the encoding of the format. On Windows (at least Japanese Windows),
+ Time#strftime("%Z") includes non ASCII in locale encoding (CP932).
+ So convert locale to default internal. [ruby-core:39092] [Bug #5226]
+
+ * strftime.c (rb_strftime): ditto.
+
+ * strftime.c (rb_strftime_timespec): ditto.
+
+ * internal.h (rb_strftime_timespec): follow above.
+
+ * time.c (rb_strftime_alloc): ditto.
+
+ * time.c (strftimev): ditto.
+
+ * time.c (time_strftime): ditto.
+
+ * time.c (time_to_s): the resulted string of Time#to_s is always
+ ascii only, so this should be US-ASCII.
+
+ * time.c (time_asctime): ditto.
+
+Sat Aug 27 11:18:12 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * Revert r33078. It caused a Rails application NoMethodError.
+
+ /home/nahi/git/emptyApp/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/utils.rb:157: warning: toplevel constant ScanError referenced by Regin::Parser::ScanError
+ /home/nahi/git/emptyApp/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/vendor/regin/regin/parser.rb:17:in `parse_regexp': undefined method `scan_str' for #<Regin::Parser:0x00000002344548> (NoMethodError)
+
+Sat Aug 27 08:44:58 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Import RDoc 3.9.4. Typo and grammar fixes by Luke Gruber.
+ [Ruby 1.9 - Bug #5203]
+
+Sat Aug 27 07:53:34 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/open-uri.rb: Fix indentation of OpenURI::OpenRead#open. Use ++
+ instead of `' for method arguments in open-uri.rb
+
+Sat Aug 27 07:22:07 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/pathname/lib/pathname.rb: Fix typos and grammar mistakes. Patch
+ by Luke Gruber. [#5203]
+ * ext/pty/lib/expect.rb: ditto
+ * lib/mathn.rb: ditto
+ * lib/net/http.rb: ditto
+ * lib/open-uri.rb: ditto
+ * lib/ostruct.rb: ditto
+ * lib/tempfile.rb: ditto
+ * lib/thread.rb: ditto
+ * lib/weakref.rb: ditto
+ * sample/webrick/httpproxy.rb: ditto
+
+Sat Aug 27 04:03:18 2011 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.c (iseq_data_to_ary): fix type of variable
+ (long -> unsigned long) to suppress a warning.
+
+Sat Aug 27 04:02:11 2011 Koichi Sasada <ko1@atdot.net>
+
+ * vm_core.h: add a decl. of rb_autoloading_value().
+
+Fri Aug 26 19:12:08 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * variable.c: Make autoload thread-safe. See #921.
+
+ What's the problem?
+ autoload is thread unsafe. When we define a constant to be
+ autoloaded, we expect the constant construction is invariant. But
+ current autoload implementation allows other threads to access the
+ constant while the first thread is loading a file.
+
+ What's happening inside?
+ The current implementation uses Qundef as a marker of autoload in
+ Constant table. Once the first thread find Qundef as a value at
+ constant lookup, it starts loading a defined feature. Generally a
+ loaded file overrides the Qundef in Constant table by module/class
+ declaration at very beginning lines of the file, so other threads
+ can see the new Module/Class object before feature loading is
+ finished. It breaks invariant construction.
+
+ How to solve?
+ To ensure invariant constant construction, we need to override
+ Qundef with defined Object after the feature loading. For keeping
+ Qundef in Constant table, I expanded autoload_data struct in
+ Module to have a slot for keeping the defined object while feature
+ loading. And changed Module's constant lookup/update logic a
+ little so that the slot is only visible from the thread which
+ invokes feature loading. (== the first thread which accessed the
+ autoload constant)
+
+ Evaluation?
+ All test passes (bootstrap test, test-all and RubySpec) and added
+ 8 tests for threading behavior. Extra logics are executed only
+ when Qundef is found, so no perf drop should happen except
+ autoloading.
+
+ * variable.c (rb_autoload): Prepare new autoload_data struct.
+
+ * variable.c (rb_autoload_load): Load feature and update Constant
+ table after feature loading is finished.
+
+ * variable.c (rb_const_get_0): When the fetched constant is under
+ autoloading, it returns the object only for the thread which starts
+ autoloading.
+
+ * variable.c (rb_const_defined_0): Ditto.
+
+ * variable.c (rb_const_set): When the specified constant is under
+ autoloading, it sets the object only for the thread which starts
+ autoloading. Otherwise, simply overrides Qundef with constant
+ override warning.
+
+ * vm_insnhelper.c (vm_get_ev_const): Apply same change as
+ rb_const_get_0 in variable.c.
+
+ * test/ruby/test_autoload.rb: Added tests for threading behavior.
+
+Fri Aug 26 10:10:37 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 1.8.10. Fixes security issue in
+ creating ruby-format gemspecs. Fixes Gem.dir not being at the front
+ of Gem.path to fix uninstall and cleanup commands. Fixes gem
+ uninstall stopping on the first missing gem.
+
+Fri Aug 26 08:21:10 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * time.c (strftimev): Make Time#to_s default to US-ASCII encoding but
+ respect Encoding.default_internal. [ruby-core:39092]
+ * test/ruby/test_time.rb (class TestTime): Corresponding test.
+
+Thu Aug 25 09:43:16 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/lib/openssl/bn.rb: Hide copyright info from RDoc.
+ * ext/openssl/lib/openssl/digest.rb: ditto
+ * ext/openssl/lib/openssl/x509.rb: ditto
+ * ext/openssl/lib/openssl/cipher.rb: ditto
+
+Thu Aug 25 09:25:48 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/ossl_digest.c: Document OpenSSL::Digest::digest and add
+ an example to OpenSSL::Digest. Patch by Sylvain Daubert.
+ [Ruby 1.9 - Bug #5166]
+ * ext/openssl/lib/openssl/digest.rb (module OpenSSL): ditto
+
+Thu Aug 25 08:19:43 2011 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (vm_make_env_each): work around to solve Bug #2729.
+ fixes: Bug #2729
+ a patch from Kazuki Tsujimoto <kazuki@callcc.net>
+ This problem is caused by changing dfp (dynamic env pointer)
+ from saved dfp. Saved dfp is pointed env in VM stack. However,
+ the dfp can be moved because VM copies env from VM stack to
+ the heap. At this copying, dfp was also changed. To solve this
+ problem, I'll try to change throw mechanism (not save target dfp,
+ but save target cfp).
+
+ * bootstraptest/test_flow.rb: add a test for above.
+
+Thu Aug 25 07:57:33 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * numeric.c (int_round): Fix Integer#round [ruby-core:39096]
+
+Thu Aug 25 07:00:00 2011 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.h, vm_insnhelper.c, vm.c, vm_method.c, insns.def:
+ Manage a redefinition of special methods for each classes.
+ A patch from Joel Gouly <joel.gouly@gmail.com>. Thanks!
+
+Thu Aug 25 06:51:08 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: Fixing psych version number.
+ * ext/psych/psych.gemspec: updating the gemspec.
+
+Thu Aug 25 06:11:35 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/nodes/node.rb: default `to_yaml` encoding to be
+ UTF-8.
+ * test/psych/test_encoding.rb: test yaml dump encoding.
+
+Thu Aug 25 01:24:33 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * test/fileutils/test_fileutils.rb (test_chmod_symbol_mode): Solaris
+ seems to behave the same as FreeBSD.
+
+Thu Aug 25 01:11:36 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * test/ruby/test_rubyoptions.rb (test_script_from_stdin): slave pty
+ should be manipulated because master pty may not be a tty on some
+ environment (e.g. Solaris). [Bug:#5222] [ruby-dev:44420]
+
+Wed Aug 24 15:13:56 2011 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.h, iseq.c, compile.c: Change the line number data structure
+ to solve an issue reported at [ruby-dev:44413] [Ruby 1.9 - Bug #5217].
+ Before this fix, each instruction has an information including
+ line number (iseq::iseq_insn_info_table). Instead of this data
+ structure, recording only line number changing places
+ (iseq::iseq_line_info_table).
+ The order of entries in iseq_line_info_table is ascending order of
+ iseq_line_info_table_entry::position. You can get a line number
+ by an iseq and a program counter with this data structure.
+ This fix reduces memory consumption of iseq (bytecode).
+ On my measurement, a rails application consumes 21.8MB for
+ iseq with this fix on the 32bit CPU. Without this fix, it
+ consumes 24.7MB for iseq [ruby-dev:44415].
+
+ * proc.c: ditto.
+
+ * vm_insnhelper.c: ditto.
+
+ * vm_method.c: ditto.
+
+ * vm.c (rb_vm_get_sourceline): change to use rb_iseq_line_no().
+
+Wed Aug 24 09:49:10 2011 Koichi Sasada <ko1@atdot.net>
+
+ * insns.def (defined): fix to checking class variable.
+ A patch by Magnus Holm <judofyr@gmail.com>. Thanks!
+
+ * test/ruby/test_variable.rb: add a test for above.
+
+Wed Aug 24 08:53:06 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Update to RDoc 3.9.3. Fixes RDoc with `ruby -Ku`. Allows
+ HTTPS image paths to be turned into <img> tags. Prevents special
+ markup inside <tt> from being processed.
+
+Wed Aug 24 07:57:43 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 1.8.9. Fixes uninstalling multiple
+ gems and gem cleanup.
+
+Wed Aug 24 06:45:20 2011 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*: Imported minitest 2.5.0 (r6557)
+ * test/minitest/*: ditto
+
+Wed Aug 24 00:38:22 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * thread.c (update_coverage): skip coverage count up if the current
+ line is out of the way. rb_sourceline() is unreliable when source
+ code is big. [ruby-dev:44413]
+
+ * test/coverage/test_coverage.rb: add a test for above.
+
+Tue Aug 23 15:23:56 2011 Eric Hodel <drbrain@segment7.net>
+
+ * load.c (rb_f_require): Improve documentation of Kernel#require.
+ [Ruby 1.9 - Bug #5210]
+
+Tue Aug 23 11:27:26 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/zlib/zlib.c (gzfile_read_header): Ensure that each section of
+ gzip header is readable to avoid SEGV.
+
+ * test/zlib/test_zlib.rb (test_corrupted_header): Test it.
+
+Mon Aug 22 23:43:33 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * sprintf.c (rb_str_format): add RB_GC_GUARD to prevent temporary
+ strings from GC.
+
+Sun Aug 21 17:49:53 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * iseq.c (iseq_s_disasm): remove variable which is no longer used
+ since r33013.
+
+Sun Aug 21 14:20:58 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * configure.in: use LD_LIBRARY_PATH_64 on 64-bit Solaris.
+
+Sat Aug 20 13:19:52 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * iseq.c (iseq_s_disasm): fix a bug that may cause SEGV.
+
+ * test/ruby/test_method.rb (test_body): add a test for the above change.
+
+Sat Aug 20 10:43:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/stringio/stringio.c (strio_read): return new string if nil
+ is explicitly given as a buffer ([Bug #5207]), otherwise set the
+ encoding. also removed dead code.
+
+Fri Aug 19 14:25:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (proc_spawn_v, proc_spawn): should not wait the
+ spawned process.
+
+ * process.c (proc_spawn_v): fix missing argument, and try with
+ /bin/sh only if failed with ENOEXEC.
+
+Fri Aug 19 14:12:57 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (idle): raises a Net::IMAP::Error when the
+ connection is closed. based on the patch by Hugo Barauna.
+ [Bug #5190] [ruby-core:38930]
+
+Fri Aug 19 13:18:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * configure.in: defines _DARWIN_UNLIMITED_SELECT if the target_os
+ is darwin.
+
+Fri Aug 19 13:14:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * thread.c: add a description for the behavior of select(2) on
+ Mac OS X 10.7 (Lion).
+
+Fri Aug 19 11:28:58 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (msg_att): accepts extra space before ')'.
+ based on the patch by art lussos. [Bug #5163] [ruby-core:38820]
+
+Wed Aug 17 23:01:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (cannot_be_coerced_into_BigDecimal):
+ remove duplication.
+
+Wed Aug 17 15:27:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (cannot_be_coerced_into_BigDecimal):
+ add a new function for raising error when an object cannot coerce
+ into BigDecimal. [Bug #5172]
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimalValueWithPrec): use
+ cannot_be_coerced_into_BigDecimal function.
+
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): ditto.
+
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_log): ditto.
+
+ * test/bigdecimal/test_bigdecimal.rb: test for the above changes.
+
+ * test/bigdecimal/testbase.rb (under_gc_stress): add a new utility
+ method to run tests under the condition of GC.stress = true.
+
+Wed Aug 17 10:16:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * rational.c (nurat_coerce): Rational#coerce should converts itself
+ into Complex if the argument is a Complex with non-zero imaginary
+ part. [Bug #5020] [ruby-dev:44088]
+
+ * test/ruby/test_rational.rb (test_coerce): test for the above change.
+
+Wed Aug 17 06:33:19 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_x509cert.c: Add class documentation for
+ OpenSSL::X509::Certificate.
+
+Wed Aug 17 04:54:25 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_pkey.c: corrected docs, OpenSSL::PKey::DH does
+ *not* support #sign/verify.
+
+Tue Aug 16 18:56:54 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (ruby_threadptr_data_type): rename to hide.
+ [ruby-core:38972]
+
+Tue Aug 16 18:52:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/mkexports.rb (Exports::Mswin#each_export): exclude Init_
+ and _threadptr_ functions, as well as mingw.
+
+Tue Aug 16 09:31:44 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/dl: Add documentation. Patch by Vincent Batts.
+ [Ruby 1.9 - Bug #5192]
+
+Tue Aug 16 08:48:26 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/.document (fiddle): Remove duplicate entry
+ * ext/fiddle: Complete documentation of Fiddle. Patch by Vincent
+ Batts. [#5192]
+
+Tue Aug 16 08:00:15 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/socket: Make Socket documentation appear. Add documentation for
+ Socket, TCPServer, SOCKSSocket. Patch by Sylvain Daubert.
+ [Ruby 1.9 - Feature #5182]
+
+Mon Aug 15 09:58:55 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_ssl.c: Support disabling OpenSSL compression.
+
+ * test/openssl/test_ssl.rb: Add a test for it.
+ Thanks to Eric Wong for the patch.
+ [Ruby 1.9 - Feature #5183] [ruby-core:38911]
+
+Sun Aug 14 05:57:01 2011 Tanaka Akira <akr@fsij.org>
+
+ * test/socket/test_socket.rb (test_connect_timeout): added a test
+ based on a patch by Eric Wong. [ruby-core:38910]
+
+Sat Aug 13 22:17:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/mkconfig.rb: do not make the entries related to sitedir and
+ verdordir if disabled by --without options. [ruby-core:38922]
+ [Bug #5187]
+
+Sat Aug 13 17:03:22 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: [ruby-core:38861]
+
+Sat Aug 13 09:39:07 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/date/test_*.rb: added tests.
+
+Sat Aug 13 09:36:19 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * ext/date/date_parse.c (parse_ddd_cb): fix r32896. RB_GC_GUARD
+ insertion position was mistaken. [ruby-dev:44337] [Bug #5152]
+
+Sat Aug 13 09:26:24 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/core_ext.rb: Make Kernel#y private.
+ [ruby-core:38913]
+
+ * test/psych/test_yaml.rb: corresponding test.
+
+Sat Aug 13 09:05:16 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (date_strftime_alloc): followed the change
+ of r32885.
+
+ * doc/NEWS-1.9.3: followed the above change.
+
+Sat Aug 13 08:55:38 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/scalar_scanner.rb: Only consider strings
+ with fewer than 2 dots to be numbers. [ruby-core:38915]
+
+Sat Aug 13 08:47:20 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: [ruby-core:38855].
+
+Sat Aug 13 03:41:37 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/uri/common.rb: Fix documentation of URI::Parser.new. Patch by
+ Steve Klabnik. [Ruby 1.9 - Bug #5177]
+
+Sat Aug 13 02:19:57 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/digest/digest.c: Add documentation for the Digest module. Patch
+ by Sylvain Daubert. [Ruby 1.9 - Bug #5167]
+
+Sat Aug 13 01:56:11 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rake: Update to Rake 0.9.2.2. Prevent pollution of toplevel
+ namespace by Commands. Remove unused variable and debugging
+ statement in tests.
+
+Fri Aug 12 11:39:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: Describe "no" configure option for site_ruby
+ and vendor_ruby. Patch by Vit Ondruch. [Bug #5187][ruby-core:38921]
+
+Fri Aug 12 09:00:24 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Import RubyGems 1.8.8. Fixes encoding of YAML gemspec
+ from gems. Github Issue #149
+
+Fri Aug 12 08:17:46 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ipsocket.c (init_inetsock_internal): use SOMAXCONN for
+ listen backlog.
+
+ * ext/socket/unixsocket.c (rsock_init_unixsock): ditto.
+
+ * ext/socket/lib/socket.rb (Addrinfo#listen): ditto.
+ (Socket.tcp_server_sockets_port0): ditto.
+
+ * ext/socket/mkconstants.rb: define SOMAXCONN as 5 if not available.
+
+ [ruby-core:38493]
+
+Fri Aug 12 03:24:35 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Import RDoc 3.9.2. Fixes TIDYLINK for HTML output.
+
+Thu Aug 11 15:37:42 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * variable.c (autoload_delete): An autoload entry is still in a
+ RCLASS_IV_TBL, not in a RCLASS_CONST_TBL, so take back the table
+ changed in r29600. And an autoload entry keeps not a
+ rb_const_entry_t but a NODE so remove rb_const_entry_t thing added
+ in r29602.
+
+Thu Aug 11 15:07:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (link_command): use LIBRUBYARG in rbconfig for
+ unbundled extensions. [ruby-core:38802] [Bug #5147]
+
+ * lib/mkmf.rb (init_mkmf): revert r32902. [ruby-core:38903]
+
+Wed Aug 10 23:03:55 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/lib/socket.rb: fix argument check in the previous commit.
+
+Wed Aug 10 22:12:28 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/lib/socket.rb (Socket.tcp): add :connect_timeout option.
+ (Addrinfo#connect_from): add :timeout option.
+ (Addrinfo#connect): ditto.
+ (Addrinfo#connect_to): ditto.
+ [ruby-core:38538]
+
+Wed Aug 10 21:27:19 2011 Tanaka Akira <akr@fsij.org>
+
+ * lib/net/pop.rb: fix typo in document.
+
+ * lib/net/http.rb: ditto.
+
+ * lib/net/imap.rb: ditto.
+
+Wed Aug 10 19:30:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * complex.c (nucomp_rationalize): calls rationalize of real part if
+ imaginary part is exactly zero. The patch is made by Marc-Andre
+ Lafortune. fixes [Bug #5178] [ruby-core:38885]
+
+ * test/ruby/test_complex.rb (test_rationalize): add a test for the
+ above change.
+
+ * complex.c (nucomp_to_r): fix RDoc comment. The patch is made by
+ Marc-Andre Lafortune.
+
+Wed Aug 10 14:11:07 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (init_mkmf): set $LIBRUBYARG regardless of shared
+ option. [ruby-core:38802] [Bug #5147]
+
+Wed Aug 10 02:53:27 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb: come back autoload. OpenSSL constant is used
+ some places, so it leads mistakes like HTTP.start.
+
+Tue Aug 9 22:57:45 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * ext/date/date_parse.c (date_zone_to_diff): add RB_GC_GUARD.
+ [ruby-dev:44337] [Bug #5152]
+
+ * ext/date/data_parse.c (parse_ddd_cb): ditto.
+
+Tue Aug 9 14:25:47 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * ext/fiddle/conversions.c (generic_to_value): ffi_arg and ffi_sarg
+ should be used to handle shorter return value. fix [Bug #3861]
+ [ruby-core:32504]
+
+ * ext/fiddle/closure.c (callback): ditto
+
+ * ext/fiddle/conversions.h (fiddle_generic): ditto
+
+ * ext/fiddle/conversions.c (value_to_generic): char, short and int
+ are strictly distinguished on big-endian CPU, e.g. sparc64.
+
+Tue Aug 9 11:21:08 2011 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (gc_lazy_sweep): if sweep target slots are not found, we
+ try heap_increment() because it might be able to expand the
+ heap. [Bug #5127] [ruby-dev:44285]
+
+ * gc.c (gc_clear_mark_on_sweep_slots): if a sweeping was
+ interrupted, we expand the heap if at all possible.
+
+Tue Aug 9 12:20:33 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * test/fiddle/helper.rb (libc_so, libm_so): Solaris support added.
+ [ruby-core:38853] [Bug #5168]
+
+ * test/dl/test_base.rb (libc_so, libm_so): on Solaris, remove libc
+ and libm version numbers for detecting default libc and libm.
+
+Tue Aug 9 09:18:04 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c (gzfile_wrap): Document encoding options.
+
+ * ext/zlib/zlib.c (rb_gzwriter_s_open): ditto
+
+ * ext/zlib/zlib.c (rb_gzreader_s_open): ditto
+
+Sun Aug 7 23:31:32 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * time.c (rb_strftime_alloc): raise ERANGE if width is too large.
+ Patch by Nobuyoshi Nakada. [Bug #4457] [ruby-dev:43285]
+
+ * test/ruby/test_time.rb (class TestTime): add a test for the
+ above change.
+
+Sun Aug 7 22:51:45 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/openssl/ossl_asn1.c (decode_eoc): remove unused variables.
+ Patch by Eric Wong. [Feature #5157] [ruby-core:38798]
+
+ * ext/openssl/ossl_asn1.c (ossl_asn1_decode): ditto.
+
+ * ext/openssl/ossl_pkey.c (ossl_pkey_new_from_data): ditto.
+
+Sun Aug 7 22:37:08 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: add -Wunused-variable to default CFLAGS.
+ Patch by Eric Wong. [Feature #5157] [ruby-core:38798]
+
+Sun Aug 7 15:37:35 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/digest/sha2/sha2ossl.c: use original SHA384_Final on DragonFly.
+
+Sun Aug 7 14:08:16 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * ext/objspace/objspace.c: fix typos in a document.
+
+Sun Aug 7 07:14:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * cont.c (HAVE_GETCONTEXT): see getcontext(3) because DragonFly BSD
+ x64 port doesn't have it.
+
+Sun Aug 7 00:42:55 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/tk/lib/tk/wm.rb (Tk::Wm.command): Add the missing receiver
+ before calling epath. patched by flori
+ https://github.com/flori/ruby/commit/aa9474d32e5f2c57f8b0e2e0c528a03f06a4d433
+
+Sat Aug 6 07:06:34 2011 Eric Hodel <drbrain@segment7.net>
+
+ * marshal.c (w_object): Fix exception message when _dump_data is not
+ defined on a T_DATA object.
+
+Fri Aug 5 22:16:20 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * numeric.c (rb_infinity, rb_nan): use WORDS_BIGENDIAN to get endian.
+ fix [Bug #5160] [ruby-dev:44356]
+
+Fri Aug 5 17:14:11 2011 Akinori MUSHA <knu@iDaemons.org>
+
+ * test/test_syslog.rb (TestSyslog#test_log): Do not be too
+ specific about the log line format. Fixes #5081.
+
+Fri Aug 5 15:57:10 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * complex.c (f_signbit): fix compile error in gcc4 on Solaris with
+ CFLAGS="-std=gnu99". [ruby-dev:44355] fix [Bug #5159]
+
+ * math.c: ditto.
+
+Fri Aug 5 15:55:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_object.rb: tests that respond_to? returns false.
+
+Fri Aug 5 13:32:43 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/xmlrpc/client.rb, lib/xmlrpc/server.rb: should use
+ String#bytesize instead of String#size.
+
+Fri Aug 5 12:18:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (check_funcall): try respond_to? first if redefined.
+ [Bug #5158]
+
+Fri Aug 5 09:48:22 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Import RubyGems 1.8.7:
+ Added missing require for `gem uninstall --format-executable`.
+
+ The correct name of the executable being uninstalled is now displayed
+ with --format-executable.
+
+ Fixed `gem unpack uninstalled_gem` default version picker.
+
+ RubyGems no longer claims a nonexistent gem can be uninstalled.
+
+ `gem which` no longer claims directories are requirable files.
+
+ `gem cleanup` continues cleaning up gems if one can't be uninstalled
+ due to permissions. Issue #82.
+
+ Gem repository directories are no longer created world-writable.
+ Patch by Sakuro OZAWA. [Ruby 1.9 - Bug #4930]
+
+Fri Aug 5 07:00:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/io/console/test_io_console.rb (test_noctty): daemon() on
+ Fedora Rawhide seems not to detach the controlling terminal,
+ when the argument noclose is non-zero. ref: [Bug #5135]
+
+Thu Aug 4 23:48:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * thread_pthread.c (native_cond_signal): retry to call pthread_cond_signal
+ and pthread_cond_broadcast if they return EAGAIN in
+ native_cond_signal and native_cond_broadcast, respectively.
+ It is for the pthread implementation of Mac OS X 10.7 (Lion).
+ fixes #5155. [ruby-dev:44342].
+
+ * thread_pthread.c (native_cond_broadcast): ditto.
+
+ * thread_pthread.c (struct cached_thread_entry): stop using
+ pthread_cond_t and its functions directly.
+
+ * thread_pthread.c (register_cached_thread_and_wait): ditto.
+
+ * thread_pthread.c (use_cached_thread): ditto.
+
+Thu Aug 4 20:29:41 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * configure.in: when Solaris cc, use $(CC) to link shared libs.
+
+Thu Aug 4 20:19:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * error.c (report_bug): use a small message buffer instead of BUFSIZ.
+ It is needed for avoiding nested SIGSEGV on Linux.
+ Note: BUFSIZ is not proper buffer size. It's unrelated with maximum
+ filename length. :-/
+ [Bug #5139] [ruby-dev:44315]
+
+Thu Aug 4 16:08:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/rbinstall.rb (gem): install all gemspecs under lib and ext.
+
+ * tool/rbinstall.rb (Gem::Specification): may not be defined when
+ cross-compiling and BASERUBY is 1.8.
+
+Thu Aug 4 11:30:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * include/ruby/missing.h: define __syscall on OpenBSD as r32702.
+
+Thu Aug 4 03:02:54 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * tool/rbinstall.rb: use rubygems to load gemspecs, copy actual
+ gemspecs on install rather than generate fake ones for all gems.
+
+Thu Aug 4 02:45:10 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * configure.in: set CXX variable to the C++ compiler that matches the
+ C compiler specified by CC variable (e.g. use g++-4.2 for gcc-4.2).
+
+Thu Aug 4 02:21:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (link_command): use static library only for bundled
+ extensions. [Bug #5147]
+
+Thu Aug 4 02:02:10 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/psych.gemspec: installing psych as a gem.
+
+Wed Aug 3 16:01:35 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * util.c, include/ruby/util.h (ruby_add_suffix): remove the function.
+ [Bug #5153] [ruby-core:38736]
+
+ * io.c (argf_next_argv): remove the call of above function.
+
+ * ext/-test-/add_suffix, test/-ext-/test_add_suffix.rb: remove the test
+ extension module because this is only for testing ruby_add_suffix().
+
+ * LEGAL: remove the mention about a part of util.c, because now we
+ removed the part.
+
+ * io.c (argf_next_argv): now the new filename is not guaranteed to
+ use, so should check the return value of rename(2).
+
+ * test/ruby/test_argf.rb (TestArgf#test_inplace_rename_impossible):
+ now we expect same result with other platforms on no_safe_rename
+ platforms (=Windows).
+
+Wed Aug 3 09:18:08 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/xmlrpc/webrick_testing.rb (WEBrick_Testing#start_server):
+ Like r32795, bind address should be specified.
+
+Wed Aug 3 07:46:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (enc_find): mistakenly remained !. [Bug #5150]
+
+Wed Aug 3 00:11:08 2011 Tanaka Akira <akr@fsij.org>
+
+ * lib/prettyprint.rb: update document. [ruby-core:36776]
+
+Tue Aug 2 22:04:46 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * gc.c (init_heap): allocate sigaltstack after heaps are allocated.
+ [ruby-dev:44315] [Bug #5139]
+
+ * vm.c (thread_free): use free because objspace is not ready.
+
+ * vm.c (th_init): use malloc because objspace is not ready.
+
+Tue Aug 2 20:10:16 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * test/testunit/test_parallel.rb: pass "--ruby" option to
+ test/testunit/tests_for_parallel/runner.rb. [Bug #5132] [ruby-dev:44303]
+
+Tue Aug 2 15:53:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * encoding.c (str_to_encoding): rename from to_encoding and
+ use str_to_encindex.
+
+ * encoding.c (str_to_encindex): split from to_encoding.
+
+ * encoding.c (rb_to_encoding): use str_to_encoding.
+
+ * encoding.c (rb_obj_encoding): don't bypass rb_encoding*.
+ If it uses rb_encoding*, it bypass encindex. If it uses encindex,
+ it doesn't bypass.
+
+ * encoding.c (enc_find): add shortcut for encoding object, use
+ str_to_encindex, and avoid bypass rb_encoding*.
+
+Tue Aug 2 12:03:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (recursive_hash): hash value of emptied hash should be
+ equal to an empty hash. [ruby-core:38650]
+
+Tue Aug 2 11:42:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_enc_symname2_p): :! is valid symbol. [Bug #5136]
+
+Tue Aug 2 07:33:29 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/net/http/test_http.rb (TestNetHTTP_version_1_1_methods#test_timeout_during_HTTP_session):
+ If you connect to localhost, you should listen localhost.
+
+ * test/net/http/test_https.rb (TestNetHTTPS#test_timeout_during_SSL_handshake):
+ ditto.
+
+Tue Aug 2 06:18:15 2011 Luis Lavena <luislavena@gmail.com>
+
+ * lib/rubygems/installer.rb (class Gem): Correct path check on Windows
+ Possible fix for [Ruby 1.9 - Bug #5111]
+ * test/rubygems/test_gem_installer.rb (load Gem): ditto
+
+Mon Aug 1 20:12:03 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_process.rb (TestProcess#windows?): new method.
+
+ * test/ruby/test_process.rb (TestProcess#*): use above method.
+
+ * test/ruby/test_process.rb (TestProcess#test_execopts_redirect):
+ windows doesn't support FD_CLOEXEC.
+
+Mon Aug 1 15:45:23 2011 Eric Hodel <drbrain@segment7.net>
+
+ * test/rake/test_rake_functional.rb: Don't assume the binary name of
+ ruby is "ruby". [Ruby 1.9 - Bug #5114]
+ * test/rake/helper.rb: ditto
+
+Mon Aug 1 15:31:14 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/io/console/test_io_console.rb (TestIO_Console#test_sync):
+ Skip when PTY allocation failed (that's not our fault).
+
+Mon Aug 1 15:04:12 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/xmlrpc/test_webrick_server.rb (Test_Webrick#setup_http_server):
+ XMLRPC::Client.new3(), when called without host: argument, tries
+ to connect to a host where "localhost" resolves to. On the
+ other hand a WEBrick::HTTPServer.new(), when called without
+ BindAddress: argument, tries to listen all the address where
+ getaddrinfo(AF_UNSPEC) resolves to. This is a mismatch because
+ "localhost" might not resolve to one of those listening sockets.
+ We would better explicitly specify "localhost" here and if
+ failed, just skip the whole test.
+
+Mon Aug 1 14:24:56 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc.rb: Import RDoc 3.9.1. Fixes bugs in the RDoc::Markup
+ parser.
+
+Mon Aug 1 12:00:35 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * insns.def (concatstrings): don't use initial ASCII-8BIT string.
+ [ruby-core:38635] [Bug #5126]
+
+Sun Jul 31 22:57:16 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * enc/Makefile.in (ECHO1): Same as the recent fix in common.mk.
+ ":" in a make variable replacement cause a syntax error with
+ /usr/ccs/bin/make on Solaris. Uses $(NULLCMD) instead.
+
+Sun Jul 31 21:16:02 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * complex.c (f_signbit): gcc4 on Solaris DOES have signbit but does
+ not have it on header.
+
+ * math.c: ditto.
+
+Sun Jul 31 21:09:04 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * common.mk (node_name.inc): Use $(Q) for consistency.
+
+ * Makefile.in (INSNS): ditto.
+
+Sun Jul 31 21:19:51 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * lib/mkmf.rb (configuration:ECHO1): Same as the recent fix in
+ common.mk.
+ ":" in a make variable replacement cause a syntax error with
+ /usr/ccs/bin/make on Solaris. Uses $(NULLCMD) instead.
+
+Sun Jul 31 20:39:12 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * common.mk (ECHO1): nmake does not allow parenthesis in make variable
+ replacement.
+
+Sun Jul 31 23:06:57 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm.c (check_env): print debug messages to stderr.
+ [Feature #4871] [ruby-dev:43743]
+
+Sun Jul 31 22:50:23 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm.c (vm_make_env_each): don't save prev env value.
+ It is no longer used. [Feature #4871] [ruby-dev:43743]
+
+ * vm.c (check_env): changed accordingly.
+
+Sun Jul 31 20:21:36 2011 "Yuki Sonoda (Yugui)" <yugui@yugui.jp>
+
+ * common.mk (ECHO1): ":" in a make variable replacement cause a syntax
+ error with /usr/ccs/bin/make on Solaris. Uses $(NULLCMD) instead.
+
+ * configure.in (NULLCMD): new check.
+
+ * Makefile.in (NULLCMD): Reflects checking in configure.
+
+ * win32/Makefile.sub (NULLCMD): new assignment.
+
+Sun Jul 31 18:58:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_pipe): pipe on cygwin can succeed half but fail
+ half.
+
+Sun Jul 31 11:31:07 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm.c: check if cfp is valid. [Bug #5083] [ruby-dev:44208]
+
+Sun Jul 31 09:18:28 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Update to RDoc 3.9. Fixed `ri []`, stopdoc creating an
+ object reference, nodoc for class aliases, verbatim === lines.
+
+Sun Jul 31 01:29:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (rb_io_each_byte): remove unused variable e.
+
+Sat Jul 31 01:23:45 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * test/bigdecimal/test_bigdecimal.rb (test_version): removed.
+
+Sat Jul 30 23:19:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * defs/default_gems: separate from tool/rbinstall.rb.
+
+Sat Jul 30 23:14:44 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_each_byte): rbuf can be refreshed during yield.
+ [Bug #5119]
+
+Sat Jul 30 22:35:50 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * strftime.c (NEEDS): avoid SEGV due to integer overflow in
+ sparc-solaris2.10 and i686-linux. fix [Bug #4456] [ruby-dev:43284]
+
+Sat Jul 30 17:26:26 2011 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * test/win32ole/test_win32ole_variant.rb: use skip method to skip the test.
+
+ * test/win32ole/test_win32ole_variant_outarg.rb: ditto.
+
+Sat Jul 30 14:27:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_version): version 1.1.0.
+
+ * ext/bigdecimal/bigdecimal.gemspec: turn into a default gem.
+
+ * tool/rbinstall.rb: ditto.
+
+Sat Jul 30 11:21:55 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm_core.h (ALT_STACK_SIZE): use MINSIGSTKSZ*2 instead of SIGSTKSZ*2.
+ [ruby-core:38607]
+
+Sat Jul 30 10:39:14 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm.c (th_init): preallocate alternative stack.
+ NoMemoryError is better than rb_bug, of course.
+ Patch by Eric Wong. [ruby-core:38572][ruby-core:38594].
+
+ * signal.c (rb_register_sigaltstack): ditto.
+
+ * vm_core.h: moved ALT_STACK_SIZE definition from signal.c.
+ * vm.c (thread_free): use xfree() instead of free().
+
+Sat Jul 30 07:20:49 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/lib/socket.rb (udp_server_sockets): unused variable
+ removed.
+ patch by Jeremy Evans. [ruby-core:38600]
+
+Fri Jul 29 23:56:32 2011 Tanaka Akira <akr@fsij.org>
+
+ * lib/securerandom.rb: call OpenSSL::Random.seed at the
+ SecureRandom.random_bytes call.
+ based on the patch by Masahiro Tomita. [ruby-dev:44270]
+
+Fri Jul 29 23:53:48 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_set_len): new function to set array length.
+
+ * vm_eval.c (method_missing): set the length of argv array, to mark
+ arguments.
+
+ * vm_eval.c (rb_apply): get rid of too large alloca.
+
+Fri Jul 29 20:48:39 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb: fix typos.
+
+Fri Jul 29 20:28:56 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb: use whitespaces as a separator.
+
+Fri Jul 29 18:59:07 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb: add documents for constants.
+ patch by Eric Hodel. [ruby-core:37853] [Bug #4989]
+
+Fri Jul 29 16:00:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in (enable_pthread): use -pthread on OpenBSD without
+ explicit option. patched by Jeremy Evans. [ruby-core:38572]
+
+Thu Jul 28 23:36:28 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * ext/fiddle/closure.c (callback): use rb_ary_tmp_new() instead of
+ xmalloc() to allocate an array for arguments of callback procedure,
+ to prevent arguments from being swept by GC. [ruby-core:38546]
+ [Bug #4929]
+
+Thu Jul 28 22:36:06 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl_cipher.c (ossl_cipher_initialize): Avoid possible
+ SEGV from AES encryption/decryption. Processing data by
+ Cipher#update without initializing key (meaningless usage of Cipher
+ object since we don't offer a way to export a key) could cause SEGV.
+
+ In OpenSSL, the EVP which has EVP_CIPH_RAND_KEY flag (such as DES3)
+ allows uninitialized key, but other EVPs (such as AES) does not
+ allow it. Calling EVP_CipherUpdate() without initializing key causes
+ SEGV so we set the data filled with "\0" as the key by default. See
+ #2768.
+
+ * test/openssl/test_cipher.rb: test it.
+
+Thu Jul 28 14:25:08 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/rubygems/user_interaction.rb (Gem::StreamUI#tty?): typo.
+
+Thu Jul 28 12:32:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/dl/callback/mkcallback.rb (gencallback): use PTR2NUM.
+
+ * ext/dl/cptr.c (rb_dlptr_aref, rb_dlptr_aset): check NULL pointer
+ dereference.
+
+ * ext/dl/cptr.c (rb_dlptr_s_to_ptr): use rb_check_funcall.
+
+ * ext/dl/cptr.c (rb_dlptr_s_to_ptr): fix wrapping condition.
+
+Thu Jul 28 04:53:31 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/delegate.rb: Move file-level documentation to the appropriate
+ classes.
+
+Thu Jul 28 02:15:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/dl/cfunc.c (dlcfunc_mark), ext/dl/cptr.c (dlptr_mark):
+ workaround to mark wrapped object. this is not a true fix,
+ because [Bug #4929] is caused by the interface design of DL.
+
+Thu Jul 28 00:28:15 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/fileutils/test_fileutils.rb: add OpenBSD case.
+ patched by Jeremy Evans [ruby-core:38530] see #5097
+
+ * test/ruby/test_process.rb: ditto.
+
+Wed Jul 27 22:46:59 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/rinda/test_rinda.rb (test_remote_array_and_hash):
+ add local variables to protect objects from GC. [ruby-dev:44253]
+ [Bug #5104]
+
+Wed Jul 27 17:55:54 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * include/ruby/missing.h: define __syscall if the platform has
+ __syscall in the library but doesn't define it in headers
+ for example Mac OS X.
+
+Wed Jul 27 15:39:14 2011 Eric Hodel <drbrain@segment7.net>
+
+ * object.c: Add usage documentation for BasicObject. Based on patch
+ by Thomas Sawyer. [Ruby 1.9 - Bug #5067]
+
+Wed Jul 27 12:24:17 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/uninstaller.rb: Add missing require and update
+ messaging to avoid confusion with uninstall --format-executable.
+ [Ruby 1.9 - Bug #4062]
+
+Wed Jul 27 09:34:24 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 1.8.6.1.
+
+Wed Jul 27 09:27:59 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_pkcs12.rb: Add test and intermediate certificates.
+ [ Ruby 1.9 - Feature #3793 ] [ruby-core:32088]
+
+Wed Jul 27 01:05:32 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval_error.c (rb_print_undef_str): new function to raise
+ NameError for undefined method.
+
+ * load.c (rb_mod_autoload_p), object.c (rb_mod_const_get),
+ variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c
+ (rb_mod_{remove,undef,alias}_method, set_method_visibility):
+ remove inadvertent symbol creation. based on the first patch by
+ Jeremy Evans at [ruby-core:38447]. [Feature #5089]
+
+ * vm_method.c (obj_respond_to): fix the respond_to_missing? override
+ case. based on the patch by Jeremy Evans at [ruby-core:38417].
+ [Feature #5072]
+
+ * parse.y (rb_check_id): make the given name a symbol or a string.
+ based on the second patch by Jeremy Evans at [ruby-core:38447]
+
+Wed Jul 27 00:50:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/lib/bigdecimal/util.rb (Rational#to_d):
+ zero or negative precision is error. fixes #5098.
+ [ruby-dev:44210]
+
+ * test/bigdecimal/test_bigdecimal_util.rb: add test for the above
+ change.
+
+Wed Jul 27 00:48:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): modified for
+ specifying precision. fixes #5098. [ruby-dev:44210]
+
+ * test/bigdecimal/test_bigdecimal_util.rb: add test for the above
+ change.
+
+Wed Jul 27 00:45:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/lib/bigdecimal/util.rb (Integer#to_d): added
+ for symmetry to BigDecimal() function with an Integer.
+ fixes #5098. [ruby-dev:44210]
+
+ * test/bigdecimal/test_bigdecimal_util.rb: add test for the above
+ change.
+
+Wed Jul 27 00:30:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/lib/bigdecimal/util.rb (BigDecimal#to_d): added
+ for adapting other Numeric subclasses. [ruby-dev:44245]
+
+ * test/bigdecimal/test_bigdecimal_util.rb: test for the above change.
+
+Wed Jul 27 00:27:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * bigdecimal/bigdecimal.c (VpDup) a new function for duplicating
+ a BigDecimal.
+
+ * bigdecimal/bigdecimal.c (BigDecimal_new): support generating a new
+ BigDecimal from another BigDecimal using BigDecimal global function
+ or constructor. [ruby-dev:44245]
+
+Tue Jul 26 23:33:24 2011 Igor Zubkov <igor.zubkov@gmail.com>
+
+ * array.c: Fix typo. https://github.com/ruby/ruby/pull/36
+
+Mon Jul 25 23:51:01 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * proc.c: pre-allocate the unlinked_method_entry_list_entry struct to
+ avoid memory allocation during GC. based on a patch from Eric Wong.
+ [ruby-core:38498]
+
+Mon Jul 25 23:39:33 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rake/test_rake_directory_task.rb (TestRakeDirectoryTask#
+ test_directory_win32): fixed wrong test.
+
+Mon Jul 25 22:36:11 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * proc.c (struct METHOD), gc.c (gc_marks), vm_method.c
+ (rb_gc_mark_unlinked_live_method_entries): fix SEGV bug.
+ rb_method_entry_t was free'd even when the method is still on the
+ stack if it is BMETHOD (i.e., Method#call). This is because
+ rb_method_entry_t is embedded in struct METHOD. This commit
+ separates them and marks the live method entries.
+ See [ruby-core:38449] in detail. fix [Bug #5047] [ruby-core:38171]
+
+Mon Jul 25 22:14:37 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * lib/xmlrpc/client.rb: Fix possible HTTP header formatting failure by
+ 'Basic' header. Long username caused the base64 String truncation in
+ HTTP header which is not allowed. See #5046.
+
+ * test/xmlrpc/test_webrick_server.rb: test it.
+
+Mon Jul 25 15:04:33 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/lib/openssl.rb: End of transition period introduced by
+ [ruby-dev:38018]. From the next version of 1.9.3, you should use
+ require "openssl"
+ instead of
+ require "openssl/ssl"
+ and
+ require "openssl/x509"
+
+Mon Jul 25 13:46:38 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/lib/openssl/x509.rb: Cosmetic change: move definition
+ introduced in r30152 to x509-internal.rb.
+
+Mon Jul 25 13:09:42 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl_ssl.c (ossl_ssl_shutdown): Avoid randomly generated
+ SSLError from SSLSocket just after invoking SSLSocket#close.
+ OpenSSL's SSL_shutdown could try to send alert packet and it might
+ set SSLerr(global error stack) as the result. It causes the next
+ SSL read/write operation to fail by unrelated reason.
+
+ By design, we're ignoring any error at SSL_shutdown() so we clear
+ global error stack after SSL_shutdown is called. See #5039.
+
+Sun Jul 24 20:29:53 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: refine the recvmsg test.
+
+Sun Jul 24 20:02:31 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: fix the recvmsg test.
+
+Sun Jul 24 08:42:51 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: test recvmsg allocates file descriptors for
+ fd passing even with MSG_PEEK.
+
+ * ext/socket/ancdata.c: use the above test result.
+
+Sun Jul 24 01:04:50 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/specification.rb: Restore behavior of
+ Gem::Specification#loaded. [Ruby 1.9 - Bug #5032]
+
+Sun Jul 24 00:05:00 2011 Jeremy Evans <merch-redmine@jeremyevans.net>
+
+ * error.c (rb_name_error_str): new function to raise NameError
+ with the name string but not ID.
+
+ * object.c, proc.c, variable.c: more removal of inadvertent symbol
+ creation. [Feature #5079]
+
+Sat Jul 23 21:14:00 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * lib/cmath.rb (cbrt): should return a real number if possible.
+
+Sat Jul 23 20:12:52 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/rake/test_rake_functional.rb (setup): Use __FILE__ for the base
+ directory. Current directory is not the top source directory when
+ the building process runs on other than there.
+
+ * test/rake/test_rake_rake_test_loader.rb: ditto.
+
+ * test/rake/test_rake_task_argument_parsing.rb
+ (test_terminal_width_using_hardcoded_80): hardcoded 80 is used
+ when app.unix? is false.
+
+Sat Jul 23 20:11:50 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: an issue that is same as [ruby-dev:44071].
+ * ext/date/date_strftime.c: identical to [ruby-dev:44112].
+
+Sat Jul 23 19:12:53 2011 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * test/win32ole/test_err_in_callback.rb (test_err_in_callback):
+ skip test if ADODB.connection is not available.
+
+Sat Jul 23 15:37:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * parse.y (rb_enc_symname_type): :$a!, @a! and so on are not
+ valid symbols, so they should be inspected with quotes.
+
+Sat Jul 23 17:06:25 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c (rb_update_max_fd): validate fd.
+
+ * ext/socket/rubysocket.h (rsock_discard_cmsg_resource): add
+ msg_peek_p argument for the declaration.
+
+ * ext/socket/ancdata.c (discard_cmsg): add msg_peek_p argument.
+ assume FreeBSD, NetBSD and MacOS X doesn't generate passed fd
+ when MSG_PEEK.
+ (rsock_discard_cmsg_resource): add msg_peek_p argument.
+ (bsock_recvmsg_internal): call rsock_discard_cmsg_resource with
+ msg_peek_p argument.
+
+ * ext/socket/unixsocket.c (unix_recv_io): call
+ rsock_discard_cmsg_resource with msg_peek_p argument.
+
+Sat Jul 23 14:38:28 2011 Eric Hodel <drbrain@segment7.net>
+
+ * test/rake*: Remove dependencies on flexmock and session gems.
+ [Ruby 1.9 - Bug #4987]
+
+Sat Jul 23 12:19:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_check_id): take care of attrset ID created
+ implicitly by local ID. [Bug #5084]
+
+ * parse.y (rb_check_id): conversion condition was inverse.
+ [Bug #5084]
+
+Fri Jul 22 21:46:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm_insnhelper.c (vm_call_cfunc): added volatile for a workaround
+ of cfp consistency error problem on OS X 10.7 (Lion). It's
+ suspected llvm optimization bug.
+ [Bug #5074] [ruby-dev:44185]
+
+Fri Jul 22 21:18:20 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/generic.rb (WFKV_): unroll the loop of regexp.
+
+ * lib/uri/generic.rb (URI.decode_www_form_component): ditto.
+
+Fri Jul 22 21:06:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (rb_mod_{const,cvar}_defined, rb_obj_ivar_defined):
+ avoid inadvertent symbol creation in reflection methods. based
+ on a patch by Jeremy Evans at [ruby-core:38367]. [Feature #5072]
+
+ * vm_method.c (rb_mod_method_defined)
+ (rb_mod_{public,private,protected}_method_defined)
+ (obj_respond_to): ditto.
+
+ * parse.y (rb_check_id): new function returns already interned ID
+ or 0.
+
+Fri Jul 22 20:44:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_is_global_id, rb_is_attrset_id): add missing
+ predicates.
+
+Fri Jul 22 20:24:38 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/ruby/test_object.rb (TestObject#test_respond_to_missing):
+ 2nd argument of respond_to_missing? is not optional.
+
+Fri Jul 22 19:05:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_enc_symname2_p): get rid of potential out-of-bound
+ access.
+
+Fri Jul 22 13:55:59 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/http.rb: Net::HTTP#finish is used to manually close
+ connections. [Ruby 1.9 - Bug #5045]
+
+Fri Jul 22 13:51:29 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/readline/readline.c: Add examples for Readline.completion_proc=.
+ [Ruby 1.9 - Bug #5057]
+
+Fri Jul 22 13:03:12 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_hmac.c: Revert checking return type of
+ HMAC_Init_ex as it is not compatible with OpenSSL < 1.0.0.
+
+Fri Jul 22 12:10:21 2011 Eric Hodel <drbrain@segment7.net>
+
+ * tool/rbinstall.rb (default gems): Install executables into the fake
+ gem dir for Gem.bin_path. [#4485]
+
+Fri Jul 22 11:20:20 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_digest.c: Check return value of EVP_DigestInit_ex.
+ * ext/openssl/ossl_hmac.c: Check return value of HMAC_Init_ex.
+ Thanks, Jared Jennings, for the patch.
+ [ Ruby 1.9 - Bug #4944 ] [ruby-core:37670]
+
+Fri Jul 22 09:09:43 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_engine.c: Avoid double free of ENGINE reference.
+ * test/openssl/test_engine.rb: Add a test for it.
+ Thanks to Ippei Obayashi for providing the patch.
+ [ Ruby 1.9 - Bug #5062 ] [ruby-dev:44173]
+
+Fri Jul 22 06:37:13 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/csv.rb: Do not modify CSV.generate's argument [ruby-core:38356]
+
+Thu Jul 21 20:59:59 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ancdata.c (discard_cmsg): workaround for MacOS X Lion.
+
+Thu Jul 21 20:02:11 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * thread.c (set_trace_func, thread_set_trace_func_m): reset tracing
+ state when set_trace_func hook is removed. This is workaround patch
+ to force to reset tracing state that is broken by continuation call.
+ a patch from James M. Lawrence. [Feature #4347] [ruby-core:34998]
+
+ * test/ruby/test_continuation.rb (class TestContinuation): add a test
+ for above. a patch from James M. Lawrence.
+
+Thu Jul 21 19:27:19 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * node.c (dump_node): add today's knowledge. "init arguments (m)" and
+ "init arguments (p)" of compile.c indicates a Ruby code that
+ evaluates multiple assignments that is in method or block
+ parameters: def foo((m1,m2), (m3,m4), *r, (p1,p2), (p3,p4)); end
+ The former (init arguments (m)) evaluates the multiple assignments
+ before rest argument, that are (m1,m2) and (m3,m4). The letter
+ (init arguments (p)) does ones after rest argument, that are
+ (p1,p2) and (p3, p4).
+
+Thu Jul 21 18:11:07 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enum.c (enum_inject): remove empty line to notify rdoc
+ Enumerable#reduce is alias. patched by milki@github.
+ https://github.com/ruby/ruby/pull/26
+
+Thu Jul 21 17:30:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * array.c (rb_ary_delete_at_m): use simple array literal in rdoc.
+ patched by samuel tonini. [ruby-core:38310] [Bug #5066]
+
+Thu Jul 21 17:14:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#each):
+ Allow HTTP/0.9 request which doesn't has any header or body.
+ patched by Felix Jodoin. [ruby-core:38040] [Bug #5022]
+
+Wed Jul 20 23:02:18 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * io.c (rb_update_max_fd): remove parentheses. they are not in
+ macro.
+
+Wed Jul 20 22:22:23 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_update_max_fd): declaration moved from
+ internal.h.
+
+ * file.c: ditto.
+
+ * io.c: call rb_update_max_fd for each new fds.
+
+ * process.c: ditto.
+
+ * random.c: ditto.
+
+ * ruby.c: ditto.
+
+ * ext/io/console/console.c: ditto.
+
+ * ext/openssl/ossl_bio.c: ditto.
+
+ * ext/pty/pty.c: ditto.
+
+ * ext/socket/init.c: ditto.
+
+ * ext/socket/socket.c: ditto.
+
+ * ext/socket/ancdata.c: ditto.
+
+ * ext/socket/unixsocket.c: ditto.
+
+Wed Jul 20 15:16:22 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/dl/handle.c (dlhandle_sym): clear previous error with dlerror()
+ before calling dlsym(). [ruby-dev:44091] [Bug #5021]
+
+Wed Jul 20 07:16:26 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * NEWS: mention Kernel#warn. [ruby-core:38119] [Feature #5029]
+
+Tue Jul 19 16:40:45 2011 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
+
+ * cont.c (cont_save_thread): fix missing semicolon.
+
+Tue Jul 19 16:25:15 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c (UPDATE_MAXFD): removed.
+
+Tue Jul 19 16:07:45 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c (rb_update_max_fd): new function.
+
+ * internal.h (rb_update_max_fd): declare rb_update_max_fd.
+
+ * thread_pthread.c (rb_thread_create_timer_thread): update max fd when
+ timer thread pipe is created.
+
+Mon Jul 18 13:36:47 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: define a new BadAlias error class.
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: raise an exception when
+ deserializing an alias that does not exist.
+
+ * test/psych/test_merge_keys.rb: corresponding test.
+
+Mon Jul 18 00:00:46 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * ext/curses/curses.c: added the new class Curses::Pad, which
+ supports scrolling. patch by Eric Hodel. [Feature #4896]
+ [ruby-core:37206]
+
+Sun Jul 17 16:26:40 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_check_trusted): new function to check an object is
+ trusted.
+
+ * struct.c (rb_struct_modify), time.c (time_modify): check by the
+ above function to show proper class names. [Bug #5036]
+
+Sun Jul 17 15:30:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_warn_m): accept multiple args in like puts. rdoc
+ patch by Erik Price at [ruby-core:38119]. [Feature #5029]
+
+Sun Jul 17 07:56:31 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_ssl_session.rb: add PEM SSL session without TLS
+ extensions. Use this as the default for the tests to ensure
+ compatibility with OpenSSL 0.9.7.
+ [ Ruby 1.9 - Bug #4961 ] [ruby-core:37726]
+
+Sat Jul 16 17:29:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_UNIVERSAL_ARCH): restore arch flag.
+ Bug #4977
+
+Sat Jul 16 06:27:51 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/uri/common.rb (module): Remove optional parser argument to
+ Kernel#URI
+ [ruby-core:38061]
+
+ * lib/uri/generic.rb (module): ditto
+
+Sat Jul 16 03:19:45 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (is_socket, is_console): add prototypes to fix compile
+ problem with gcc introduced at r32549.
+ reported by Jon Forums. [Bug #5030] [ruby-core:38079]
+
+Sat Jul 16 00:55:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * time.c (time_dup): used rb_obj_class() instead of CLASS_OF().
+ The patch is made by Kazuki Tsujimoto. [Bug #5012] [ruby-dev:44071]
+
+ * test/ruby/test_time.rb (TestTime#test_getlocal_dont_share_eigenclass):
+ added a new test for eigenclass of time object.
+
+Fri Jul 15 19:11:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * bignum.c (bigsub_int): add RB_GC_GUARD. This patch is made by
+ Makoto Kishimoto. fixes #4223 [ruby-dev:42907]
+
+ * bignum.c (bigadd_int): ditto.
+
+Fri Jul 15 14:27:53 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c, include/ruby/win32.h (rb_w32_io_cancelable_p): renamed
+ from rb_w32_has_cancel_io(). now it takes a parameter as fd to check
+ the fd is console or not, because we cannot cancel console input even
+ if we have cancel_io function.
+
+ * io.c (WAIT_FD_IN_WIN32): call above function instead of the old one,
+ so now we can kill the thread which calls STDIN.gets.
+ the problem was reported by ko1 via IRC.
+
+Fri Jul 15 09:10:41 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/digest/sha2/sha2.c (SHA256_Update, SHA512_Update): avoid Bus
+ Error caused by unalignment access on Sparc-Solaris (and possibly on
+ other similar environment.) This patch just do memcpy always instead
+ of checking architecture. I see no perf drop on my 64bit env. For
+ more details, see #4320.
+
+ * test/digest/test_digest.rb: add test for unalignment access.
+
+Fri Jul 15 01:51:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * regint.h (PLATFORM_UNALIGNED_WORD_ACCESS): Power PC does not
+ allow unaligned word access.
+
+ * st.c (UNALIGNED_WORD_ACCESS): x86_64 allows unaligned word
+ access as well as i386.
+
+Thu Jul 14 12:19:34 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl.c (ossl_verify_cb): trap the exception from
+ verify callback of SSLContext and X509Store and make the
+ verification fail normally. Raising exception directly from callback
+ causes orphan resources in OpenSSL stack. Patched by Ippei Obayashi.
+ See #4445.
+
+ * test/openssl/test_ssl.rb
+ (test_exception_in_verify_callback_is_ignored): test it.
+
+Tue Jul 12 23:41:49 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * NEWS: add a description of Signal.trap change.
+
+Tue Jul 12 20:02:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (reserved_signal_p): reverted a part of r32523.
+ chikanaga noticed trap(:CHLD) has some realworld usecase.
+ * test/ruby/test_signal.rb (TestSignal#test_reserved_signal):
+ ditto.
+
+Tue Jul 12 17:12:45 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * vm_method.c (rb_add_method): should not call method_added hook
+ for undef operation. [Bug #5015]
+
+Tue Jul 12 16:58:44 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb(Test::Unit::Options#process_args): Fix bug.
+ Fix process_args didn't return `@option` after r30939.
+
+Tue Jul 12 14:07:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (install_sighandler): fixed a race.
+
+Tue Jul 12 13:49:32 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (sig_trap): don't permit to change a signal handler which
+ the interpreter reserved.
+ * signal.c (reserved_signal_p): ditto.
+ [Bug #2616] [ruby-core:27625]
+
+ * test/ruby/test_signal.rb (TestSignal#test_reserved_signal):
+ added a test for reserved signal.
+
+Tue Jul 12 11:58:28 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/setup.mak: support x86-amd64 cross compile environment.
- * object.c (rb_obj_alloc): prohibit instantiation from
- uninitialized class.
+Mon Jul 11 23:22:28 2011 Yutaka Kanemoto <kanemoto@ruby-lang.org>
- * object.c (rb_class_superclass): check uninitialized class.
+ * time.c: can't compile time.c on AIX due to missing declaration for
+ ffs(). It is declared in strings.h on AIX.
- * array.c (rb_ary_fill): wrong index processing with block. this
- fix was done by Koji Arai <JCA02266@nifty.ne.jp> [ruby-list:38029]
+Mon Jul 11 15:54:24 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * marshal.c (w_object): should preserve generic ivar for nil,
- true, false, symbols, and fixnums.
+ * process.c: removed signal() macro. It's no longer used.
- * marshal.c (w_uclass): base_klass check should be done after
- rb_class_real().
+Mon Jul 11 15:02:24 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Aug 6 01:18:50 2003 Minero Aoki <aamine@loveruby.net>
+ * numeric.c (rb_num2ull): use FIX2LONG instead of FIX2ULONG. see
+ rb_num2ulong(). fixed the problem of ObjectSpace._id2ref of IL32LLP64
+ platforms, introduced at r32433.
- * lib/net/http.rb: update document.
+Mon Jul 11 05:38:05 2011 Yutaka Kanemoto <kanemoto@ruby-lang.org>
- * lib/net/pop.rb: ditto.
+ * thread_pthread.c (get_stack): need to adjust stack addr for
+ [Bug #1813] on AIX.
- * lib/net/protocol.rb: ditto.
+Mon Jul 11 01:16:27 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Aug 6 00:48:37 2003 Koji Arai <jca02266@nifty.ne.jp>
+ * thread_pthread.c (rb_thread_create_timer_thread): removed
+ rb_disable_interrupt()/rb_enable_interrupt().
+ * vm_core.h: ditto.
+ * process.c (static void before_exec): ditto.
+ * process.c (static void after_exec): ditto.
+ [Bug #4765] [ruby-dev:43571]
- * marshal.c (w_object): should recommend marshal_dump rather than
- _dump_data.
+ * eval_intern.h: removed rb_trap_restore_mask().
+ * vm_eval.c (rb_throw_obj): ditto.
+ * eval.c (setup_exception): ditto.
-Tue Aug 5 17:58:57 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * signal.c: removed trap_last_mask.
+ * signal.c (trap_restore_mask): removed.
+ * signal.c (init_sigchld): comment clarification why signal block
+ is needed. and removed trap_last_mask operation.
+ * signal.c (trap_ensure): removed trap_last_mask operation.
- * lib/fileutils.rb (install): should preserve timestamp only.
+ * signal.c (rb_disable_interrupt, rb_enable_interrupt): made
+ static and removed sigdelset(SIGVTALRM) and sigdelset(SIGSEGV).
-Tue Aug 5 17:31:59 2003 Ian Macdonald <ian@caliban.org>
+ * process.c (rb_syswait): removed implicit signal handler change.
- * lib/shell/command-processor.rb (Shell::CommandProcessor::rmdir):
- simple typo.
+Sun Jul 10 23:49:12 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-Tue Aug 5 15:47:34 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * docs/NEWS-1.9.3: moved from NEWS.
- * eval.c (rb_load): should preserve current source file/line.
+ * docs/ChangeLog-1.9.3: merged ChangeLog for 1.9.3.
-Tue Aug 5 10:04:42 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * NEWS: NEWS for 1.9.4 that describes changes since 1.9.3
- * string.c (str_new4): ptr may refer null_str.
+ * ChangeLog: new ChangeLog for 1.9.4.
-Mon Aug 4 17:25:18 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Jul 10 23:30:52 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * stable version 1.8.0 released.
+ * version.h (RUBY_VERSION): ruby_1_9_3 branch was forked.
+For the changes before 1.9.3, see doc/ChangeLog-1.9.3
For the changes before 1.8.0, see doc/ChangeLog-1.8.0
Local variables:
+coding: us-ascii
add-log-time-format: (lambda ()
(let* ((time (current-time))
+ (system-time-locale "C")
(diff (+ (cadr time) 32400))
(lo (% diff 65536))
- (hi (+ (car time) (/ diff 65536))))
+ (hi (+ (car time) (/ diff 65536))))
(format-time-string "%a %b %e %H:%M:%S %Y" (list hi lo) t)))
indent-tabs-mode: t
tab-width: 8
+change-log-indent-text: 2
end:
+vim: tabstop=8 shiftwidth=2
diff --git a/GPL b/GPL
index 5b6e7c66c2..d159169d10 100644
--- a/GPL
+++ b/GPL
@@ -1,12 +1,12 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
- Preamble
+ Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
+the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
-
- GNU GENERAL PUBLIC LICENSE
+
+ GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
-
+
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
-
+
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
-
+
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
- NO WARRANTY
+ NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -303,10 +303,9 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
+library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
diff --git a/KNOWNBUGS.rb b/KNOWNBUGS.rb
new file mode 100644
index 0000000000..b97a08d928
--- /dev/null
+++ b/KNOWNBUGS.rb
@@ -0,0 +1,5 @@
+#
+# This test file concludes tests which point out known bugs.
+# So all tests will cause failure.
+#
+
diff --git a/LEGAL b/LEGAL
index 908eb270f5..65706459cd 100644
--- a/LEGAL
+++ b/LEGAL
@@ -5,34 +5,59 @@ All the files in this distribution are covered under either the Ruby's
license (see the file COPYING) or public-domain except some files
mentioned below.
-regex.[ch]:
-
- These files are under LGPL. Treat them as LGPL says. (See the file
- LGPL for details)
-
- Extended regular expression matching and search library.
- Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file LGPL. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
- Multi-byte extension added May, 1993 by t^2 (Takahiro Tanimoto)
- Last change: May 21, 1993 by t^2
- removed gapped buffer support, multiple syntax support by matz <matz@nts.co.jp>
- Perl5 extension added by matz <matz@caelum.co.jp>
- UTF-8 extension added Jan 16 1999 by Yoshida Masato <yoshidam@tau.bekkoame.ne.jp>
+include/ruby/oniguruma.h:
+regcomp.c:
+regenc.[ch]:
+regerror.c:
+regexec.c:
+regint.h:
+regparse.[ch]:
+enc/ascii.c
+enc/big5.c
+enc/cp949.c
+enc/emacs_mule.c
+enc/encdb.c
+enc/euc_jp.c
+enc/euc_kr.c
+enc/euc_tw.c
+enc/gb18030.c
+enc/gb2312.c
+enc/gbk.c
+enc/iso_8859_1.c
+enc/iso_8859_10.c
+enc/iso_8859_11.c
+enc/iso_8859_13.c
+enc/iso_8859_14.c
+enc/iso_8859_15.c
+enc/iso_8859_16.c
+enc/iso_8859_2.c
+enc/iso_8859_3.c
+enc/iso_8859_4.c
+enc/iso_8859_5.c
+enc/iso_8859_6.c
+enc/iso_8859_7.c
+enc/iso_8859_8.c
+enc/iso_8859_9.c
+enc/koi8_r.c
+enc/koi8_u.c
+enc/shift_jis.c
+enc/unicode.c
+enc/us_ascii.c
+enc/utf_16be.c
+enc/utf_16le.c
+enc/utf_32be.c
+enc/utf_32le.c
+enc/utf_8.c
+enc/windows_1251.c
+
+Oniguruma ---- (C) K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+
+http://www.geocities.jp/kosako3/oniguruma/
+http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/oniguruma/
+http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/
+
+ When this software is partly used or it is distributed with Ruby,
+ this of Ruby follows the license of Ruby.
configure:
@@ -43,9 +68,8 @@ configure:
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
-config.guess:
-config.sub:
-parse.c:
+tool/config.guess:
+tool/config.sub:
As long as you distribute these files with the file configure, they
are covered under the Ruby's license.
@@ -72,7 +96,58 @@ parse.c:
configuration script generated by Autoconf, you may include it under
the same distribution terms that you use for the rest of that program.
+parse.c:
+
+ This file is licensed under the GPL, but is incorporated into Ruby and
+ redistributed under the terms of the Ruby license, as permitted by the
+ exception to the GPL below.
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+ /* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
util.c (partly):
+
+ Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
+
+ Permission to use, copy, modify, and distribute this software for any
+ purpose without fee is hereby granted, provided that this entire notice
+ is included in all copies of any software which is or includes a copy
+ or modification of this software and in all copies of the supporting
+ documentation for such software.
+
+ THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
+ WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY
+ REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
+ OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
+
win32/win32.[ch]:
You can apply the Artistic License to these files. (or GPL,
@@ -83,6 +158,32 @@ win32/win32.[ch]:
You may distribute under the terms of either the GNU General Public
License or the Artistic License, as specified in the perl README file.
+util.c (partly):
+
+ Copyright (c) 2004-2008 David Schultz <das@FreeBSD.ORG>
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
random.c
This file is under the new-style BSD license.
@@ -130,72 +231,109 @@ random.c
http://www.math.keio.ac.jp/matumoto/emt.html
email: matumoto@math.keio.ac.jp
+vsnprintf.c:
+
+ This file is under the old-style BSD license. Note that the
+ paragraph 3 below is now null and void.
+
+ Copyright (c) 1990, 1993
+ The Regents of the University of California. All rights reserved.
+
+ This code is derived from software contributed to Berkeley by
+ Chris Torek.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+ IMPORTANT NOTE:
+ --------------
+ From ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
+ paragraph 3 above is now null and void.
+
st.[ch]:
-x68/*:
missing/alloca.c:
missing/dup2.c:
+missing/erf.c:
missing/finite.c:
missing/hypot.c:
missing/isinf.c:
missing/isnan.c:
+missing/lgamma_r.c:
missing/memcmp.c:
missing/memmove.c:
-missing/strcasecmp.c:
missing/strchr.c:
-missing/streror.c:
-missing/strftime.c:
-missing/strncasecmp.c:
missing/strstr.c:
missing/strtol.c:
+missing/tgamma.c:
ext/digest/sha1/sha1.[ch]:
These files are all under public domain.
-missing/strtod.c:
-
- This file will not be used on most platforms depending on how the
- configure script results. In any case you must not receive any fee
- with the file itself.
-
- Copyright (c) 1988-1993 The Regents of the University of California.
- Copyright (c) 1994 Sun Microsystems, Inc.
+missing/crypt.c:
- Permission to use, copy, modify, and distribute this
- software and its documentation for any purpose and without
- fee is hereby granted, provided that the above copyright
- notice appear in all copies. The University of California
- makes no representations about the suitability of this
- software for any purpose. It is provided "as is" without
- express or implied warranty.
+ This file is under the old-style BSD license. Note that the
+ paragraph 3 below is now null and void.
-missing/strtoul.c:
+ Copyright (c) 1989, 1993
+ The Regents of the University of California. All rights reserved.
- This file will not be used on most platforms depending on how the
- configure script results. In any case you must not receive any fee
- with the file itself.
+ This code is derived from software contributed to Berkeley by
+ Tom Truscott.
- Copyright 1988 Regents of the University of California
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
- Permission to use, copy, modify, and distribute this
- software and its documentation for any purpose and without
- fee is hereby granted, provided that the above copyright
- notice appear in all copies. The University of California
- makes no representations about the suitability of this
- software for any purpose. It is provided "as is" without
- express or implied warranty.
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
-missing/erf.c:
-missing/crypt.c:
-missing/vsnprintf.c:
+missing/setproctitle.c
This file is under the old-style BSD license. Note that the
paragraph 3 below is now null and void.
- Copyright (c) 1990, 1993
- The Regents of the University of California. All rights reserved.
-
- This code is derived from software contributed to Berkeley by
- Chris Torek.
+ Copyright 2003 Damien Miller
+ Copyright (c) 1983, 1995-1997 Eric P. Allman
+ Copyright (c) 1988, 1993
+ The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -221,10 +359,46 @@ missing/vsnprintf.c:
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
- IMPORTANT NOTE:
- --------------
- From ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
- paragraph 3 above is now null and void.
+missing/strlcat.c
+missing/strlcpy.c
+
+ These files are under the new-style BSD license.
+
+ Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+missing/langinfo.c
+
+ This file is from http://www.cl.cam.ac.uk/~mgk25/ucs/langinfo.c.
+ Ruby uses a modified version. The file contains the following
+ author/copyright notice:
+
+ Markus.Kuhn@cl.cam.ac.uk -- 2002-03-11
+ Permission to use, copy, modify, and distribute this software
+ for any purpose and without fee is hereby granted. The author
+ disclaims all warranties with regard to this software.
ext/digest/md5/md5.[ch]:
@@ -264,18 +438,7 @@ ext/digest/rmd160/rmd160.[ch]:
Copyright (c) Katholieke Universiteit Leuven
1996, All Rights Reserved
-ext/digest/rmd160/rmd160hl.c:
-ext/digest/sha1/sha1hl.c:
-
- These files are under the beer-ware license.
-
- "THE BEER-WARE LICENSE" (Revision 42):
- <phk@login.dkuug.dk> wrote this file. As long as you retain this notice you
- can do whatever you want with this stuff. If we meet some day, and you think
- this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
-
ext/digest/sha2/sha2.[ch]:
-ext/digest/sha2/sha2hl.c:
These files are under the new-style BSD license.
diff --git a/LGPL b/LGPL
deleted file mode 100644
index b1e3f5a263..0000000000
--- a/LGPL
+++ /dev/null
@@ -1,504 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/Makefile.in b/Makefile.in
index 8fd59babcd..e68976257b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,16 +1,33 @@
SHELL = /bin/sh
+NULLCMD = @NULLCMD@
+n=$(NULLCMD)
+ECHO1 = $(V:1=@$n)
+RUNCMD = $(SHELL)
+CDPATH = .
+CHDIR = @CHDIR@
+exec = exec
+NULL = /dev/null
+PATH_SEPARATOR = @PATH_SEPARATOR@
#### Start of system configuration section. ####
srcdir = @srcdir@
-VPATH = $(srcdir):$(srcdir)/missing
+top_srcdir = $(srcdir)
+hdrdir = $(srcdir)/include
+PLATFORM_DIR = @PLATFORM_DIR@
CC = @CC@
-YACC = @YACC@
+CPP = @CPP@
+LD = @LD@
+YACC = bison
PURIFY =
AUTOCONF = autoconf
@SET_MAKE@
MKFILES = @MAKEFILES@
+BASERUBY = @BASERUBY@
+TEST_RUNNABLE = @TEST_RUNNABLE@
+CROSS_COMPILING = @CROSS_COMPILING@
+DOXYGEN = @DOXYGEN@
prefix = @prefix@
exec_prefix = @exec_prefix@
@@ -23,37 +40,74 @@ datadir = @datadir@
arch = @arch@
sitearch = @sitearch@
sitedir = @sitedir@
+ruby_version = @ruby_version@
TESTUI = console
TESTS =
-RDOCTARGET = @RDOCTARGET@
+INSTALLDOC = @INSTALLDOC@
+DOCTARGETS = @RDOCTARGET@ @CAPITARGET@
EXTOUT = @EXTOUT@
-RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
+arch_hdrdir = $(EXTOUT)/include/$(arch)
+VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/enc:$(srcdir)/missing
empty =
OUTFLAG = @OUTFLAG@$(empty)
-CFLAGS = @CFLAGS@ @XCFLAGS@ @ARCH_FLAG@
-CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@
+COUTFLAG = @COUTFLAG@$(empty)
+ARCH_FLAG = @ARCH_FLAG@
+CFLAGS = @CFLAGS@ $(ARCH_FLAG)
+cflags = @cflags@
+optflags = @optflags@
+debugflags = @debugflags@
+warnflags = @warnflags@ @strict_warnflags@
+INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir)
+XCFLAGS = @XCFLAGS@
+CPPFLAGS = @CPPFLAGS@ $(INCFLAGS)
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
-EXTLDFLAGS =
+EXTLDFLAGS = @EXTLDFLAGS@
XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS)
-EXTLIBS =
+EXTLIBS =
LIBS = @LIBS@ $(EXTLIBS)
MISSING = @LIBOBJS@ @ALLOCA@
LDSHARED = @LIBRUBY_LDSHARED@
-DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(EXTLDFLAGS) @ARCH_FLAG@
+DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(XLDFLAGS) $(ARCH_FLAG)
SOLIBS = @SOLIBS@
MAINLIBS = @MAINLIBS@
-MINIOBJS = @MINIOBJS@
-
+ARCHMINIOBJS = @MINIOBJS@
+DLNOBJ = @DLNOBJ@
+ENCOBJS = @ENCOBJS@
+EXTOBJS = @EXTOBJS@
+BUILTIN_ENCOBJS = @BUILTIN_ENCOBJS@
+BUILTIN_TRANSSRCS = @BUILTIN_TRANSSRCS@
+BUILTIN_TRANSOBJS = @BUILTIN_TRANSOBJS@
+POSTLINK = @POSTLINK@
+
+RUBY_BASE_NAME=@RUBY_BASE_NAME@
+RUBY_PROGRAM_VERSION=@RUBY_PROGRAM_VERSION@
RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
RUBY_SO_NAME=@RUBY_SO_NAME@
+RUBY_RELEASE_DATE=@RUBY_RELEASE_DATE@
EXEEXT = @EXEEXT@
+LIBEXT = @LIBEXT@
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
RUBY = $(RUBY_INSTALL_NAME)
-MINIRUBY = @MINIRUBY@
-RUNRUBY = @RUNRUBY@
+MINIRUBY = @MINIRUBY@\
+ $(MINIRUBYOPT)
+RUNRUBY_COMMAND = @RUNRUBY@ $(RUNRUBYOPT)
+RUNRUBY = $(RUNRUBY_COMMAND) -- $(RUN_OPTS)
+RUNRUBY_DEBUGGER = --debugger='gdb -x run.gdb --quiet --args'
+XRUBY = @XRUBY@
+BTESTRUBY = @BTESTRUBY@\
+ $(MINIRUBYOPT)
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+XRUBY_LIBDIR = @XRUBY_LIBDIR@
+XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@
+XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@
+
+DEFAULT_PRELUDES = $(@USE_RUBYGEMS@_GEM_PRELUDE)
#### End of system configuration section. ####
@@ -68,26 +122,68 @@ LIBRUBY = @LIBRUBY@
LIBRUBYARG = @LIBRUBYARG@
LIBRUBYARG_STATIC = @LIBRUBYARG_STATIC@
LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
+LIBRUBY_RELATIVE = @LIBRUBY_RELATIVE@
+LIBRUBY_A_OBJS = @LIBRUBY_A_OBJS@
+
+THREAD_MODEL = @THREAD_MODEL@
PREP = @PREP@
ARCHFILE = @ARCHFILE@
SETUP =
EXTSTATIC = @EXTSTATIC@
+SET_LC_MESSAGES = env LC_MESSAGES=C
+MAKEDIRS = @MKDIR_P@
+CP = cp
+MV = mv
RM = rm -f
+RMDIR = @RMDIR@
+RMDIRS = @RMDIRS@
+RMALL = @RMALL@
NM = @NM@
AR = @AR@
ARFLAGS = rcu
RANLIB = @RANLIB@
AS = @AS@
-ASFLAGS = @ASFLAGS@
+ASFLAGS = @ASFLAGS@ $(INCFLAGS)
+IFCHANGE = $(srcdir)/tool/ifchange
+SET_LC_MESSAGES = env LC_MESSAGES=C
+OBJDUMP = @OBJDUMP@
+OBJCOPY = @OBJCOPY@
+VCS = @VCS@
+VCSUP = @VCSUP@
+DTRACE = @DTRACE@
+DTRACE_EXT = @DTRACE_EXT@
+DTRACE_OBJ = @DTRACE_OBJ@
+DTRACE_GLOMMED_OBJ = @DTRACE_GLOMMED_OBJ@
OBJEXT = @OBJEXT@
+ASMEXT = S
+DLEXT = @DLEXT@
MANTYPE = @MANTYPE@
+SYMBOL_PREFIX = @SYMBOL_PREFIX@
+
+INSTALLED_LIST= .installed.list
+
+MKMAIN_CMD = mkmain.sh
+
+NEWLINE_C = newline.c
+MINIPRELUDE_C = miniprelude.c
+RBCONFIG = .rbconfig.time
+
+SRC_FILE = $<
+OS_SRC_FILE = $<
+DEST_FILE = $@
+OS_DEST_FILE = $@
-PREINSTALL = @PREINSTALL@
+MESSAGE_BEGIN = @for line in
+MESSAGE_END = ; do echo "$$line"; done
+
+configure_args = @configure_args@
#### End of variables
+.SUFFIXES: .inc .h .c .y .i .$(DTRACE_EXT)
+
all:
.DEFAULT: all
@@ -96,47 +192,65 @@ all:
.NOEXPORT:
miniruby$(EXEEXT):
- @$(RM) $@
- $(PURIFY) $(CC) $(MAINOBJ) $(MINIOBJS) $(LIBRUBY_A) $(LIBS) $(OUTFLAG)$@ $(LDFLAGS) $(MAINLIBS)
+ @-if test -f $@; then $(MV) -f $@ $@.old; $(RM) $@.old; fi
+ $(ECHO) linking $@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(DTRACE_OBJ) $(LIBS) $(OUTFLAG)$@
$(PROGRAM):
@$(RM) $@
- $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@
+ $(ECHO) linking $@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
+ $(Q) $(POSTLINK)
# We must `rm' the library each time this rule is invoked because "updating" a
# MAB library on Apple/NeXT (see --enable-fat-binary in configure) is not
# supported.
$(LIBRUBY_A):
@$(RM) $@
- $(AR) $(ARFLAGS) $@ $(OBJS) $(DMYEXT)
+ $(ECHO) linking static-library $@
+ $(Q) $(AR) $(ARFLAGS) $@ $(LIBRUBY_A_OBJS) $(DMYEXT)
@-$(RANLIB) $@ 2> /dev/null || true
+ $(ECHO) verifying static-library $@
+ @$(PURIFY) $(CC) $(XLDFLAGS) $(MAINOBJ) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)conftest$(EXEEXT) $(LDFLAGS)
+ @$(RM) conftest$(EXEEXT) conftest.c
$(LIBRUBY_SO):
- $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(OUTFLAG)$@
+ @-$(PRE_LIBRUBY_UPDATE)
+ $(ECHO) linking shared-library $@
+ $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(DTRACE_OBJ) $(SOLIBS) $(EXTSOLIBS) $(OUTFLAG)$@
+ -$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)*_threadptr_*' $@
+ $(Q) $(POSTLINK)
@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
File.symlink "$(LIBRUBY_SO)", link}' \
$(LIBRUBY_ALIASES) || true
-
-fake.rb: Makefile
- @echo ' \
- class Object; \
- CROSS_COMPILING = RUBY_PLATFORM; \
- remove_const :RUBY_PLATFORM; \
- remove_const :RUBY_VERSION; \
- RUBY_PLATFORM = "@arch@"; \
- RUBY_VERSION = "@MAJOR@.@MINOR@.@TEENY@"; \
- end; \
- if RUBY_PLATFORM =~ /mswin|bccwin|mingw/; \
- class File; \
- remove_const :ALT_SEPARATOR; \
- ALT_SEPARATOR = "\\"; \
- end; \
- end; \
- ' > $@
-
-Makefile: $(srcdir)/Makefile.in
-
-$(MKFILES): config.status $(srcdir)/common.mk
+$(arch)-fake.rb: config.status $(srcdir)/template/fake.rb.in
+ @./config.status --file=$@:$(srcdir)/template/fake.rb.in
+ @chmod +x $@
+
+ruby_pc = @ruby_pc@
+$(ruby_pc):
+ @./config.status --file=$@:$(srcdir)/template/ruby.pc.in
+
+install-cross: $(arch)-fake.rb $(RBCONFIG) rbconfig.rb $(arch_hdrdir)/ruby/config.h \
+ $(LIBRUBY_A) $(LIBRUBY_SO) $(ARCHFILE)
+ $(ECHO) installing cross-compiling stuff
+ $(Q) $(MAKEDIRS) $(XRUBY_RUBYLIBDIR)/$(arch) $(XRUBY_RUBYHDRDIR)/$(arch)/ruby
+ $(Q) sed '/^\$$:\.unshift/q' $(arch)-fake.rb > fake.rb
+ $(Q) $(BASERUBY) -p \
+ -e '~/^\s*CONFIG\["LDFLAGS"\]/ and' \
+ -e '$$_[/(?=\s*"$$)/] = %q[ #{(CONFIG["LIBPATHFLAG"]%File.dirname(__FILE__)).strip}]' \
+ rbconfig.rb > fake-rbconfig.rb
+ $(INSTALL_SCRIPT) fake.rb $(XRUBY_RUBYLIBDIR)/$(arch)/fake.rb
+ $(INSTALL_SCRIPT) fake-rbconfig.rb $(XRUBY_RUBYLIBDIR)/$(arch)/rbconfig.rb
+ @$(RM) fake.rb fake-rbconfig.rb
+ $(INSTALL_DATA) $(arch_hdrdir)/ruby/config.h $(XRUBY_RUBYHDRDIR)/$(arch)/ruby
+ $(INSTALL_DATA) $(top_srcdir)/include/ruby/win32.h $(XRUBY_RUBYHDRDIR)/ruby
+ $(INSTALL_DATA) $(LIBRUBY) $(LIBRUBY_A) $(XRUBY_RUBYLIBDIR)/$(arch)
+ $(INSTALL_PROGRAM) $(LIBRUBY_SO) $(XRUBY_RUBYLIBDIR)/$(arch)
+
+Makefile: $(srcdir)/Makefile.in $(srcdir)/enc/Makefile.in
+
+$(MKFILES): config.status
MAKE=$(MAKE) $(SHELL) ./config.status
@{ \
echo "all:; -@rm -f conftest.mk"; \
@@ -146,33 +260,201 @@ $(MKFILES): config.status $(srcdir)/common.mk
$(MAKE) -f conftest.mk | grep '^AUTO_REMAKE$$' >/dev/null 2>&1 || \
{ echo "Makefile updated, restart."; exit 1; }
-config.status: $(srcdir)/configure
- MINIRUBY="$(MINIRUBY)" $(SHELL) ./config.status --recheck
+uncommon.mk: $(srcdir)/common.mk
+ sed 's/{\$$([^(){}]*)[^{}]*}//g' $< > $@
-$(srcdir)/configure: $(srcdir)/configure.in
- cd $(srcdir) && $(AUTOCONF)
+.PHONY: reconfig
+reconfig-args = $(srcdir)/configure $(configure_args)
+config.status-args = ./config.status --recheck
+reconfig-exec-0 = exec 3>&1; exit `exec 4>&1; { "$$@" 3>&- 4>&-; echo $$? 1>&4; } | fgrep -v '(cached)' 1>&3`
+reconfig-exec-1 = set -x; "$$@"
-lex.c: keywords
- @-$(RM) $@
- gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@ || \
- cp "$(srcdir)/$@" .
+reconfig config.status: $(srcdir)/configure $(srcdir)/enc/Makefile.in \
+ $(srcdir)/include/ruby/version.h
+ @PWD= MINIRUBY="$(MINIRUBY)"; export MINIRUBY; \
+ set $(SHELL) $($@-args); $(reconfig-exec-$(V))
-.y.c:
- $(YACC) $<
- sed '/^#/s|y\.tab\.c|$@|' y.tab.c > $@
- rm -f y.tab.c
+$(srcdir)/configure: $(srcdir)/configure.in
+ $(CHDIR) $(srcdir) && exec $(AUTOCONF)
+
+incs: id.h
+all-incs: probes.h
+
+# Things which should be considered:
+# * with gperf v.s. without gperf
+# * committers may have various versions of gperf
+# * ./configure v.s. ../ruby/configure
+# * GNU make v.s. HP-UX make # HP-UX make invokes the action if lex.c and keywords has same mtime.
+# * svn checkout generate a file with mtime as current time
+# * ext4 and XFS has a mtime with fractional part
+lex.c: defs/keywords
+ @\
+ if cmp -s $(srcdir)/defs/lex.c.src $?; then \
+ [ $(Q) ] && echo copying $@ || set -x; \
+ $(CP) $(srcdir)/lex.c.blt $@; \
+ else \
+ [ $(Q) ] && echo generating $@ || set -x; \
+ gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@.tmp && \
+ $(MV) $@.tmp $@ && \
+ $(CP) $? $(srcdir)/defs/lex.c.src && \
+ $(CP) $@ $(srcdir)/lex.c.blt; \
+ fi
+
+NAME2CTYPE_OPTIONS = -7 -c -j1 -i1 -t -C -P -T -H uniname2ctype_hash -Q uniname2ctype_pool -N uniname2ctype_p
+
+enc/unicode/name2ctype.h: enc/unicode/name2ctype.kwd
+ $(MAKEDIRS) $(@D)
+ @set +e; \
+ if cmp -s $(?:.kwd=.src) $?; then \
+ set -x; \
+ $(CP) $(?:.kwd=.h.blt) $@; \
+ else \
+ trap '$(RM) $@-1.h $@-2.h' 0 && \
+ set -x; \
+ sed '/^#ifdef USE_UNICODE_PROPERTIES/,/^#endif/d' $? | gperf $(NAME2CTYPE_OPTIONS) > $@-1.h && \
+ sed '/^#ifdef USE_UNICODE_PROPERTIES/d;/^#endif/d' $? | gperf $(NAME2CTYPE_OPTIONS) > $@-2.h && \
+ diff -DUSE_UNICODE_PROPERTIES $@-1.h $@-2.h > $@.tmp || :; \
+ $(MV) $@.tmp $@ && \
+ $(CP) $? $(?:.kwd=.src) && \
+ $(CP) $@ $(?:.kwd=.h.blt); \
+ fi
.c.@OBJEXT@:
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
+ @$(ECHO) compiling $<
+ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $<
.s.@OBJEXT@:
- $(AS) $(ASFLAGS) -o $@ $<
+ @$(ECHO) assembling $<
+ $(Q) $(AS) $(ASFLAGS) -o $@ $<
+
+.c.S:
+ @$(ECHO) translating $<
+ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -S $<
+
+.c.i:
+ @$(ECHO) preprocessing $<
+ $(Q) $(CPP) $(warnflags) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -E $< > $@
+
+.d.h:
+ @$(ECHO) translating probes $<
+ $(Q) $(DTRACE) -o $@.tmp -h -C $(INCFLAGS) -s $<
+ $(Q) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/PROBES_H/g' -e 's/(char \*/(const char */g' -e 's/, char \*/, const char */g' $@.tmp > $@
+ $(Q) $(RM) $@.tmp
+
+.dmyh.h:
+ @$(ECHO) copying dummy $(DEST_FILE)
+ $(Q) $(CP) $(OS_SRC_FILE) $(OS_DEST_FILE)
+
+probes.@OBJEXT@: $(srcdir)/probes.d
+ @$(ECHO) processing probes in object files
+ $(Q) stamp="$*.stamp"; \
+ if test -f "$$stamp" -o -f "$@"; then \
+ $(RM) $(DTRACE_DEPENDENT_OBJS) "$$stamp"; \
+ for o in $(DTRACE_DEPENDENT_OBJS); do \
+ echo "rebuilding $$o which was modified by \"dtrace -G\""; \
+ $(MAKE) "$$o"; \
+ done; \
+ fi; \
+ touch "$$stamp"
+ $(RM) $@
+ $(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_DEPENDENT_OBJS)
+
+# DTrace static library hacks described here:
+# http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-August/000207.html
+ruby-glommed.$(OBJEXT):
+ @$(ECHO) generating a glommed object with DTrace probes for static library
+ $(Q) $(LD) -r -o $@ $(OBJS) $(DTRACE_OBJ)
clean-local::
- @$(RM) ext/extinit.c ext/extinit.$(OBJEXT)
+ $(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output \
+ enc/encinit.c enc/encinit.$(OBJEXT)
+ -$(Q)$(RM) $(pkgconfig_DATA)
distclean-local::
- @$(RM) ext/config.cache $(RBCONFIG)
+ $(Q)$(RM) ext/config.cache $(RBCONFIG) Doxyfile
+ -$(Q)$(RM) run.gdb
+ -$(Q)$(RM) $(INSTALLED_LIST) $(arch_hdrdir)/ruby/config.h verconf.h
+ -$(Q)$(RMDIRS) $(arch_hdrdir)/ruby 2> /dev/null || true
+
+clean-ext distclean-ext realclean-ext::
+ @cd ext 2>/dev/null || exit 0; set dummy `echo "${EXTS}" | tr , ' '`; shift; \
+ test "$$#" = 0 && set .; \
+ set dummy `\
+ find "$$@" -name Makefile -print | sed 's:^\./::;s:/Makefile$$:~:' | sort | sed 's:~$$::'; \
+ `; shift; \
+ cd ..; \
+ for dir do \
+ echo $(@:-ext=)ing "$$dir"; \
+ (cd "ext/$$dir" && exec $(MAKE) $(MFLAGS) $(@:-ext=)) && \
+ case "$@" in \
+ *distclean-ext*|*realclean-ext*) \
+ $(RMDIRS) "ext/$$dir" 2> /dev/null || true;; \
+ esac; \
+ done
+ -$(Q)$(RM) ext/extinit.$(OBJEXT)
+
+distclean-ext realclean-ext::
+ -$(Q)$(RM) ext/extinit.c
+ -$(Q)$(RMDIR) ext 2> /dev/null || true
+
+clean-extout:
+ -$(Q)$(RMDIRS) $(EXTOUT) 2> /dev/null || true
+
+clean-enc distclean-enc realclean-enc:
+ @test -f "$(ENC_MK)" || exit 0; \
+ echo $(@:-enc=ing) encodings; \
+ exec $(MAKE) -f $(ENC_MK) $(MFLAGS) $(@:-enc=)
+
+clean-rdoc distclean-rdoc realclean-rdoc:
+ @echo $(@:-rdoc=ing) rdoc
+ $(Q)$(RMALL) $(RDOCOUT)
+clean-capi distclean-capi realclean-capi:
+ @echo $(@:-capi=ing) capi
+ $(Q)$(RMALL) $(CAPIOUT)
+
+clean-platform:
+ @$(RM) $(PLATFORM_D)
+ -$(Q) $(RMDIR) $(PLATFORM_DIR) 2> /dev/null || true
ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
- $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(OUTFLAG)$@ -c ext/extinit.c
+ $(ECHO) compiling $@
+ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
+
+enc/encinit.$(OBJEXT): enc/encinit.c $(SETUP)
+
+up::
+ @$(CHDIR) "$(srcdir)" && LC_TIME=C exec $(VCSUP)
+
+update-mspec:
+ @$(CHDIR) $(srcdir); \
+ if [ -d spec/mspec ]; then \
+ cd spec/mspec; \
+ echo updating mspec ...; \
+ exec git pull; \
+ else \
+ echo retrieving mspec ...; \
+ exec git clone $(MSPEC_GIT_URL) spec/mspec; \
+ fi
+
+update-rubyspec: update-mspec
+ @$(CHDIR) $(srcdir); \
+ if [ -d spec/rubyspec ]; then \
+ cd spec/rubyspec; \
+ echo updating rubyspec ...; \
+ exec git pull; \
+ else \
+ echo retrieving rubyspec ...; \
+ exec git clone $(RUBYSPEC_GIT_URL) spec/rubyspec; \
+ fi
+
+test-rubyspec-precheck:
+ @if [ ! -d $(srcdir)/spec/rubyspec ]; then echo No rubyspec here. make update-rubyspec first.; exit 1; fi
+
+INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \
+ vmtc.inc vm.inc
+
+$(INSNS): $(srcdir)/insns.def vm_opts.h \
+ $(srcdir)/defs/opt_operand.def $(srcdir)/defs/opt_insn_unif.def \
+ $(srcdir)/tool/instruction.rb $(srcdir)/tool/insns2vm.rb
+ $(ECHO) generating $@
+ $(Q) $(BASERUBY) -Ku $(srcdir)/tool/insns2vm.rb $(INSNS2VMOPT) $@
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000000..2b81356fd0
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,454 @@
+# -*- rdoc -*-
+
+= NEWS for Ruby 2.0.0
+
+This document is a list of user visible feature changes made between
+releases except for bug fixes.
+
+Note that each entry is kept so brief that no reason behind or
+reference information is supplied with. For a full list of changes
+with all sufficient information, see the ChangeLog file.
+
+== Changes since the 1.9.3 release
+
+=== C API updates
+* NUM2SHORT() and NUM2USHORT() added. They are similar to NUM2INT, but short.
+* rb_newobj_of() and NEWOBJ_OF() added. They create a new object of a given class.
+
+=== Library updates (outstanding ones only)
+
+* builtin classes
+
+ * Array
+ * added method:
+ * added Array#bsearch for binary search.
+ * incompatible changes:
+ * random parameter of Array#shuffle! and Array#sample now
+ will be called with one argument, maximum value.
+ * when given Range arguments, Array#values_at now returns nil for each
+ value that is out-of-range.
+
+ * Enumerable
+ * added method:
+ * added Enumerable#lazy method for lazy enumeration.
+
+ * Enumerator
+ * added method:
+ * added Enumerator#size for lazy size evaluation.
+ * extended method:
+ * Enumerator.new accept an argument for lazy size evaluation.
+
+ * ENV
+ * aliased method:
+ * ENV.to_h is a new alias for ENV.to_hash
+
+ * Fiber
+ * incompatible changes:
+ * Fiber#resume cannot resume a fiber which invokes "Fiber#transfer".
+
+ * File
+ * extended method:
+ * File.fnmatch? now expands braces in the pattern if
+ File::FNM_EXTGLOB option is given.
+
+ * GC
+ * improvements:
+ * introduced the bitmap marking which suppresses to copy a memory page
+ with Copy-on-Write.
+ * introduced the non-recursive marking which avoids unexpected stack overflow.
+
+ * GC::Profiler
+ * added method:
+ * added GC::Profiler.raw_data which returns raw profile data for GC.
+
+ * Hash
+ * added method:
+ * added Hash#to_h as explicit conversion method, like Array#to_a.
+ * extended method:
+ * Hash#default_proc= can be passed nil to clear the default proc.
+
+ * IO
+ * deprecated methods:
+ * IO#lines, #bytes, #chars and #codepoints are deprecated.
+
+ * Kernel
+ * added method:
+ * added Kernel#Hash conversion method like Array() or Float().
+ * added Kernel#__dir__ which returns a current dirname.
+ * added Kernel#caller_locations which returns an array of
+ frame information objects.
+ * extended method:
+ * Kernel#warn accepts multiple args in like puts.
+ * Kernel#caller accepts second optional argument `n' which specify
+ required caller size.
+ * Kernel#to_enum and enum_for accept a block for lazy size evaluation.
+ * incompatible changes:
+ * system() and exec() closes non-standard file descriptors
+ (The default of :close_others option is changed to true by default.)
+ * respond_to? against a protected method now returns false unless
+ the second argument is true.
+ * __callee__ has returned to the original behavior, and now
+ returns the called name but not the original name in an
+ aliased method.
+ * Kernel#inspect does not call #to_s anymore
+ (it used to call redefined #to_s).
+
+ * LoadError
+ * added method:
+ * added LoadError#path method to return the file name that could not be
+ loaded.
+
+ * Module
+ * added method:
+ * added Module#prepend which is similar to Module#include,
+ however a method in the prepended module overrides the
+ corresponding method in the prepending module.
+ * added Module#refine, which extends a class or module locally.
+ [experimental]
+ * extended method:
+ * Module#define_method accepts a UnboundMethod from a Module.
+ * Module#const_get accepts a qualified constant string, e.g.
+ Object.const_get("Foo::Bar::Baz")
+
+ * Mutex
+ * added method:
+ * added Mutex#owned? which returns the mutex is held by current
+ thread or not. [experimental]
+ * incompatible changes:
+ * Mutex#lock, Mutex#unlock, Mutex#try_lock, Mutex#synchronize
+ and Mutex#sleep are no longer allowed to be used from trap handler
+ and raise a ThreadError in such case.
+ * Mutex#sleep may spurious wakeup. Check after wakeup.
+
+ * NilClass
+ * added method:
+ * added nil.to_h which returns {}
+
+ * Process
+ * added method:
+ * added getsid for getting session id (unix only).
+
+ * Range
+ * added method:
+ * added Range#size for lazy size evaluation.
+ * added Range#bsearch for binary search.
+
+ * RubyVM (MRI specific)
+ * added Environment variables to specify stack usage:
+ * RUBY_THREAD_VM_STACK_SIZE: vm stack size used at thread creation.
+ default: 128KB (32bit CPU) or 256KB (64bit CPU).
+ * RUBY_THREAD_MACHINE_STACK_SIZE: machine stack size used at thread
+ creation. default: 512KB or 1024KB.
+ * RUBY_FIBER_VM_STACK_SIZE: vm stack size used at fiber creation.
+ default: 64KB or 128KB.
+ * RUBY_FIBER_MACHINE_STACK_SIZE: machine stack size used at fiber
+ creation. default: 256KB or 256KB.
+ These variables are checked only at launched time.
+ * added constant DEFAULT_PARAMS to get above default parameters.
+
+ * Signal
+ * added method:
+ * added Signal.signame which returns signal name
+
+ * incompatible changes:
+ * Signal.trap raises ArgumentError when :SEGV, :BUS, :ILL, :FPE, :VTALRM
+ are specified.
+
+ * String
+ * added method:
+ * added String#b returning a copied string whose encoding is ASCII-8BIT.
+ * change return value:
+ * String#lines now returns an array instead of an enumerator.
+ * String#chars now returns an array instead of an enumerator.
+ * String#codepoints now returns an array instead of an enumerator.
+ * String#bytes now returns an array instead of an enumerator.
+
+ * Struct
+ * added method:
+ * added Struct#to_h returning values with keys corresponding to the
+ instance variable names.
+
+ * Thread
+ * added method:
+ * added Thread#thread_variable_get for getting thread local variables
+ (these are different than Fiber local variables).
+ * added Thread#thread_variable_set for setting thread local variables.
+ * added Thread#thread_variables for getting a list of the thread local
+ variable keys.
+ * added Thread#thread_variable? for testing to see if a particular thread
+ variable has been set.
+ * added Thread#backtrace_locations which returns similar information of
+ Kernel#caller_locations.
+ * incompatible changes:
+ * Thread#join and Thread#value now raises a ThreadError if target thread
+ is the current or main thread.
+
+ * Time
+ * change return value:
+ * Time#to_s returned encoding defaults to US-ASCII but automatically
+ transcodes to Encoding.default_internal if it is set.
+
+ * TracePoint
+ * new class. This class is replacement of set_trace_func.
+ Easy to use and efficient implementation.
+
+ * toplevel
+ * added method:
+ * added main.define_method which defines a global function.
+ * added main.using, which imports refinements into the current file or
+ eval string. [experimental]
+
+* cgi
+ * Add HTML5 tag maker.
+ * CGI#header has been renamed to CGI#http_header and
+ aliased to CGI#header.
+ * When HTML5 tagmaker called, overwrite CGI#header,
+ CGI#header function is to create a <header> element.
+
+* iconv
+ * Iconv has been removed. Use String#encode instead.
+
+* io/wait
+ * new features:
+ * added IO#wait_writable method.
+ * added IO#wait_readable method as alias of IO#wait.
+
+* net/http
+ * new features:
+ * Proxies are now automatically detected from the http_proxy environment
+ variable. See Net::HTTP::new for details.
+ * gzip and deflate compression are now requested for all requests by
+ default. See Net::HTTP for details.
+ * SSL sessions are now reused across connections for a single instance.
+ This speeds up connection by using a previously negotiated session.
+ * Requests may be created from a URI which sets the request_uri and host
+ header of the request (but does not change the host connected to).
+ * Responses contain the URI requested which allows easier implementation of
+ redirect following.
+ * new methods:
+ * Net::HTTP#local_host
+ * Net::HTTP#local_host=
+ * Net::HTTP#local_port
+ * Net::HTTP#local_port=
+ * extended method:
+ * Net::HTTP#connect uses local_host and local_port if specified.
+
+* net/imap
+ * new methods:
+ * Net::IMAP.default_port
+ * Net::IMAP.default_imap_port
+ * Net::IMAP.default_tls_port
+ * Net::IMAP.default_ssl_port
+ * Net::IMAP.default_imaps_port
+
+* objspace
+ * new method:
+ * ObjectSpace.reachable_objects_from(obj)
+
+* openssl
+ * Consistently raise an error when trying to encode nil values. All instances
+ of OpenSSL::ASN1::Primitive now raise TypeError when calling to_der on an
+ instance whose value is nil. All instances of OpenSSL::ASN1::Constructive
+ raise NoMethodError in the same case. Constructing such values is still
+ permitted.
+ * TLS 1.1 & 1.2 support by setting OpenSSL::SSL::SSLContext#ssl_version to
+ :TLSv1_2, :TLSv1_2_server, :TLSv1_2_client or :TLSv1_1, :TLSv1_1_server
+ :TLSv1_1_client. The version being effectively used can be queried
+ with OpenSSL::SSL#ssl_version. Furthermore, it is also possible to
+ blacklist the new TLS versions with OpenSSL::SSL:OP_NO_TLSv1_1 and
+ OpenSSL::SSL::OP_NO_TLSv1_2.
+ * Added OpenSSL::SSL::SSLContext#renegotiation_cb. A user-defined callback
+ may be set which gets called whenever a new handshake is negotiated. This
+ also allows to programmatically decline (client) renegotiation attempts.
+ * Support for "0/n" splitting of records as BEAST mitigation via
+ OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS.
+ * The default options for OpenSSL::SSL::SSLContext have changed to
+ OpenSSL::SSL::OP_ALL & ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS
+ instead of OpenSSL::SSL::OP_ALL only. This enables the countermeasure for
+ the BEAST attack by default.
+ * OpenSSL requires passwords for decrypting PEM-encoded files to be at least
+ four characters long. This led to awkward situations where an export with
+ a password with fewer than four characters was possible, but accessing the
+ file afterwards failed. OpenSSL::PKey::RSA, OpenSSL::PKey::DSA and
+ OpenSSL::PKey::EC therefore now enforce the same check when exporting a
+ private key to PEM with a password - it has to be at least four characters
+ long.
+ * SSL/TLS support for the Next Protocol Negotiation extension. Supported
+ with OpenSSL 1.0.1 and higher.
+ * OpenSSL::OPENSSL_FIPS allows client applications to detect whether OpenSSL
+ is FIPS-enabled. OpenSSL.fips_mode= allows turning on and off FIPS mode
+ manually in order to adapt to situations where FIPS mode would be an
+ explicit requirement.
+ * Authenticated Encryption with Associated Data (AEAD) is supported via
+ Cipher#auth_data= and Cipher#auth_tag/Cipher#auth_tag=.
+ Currently (OpenSSL 1.0.1c), only GCM mode is supported.
+
+* ostruct
+ * new methods:
+ * OpenStruct#[], []=
+ * OpenStruct#each_pair
+ * OpenStruct#eql?
+ * OpenStruct#hash
+ * OpenStruct#to_h converts the struct to a hash.
+ * extended method:
+ * OpenStruct.new also accepts an OpenStruct / Struct.
+
+* pathname
+ * extended method:
+ * Pathname#find returns an enumerator if no block is given.
+
+* rake
+ * rake has been updated to version 0.9.5.
+
+ This version is backwards-compatible with previous rake versions and
+ contains many bug fixes.
+
+ See
+ http://rake.rubyforge.org/doc/release_notes/rake-0_9_5_rdoc.html for a list
+ of changes in rake 0.9.3, 0.9.4 and 0.9.5.
+
+* rdoc
+ * rdoc has been updated to version 4.0
+
+ This version is largely backwards-compatible with previous rdoc versions.
+ The most notable change is an update to the ri data format (ri data must
+ be regenerated for gems shared across rdoc versions). Further API changes
+ are internal and won't affect most users.
+
+ See https://github.com/rdoc/rdoc/blob/master/History.rdoc for a list of
+ changes in rdoc 4.0.
+
+* resolv
+ * new methods:
+ * Resolv::DNS#timeouts=
+ * Resolv::DNS::Config#timeouts=
+
+* rexml
+ * REXML::Document#write supports Hash arguments.
+ * REXML::Document#write supports new :encoding option. It changes
+ XML document encoding. Without :encoding option, encoding in
+ XML declaration is used for XML document encoding.
+
+* RubyGems
+ * Updated to 2.0.0.preview2
+
+ RubyGems 2.0.0 features the following improvements:
+
+ * Improved support for default gems shipping with ruby 2.0.0+
+ * A gem can have arbitrary metadata through Gem::Specification#metadata
+ * `gem search` now defaults to --remote and is anchored like gem list.
+ * Added --document to replace --rdoc and --ri. Use --no-document to
+ disable documentation, --document=rdoc to only generate rdoc.
+ * Only ri-format documentation is generated by default.
+ * `gem server` uses RDoc::Servlet from RDoc 4.0 to generate HTML
+ documentation.
+
+ For an expanded list of updates and bug fixes see:
+ https://github.com/rubygems/rubygems/blob/master/History.txt
+
+* shellwords
+ * Shellwords#shellescape() now stringifies the given object using to_s.
+ * Shellwords#shelljoin() accepts non-string objects in the given
+ array, each of which is stringified using to_s.
+
+* stringio
+ * deprecated methods:
+ * StringIO#lines, #bytes, #chars and #codepoints are deprecated.
+
+* syslog
+ * Added Syslog::Logger which provides a Logger API atop Syslog.
+ * Syslog::Priority, Syslog::Level, Syslog::Option and Syslog::Macros
+ are introduced for easy detection of available constants on a
+ running system.
+
+* tmpdir
+ * incompatible changes:
+ * Dir.mktmpdir uses FileUtils.remove_entry instead of
+ FileUtils.remove_entry_secure. This means that applications should not
+ change the permission of the created temporary directory to make
+ accessible from other users.
+
+* yaml
+ * Syck has been removed. YAML now completely depends on libyaml being
+ installed.
+
+* zlib
+ * Added streaming support for Zlib::Inflate and Zlib::Deflate. This allows
+ processing of a stream without the use of large amounts of memory.
+ * Added support for the new deflate strategies Zlib::RLE and Zlib::FIXED.
+ * Zlib streams are now processed without the GVL. This allows gzip, zlib and
+ deflate streams to be processed in parallel.
+ * deprecated methods:
+ * Zlib::GzipReader#lines and #bytes are deprecated.
+
+=== Language changes
+
+ * Added %i and %I for symbol list creation (similar to %w and %W).
+
+ * Default source encoding is changed to UTF-8. (was US-ASCII)
+
+=== Compatibility issues (excluding feature bug fixes)
+
+ * Array#values_at
+
+ See above.
+
+ * String#lines
+ * String#chars
+ * String#codepoints
+ * String#bytes
+
+ These methods no longer return an Enumerator, although passing a
+ block is still supported for backwards compatibility.
+
+ Code like str.lines.with_index(1) { |line, lineno| ... } no longer
+ works because str.lines returns an array. Replace lines with
+ each_line in such cases.
+
+ * IO#lines
+ * IO#chars
+ * IO#codepoints
+ * IO#bytes
+ * ARGF#lines
+ * ARGF#chars
+ * ARGF#codepoints
+ * ARGF#bytes
+ * StringIO#lines
+ * StringIO#chars
+ * StringIO#codepoints
+ * StringIO#bytes
+ * Zlib::GzipReader#lines
+ * Zlib::GzipReader#bytes
+
+ These methods are deprecated in favor of each_line, each_byte,
+ each_char and each_codepoint.
+
+ * Signal.trap
+
+ See above.
+
+ * Merge Onigmo.
+ https://github.com/k-takata/Onigmo
+
+ * The :close_others option is true by default for system() and exec().
+ Also, the close-on-exec flag is set by default for all new file descriptors.
+ This means file descriptors doesn't inherit to spawned process unless
+ explicitly requested such as system(..., fd=>fd).
+
+ * Kernel#respond_to? against a protected method now returns false
+ unless the second argument is true.
+
+ * Dir.mktmpdir in lib/tmpdir.rb
+
+ See above.
+
+ * OpenStruct new methods can conflict with custom attributes named
+ "each_pair", "eql?", "hash" or "to_h".
+
+ * Thread#join, Thread#value
+
+ See above.
+
+ * Mutex#lock, Mutex#unlock, Mutex#try_lock, Mutex#synchronize and Mutex#sleep
+
+ See above.
diff --git a/README b/README
index cf836415ad..2de785d86e 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-* What's Ruby
+= What's Ruby
Ruby is the interpreted scripting language for quick and
easy object-oriented programming. It has many features to
@@ -6,88 +6,126 @@ process text files and to do system management tasks (as in
Perl). It is simple, straight-forward, and extensible.
-* Features of Ruby
+== Features of Ruby
- + Simple Syntax
- + *Normal* Object-Oriented features(ex. class, method calls)
- + *Advanced* Object-Oriented features(ex. Mix-in, Singleton-method)
- + Operator Overloading
- + Exception Handling
- + Iterators and Closures
- + Garbage Collection
- + Dynamic Loading of Object files(on some architecture)
- + Highly Portable(works on many UNIX machines, and on DOS,
- Windows, Mac, BeOS etc.)
+* Simple Syntax
+* *Normal* Object-Oriented features(ex. class, method calls)
+* *Advanced* Object-Oriented features(ex. Mix-in, Singleton-method)
+* Operator Overloading
+* Exception Handling
+* Iterators and Closures
+* Garbage Collection
+* Dynamic Loading of Object files(on some architecture)
+* Highly Portable (works on many Unix-like/POSIX compatible platforms
+ as well as Windows, Mac OS X, BeOS etc.)
+ cf. http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatforms
-* How to get Ruby
+== How to get Ruby
The Ruby distribution files can be found in the following FTP site:
- ftp://ftp.ruby-lang.org/pub/ruby/
-
-The latest source code of this version series can be checked out
-through SVN with the following command:
-
- $ svn co http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_6/
+ftp://ftp.ruby-lang.org/pub/ruby/
The trunk of the Ruby source tree can be checked out with the
following command:
$ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
+Or if you are using git then use following command:
+
+ $ git clone git://github.com/ruby/ruby.git
+
There are some other branches under development. Try the following
command and see the list of branches:
$ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
+Or if you are using git then use following command:
-* Ruby home-page
+ $ git ls-remote git://github.com/ruby/ruby.git
+
+== Ruby home-page
The URL of the Ruby home-page is:
- http://www.ruby-lang.org/
+http://www.ruby-lang.org/
-* Mailing list
+== Mailing list
There is a mailing list to talk about Ruby.
To subscribe this list, please send the following phrase
- subscribe YourFirstName YourFamilyName
+ subscribe YourFirstName YourFamilyName
e.g.
subscribe Joseph Smith
-in the mail body (not subject) to the address <ruby-talk-ctl@ruby-lang.org>.
+in the mail body (not subject) to the address <mailto:ruby-talk-ctl@ruby-lang.org>.
-* How to compile and install
+== How to compile and install
This is what you need to do to compile and install Ruby:
- 1. If ./configure does not exist or is older than configure.in,
+0. If you want to use Microsoft Visual C++ to compile ruby,
+ read win32/README.win32 instead of this document.
+
+1. If +./configure+ does not exist or is older than configure.in,
run autoconf to (re)generate configure.
- 2. Run ./configure, which will generate config.h and Makefile.
+2. Run +./configure+, which will generate config.h and Makefile.
- 3. Edit defines.h if you need. Usually this step will not be needed.
+ Some C compiler flags may be added by default depending on your
+ environment. Specify <tt>optflags=..</tt> and <tt>warnflags=..</tt> as
+ necessary to override them.
- 4. Remove comment mark(#) before the module names from ext/Setup (or
- add module names if not present), if you want to link modules
+3. Edit +defines.h+ if you need. Usually this step will not be needed.
+
+4. Remove comment mark(<tt>#</tt>) before the module names from +ext/Setup+
+ (or add module names if not present), if you want to link modules
statically.
If you don't want to compile non static extension modules
(probably on architectures which does not allow dynamic loading),
- remove comment mark from the line "#option nodynamic" in
- ext/Setup.
+ remove comment mark from the line "<tt>#option nodynamic</tt>" in
+ +ext/Setup+.
+
+ Usually this step will not be needed.
- 5. Run make.
+5. Run +make+.
- 6. Optionally, run 'make test' to check whether the compiled Ruby
- interpreter works well. If you see the message "test succeeded",
+6. Optionally, run '<tt>make check</tt>' to check whether the compiled Ruby
+ interpreter works well. If you see the message "<tt>check succeeded</tt>",
your ruby works as it should (hopefully).
- 7. Run 'make install'
+7. Run '<tt>make install</tt>'
+
+ This command will create following directories and install files
+ onto them.
+
+ * <tt>${DESTDIR}${prefix}/bin</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/share/man/man1</tt>
+ * <tt>${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system</tt>
+
+ If Ruby's API version is '_x.y.z_', the <tt>${MAJOR}</tt> is '_x_', the
+ <tt>${MINOR}</tt> is '_y_', and the <tt>${TEENY}</tt> is '_z_'.
+
+ *NOTE*: teeny of the API version may be different from one of
+ Ruby's program version
You may have to be a super user to install ruby.
@@ -95,20 +133,21 @@ If you fail to compile ruby, please send the detailed error report with
the error log and machine/OS type, to help others.
-* Copying
+== Copying
-See the file COPYING.
+See the file +COPYING+.
-* The Author
+== The Author
-Feel free to send comments and bug reports to the author. Here is the
+Feel free to send comments and bug reports to the author. Here is the
author's latest mail address:
- matz@netlab.jp
+<mailto:matz@ruby-lang.org>
-------------------------------------------------------
created at: Thu Aug 3 11:57:36 JST 1995
+--
Local variables:
-mode: indented-text
+mode: rdoc
end:
diff --git a/README.EXT b/README.EXT
index e5d39911ca..ba74e5c8d2 100644
--- a/README.EXT
+++ b/README.EXT
@@ -1,58 +1,58 @@
-.\" README.EXT - -*- Text -*- created at: Mon Aug 7 16:45:54 JST 1995
+# README.EXT - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995
This document explains how to make extension libraries for Ruby.
-1. Basic knowledge
+= Basic Knowledge
In C, variables have types and data do not have types. In contrast,
Ruby variables do not have a static type, and data themselves have
types, so data will need to be converted between the languages.
-Data in Ruby are represented by C type `VALUE'. Each VALUE data has
-its data-type.
+Data in Ruby are represented by the C type `VALUE'. Each VALUE data
+has its data-type.
To retrieve C data from a VALUE, you need to:
- (1) Identify the VALUE's data type
- (2) Convert the VALUE into C data
+1. Identify the VALUE's data type
+2. Convert the VALUE into C data
Converting to the wrong data type may cause serious problems.
-
-1.1 Data-types
+== Data-Types
The Ruby interpreter has the following data types:
- T_NIL nil
- T_OBJECT ordinary object
- T_CLASS class
- T_MODULE module
- T_FLOAT floating point number
- T_STRING string
- T_REGEXP regular expression
- T_ARRAY array
- T_FIXNUM Fixnum(31bit integer)
- T_HASH associative array
- T_STRUCT (Ruby) structure
- T_BIGNUM multi precision integer
- T_FILE IO
- T_TRUE true
- T_FALSE false
- T_DATA data
- T_SYMBOL symbol
+T_NIL :: nil
+T_OBJECT :: ordinary object
+T_CLASS :: class
+T_MODULE :: module
+T_FLOAT :: floating point number
+T_STRING :: string
+T_REGEXP :: regular expression
+T_ARRAY :: array
+T_HASH :: associative array
+T_STRUCT :: (Ruby) structure
+T_BIGNUM :: multi precision integer
+T_FIXNUM :: Fixnum(31bit or 63bit integer)
+T_COMPLEX :: complex number
+T_RATIONAL :: rational number
+T_FILE :: IO
+T_TRUE :: true
+T_FALSE :: false
+T_DATA :: data
+T_SYMBOL :: symbol
In addition, there are several other types used internally:
- T_ICLASS
- T_MATCH
- T_UNDEF
- T_VARMAP
- T_SCOPE
- T_NODE
+T_ICLASS :: included module
+T_MATCH :: MatchData object
+T_UNDEF :: undefined
+T_NODE :: syntax tree node
+T_ZOMBIE :: object awaiting finalization
Most of the types are represented by C structures.
-1.2 Check Data Type of the VALUE
+== Check Data Type of the VALUE
The macro TYPE() defined in ruby.h shows the data type of the VALUE.
TYPE() returns the constant number T_XXXX described above. To handle
@@ -78,65 +78,77 @@ There is the data-type check function
void Check_Type(VALUE value, int type)
-which raises an exception if the VALUE does not have the type specified.
+which raises an exception if the VALUE does not have the type
+specified.
There are also faster check macros for fixnums and nil.
FIXNUM_P(obj)
NIL_P(obj)
-1.3 Convert VALUE into C data
+== Convert VALUE into C Data
-The data for type T_NIL, T_FALSE, T_TRUE are nil, true, false
+The data for type T_NIL, T_FALSE, T_TRUE are nil, false, true
respectively. They are singletons for the data type.
-
-The T_FIXNUM data is a 31bit length fixed integer (63bit length on
-some machines), which can be convert to a C integer by using the
-FIX2INT() macro. There is also NUM2INT() which converts any Ruby
-numbers into C integers. The NUM2INT() macro includes a type check, so
-an exception will be raised if the conversion failed. NUM2DBL() can
-be used to retrieve the double float value in same way.
-
-To get char* from a VALUE, version 1.7 recommend to use new macros
-StringValue() and StringValuePtr(). StringValue(var) replaces var's
-value to the result of "var.to_str()". StringValuePtr(var) does same
-replacement and returns char* representation of var. These macros
-will skip the replacement if var is a String. Notice that the macros
-requires to take only lvalue as their argument, to change the value
-of var in the replacement.
-
-In version 1.6 or earlier, STR2CSTR() was used to do same thing
-but now it is obsoleted in version 1.7 because of STR2CSTR() has
-a risk of dangling pointer problem in to_str() impliclit conversion.
+The equivalent C constants are: Qnil, Qfalse, Qtrue.
+Note that Qfalse is false in C also (i.e. 0), but not Qnil.
+
+The T_FIXNUM data is a 31bit or 63bit length fixed integer.
+This size is depend on the size of long: if long is 32bit then
+T_FIXNUM is 31bit, if long is 64bit then T_FIXNUM is 63bit.
+T_FIXNUM can be converted to a C integer by using the
+FIX2INT() macro or FIX2LONG(). Though you have to check that the
+data is really FIXNUM before using them, they are faster. FIX2LONG()
+never raises exceptions, but FIX2INT() raises RangeError if the
+result is bigger or smaller than the size of int.
+There are also NUM2INT() and NUM2LONG() which converts any Ruby
+numbers into C integers. These macros includes a type check,
+so an exception will be raised if the conversion failed. NUM2DBL()
+can be used to retrieve the double float value in the same way.
+
+You can use the macros
+StringValue() and StringValuePtr() to get a char* from a VALUE.
+StringValue(var) replaces var's value with the result of "var.to_str()".
+StringValuePtr(var) does same replacement and returns char*
+representation of var. These macros will skip the replacement if var
+is a String. Notice that the macros take only the lvalue as their
+argument, to change the value of var in place.
+
+You can also use the macro named StringValueCStr(). This is just
+like StringValuePtr(), but always add nul character at the end of
+the result. If the result contains nul character, this macro causes
+the ArgumentError exception.
+StringValuePtr() doesn't guarantee the existence of a nul at the end
+of the result, and the result may contain nul.
Other data types have corresponding C structures, e.g. struct RArray
-for T_ARRAY etc. The VALUE of the type which has corresponding structure
-can be cast to retrieve the pointer to the struct. The casting macro
-will be of the form RXXXX for each data type; for instance, RARRAY(obj).
-See "ruby.h".
+for T_ARRAY etc. The VALUE of the type which has the corresponding
+structure can be cast to retrieve the pointer to the struct. The
+casting macro will be of the form RXXXX for each data type; for
+instance, RARRAY(obj). See "ruby.h".
-For example, `RSTRING(str)->len' is the way to get the size of the
-Ruby String object. The allocated region can be accessed by
-`RSTRING(str)->ptr'. For arrays, use `RARRAY(ary)->len' and
-`RARRAY(ary)->ptr' respectively.
+There are some accessing macros for structure members, for example
+`RSTRING_LEN(str)' to get the size of the Ruby String object. The
+allocated region can be accessed by `RSTRING_PTR(str)'. For arrays,
+use `RARRAY_LEN(ary)' and `RARRAY_PTR(ary)' respectively.
Notice: Do not change the value of the structure directly, unless you
-are responsible for the result. This ends up being the cause of interesting
-bugs.
+are responsible for the result. This ends up being the cause of
+interesting bugs.
-1.4 Convert C data into VALUE
+== Convert C Data into VALUE
To convert C data to Ruby values:
- * FIXNUM
+FIXNUM ::
- left shift 1 bit, and turn on LSB.
+ left shift 1 bit, and turn on LSB.
- * Other pointer values
+Other pointer values::
- cast to VALUE.
+ cast to VALUE.
-You can determine whether a VALUE is pointer or not by checking its LSB.
+You can determine whether a VALUE is pointer or not by checking its LSB.
Notice Ruby does not allow arbitrary pointer values to be a VALUE. They
should be pointers to the structures which Ruby knows about. The known
@@ -144,81 +156,149 @@ structures are defined in <ruby.h>.
To convert C numbers to Ruby values, use these macros.
- INT2FIX() for integers within 31bits.
- INT2NUM() for arbitrary sized integer.
+INT2FIX() :: for integers within 31bits.
+INT2NUM() :: for arbitrary sized integer.
INT2NUM() converts an integer into a Bignum if it is out of the FIXNUM
range, but is a bit slower.
-1.5 Manipulating Ruby data
+== Manipulating Ruby Data
+
+As I already mentioned, it is not recommended to modify an object's
+internal structure. To manipulate objects, use the functions supplied
+by the Ruby interpreter. Some (not all) of the useful functions are
+listed below:
+
+=== String Functions
+
+rb_str_new(const char *ptr, long len) ::
+
+ Creates a new Ruby string.
+
+rb_str_new2(const char *ptr) ::
+rb_str_new_cstr(const char *ptr) ::
+
+ Creates a new Ruby string from a C string. This is equivalent to
+ rb_str_new(ptr, strlen(ptr)).
+
+rb_tainted_str_new(const char *ptr, long len) ::
+
+ Creates a new tainted Ruby string. Strings from external data
+ sources should be tainted.
+
+rb_tainted_str_new2(const char *ptr) ::
+rb_tainted_str_new_cstr(const char *ptr) ::
+
+ Creates a new tainted Ruby string from a C string.
+
+rb_sprintf(const char *format, ...) ::
+rb_vsprintf(const char *format, va_list ap) ::
+
+ Creates a new Ruby string with printf(3) format.
+
+rb_str_cat(VALUE str, const char *ptr, long len) ::
+
+ Appends len bytes of data from ptr to the Ruby string.
-As I already mentioned, it is not recommended to modify an object's internal
-structure. To manipulate objects, use the functions supplied by the Ruby
-interpreter. Some (not all) of the useful functions are listed below:
+rb_str_cat2(VALUE str, const char* ptr) ::
- String functions
+ Appends C string ptr to Ruby string str. This function is
+ equivalent to rb_str_cat(str, ptr, strlen(ptr)).
- rb_str_new(const char *ptr, long len)
+rb_str_catf(VALUE str, const char* format, ...) ::
+rb_str_vcatf(VALUE str, const char* format, va_list ap) ::
- Creates a new Ruby string.
+ Appends C string format and successive arguments to Ruby string
+ str according to a printf-like format. These functions are
+ equivalent to rb_str_cat2(str, rb_sprintf(format, ...)) and
+ rb_str_cat2(str, rb_vsprintf(format, ap)), respectively.
- rb_str_new2(const char *ptr)
+rb_enc_str_new(const char *ptr, long len, rb_encoding *enc) ::
- Creates a new Ruby string from a C string. This is equivalent to
- rb_str_new(ptr, strlen(ptr)).
+ Creates a new Ruby string with the specified encoding.
- rb_tainted_str_new(const char *ptr, long len)
+rb_usascii_str_new(const char *ptr, long len) ::
+rb_usascii_str_new_cstr(const char *ptr) ::
- Creates a new tainted Ruby string. Strings from external data
- sources should be tainted.
+ Creates a new Ruby string with encoding US-ASCII.
- rb_tainted_str_new2(const char *ptr)
+rb_str_resize(VALUE str, long len) ::
- Creates a new tainted Ruby string from a C string.
+ Resizes Ruby string to len bytes. If str is not modifiable, this
+ function raises an exception. The length of str must be set in
+ advance. If len is less than the old length the content beyond
+ len bytes is discarded, else if len is greater than the old length
+ the content beyond the old length bytes will not be preserved but
+ will be garbage. Note that RSTRING_PTR(str) may change by calling
+ this function.
- rb_str_cat(VALUE str, const char *ptr, long len)
+rb_str_set_len(VALUE str, long len) ::
- Appends len bytes of data from ptr to the Ruby string.
+ Sets the length of Ruby string. If str is not modifiable, this
+ function raises an exception. This function preserves the content
+ upto len bytes, regardless RSTRING_LEN(str). len must not exceed
+ the capacity of str.
- Array functions
+=== Array Functions
- rb_ary_new()
+rb_ary_new() ::
- Creates an array with no elements.
+ Creates an array with no elements.
- rb_ary_new2(long len)
+rb_ary_new2(long len) ::
- Creates an array with no elements, allocating internal buffer
- for len elements.
+ Creates an array with no elements, allocating internal buffer
+ for len elements.
- rb_ary_new3(long n, ...)
+rb_ary_new3(long n, ...) ::
- Creates an n-element array from the arguments.
+ Creates an n-element array from the arguments.
- rb_ary_new4(long n, VALUE *elts)
+rb_ary_new4(long n, VALUE *elts) ::
- Creates an n-element array from a C array.
+ Creates an n-element array from a C array.
- rb_ary_push(VALUE ary, VALUE val)
- rb_ary_pop(VALUE ary)
- rb_ary_shift(VALUE ary)
- rb_ary_unshift(VALUE ary, VALUE val)
+rb_ary_to_ary(VALUE obj) ::
- Array operations. The first argument to each functions must be an
- array. They may dump core if other types given.
+ Converts the object into an array.
+ Equivalent to Object#to_ary.
-2. Extending Ruby with C
+There are many functions to operate an array. They may dump core if other
+types are given.
-2.1 Addding new features to Ruby
+rb_ary_aref(argc, VALUE *argv, VALUE ary) ::
+
+ Equivaelent to Array#[].
+
+rb_ary_entry(VALUE ary, long offset) ::
+
+ ary[offset]
+
+rb_ary_subseq(VALUE ary, long beg, long len) ::
+
+ ary[beg, len]
+
+rb_ary_push(VALUE ary, VALUE val) ::
+rb_ary_pop(VALUE ary) ::
+rb_ary_shift(VALUE ary) ::
+rb_ary_unshift(VALUE ary, VALUE val) ::
+
+rb_ary_cat(VALUE ary, const VALUE *ptr, long len) ::
+
+ Appends len elements of objects from ptr to the array.
+
+= Extending Ruby with C
+
+== Adding New Features to Ruby
You can add new features (classes, methods, etc.) to the Ruby
interpreter. Ruby provides APIs for defining the following things:
- * Classes, Modules
- * Methods, Singleton Methods
- * Constants
+* Classes, Modules
+* Methods, Singleton Methods
+* Constants
-2.1.1 Class/module definition
+=== Class and Module Definition
To define a class or module, use the functions below:
@@ -233,21 +313,21 @@ To define nested classes or modules, use the functions below:
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
VALUE rb_define_module_under(VALUE outer, const char *name)
-2.1.2 Method/singleton method definition
+=== Method and Singleton Method Definition
To define methods or singleton methods, use these functions:
- void rb_define_method(VALUE klass, const char *name,
+ void rb_define_method(VALUE klass, const char *name,
VALUE (*func)(), int argc)
- void rb_define_singleton_method(VALUE object, const char *name,
+ void rb_define_singleton_method(VALUE object, const char *name,
VALUE (*func)(), int argc)
The `argc' represents the number of the arguments to the C function,
-which must be less than 17. But I believe you don't need that much. :-)
+which must be less than 17. But I doubt you'll need that many.
If `argc' is negative, it specifies the calling sequence, not number of
-the arguments.
+the arguments.
If argc is -1, the function will be called as:
@@ -264,15 +344,23 @@ will be called like:
where obj is the receiver, and args is the Ruby array containing
actual arguments.
-There are two more functions to define methods. One is to define
-private methods:
+There are some more functions to define methods. One takes an ID
+as the name of method to be defined. See also ID or Symbol below.
+
+ void rb_define_method_id(VALUE klass, ID name,
+ VALUE (*func)(ANYARGS), int argc)
+
+There are two functions to define private/protected methods:
- void rb_define_private_method(VALUE klass, const char *name,
+ void rb_define_private_method(VALUE klass, const char *name,
VALUE (*func)(), int argc)
+ void rb_define_protected_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
-The other is to define module functions, which are private AND singleton
-methods of the module. For example, sqrt is the module function
-defined in Math module. It can be call in the form like:
+At last, rb_define_module_function defines a module functions,
+which are private AND singleton methods of the module.
+For example, sqrt is the module function defined in Math module.
+It can be called in the following way:
Math.sqrt(4)
@@ -283,28 +371,32 @@ or
To define module functions, use:
- void rb_define_module_function(VALUE module, const char *name,
+ void rb_define_module_function(VALUE module, const char *name,
VALUE (*func)(), int argc)
-Oh, in addition, function-like methods, which are private methods defined
+In addition, function-like methods, which are private methods defined
in the Kernel module, can be defined using:
void rb_define_global_function(const char *name, VALUE (*func)(), int argc)
-To define alias to the method,
+To define an alias for the method,
void rb_define_alias(VALUE module, const char* new, const char* old);
+To define a reader/writer for an attribute,
+
+ void rb_define_attr(VALUE klass, const char *name, int read, int write)
+
To define and undefine the `allocate' class method,
void rb_define_alloc_func(VALUE klass, VALUE (*func)(VALUE klass));
void rb_undef_alloc_func(VALUE klass);
-func have to take the klass as the argument and return a newly
-allocated instance. This instance should be empty as possible,
+func has to take the klass as the argument and return a newly
+allocated instance. This instance should be as empty as possible,
without any expensive (including external) resources.
-2.1.3 Constant definition
+=== Constant Definition
We have 2 functions to define constants:
@@ -314,37 +406,60 @@ We have 2 functions to define constants:
The former is to define a constant under specified class/module. The
latter is to define a global constant.
-2.2 Use Ruby features from C
+== Use Ruby Features from C
There are several ways to invoke Ruby's features from C code.
-2.2.1 Evaluate Ruby Programs in a String
+=== Evaluate Ruby Programs in a String
The easiest way to use Ruby's functionality from a C program is to
-evaluate the string as Ruby program. This function will do the job.
+evaluate the string as Ruby program. This function will do the job:
VALUE rb_eval_string(const char *str)
Evaluation is done under the current context, thus current local variables
of the innermost method (which is defined by Ruby) can be accessed.
-2.2.2 ID or Symbol
+Note that the evaluation can raise an exception. There is a safer
+function:
+
+ VALUE rb_eval_string_protect(const char *str, int *state)
-You can invoke methods directly, without parsing the string. First I need
-to explain about ID. ID is the integer number to represent Ruby's
-identifiers such as variable names. The Ruby data type corresponding to ID
-is Symbol. It can be accessed from Ruby in the form:
+It returns nil when an error occur. Moreover, *state is zero if str was
+successfully evaluated, or nonzero otherwise.
- :Identifier
+=== ID or Symbol
+
+You can invoke methods directly, without parsing the string. First I
+need to explain about ID. ID is the integer number to represent
+Ruby's identifiers such as variable names. The Ruby data type
+corresponding to ID is Symbol. It can be accessed from Ruby in the
+form:
+
+ :Identifier
+
+or
+
+ :"any kind of string"
You can get the ID value from a string within C code by using
rb_intern(const char *name)
+ rb_intern_str(VALUE name)
You can retrieve ID from Ruby object (Symbol or String) given as an
argument by using
rb_to_id(VALUE symbol)
+ rb_check_id(volatile VALUE *name)
+ rb_check_id_cstr(const char *name, long len, rb_encoding *enc)
+
+These functions try to convert the argument to a String if it was not
+a Symbol nor a String. The second function stores the converted
+result into *name, and returns 0 if the string is not a known symbol.
+After this function returned a non-zero value, *name is always a
+Symbol or a String, otherwise it is a String if the result is 0.
+The third function takes NUL-terminated C string, not Ruby VALUE.
You can convert C ID to Ruby Symbol by using
@@ -354,7 +469,7 @@ and to convert Ruby Symbol object to ID, use
ID SYM2ID(VALUE symbol)
-2.2.3 Invoke Ruby method from C
+=== Invoke Ruby Method from C
To invoke methods directly, you can use the function below
@@ -363,11 +478,11 @@ To invoke methods directly, you can use the function below
This function invokes a method on the recv, with the method name
specified by the symbol mid.
-2.2.4 Accessing the variables and constants
+=== Accessing the Variables and Constants
You can access class variables and instance variables using access
-functions. Also, global variables can be shared between both environments.
-There's no way to access Ruby's local variables.
+functions. Also, global variables can be shared between both
+environments. There's no way to access Ruby's local variables.
The functions to access/modify instance variables are below:
@@ -380,13 +495,14 @@ To access the constants of the class/module:
VALUE rb_const_get(VALUE obj, ID id)
-See 2.1.3 for defining new constant.
+See also Constant Definition above.
-3. Information sharing between Ruby and C
+= Information Sharing Between Ruby and C
-3.1 Ruby constants that C can be accessed from C
+=== Ruby Constants That C Can Be Accessed From C
-The following Ruby constants can be referred from C.
+As stated in section 1.3,
+the following Ruby constants can be referred from C.
Qtrue
Qfalse
@@ -397,7 +513,7 @@ Boolean values. Qfalse is false in C also (i.e. 0).
Ruby nil in C scope.
-3.2 Global variables shared between C and Ruby
+== Global Variables Shared Between C and Ruby
Information can be shared between the two environments using shared global
variables. To define them, you can use functions listed below:
@@ -416,30 +532,37 @@ function below.
You can defined hooked variables. The accessor functions (getter and
setter) are called on access to the hooked variables.
- void rb_define_hooked_variable(constchar *name, VALUE *var,
+ void rb_define_hooked_variable(const char *name, VALUE *var,
VALUE (*getter)(), void (*setter)())
If you need to supply either setter or getter, just supply 0 for the
hook you don't need. If both hooks are 0, rb_define_hooked_variable()
works just like rb_define_variable().
- void rb_define_virtual_variable(const char *name,
- VALUE (*getter)(), void (*setter)())
+The prototypes of the getter and setter functions are as follows:
+
+ VALUE (*getter)(ID id, VALUE *var);
+ void (*setter)(VALUE val, ID id, VALUE *var);
-This function defines a Ruby global variable without a corresponding C
+
+Also you can define a Ruby global variable without a corresponding C
variable. The value of the variable will be set/get only by hooks.
+ void rb_define_virtual_variable(const char *name,
+ VALUE (*getter)(), void (*setter)())
+
The prototypes of the getter and setter functions are as follows:
- (*getter)(ID id, void *data, struct global_entry* entry);
- (*setter)(VALUE val, ID id, void *data, struct global_entry* entry);
+ VALUE (*getter)(ID id);
+ void (*setter)(VALUE val, ID id);
-3.3 Encapsulate C data into Ruby object
+
+== Encapsulate C Data into a Ruby Object
To wrap and objectify a C pointer as a Ruby object (so called
DATA), use Data_Wrap_Struct().
- Data_Wrap_Struct(klass, mark, free, ptr)
+ Data_Wrap_Struct(klass, mark, free, sval)
Data_Wrap_Struct() returns a created DATA object. The klass argument
is the class for the DATA object. The mark argument is the function
@@ -448,6 +571,10 @@ function to free the pointer allocation. If this is -1, the pointer
will be just freed. The functions mark and free will be called from
garbage collector.
+These mark / free functions are invoked during GC execution. No
+object allocations are allowed during it, so do not allocate ruby
+objects inside them.
+
You can allocate and wrap the structure in one step.
Data_Make_Struct(klass, type, mark, free, sval)
@@ -468,31 +595,34 @@ Data_Get_Struct().
A pointer to the structure will be assigned to the variable sval.
-See the example below for details.
+See the example below for details.
-4. Example - Creating dbm extension
+= Example - Creating dbm Extension
OK, here's the example of making an extension library. This is the
extension to access DBMs. The full source is included in the ext/
directory in the Ruby's source tree.
-(1) make the directory
+== Make the Directory
% mkdir ext/dbm
Make a directory for the extension library under ext directory.
-(2) design the library
+== Design the Library
You need to design the library features, before making it.
-(3) write C code.
+== Write the C Code
You need to write C code for your extension library. If your library
has only one source file, choosing ``LIBRARY.c'' as a file name is
preferred. On the other hand, in case your library has multiple source
files, avoid choosing ``LIBRARY.c'' for a file name. It may conflict
with an intermediate file ``LIBRARY.o'' on some platforms.
+Note that some functions in mkmf library described below generate
+a file ``conftest.c'' for checking with compilation. You shouldn't
+choose ``conftest.c'' as a name of a source file.
Ruby will execute the initializing function named ``Init_LIBRARY'' in
the library. For example, ``Init_dbm()'' will be executed when loading
@@ -500,53 +630,48 @@ the library.
Here's the example of an initializing function.
---
-Init_dbm()
-{
- /* define DBM class */
- cDBM = rb_define_class("DBM", rb_cObject);
- /* DBM includes Enumerate module */
- rb_include_module(cDBM, rb_mEnumerable);
-
- /* DBM has class method open(): arguments are received as C array */
- rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1);
-
- /* DBM instance method close(): no args */
- rb_define_method(cDBM, "close", fdbm_close, 0);
- /* DBM instance method []: 1 argument */
- rb_define_method(cDBM, "[]", fdbm_fetch, 1);
- :
-
- /* ID for a instance variable to store DBM data */
- id_dbm = rb_intern("dbm");
-}
---
-
-The dbm extension wraps the dbm struct in the C environment using
-Data_Make_Struct.
+ void
+ Init_dbm(void)
+ {
+ /* define DBM class */
+ cDBM = rb_define_class("DBM", rb_cObject);
+ /* DBM includes Enumerate module */
+ rb_include_module(cDBM, rb_mEnumerable);
+
+ /* DBM has class method open(): arguments are received as C array */
+ rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1);
+
+ /* DBM instance method close(): no args */
+ rb_define_method(cDBM, "close", fdbm_close, 0);
+ /* DBM instance method []: 1 argument */
+ rb_define_method(cDBM, "[]", fdbm_fetch, 1);
+
+ /* ... */
---
-struct dbmdata {
- int di_size;
- DBM *di_dbm;
-};
+ /* ID for a instance variable to store DBM data */
+ id_dbm = rb_intern("dbm");
+ }
+
+The dbm extension wraps the dbm struct in the C environment using
+Data_Make_Struct.
+ struct dbmdata {
+ int di_size;
+ DBM *di_dbm;
+ };
-obj = Data_Make_Struct(klass, struct dbmdata, 0, free_dbm, dbmp);
---
+ obj = Data_Make_Struct(klass, struct dbmdata, 0, free_dbm, dbmp);
-This code wraps the dbmdata structure into a Ruby object. We avoid wrapping
-DBM* directly, because we want to cache size information.
+This code wraps the dbmdata structure into a Ruby object. We avoid
+wrapping DBM* directly, because we want to cache size information.
To retrieve the dbmdata structure from a Ruby object, we define the
following macro:
---
-#define GetDBM(obj, dbmp) {\
- Data_Get_Struct(obj, struct dbmdata, dbmp);\
- if (dbmp->di_dbm == 0) closed_dbm();\
-}
---
+ #define GetDBM(obj, dbmp) {\
+ Data_Get_Struct(obj, struct dbmdata, dbmp);\
+ if (dbmp->di_dbm == 0) closed_dbm();\
+ }
This sort of complicated macro does the retrieving and close checking for
the DBM.
@@ -554,14 +679,11 @@ the DBM.
There are three kinds of way to receive method arguments. First,
methods with a fixed number of arguments receive arguments like this:
---
-static VALUE
-fdbm_delete(obj, keystr)
- VALUE obj, keystr;
-{
- :
-}
---
+ static VALUE
+ fdbm_delete(VALUE obj, VALUE keystr)
+ {
+ /* ... */
+ }
The first argument of the C function is the self, the rest are the
arguments to the method.
@@ -569,57 +691,49 @@ arguments to the method.
Second, methods with an arbitrary number of arguments receive
arguments like this:
---
-static VALUE
-fdbm_s_open(argc, argv, klass)
- int argc;
- VALUE *argv;
- VALUE klass;
-{
- :
- if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
- mode = 0666; /* default value */
- }
- :
-}
---
+ static VALUE
+ fdbm_s_open(int argc, VALUE *argv, VALUE klass)
+ {
+ /* ... */
+ if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
+ mode = 0666; /* default value */
+ }
+ /* ... */
+ }
The first argument is the number of method arguments, the second
argument is the C array of the method arguments, and the third
argument is the receiver of the method.
You can use the function rb_scan_args() to check and retrieve the
-arguments. For example, "11" means that the method requires at least one
-argument, and at most receives two arguments.
+arguments. The third argument is a string that specifies how to
+capture method arguments and assign them to the following VALUE
+references.
-Methods with an arbitrary number of arguments can receive arguments
-by Ruby's array, like this:
---
-static VALUE
-fdbm_indexes(obj, args)
- VALUE obj, args;
-{
- :
-}
---
+The following is an example of a method that takes arguments by Ruby's
+array:
+
+ static VALUE
+ thread_initialize(VALUE thread, VALUE args)
+ {
+ /* ... */
+ }
The first argument is the receiver, the second one is the Ruby array
which contains the arguments to the method.
-** Notice
-
-GC should know about global variables which refer to Ruby's objects, but
-are not exported to the Ruby world. You need to protect them by
+*Notice*: GC should know about global variables which refer to Ruby's objects,
+but are not exported to the Ruby world. You need to protect them by
void rb_global_variable(VALUE *var)
-(4) prepare extconf.rb
+== Prepare extconf.rb
If the file named extconf.rb exists, it will be executed to generate
Makefile.
-extconf.rb is the file for check compilation conditions etc. You
+extconf.rb is the file for checking compilation conditions etc. You
need to put
require 'mkmf'
@@ -627,10 +741,26 @@ need to put
at the top of the file. You can use the functions below to check
various conditions.
- have_library(lib, func): check whether library containing function exists.
- have_func(func, header): check whether function exists
- have_header(header): check whether header file exists
- create_makefile(target): generate Makefile
+ have_macro(macro[, headers[, opt]]): check whether macro is defined
+ have_library(lib[, func[, headers[, opt]]]): check whether library containing function exists
+ find_library(lib[, func, *paths]): find library from paths
+ have_func(func[, headers[, opt]): check whether function exists
+ have_var(var[, headers[, opt]]): check whether variable exists
+ have_header(header[, preheaders[, opt]]): check whether header file exists
+ find_header(header, *paths): find header from paths
+ have_framework(fw): check whether framework exists (for MacOS X)
+ have_struct_member(type, member[, headers[, opt]]): check whether struct has member
+ have_type(type[, headers[, opt]]): check whether type exists
+ find_type(type, opt, *headers): check whether type exists in headers
+ have_const(const[, headers[, opt]]): check whether constant is defined
+ check_sizeof(type[, headers[, opts]]): check size of type
+ check_signedness(type[, headers[, opts]]): check signedness of type
+ convertible_int(type[, headers[, opts]]): find convertible integer type
+ find_executable(bin[, path]): find excutable file path
+ create_header(header): generate configured header
+ create_makefile(target[, target_prefix]): generate Makefile
+
+See MakeMakefile for full documentation of these functions.
The value of the variables below will affect the Makefile.
@@ -639,492 +769,693 @@ The value of the variables below will affect the Makefile.
$LDFLAGS: included in LDFLAGS make variable (such as -L)
$objs: list of object file names
-In normal, object files list is automatically generated by searching
-source files, but you need directs them explicitly if any sources will
+Normally, the object files list is automatically generated by searching
+source files, but you must define them explicitly if any sources will
be generated while building.
If a compilation condition is not fulfilled, you should not call
-``create_makefile''. The Makefile will not generated, compilation will
+``create_makefile''. The Makefile will not be generated, compilation will
not be done.
-(5) prepare depend (optional)
+== Prepare Depend (Optional)
If the file named depend exists, Makefile will include that file to
check dependencies. You can make this file by invoking
% gcc -MM *.c > depend
-It's no harm. Prepare it.
+It's harmless. Prepare it.
-(6) generate Makefile
+== Generate Makefile
Try generating the Makefile by:
ruby extconf.rb
+If the library should be installed under vendor_ruby directory
+instead of site_ruby directory, use --vendor option as follows.
+
+ ruby extconf.rb --vendor
+
You don't need this step if you put the extension library under the ext
directory of the ruby source tree. In that case, compilation of the
interpreter will do this step for you.
-(7) make
+== Run make
Type
make
to compile your extension. You don't need this step either if you have
-put extension library under the ext directory of the ruby source tree.
+put the extension library under the ext directory of the ruby source tree.
-(8) debug
+== Debug
You may need to rb_debug the extension. Extensions can be linked
-statically by the adding directory name in the ext/Setup file so that
+statically by adding the directory name in the ext/Setup file so that
you can inspect the extension with the debugger.
-(9) done, now you have the extension library
+== Done! Now You Have the Extension Library
You can do anything you want with your library. The author of Ruby
will not claim any restrictions on your code depending on the Ruby API.
Feel free to use, modify, distribute or sell your program.
-Appendix A. Ruby source files overview
+= Appendix A. Ruby Source Files Overview
-ruby language core
+== Ruby Language Core
- class.c
- error.c
- eval.c
- gc.c
- object.c
- parse.y
- variable.c
+class.c :: classes and modules
+error.c :: exception classes and exception mechanism
+gc.c :: memory management
+load.c :: library loading
+object.c :: objects
+variable.c :: variables and constants
+
+== Ruby Syntax Parser
+
+parse.y :: grammar definition
+parse.c :: automatically generated from parse.y
+keywords :: reserved keywords
+lex.c :: automatically generated from keywords
+
+== Ruby Evaluator (a.k.a. YARV)
-utility functions
+ compile.c
+ eval.c
+ eval_error.c
+ eval_jump.c
+ eval_safe.c
+ insns.def : definition of VM instructions
+ iseq.c : implementation of VM::ISeq
+ thread.c : thread management and context swiching
+ thread_win32.c : thread implementation
+ thread_pthread.c : ditto
+ vm.c
+ vm_dump.c
+ vm_eval.c
+ vm_exec.c
+ vm_insnhelper.c
+ vm_method.c
+
+ opt_insns_unif.def : instruction unification
+ opt_operand.def : definitions for optimization
+
+ -> insn*.inc : automatically generated
+ -> opt*.inc : automatically generated
+ -> vm.inc : automatically generated
+
+== Regular Expression Engine (Oniguruma)
- dln.c
regex.c
- st.c
- util.c
+ regcomp.c
+ regenc.c
+ regerror.c
+ regexec.c
+ regparse.c
+ regsyntax.c
+
+== Utility Functions
-ruby interpreter implementation
+debug.c :: debug symbols for C debuggger
+dln.c :: dynamic loading
+st.c :: general purpose hash table
+strftime.c :: formatting times
+util.c :: misc utilities
+
+== Ruby Interpreter Implementation
dmyext.c
+ dmydln.c
+ dmyencoding.c
+ id.c
inits.c
main.c
ruby.c
version.c
-class library
+ gem_prelude.rb
+ prelude.rb
- array.c
- bignum.c
- compar.c
- dir.c
- enum.c
- file.c
- hash.c
- io.c
- marshal.c
- math.c
- numeric.c
- pack.c
- prec.c
- process.c
- random.c
- range.c
- re.c
- signal.c
- sprintf.c
- string.c
- struct.c
- time.c
+== Class Library
-Appendix B. Ruby extension API reference
+array.c :: Array
+bignum.c :: Bignum
+compar.c :: Comparable
+complex.c :: Complex
+cont.c :: Fiber, Continuation
+dir.c :: Dir
+enum.c :: Enumerable
+enumerator.c :: Enumerator
+file.c :: File
+hash.c :: Hash
+io.c :: IO
+marshal.c :: Marshal
+math.c :: Math
+numeric.c :: Numeric, Integer, Fixnum, Float
+pack.c :: Array#pack, String#unpack
+proc.c :: Binding, Proc
+process.c :: Process
+random.c :: random number
+range.c :: Range
+rational.c :: Rational
+re.c :: Regexp, MatchData
+signal.c :: Signal
+sprintf.c :: String#sprintf
+string.c :: String
+struct.c :: Struct
+time.c :: Time
-** Types
+defs/known_errors.def :: Errno::* exception classes
+-> known_errors.inc :: automatically generated
- VALUE
+== Multilingualization
-The type for the Ruby object. Actual structures are defined in ruby.h,
-such as struct RString, etc. To refer the values in structures, use
-casting macros like RSTRING(obj).
+encoding.c :: Encoding
+transcode.c :: Encoding::Converter
+enc/*.c :: encoding classes
+enc/trans/* :: codepoint mapping tables
-** Variables and constants
+== goruby Interpreter Implementation
- Qnil
+ goruby.c
+ golf_prelude.rb : goruby specific libraries.
+ -> golf_prelude.c : automatically generated
-const: nil object
- Qtrue
+= Appendix B. Ruby Extension API Reference
-const: true object(default true value)
+== Types
- Qfalse
+VALUE ::
-const: false object
+ The type for the Ruby object. Actual structures are defined in ruby.h,
+ such as struct RString, etc. To refer the values in structures, use
+ casting macros like RSTRING(obj).
-** C pointer wrapping
+== Variables and Constants
- Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval)
+Qnil::
+ nil object
-Wrap a C pointer into a Ruby object. If object has references to other
-Ruby objects, they should be marked by using the mark function during
-the GC process. Otherwise, mark should be 0. When this object is no
-longer referred by anywhere, the pointer will be discarded by free
-function.
+Qtrue::
+ true object (default true value)
- Data_Make_Struct(klass, type, mark, free, sval)
+Qfalse::
+ false object
-This macro allocates memory using malloc(), assigns it to the variable
-sval, and returns the DATA encapsulating the pointer to memory region.
+== C Pointer Wrapping
- Data_Get_Struct(data, type, sval)
+Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval) ::
-This macro retrieves the pointer value from DATA, and assigns it to
-the variable sval.
+ Wrap a C pointer into a Ruby object. If object has references to other
+ Ruby objects, they should be marked by using the mark function during
+ the GC process. Otherwise, mark should be 0. When this object is no
+ longer referred by anywhere, the pointer will be discarded by free
+ function.
-** Checking data types
+Data_Make_Struct(klass, type, mark, free, sval) ::
-TYPE(value)
-FIXNUM_P(value)
-NIL_P(value)
-void Check_Type(VALUE value, int type)
-void Check_SafeStr(VALUE value)
+ This macro allocates memory using malloc(), assigns it to the variable
+ sval, and returns the DATA encapsulating the pointer to memory region.
-** Data type conversion
+Data_Get_Struct(data, type, sval) ::
-FIX2INT(value)
-INT2FIX(i)
-NUM2INT(value)
-INT2NUM(i)
-NUM2DBL(value)
-rb_float_new(f)
-StringValue(value)
-StringValuePtr(value)
-StringValueCStr(value)
-rb_str_new2(s)
+ This macro retrieves the pointer value from DATA, and assigns it to
+ the variable sval.
-** defining class/module
+== Checking Data Types
- VALUE rb_define_class(const char *name, VALUE super)
+TYPE(value) ::
-Defines a new Ruby class as a subclass of super.
+ Internal type (T_NIL, T_FIXNUM, etc.)
- VALUE rb_define_class_under(VALUE module, const char *name, VALUE super)
+FIXNUM_P(value) ::
-Creates a new Ruby class as a subclass of super, under the module's
-namespace.
+ Is +value+ a Fixnum?
- VALUE rb_define_module(const char *name)
+NIL_P(value) ::
-Defines a new Ruby module.
+ Is +value+ nil?
- VALUE rb_define_module_under(VALUE module, const char *name)
+void Check_Type(VALUE value, int type) ::
-Defines a new Ruby module under the module's namespace.
+ Ensures +value+ is of the given internal +type+ or raises a TypeError
- void rb_include_module(VALUE klass, VALUE module)
+SaveStringValue(value) ::
-Includes module into class. If class already includes it, just
-ignored.
+ Checks that +value+ is a String and is not tainted
- void rb_extend_object(VALUE object, VALUE module)
+== Data Type Conversion
-Extend the object with the module's attributes.
+FIX2INT(value), INT2FIX(i) ::
-** Defining Global Variables
+ Fixnum <-> integer
- void rb_define_variable(const char *name, VALUE *var)
+FIX2LONG(value), LONG2FIX(l) ::
-Defines a global variable which is shared between C and Ruby. If name
-contains a character which is not allowed to be part of the symbol,
-it can't be seen from Ruby programs.
+ Fixnum <-> long
- void rb_define_readonly_variable(const char *name, VALUE *var)
+NUM2INT(value), INT2NUM(i) ::
-Defines a read-only global variable. Works just like
-rb_define_variable(), except defined variable is read-only.
+ Numeric <-> integer
- void rb_define_virtual_variable(const char *name,
- VALUE (*getter)(), VALUE (*setter)())
+NUM2UINT(value), UINT2NUM(ui) ::
-Defines a virtual variable, whose behavior is defined by a pair of C
-functions. The getter function is called when the variable is
-referred. The setter function is called when the value is set to the
-variable. The prototype for getter/setter functions are:
+ Numeric <-> unsigned integer
- VALUE getter(ID id)
- void setter(VALUE val, ID id)
+NUM2LONG(value), LONG2NUM(l) ::
-The getter function must return the value for the access.
+ Numeric <-> long
- void rb_define_hooked_variable(const char *name, VALUE *var,
- VALUE (*getter)(), VALUE (*setter)())
+NUM2ULONG(value), ULONG2NUM(ul) ::
-Defines hooked variable. It's a virtual variable with a C variable.
-The getter is called as
+ Numeric <-> unsigned long
- VALUE getter(ID id, VALUE *var)
+NUM2LL(value), LL2NUM(ll) ::
-returning a new value. The setter is called as
+ Numeric <-> long long
- void setter(VALUE val, ID id, VALUE *var)
+NUM2ULL(value), ULL2NUM(ull) ::
-GC requires C global variables which hold Ruby values to be marked.
+ Numeric <-> unsigned long long
- void rb_global_variable(VALUE *var)
+NUM2OFFT(value), OFFT2NUM(off) ::
-Tells GC to protect these variables.
+ Numeric <-> off_t
-** Constant Definition
+NUM2SIZET(value), SIZET2NUM(size) ::
- void rb_define_const(VALUE klass, const char *name, VALUE val)
+ Numeric <-> size_t
-Defines a new constant under the class/module.
+NUM2SSIZET(value), SSIZET2NUM(ssize) ::
- void rb_define_global_const(const char *name, VALUE val)
+ Numeric <-> ssize_t
-Defines a global constant. This is just the same as
+NUM2DBL(value) ::
- rb_define_const(cKernal, name, val)
+ Numeric -> double
-** Method Definition
+rb_float_new(f) ::
- rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc)
+ double -> Float
-Defines a method for the class. func is the function pointer. argc
-is the number of arguments. if argc is -1, the function will receive
-3 arguments: argc, argv, and self. if argc is -2, the function will
-receive 2 arguments, self and args, where args is a Ruby array of
-the method arguments.
+StringValue(value) ::
- rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc)
+ Object with #to_str -> String
-Defines a private method for the class. Arguments are same as
-rb_define_method().
+StringValuePtr(value) ::
- rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc)
+ Object with #to_str -> pointer to String data
-Defines a singleton method. Arguments are same as rb_define_method().
+StringValueCStr(value) ::
- rb_scan_args(int argc, VALUE *argv, const char *fmt, ...)
+ Object with #to_str -> pointer to String data without NULL bytes
-Retrieve argument from argc, argv. The fmt is the format string for
-the arguments, such as "12" for 1 non-optional argument, 2 optional
-arguments. If `*' appears at the end of fmt, it means the rest of
-the arguments are assigned to the corresponding variable, packed in
-an array.
+rb_str_new2(s) ::
-** Invoking Ruby method
+ char * -> String
- VALUE rb_funcall(VALUE recv, ID mid, int narg, ...)
+== Defining Class and Module
-Invokes a method. To retrieve mid from a method name, use rb_intern().
+VALUE rb_define_class(const char *name, VALUE super) ::
- VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
+ Defines a new Ruby class as a subclass of super.
-Invokes a method, passing arguments by an array of values.
+VALUE rb_define_class_under(VALUE module, const char *name, VALUE super) ::
- VALUE rb_eval_string(const char *str)
+ Creates a new Ruby class as a subclass of super, under the module's
+ namespace.
-Compiles and executes the string as a Ruby program.
+VALUE rb_define_module(const char *name) ::
- ID rb_intern(const char *name)
+ Defines a new Ruby module.
-Returns ID corresponding to the name.
+VALUE rb_define_module_under(VALUE module, const char *name) ::
- char *rb_id2name(ID id)
+ Defines a new Ruby module under the module's namespace.
-Returns the name corresponding ID.
+void rb_include_module(VALUE klass, VALUE module) ::
- char *rb_class2name(VALUE klass)
+ Includes module into class. If class already includes it, just ignored.
-Returns the name of the class.
+void rb_extend_object(VALUE object, VALUE module) ::
- int rb_respond_to(VALUE object, ID id)
+ Extend the object with the module's attributes.
-Returns true if the object responds to the message specified by id.
+== Defining Global Variables
-** Instance Variables
+void rb_define_variable(const char *name, VALUE *var) ::
- VALUE rb_iv_get(VALUE obj, const char *name)
+ Defines a global variable which is shared between C and Ruby. If name
+ contains a character which is not allowed to be part of the symbol,
+ it can't be seen from Ruby programs.
-Retrieve the value of the instance variable. If the name is not
-prefixed by `@', that variable shall be inaccessible from Ruby.
+void rb_define_readonly_variable(const char *name, VALUE *var) ::
- VALUE rb_iv_set(VALUE obj, const char *name, VALUE val)
+ Defines a read-only global variable. Works just like
+ rb_define_variable(), except the defined variable is read-only.
-Sets the value of the instance variable.
+void rb_define_virtual_variable(const char *name, VALUE (*getter)(), VALUE (*setter)()) ::
-** Control Structure
+ Defines a virtual variable, whose behavior is defined by a pair of C
+ functions. The getter function is called when the variable is
+ referenced. The setter function is called when the variable is set to a
+ value. The prototype for getter/setter functions are:
- VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
+ VALUE getter(ID id)
+ void setter(VALUE val, ID id)
-Calls the function func1, supplying func2 as the block. func1 will be
-called with the argument arg1. func2 receives the value from yield as
-the first argument, arg2 as the second argument.
-
- VALUE rb_yield(VALUE val)
+ The getter function must return the value for the access.
-Evaluates the block with value val.
+void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), VALUE (*setter)()) ::
- VALUE rb_rescue(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
+ Defines hooked variable. It's a virtual variable with a C variable.
+ The getter is called as
-Calls the function func1, with arg1 as the argument. If an exception
-occurs during func1, it calls func2 with arg2 as the argument. The
-return value of rb_rescue() is the return value from func1 if no
-exception occurs, from func2 otherwise.
+ VALUE getter(ID id, VALUE *var)
- VALUE rb_ensure(VALUE (*func1)(), void *arg1, void (*func2)(), void *arg2)
+ returning a new value. The setter is called as
-Calls the function func1 with arg1 as the argument, then calls func2
-with arg2 if execution terminated. The return value from
-rb_ensure() is that of func1.
+ void setter(VALUE val, ID id, VALUE *var)
-** Exceptions and Errors
+ GC requires C global variables which hold Ruby values to be marked.
- void rb_warn(const char *fmt, ...)
+void rb_global_variable(VALUE *var)
-Prints a warning message according to a printf-like format.
+ Tells GC to protect these variables.
- void rb_warning(const char *fmt, ...)
+== Constant Definition
-Prints a warning message according to a printf-like format, if
-$VERBOSE is true.
+void rb_define_const(VALUE klass, const char *name, VALUE val) ::
-void rb_raise(rb_eRuntimeError, const char *fmt, ...)
+ Defines a new constant under the class/module.
-Raises RuntimeError. The fmt is a format string just like printf().
+void rb_define_global_const(const char *name, VALUE val) ::
- void rb_raise(VALUE exception, const char *fmt, ...)
+ Defines a global constant. This is just the same as
-Raises a class exception. The fmt is a format string just like printf().
+ rb_define_const(cKernal, name, val)
- void rb_fatal(const char *fmt, ...)
+== Method Definition
-Raises a fatal error, terminates the interpreter. No exception handling
-will be done for fatal errors, but ensure blocks will be executed.
+rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
- void rb_bug(const char *fmt, ...)
+ Defines a method for the class. func is the function pointer. argc
+ is the number of arguments. if argc is -1, the function will receive
+ 3 arguments: argc, argv, and self. if argc is -2, the function will
+ receive 2 arguments, self and args, where args is a Ruby array of
+ the method arguments.
-Terminates the interpreter immediately. This function should be
-called under the situation caused by the bug in the interpreter. No
-exception handling nor ensure execution will be done.
+rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
-** Initialize and Starts the Interpreter
+ Defines a private method for the class. Arguments are same as
+ rb_define_method().
-The embedding API functions are below (not needed for extension libraries):
+rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ Defines a singleton method. Arguments are same as rb_define_method().
+
+rb_scan_args(int argc, VALUE *argv, const char *fmt, ...) ::
+
+ Retrieve argument from argc and argv to given VALUE references
+ according to the format string. The format can be described in ABNF
+ as follows:
+
+ scan-arg-spec := param-arg-spec [option-hash-arg-spec] [block-arg-spec]
+
+ param-arg-spec := pre-arg-spec [post-arg-spec] / post-arg-spec /
+ pre-opt-post-arg-spec
+ pre-arg-spec := num-of-leading-mandatory-args [num-of-optional-args]
+ post-arg-spec := sym-for-variable-length-args
+ [num-of-trailing-mandatory-args]
+ pre-opt-post-arg-spec := num-of-leading-mandatory-args num-of-optional-args
+ num-of-trailing-mandatory-args
+ option-hash-arg-spec := sym-for-option-hash-arg
+ block-arg-spec := sym-for-block-arg
+
+ num-of-leading-mandatory-args := DIGIT ; The number of leading
+ ; mandatory arguments
+ num-of-optional-args := DIGIT ; The number of optional
+ ; arguments
+ sym-for-variable-length-args := "*" ; Indicates that variable
+ ; length arguments are
+ ; captured as a ruby array
+ num-of-trailing-mandatory-args := DIGIT ; The number of trailing
+ ; mandatory arguments
+ sym-for-option-hash-arg := ":" ; Indicates that an option
+ ; hash is captured if the last
+ ; argument is a hash or can be
+ ; converted to a hash with
+ ; #to_hash. When the last
+ ; argument is nil, it is
+ ; captured if it is not
+ ; ambiguous to take it as
+ ; empty option hash; i.e. '*'
+ ; is not specified and
+ ; arguments are given more
+ ; than sufficient.
+ sym-for-block-arg := "&" ; Indicates that an iterator
+ ; block should be captured if
+ ; given
+
+ For example, "12" means that the method requires at least one
+ argument, and at most receives three (1+2) arguments. So, the format
+ string must be followed by three variable references, which are to be
+ assigned to captured arguments. For omitted arguments, variables are
+ set to Qnil. NULL can be put in place of a variable reference, which
+ means the corresponding captured argument(s) should be just dropped.
+
+ The number of given arguments, excluding an option hash or iterator
+ block, is returned.
+
+== Invoking Ruby method
+
+VALUE rb_funcall(VALUE recv, ID mid, int narg, ...) ::
+
+ Invokes a method. To retrieve mid from a method name, use rb_intern().
+
+VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ Invokes a method, passing arguments by an array of values.
+
+VALUE rb_eval_string(const char *str) ::
+
+ Compiles and executes the string as a Ruby program.
+
+ID rb_intern(const char *name) ::
+
+ Returns ID corresponding to the name.
+
+char *rb_id2name(ID id) ::
+
+ Returns the name corresponding ID.
+
+char *rb_class2name(VALUE klass) ::
+
+ Returns the name of the class.
+
+int rb_respond_to(VALUE object, ID id) ::
+
+ Returns true if the object responds to the message specified by id.
+
+== Instance Variables
- void ruby_init()
+VALUE rb_iv_get(VALUE obj, const char *name) ::
-Initializes the interpreter.
+ Retrieve the value of the instance variable. If the name is not
+ prefixed by `@', that variable shall be inaccessible from Ruby.
- void ruby_options(int argc, char **argv)
+VALUE rb_iv_set(VALUE obj, const char *name, VALUE val) ::
-Process command line arguments for the interpreter.
+ Sets the value of the instance variable.
- void ruby_run()
+== Control Structure
-Starts execution of the interpreter.
+VALUE rb_block_call(VALUE recv, ID mid, int argc, VALUE * argv, VALUE (*func) (ANYARGS), VALUE data2) ::
- void ruby_script(char *name)
+ Calls a method on the recv, with the method name specified by the
+ symbol mid, with argc arguments in argv, supplying func as the
+ block. When func is called as the block, it will receive the value
+ from yield as the first argument, and data2 as the second argument.
+ When yielded with multiple values (in C, rb_yield_values(),
+ rb_yield_values2() and rb_yield_splat()), data2 is packed as an Array,
+ whereas yielded values can be gotten via argc/argv of the third/fourth
+ arguments.
-Specifies the name of the script ($0).
+[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2) ::
-Appendix C. Functions Available in extconf.rb
+ Calls the function func1, supplying func2 as the block. func1 will be
+ called with the argument arg1. func2 receives the value from yield as
+ the first argument, arg2 as the second argument.
+
+ When rb_iterate is used in 1.9, func1 has to call some Ruby-level method.
+ This function is obsolete since 1.9; use rb_block_call instead.
+
+VALUE rb_yield(VALUE val) ::
+
+ Evaluates the block with value val.
+
+VALUE rb_rescue(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ Calls the function func1, with arg1 as the argument. If an exception
+ occurs during func1, it calls func2 with arg2 as the argument. The
+ return value of rb_rescue() is the return value from func1 if no
+ exception occurs, from func2 otherwise.
+
+VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ Calls the function func1 with arg1 as the argument, then calls func2
+ with arg2 if execution terminated. The return value from
+ rb_ensure() is that of func1 when no exception occured.
+
+VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state) ::
+
+ Calls the function func with arg as the argument. If no exception
+ occured during func, it returns the result of func and *state is zero.
+ Otherwise, it returns Qnil and sets *state to nonzero. If state is
+ NULL, it is not set in both cases.
+ You have to clear the error info with rb_set_errinfo(Qnil) when
+ ignoring the caught exception.
+
+void rb_jump_tag(int state) ::
+
+ Continues the exception caught by rb_protect() and rb_eval_string_protect().
+ state must be the returned value from those functions. This function
+ never return to the caller.
+
+void rb_iter_break() ::
+
+ Exits from the current innermost block. This function never return to
+ the caller.
+
+void rb_iter_break_value(VALUE value) ::
+
+ Exits from the current innermost block with the value. The block will
+ return the given argument value. This function never return to the
+ caller.
+
+== Exceptions and Errors
+
+void rb_warn(const char *fmt, ...) ::
+
+ Prints a warning message according to a printf-like format.
+
+void rb_warning(const char *fmt, ...) ::
+
+ Prints a warning message according to a printf-like format, if
+ $VERBOSE is true.
+
+void rb_raise(rb_eRuntimeError, const char *fmt, ...) ::
+
+ Raises RuntimeError. The fmt is a format string just like printf().
+
+void rb_raise(VALUE exception, const char *fmt, ...) ::
+
+ Raises a class exception. The fmt is a format string just like printf().
+
+void rb_fatal(const char *fmt, ...) ::
+
+ Raises a fatal error, terminates the interpreter. No exception handling
+ will be done for fatal errors, but ensure blocks will be executed.
+
+void rb_bug(const char *fmt, ...) ::
+
+ Terminates the interpreter immediately. This function should be
+ called under the situation caused by the bug in the interpreter. No
+ exception handling nor ensure execution will be done.
+
+== Initialize and Start the Interpreter
+
+The embedding API functions are below (not needed for extension libraries):
-These functions are available in extconf.rb:
+void ruby_init() ::
- have_macro(macro, headers)
+ Initializes the interpreter.
-Checks whether macro is defined with header. Returns true if the macro
-is defined.
+void ruby_options(int argc, char **argv) ::
- have_library(lib, func)
+ Process command line arguments for the interpreter.
-Checks whether the library exists, containing the specified function.
-Returns true if the library exists.
+void ruby_run() ::
- find_library(lib, func, path...)
+ Starts execution of the interpreter.
-Checks whether a library which contains the specified function exists in
-path. Returns true if the library exists.
+void ruby_script(char *name) ::
- have_func(func, header)
+ Specifies the name of the script ($0).
-Checks whether func exists with header. Returns true if the function
-exists. To check functions in an additional library, you need to
-check that library first using have_library().
+== Hooks for the Interpreter Events
- have_var(var, header)
+ void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events,
+ VALUE data)
-Checks whether var exists with header. Returns true if the variable
-exists. To check variables in an additional library, you need to
-check that library first using have_library().
+Adds a hook function for the specified interpreter events.
+events should be OR'ed value of:
- have_header(header)
+ RUBY_EVENT_LINE
+ RUBY_EVENT_CLASS
+ RUBY_EVENT_END
+ RUBY_EVENT_CALL
+ RUBY_EVENT_RETURN
+ RUBY_EVENT_C_CALL
+ RUBY_EVENT_C_RETURN
+ RUBY_EVENT_RAISE
+ RUBY_EVENT_ALL
-Checks whether header exists. Returns true if the header file exists.
+The definition of rb_event_hook_func_t is below:
- find_header(header, path...)
+ typedef void (*rb_event_hook_func_t)(rb_event_t event, VALUE data,
+ VALUE self, ID id, VALUE klass)
-Checks whether header exists in path. Returns true if the header file
-exists.
+The third argument `data' to rb_add_event_hook() is passed to the hook
+function as the second argument, which was the pointer to the current
+NODE in 1.8. See RB_EVENT_HOOKS_HAVE_CALLBACK_DATA below.
- have_struct_member(type, member, header)
+ int rb_remove_event_hook(rb_event_hook_func_t func)
-Checks whether type has member with header. Returns true if the type
-is defined and has the member.
+Removes the specified hook function.
- have_type(type, header, opt)
+== Macros for Compatibility
-Checks whether type is defined with header. Returns true if the type
-is defined.
+Some macros to check API compatibilities are available by default.
- check_sizeof(type, header)
+NORETURN_STYLE_NEW ::
-Checks the size of type in char with header. Returns the size if the
-type is defined, otherwise nil.
+ Means that NORETURN macro is functional style instead of prefix.
- create_makefile(target)
+HAVE_RB_DEFINE_ALLOC_FUNC ::
-Generates the Makefile for the extension library. If you don't invoke
-this method, the compilation will not be done.
+ Means that function rb_define_alloc_func() is provided, that means the
+ allocation framework is used. This is same as the result of
+ have_func("rb_define_alloc_func", "ruby.h").
- find_executable(bin, path)
+HAVE_RB_REG_NEW_STR ::
-Finds command in path, which is File::PATH_SEPARATOR-separated list of
-directories. If path is nil or omitted, environment varialbe PATH
-will be used. Returns the path name of the command if it is found,
-otherwise nil.
+ Means that function rb_reg_new_str() is provided, that creates Regexp
+ object from String object. This is same as the result of
+ have_func("rb_reg_new_str", "ruby.h").
- with_config(withval[, default=nil])
+HAVE_RB_IO_T ::
-Parses the command line options and returns the value specified by
---with-<withval>.
+ Means that type rb_io_t is provided.
- enable_config(config, *defaults)
- disable_config(config, *defaults)
+USE_SYMBOL_AS_METHOD_NAME ::
-Parses the command line options for boolean. Returns true if
---enable-<config> is given, or false if --disable-<config> is given.
-Otherwise, yields defaults to the given block and returns the result
-if it is called with a block, or returns defaults.
+ Means that Symbols will be returned as method names, e.g.,
+ Module#methods, #singleton_methods and so on.
- dir_config(target[, default_dir])
- dir_config(target[, default_include, default_lib])
+HAVE_RUBY_*_H ::
-Parses the command line options and adds the directories specified by
---with-<target>-dir, --with-<target>-include, and/or --with-<target>-lib
-to $CFLAGS and/or $LDFLAGS. --with-<target>-dir=/path is equivalent to
---with-<target>-include=/path/include --with-<target>-lib=/path/lib.
-Returns an array of the added directories ([include_dir, lib_dir]).
+ Defined in ruby.h and means corresponding header is available. For
+ instance, when HAVE_RUBY_ST_H is defined you should use ruby/st.h not
+ mere st.h.
- pkg_config(pkg)
+RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ::
-Obtains the information of pkg by pkg-config command. The actual
-command name can be overriden by --with-pkg-config command line
-option.
+ Means that rb_add_event_hook() takes the third argument `data', to be
+ passed to the given event hook function.
/*
* Local variables:
diff --git a/README.EXT.ja b/README.EXT.ja
index 30c4d520ba..7b008b952e 100644
--- a/README.EXT.ja
+++ b/README.EXT.ja
@@ -1,1255 +1,1584 @@
-.\" README.EXT.ja - -*- Text -*- created at: Mon Aug 7 16:45:54 JST 1995
+# README.EXT.ja - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995
-Ruby¤Î³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤Îºî¤êÊý¤òÀâÌÀ¤·¤Þ¤¹¡¥
+Rubyã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã®ä½œã‚Šæ–¹ã‚’説明ã—ã¾ã™ï¼Ž
-1¡¥´ðÁÃÃμ±
+= 基礎知識
-C¤ÎÊÑ¿ô¤Ë¤Ï·¿¤¬¤¢¤ê¡¤¥Ç¡¼¥¿¤Ë¤Ï·¿¤¬¤¢¤ê¤Þ¤»¤ó¡¥¤Ç¤¹¤«¤é¡¤¤¿
-¤È¤¨¤Ð¥Ý¥¤¥ó¥¿¤òint¤ÎÊÑ¿ô¤ËÂåÆþ¤¹¤ë¤È¡¤¤½¤ÎÃͤÏÀ°¿ô¤È¤·¤Æ¼è
-¤ê°·¤ï¤ì¤Þ¤¹¡¥µÕ¤ËRuby¤ÎÊÑ¿ô¤Ë¤Ï·¿¤¬¤Ê¤¯¡¤¥Ç¡¼¥¿¤Ë·¿¤¬¤¢¤ê¤Þ
-¤¹¡¥¤³¤Î°ã¤¤¤Î¤¿¤á¡¤C¤ÈRuby¤ÏÁê¸ß¤ËÊÑ´¹¤·¤Ê¤±¤ì¤Ð¡¤¤ª¸ß¤¤¤Î
-¥Ç¡¼¥¿¤ò¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤»¤ó¡¥
+Cã®å¤‰æ•°ã«ã¯åž‹ãŒã‚り,データã«ã¯åž‹ãŒã‚りã¾ã›ã‚“.ã§ã™ã‹ã‚‰ï¼ŒãŸ
+ã¨ãˆã°ãƒã‚¤ãƒ³ã‚¿ã‚’intã®å¤‰æ•°ã«ä»£å…¥ã™ã‚‹ã¨ï¼Œãã®å€¤ã¯æ•´æ•°ã¨ã—ã¦å–
+り扱ã‚れã¾ã™ï¼Žé€†ã«Rubyã®å¤‰æ•°ã«ã¯åž‹ãŒãªã,データã«åž‹ãŒã‚りã¾
+ã™ï¼Žã“ã®é•ã„ã®ãŸã‚,Cã¨Rubyã¯ç›¸äº’ã«å¤‰æ›ã—ãªã‘れã°ï¼ŒãŠäº’ã„ã®
+データをアクセスã§ãã¾ã›ã‚“.
-Ruby¤Î¥Ç¡¼¥¿¤ÏVALUE¤È¤¤¤¦C¤Î·¿¤Çɽ¸½¤µ¤ì¤Þ¤¹¡¥VALUE·¿¤Î¥Ç¡¼
-¥¿¤Ï¤½¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤ò¼«Ê¬¤ÇÃΤäƤ¤¤Þ¤¹¡¥¤³¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤È
-¤¤¤¦¤Î¤Ï¥Ç¡¼¥¿(¥ª¥Ö¥¸¥§¥¯¥È)¤Î¼ÂºÝ¤Î¹½Â¤¤ò°ÕÌ£¤·¤Æ¤¤¤Æ¡¤Ruby
-¤Î¥¯¥é¥¹¤È¤Ï¤Þ¤¿°ã¤Ã¤¿¤â¤Î¤Ç¤¹¡¥
+Rubyã®ãƒ‡ãƒ¼ã‚¿ã¯VALUEã¨ã„ã†Cã®åž‹ã§è¡¨ç¾ã•れã¾ã™ï¼ŽVALUEåž‹ã®ãƒ‡ãƒ¼
+ã‚¿ã¯ãã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—を自分ã§çŸ¥ã£ã¦ã„ã¾ã™ï¼Žã“ã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã¨
+ã„ã†ã®ã¯ãƒ‡ãƒ¼ã‚¿(オブジェクト)ã®å®Ÿéš›ã®æ§‹é€ ã‚’æ„味ã—ã¦ã„ã¦ï¼ŒRuby
+ã®ã‚¯ãƒ©ã‚¹ã¨ã¯ã¾ãŸé•ã£ãŸã‚‚ã®ã§ã™ï¼Ž
-VALUE¤«¤éC¤Ë¤È¤Ã¤Æ°ÕÌ£¤Î¤¢¤ë¥Ç¡¼¥¿¤ò¼è¤ê½Ð¤¹¤¿¤á¤Ë¤Ï
+VALUEã‹ã‚‰Cã«ã¨ã£ã¦æ„味ã®ã‚るデータをå–り出ã™ãŸã‚ã«ã¯
- (1) VALUE¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤òÃΤë
- (2) VALUE¤òC¤Î¥Ç¡¼¥¿¤ËÊÑ´¹¤¹¤ë
+1. VALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—を知る
+2. VALUEã‚’Cã®ãƒ‡ãƒ¼ã‚¿ã«å¤‰æ›ã™ã‚‹
-¤ÎξÊý¤¬É¬ÍפǤ¹¡¥(1)¤ò˺¤ì¤ë¤È´Ö°ã¤Ã¤¿¥Ç¡¼¥¿¤ÎÊÑ´¹¤¬¹Ô¤ï¤ì
-¤Æ¡¤ºÇ°­¥×¥í¥°¥é¥à¤¬core dump¤·¤Þ¤¹¡¥
+ã®ä¸¡æ–¹ãŒå¿…è¦ã§ã™ï¼Ž(1)を忘れるã¨é–“é•ã£ãŸãƒ‡ãƒ¼ã‚¿ã®å¤‰æ›ãŒè¡Œã‚れ
+ã¦ï¼Œæœ€æ‚ªãƒ—ログラムãŒcore dumpã—ã¾ã™ï¼Ž
-1.1 ¥Ç¡¼¥¿¥¿¥¤¥×
+== データタイプ
-Ruby¤Ë¤Ï¥æ¡¼¥¶¤¬»È¤¦²ÄǽÀ­¤Î¤¢¤ë°Ê²¼¤Î¥¿¥¤¥×¤¬¤¢¤ê¤Þ¤¹¡¥
+Rubyã«ã¯ãƒ¦ãƒ¼ã‚¶ãŒä½¿ã†å¯èƒ½æ€§ã®ã‚る以下ã®ã‚¿ã‚¤ãƒ—ãŒã‚りã¾ã™ï¼Ž
- T_NIL nil
- T_OBJECT Ä̾ï¤Î¥ª¥Ö¥¸¥§¥¯¥È
- T_CLASS ¥¯¥é¥¹
- T_MODULE ¥â¥¸¥å¡¼¥ë
- T_FLOAT ÉâÆ°¾®¿ôÅÀ¿ô
- T_STRING ʸ»úÎó
- T_REGEXP Àµµ¬É½¸½
- T_ARRAY ÇÛÎó
- T_FIXNUM Fixnum(31bitĹÀ°¿ô)
- T_HASH Ï¢ÁÛÇÛÎó
- T_STRUCT (Ruby¤Î)¹½Â¤ÂÎ
- T_BIGNUM ¿ÇÜĹÀ°¿ô
- T_FILE Æþ½ÐÎÏ
- T_TRUE ¿¿
- T_FALSE µ¶
- T_DATA ¥Ç¡¼¥¿
- T_SYMBOL ¥·¥ó¥Ü¥ë
+T_NIL :: nil
+T_OBJECT :: 通常ã®ã‚ªãƒ–ジェクト
+T_CLASS :: クラス
+T_MODULE :: モジュール
+T_FLOAT :: æµ®å‹•å°æ•°ç‚¹æ•°
+T_STRING :: 文字列
+T_REGEXP :: æ­£è¦è¡¨ç¾
+T_ARRAY :: é…列
+T_HASH :: 連想é…列
+T_STRUCT :: (Rubyã®)構造体
+T_BIGNUM :: 多å€é•·æ•´æ•°
+T_FIXNUM :: Fixnum(31bitã¾ãŸã¯63bité•·æ•´æ•°)
+T_COMPLEX :: 複素数
+T_RATIONAL :: æœ‰ç†æ•°
+T_FILE :: 入出力
+T_TRUE :: 真
+T_FALSE :: å½
+T_DATA :: データ
+T_SYMBOL :: シンボル
-¤½¤Î¾¤ËÆâÉô¤ÇÍøÍѤµ¤ì¤Æ¤¤¤ë°Ê²¼¤Î¥¿¥¤¥×¤¬¤¢¤ê¤Þ¤¹¡¥
+ãã®ä»–ã«å†…部ã§åˆ©ç”¨ã•れã¦ã„る以下ã®ã‚¿ã‚¤ãƒ—ãŒã‚りã¾ã™ï¼Ž
- T_ICLASS
- T_MATCH
- T_UNDEF
- T_VARMAP
- T_SCOPE
- T_NODE
+ T_ICLASS
+ T_MATCH
+ T_UNDEF
+ T_NODE
+ T_ZOMBIE
-¤Û¤È¤ó¤É¤Î¥¿¥¤¥×¤ÏC¤Î¹½Â¤ÂΤǼÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤¹¡¥
+ã»ã¨ã‚“ã©ã®ã‚¿ã‚¤ãƒ—ã¯Cã®æ§‹é€ ä½“ã§å®Ÿè£…ã•れã¦ã„ã¾ã™ï¼Ž
-1.2 VALUE¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤ò¥Á¥§¥Ã¥¯¤¹¤ë
+== VALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹
-ruby.h¤Ç¤ÏTYPE()¤È¤¤¤¦¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Æ¡¤VALUE¤Î¥Ç¡¼¥¿
-¥¿¥¤¥×¤òÃΤ뤳¤È¤¬½ÐÍè¤Þ¤¹¡¥TYPE()¥Þ¥¯¥í¤Ï¾å¤Ç¾Ò²ð¤·¤¿T_XXXX
-¤Î·Á¼°¤ÎÄê¿ô¤òÊÖ¤·¤Þ¤¹¡¥VALUE¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤Ë±þ¤¸¤Æ½èÍý¤¹¤ë
-¾ì¹ç¤Ë¤Ï¡¤TYPE()¤ÎÃͤÇʬ´ô¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥
+ruby.hã§ã¯TYPE()ã¨ã„ã†ãƒžã‚¯ãƒ­ãŒå®šç¾©ã•れã¦ã„ã¦ï¼ŒVALUEã®ãƒ‡ãƒ¼ã‚¿
+タイプを知るã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼ŽTYPE()マクロã¯ä¸Šã§ç´¹ä»‹ã—ãŸT_XXXX
+ã®å½¢å¼ã®å®šæ•°ã‚’è¿”ã—ã¾ã™ï¼ŽVALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã«å¿œã˜ã¦å‡¦ç†ã™ã‚‹
+å ´åˆã«ã¯ï¼ŒTYPE()ã®å€¤ã§åˆ†å²ã™ã‚‹ã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž
switch (TYPE(obj)) {
case T_FIXNUM:
- /* FIXNUM¤Î½èÍý */
+ /* FIXNUMã®å‡¦ç† */
break;
case T_STRING:
- /* ʸ»úÎó¤Î½èÍý */
+ /* 文字列ã®å‡¦ç† */
break;
case T_ARRAY:
- /* ÇÛÎó¤Î½èÍý */
+ /* é…列ã®å‡¦ç† */
break;
default:
- /* Îã³°¤òȯÀ¸¤µ¤»¤ë */
+ /* 例外を発生ã•ã›ã‚‹ */
rb_raise(rb_eTypeError, "not valid value");
break;
}
-¤½¤ì¤È¥Ç¡¼¥¿¥¿¥¤¥×¤ò¥Á¥§¥Ã¥¯¤·¤Æ¡¤Àµ¤·¤¯¤Ê¤±¤ì¤ÐÎã³°¤òȯÀ¸¤¹
-¤ë´Ø¿ô¤¬ÍѰդµ¤ì¤Æ¤¤¤Þ¤¹¡¥
+ãれã¨ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã‚’ãƒã‚§ãƒƒã‚¯ã—ã¦ï¼Œæ­£ã—ããªã‘れã°ä¾‹å¤–を発生ã™
+る関数ãŒç”¨æ„ã•れã¦ã„ã¾ã™ï¼Ž
void Check_Type(VALUE value, int type)
-¤³¤Î´Ø¿ô¤Ïvalue¤¬type¤Ç̵¤±¤ì¤Ð¡¤Îã³°¤òȯÀ¸¤µ¤»¤Þ¤¹¡¥°ú¿ô¤È
-¤·¤ÆÍ¿¤¨¤é¤ì¤¿VALUE¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤¬Àµ¤·¤¤¤«¤É¤¦¤«¥Á¥§¥Ã¥¯¤¹
-¤ë¤¿¤á¤Ë¤Ï¡¤¤³¤Î´Ø¿ô¤ò»È¤¤¤Þ¤¹¡¥
+ã“ã®é–¢æ•°ã¯valueãŒtypeã§ç„¡ã‘れã°ï¼Œä¾‹å¤–を発生ã•ã›ã¾ã™ï¼Žå¼•æ•°ã¨
+ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸVALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ãŒæ­£ã—ã„ã‹ã©ã†ã‹ãƒã‚§ãƒƒã‚¯ã™
+ã‚‹ãŸã‚ã«ã¯ï¼Œã“ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
-FIXNUM¤ÈNIL¤Ë´Ø¤·¤Æ¤Ï¤è¤ê¹â®¤ÊȽÊÌ¥Þ¥¯¥í¤¬ÍѰդµ¤ì¤Æ¤¤¤Þ¤¹¡¥
+FIXNUMã¨NILã«é–¢ã—ã¦ã¯ã‚ˆã‚Šé«˜é€Ÿãªåˆ¤åˆ¥ãƒžã‚¯ãƒ­ãŒç”¨æ„ã•れã¦ã„ã¾ã™ï¼Ž
FIXNUM_P(obj)
NIL_P(obj)
-1.3 VALUE¤òC¤Î¥Ç¡¼¥¿¤ËÊÑ´¹¤¹¤ë
+== VALUEã‚’Cã®ãƒ‡ãƒ¼ã‚¿ã«å¤‰æ›ã™ã‚‹
+
+データタイプãŒT_NIL,T_FALSE,T_TRUEã§ã‚る時,データã¯ãれãž
+れnil,false,trueã§ã™ï¼Žã“ã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã®ã‚ªãƒ–ジェクトã¯ã²ã¨
+ã¤ãšã¤ã—ã‹å­˜åœ¨ã—ã¾ã›ã‚“.
-¥Ç¡¼¥¿¥¿¥¤¥×¤¬T_NIL, T_FALSE, T_TRUE¤Ç¤¢¤ë»þ¡¤¥Ç¡¼¥¿¤Ï¤½¤ì¤¾
-¤ìnil, false, true¤Ç¤¹¡¥¤³¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ï¤Ò¤È
-¤Ä¤º¤Ä¤·¤«Â¸ºß¤·¤Þ¤»¤ó¡¥
+データタイプãŒT_FIXNUMã®æ™‚,ã“れã¯31bitã¾ãŸã¯63bitã®ã‚µã‚¤ã‚ºã‚’
+æŒã¤æ•´æ•°ã§ã™ï¼Žlongã®ã‚µã‚¤ã‚ºãŒ32bitã®ãƒ—ラットフォームã§ã‚れã°
+31bitã«ï¼Œlongã®ã‚µã‚¤ã‚ºãŒ64bitã®ãƒ—ラットフォームã§ã‚れã°63bit
+ã«ãªã‚Šã¾ã™. FIXNUM ã‚’ C ã®æ•´æ•°ã«å¤‰æ›ã™ã‚‹ãŸã‚ã«ã¯ãƒžã‚¯ãƒ­
+「FIX2INT()ã€ã¾ãŸã¯ã€ŒFIX2LONG()ã€ã‚’使ã„ã¾ã™ï¼Žã“れらã®ãƒžã‚¯ãƒ­
+を使用ã™ã‚‹éš›ã«ã¯äº‹å‰ã«ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ãŒFIXNUMã§ã‚ã‚‹ã“ã¨ã‚’確èªã™
+ã‚‹å¿…è¦ãŒã‚りã¾ã™ãŒï¼Œæ¯”較的高速ã«å¤‰æ›ã‚’行ã†ã“ã¨ãŒã§ãã¾ã™ï¼Žã¾
+ãŸï¼Œã€ŒFIX2LONG()ã€ã¯ä¾‹å¤–を発生ã—ã¾ã›ã‚“ãŒï¼Œã€ŒFIX2INT()ã€ã¯å¤‰
+æ›çµæžœãŒintã®ã‚µã‚¤ã‚ºã«åŽã¾ã‚‰ãªã„å ´åˆã«ã¯ä¾‹å¤–を発生ã—ã¾ã™ï¼Ž
+ãれã‹ã‚‰ï¼ŒFIXNUMã«é™ã‚‰ãšRubyã®ãƒ‡ãƒ¼ã‚¿ã‚’æ•´æ•°ã«å¤‰æ›ã™ã‚‹
+「NUM2INT()ã€ãŠã‚ˆã³ã€ŒNUM2LONG()ã€ã¨ã„ã†ãƒžã‚¯ãƒ­ãŒã‚りã¾ã™ï¼Žã“
+れらã®ãƒžã‚¯ãƒ­ã¯ãƒžã‚¯ãƒ­ã¯ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã®ãƒã‚§ãƒƒã‚¯ç„¡ã—ã§ä½¿ãˆã¾ã™
+(æ•´æ•°ã«å¤‰æ›ã§ããªã„å ´åˆã«ã¯ä¾‹å¤–ãŒç™ºç”Ÿã™ã‚‹)ï¼ŽåŒæ§˜ã«ãƒã‚§ãƒƒã‚¯ç„¡
+ã§ä½¿ãˆã‚‹å¤‰æ›ãƒžã‚¯ãƒ­ã¯doubleã‚’å–り出ã™ã€ŒNUM2DBL()ã€ãŒã‚りã¾ã™ï¼Ž
-¥Ç¡¼¥¿¥¿¥¤¥×¤¬T_FIXNUM¤Î»þ¡¤¤³¤ì¤Ï31bit¤Î¥µ¥¤¥º¤ò»ý¤ÄÀ°¿ô¤Ç
-¤¹¡¥FIXNUM¤òC¤ÎÀ°¿ô¤ËÊÑ´¹¤¹¤ë¤¿¤á¤Ë¤Ï¥Þ¥¯¥í¡ÖFIX2INT()¡×¤ò»È
-¤¤¤Þ¤¹¡¥¤½¤ì¤«¤é¡¤FIXNUM¤Ë¸Â¤é¤ºRuby¤Î¥Ç¡¼¥¿¤òÀ°¿ô¤ËÊÑ´¹¤¹¤ë
-¡ÖNUM2INT()¡×¤È¤¤¤¦¥Þ¥¯¥í¤¬¤¢¤ê¤Þ¤¹¡¥¤³¤Î¥Þ¥¯¥í¤Ï¥Ç¡¼¥¿¥¿¥¤
-¥×¤Î¥Á¥§¥Ã¥¯Ìµ¤·¤Ç»È¤¨¤Þ¤¹(À°¿ô¤ËÊÑ´¹¤Ç¤­¤Ê¤¤¾ì¹ç¤Ë¤ÏÎã³°¤¬
-ȯÀ¸¤¹¤ë)¡¥Æ±Íͤ˥Á¥§¥Ã¥¯Ìµ¤·¤Ç»È¤¨¤ëÊÑ´¹¥Þ¥¯¥í¤Ïdouble¤ò
-¼è¤ê½Ð¤¹¡ÖNUM2DBL()¡×¤¬¤¢¤ê¤Þ¤¹¡£
+char* ã‚’å–り出ã™å ´åˆï¼Œ StringValue() 㨠StringValuePtr()
+を使ã„ã¾ã™ï¼Ž
+StringValue(var) 㯠var ㌠String
+ã§ã‚れã°ä½•ã‚‚ã›ãšï¼Œãã†ã§ãªã‘れ㰠var ã‚’ var.to_str() ã®çµæžœ
+ã«ç½®ãæ›ãˆã‚‹ãƒžã‚¯ãƒ­ï¼ŒStringValuePtr(var) ã¯åŒæ§˜ã« var ã‚’
+String ã«ç½®ãæ›ãˆã¦ã‹ã‚‰ var ã®ãƒã‚¤ãƒˆåˆ—表ç¾ã«å¯¾ã™ã‚‹ char* ã‚’
+è¿”ã™ãƒžã‚¯ãƒ­ã§ã™ï¼Žvar ã®å†…å®¹ã‚’ç›´æŽ¥ç½®ãæ›ãˆã‚‹å‡¦ç†ãŒå…¥ã‚‹ã®ã§ï¼Œ
+var 㯠lvalue ã§ã‚ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Ž
+ã¾ãŸï¼ŒStringValuePtr() ã«é¡žä¼¼ã—㟠StringValueCStr() ã¨ã„ã†ãƒž
+クロもã‚りã¾ã™ï¼ŽStringValueCStr(var) 㯠var ã‚’ String ã«ç½®ã
+æ›ãˆã¦ã‹ã‚‰ var ã®æ–‡å­—列表ç¾ã«å¯¾ã™ã‚‹ char* ã‚’è¿”ã—ã¾ã™ï¼Žè¿”ã•れ
+ã‚‹æ–‡å­—åˆ—ã®æœ«å°¾ã«ã¯ nul 文字ãŒä»˜åŠ ã•れã¾ã™ï¼ŽãªãŠï¼Œé€”中㫠nul
+文字ãŒå«ã¾ã‚Œã‚‹å ´åˆã¯ ArgumentError ãŒç™ºç”Ÿã—ã¾ã™ï¼Ž
+一方,StringValuePtr() ã§ã¯ï¼Œæœ«å°¾ã« nul 文字ãŒã‚ã‚‹ä¿è¨¼ã¯ãªã,
+途中㫠nul 文字ãŒå«ã¾ã‚Œã¦ã„ã‚‹å¯èƒ½æ€§ã‚‚ã‚りã¾ã™ï¼Ž
-char* ¤ò¼è¤ê½Ð¤¹¾ì¹ç¡¢version 1.6 °ÊÁ°¤Ç¤Ï¡ÖSTR2CSTR()¡×¤È
-¤¤¤¦¥Þ¥¯¥í¤ò»È¤Ã¤Æ¤¤¤Þ¤·¤¿¤¬¡¢¤³¤ì¤Ï to_str() ¤Ë¤è¤ë°ÅÌÛ¤Î
-·¿ÊÑ´¹·ë²Ì¤¬ GC ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¤¿¤á¡¢version 1.7 °Ê¹ß¤Ç¤Ï
-obsolete ¤È¤Ê¤ê¡¢Âå¤ï¤ê¤Ë StringValue() ¤È StringValuePtr()
-¤ò»È¤¦»ö¤ò¿ä¾©¤·¤Æ¤¤¤Þ¤¹¡£StringValue(var) ¤Ï var ¤¬ String
- ¤Ç¤¢¤ì¤Ð²¿¤â¤»¤º¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð var ¤ò var.to_str() ¤Î·ë²Ì¤Ë
-ÃÖ¤­´¹¤¨¤ë¥Þ¥¯¥í¡¢StringValuePtr(var) ¤ÏƱÍÍ¤Ë var ¤òÃÖ¤­´¹¤¨
-¤Æ¤«¤é var ¤Îʸ»úÎóɽ¸½¤ËÂФ¹¤ë char* ¤òÊÖ¤¹¥Þ¥¯¥í¤Ç¤¹¡£var ¤Î
-ÆâÍÆ¤òľÀÜÃÖ¤­´¹¤¨¤ë½èÍý¤¬Æþ¤ë¤Î¤Ç¡¢var ¤Ï lvalue ¤Ç¤¢¤ëɬÍפ¬
-¤¢¤ê¤Þ¤¹¡£
+ãれ以外ã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã¯å¯¾å¿œã™ã‚‹Cã®æ§‹é€ ä½“ãŒã‚りã¾ã™ï¼Žå¯¾å¿œã™
+る構造体ã®ã‚ã‚‹VALUEã¯ãã®ã¾ã¾ã‚­ãƒ£ã‚¹ãƒˆ(型変æ›)ã™ã‚Œã°æ§‹é€ ä½“ã®
+ãƒã‚¤ãƒ³ã‚¿ã«å¤‰æ›ã§ãã¾ã™ï¼Ž
-¤½¤ì°Ê³°¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤ÏÂбþ¤¹¤ëC¤Î¹½Â¤ÂΤ¬¤¢¤ê¤Þ¤¹¡¥Âбþ¤¹
-¤ë¹½Â¤ÂΤΤ¢¤ëVALUE¤Ï¤½¤Î¤Þ¤Þ¥­¥ã¥¹¥È(·¿ÊÑ´¹)¤¹¤ì¤Ð¹½Â¤ÂΤÎ
-¥Ý¥¤¥ó¥¿¤ËÊÑ´¹¤Ç¤­¤Þ¤¹¡¥
+構造体ã¯ã€Œstruct RXxxxxã€ã¨ã„ã†åå‰ã§ruby.hã§å®šç¾©ã•れã¦ã„ã¾
+ã™ï¼Žä¾‹ãˆã°æ–‡å­—列ã¯ã€Œstruct RStringã€ã§ã™ï¼Žå®Ÿéš›ã«ä½¿ã†å¯èƒ½æ€§ãŒ
+ã‚ã‚‹ã®ã¯æ–‡å­—列ã¨é…列ãらã„ã ã¨æ€ã„ã¾ã™ï¼Ž
-¹½Â¤ÂΤϡÖstruct RXxxxx¡×¤È¤¤¤¦Ì¾Á°¤Çruby.h¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Þ
-¤¹¡¥Î㤨¤Ðʸ»úÎó¤Ï¡Östruct RString¡×¤Ç¤¹¡¥¼ÂºÝ¤Ë»È¤¦²ÄǽÀ­¤¬
-¤¢¤ë¤Î¤Ïʸ»úÎó¤ÈÇÛÎ󤯤餤¤À¤È»×¤¤¤Þ¤¹¡¥
+ruby.hã§ã¯æ§‹é€ ä½“ã¸ã‚­ãƒ£ã‚¹ãƒˆã™ã‚‹ãƒžã‚¯ãƒ­ã‚‚「RXXXXX()ã€(全部大文
+å­—ã«ã—ãŸã‚‚ã®)ã¨ã„ã†åå‰ã§æä¾›ã•れã¦ã„ã¾ã™(例: RSTRING()).
-ruby.h¤Ç¤Ï¹½Â¤ÂΤإ­¥ã¥¹¥È¤¹¤ë¥Þ¥¯¥í¤â¡ÖRXXXXX()¡×(Á´ÉôÂçʸ
-»ú¤Ë¤·¤¿¤â¤Î)¤È¤¤¤¦Ì¾Á°¤ÇÄ󶡤µ¤ì¤Æ¤¤¤Þ¤¹(Îã: RSTRING())¡¥
+構造体ã‹ã‚‰ãƒ‡ãƒ¼ã‚¿ã‚’å–り出ã™ãƒžã‚¯ãƒ­ãŒæä¾›ã•れã¦ã„ã¾ã™ï¼Žæ–‡å­—列
+strã®é•·ã•ã‚’å¾—ã‚‹ãŸã‚ã«ã¯ã€ŒRSTRING_LEN(str)ã€ã¨ã—,文字列strã‚’
+char*ã¨ã—ã¦å¾—ã‚‹ãŸã‚ã«ã¯ã€ŒRSTRING_PTR(str)ã€ã¨ã—ã¾ã™ï¼Žé…列ã®
+å ´åˆã«ã¯ï¼Œãれãžã‚Œã€ŒRARRAY_LEN(ary)ã€ï¼Œã€ŒRARRAY_PTR(ary)ã€ã¨
+ãªã‚Šã¾ã™ï¼Ž
-Î㤨¤Ð¡¤Ê¸»úÎóstr¤ÎŤµ¤òÆÀ¤ë¤¿¤á¤Ë¤Ï¡ÖRSTRING(str)->len¡×¤È
-¤·¡¤Ê¸»úÎóstr¤òchar*¤È¤·¤ÆÆÀ¤ë¤¿¤á¤Ë¤Ï¡ÖRSTRING(str)->ptr¡×
-¤È¤·¤Þ¤¹¡¥ÇÛÎó¤Î¾ì¹ç¤Ë¤Ï¡¤¤½¤ì¤¾¤ì¡ÖRARRAY(ary)->len¡×¡¤
-¡ÖRARRAY(ary)->ptr¡×¤È¤Ê¤ê¤Þ¤¹¡¥
+Rubyã®æ§‹é€ ä½“を直接アクセスã™ã‚‹æ™‚ã«æ°—ã‚’ã¤ã‘ãªã‘れã°ãªã‚‰ãªã„ã“
+ã¨ã¯ï¼Œé…åˆ—ã‚„æ–‡å­—åˆ—ã®æ§‹é€ ä½“ã®ä¸­èº«ã¯å‚ç…§ã™ã‚‹ã ã‘ã§ï¼Œç›´æŽ¥å¤‰æ›´ã—
+ãªã„ã“ã¨ã§ã™ï¼Žç›´æŽ¥å¤‰æ›´ã—ãŸå ´åˆï¼Œã‚ªãƒ–ジェクトã®å†…å®¹ã®æ•´åˆæ€§ãŒ
+ã¨ã‚Œãªããªã£ã¦ï¼Œæ€ã‚ã¬ãƒã‚°ã®åŽŸå› ã«ãªã‚Šã¾ã™ï¼Ž
-Ruby¤Î¹½Â¤ÂΤòľÀÜ¥¢¥¯¥»¥¹¤¹¤ë»þ¤Ëµ¤¤ò¤Ä¤±¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³
-¤È¤Ï¡¤ÇÛÎó¤äʸ»úÎó¤Î¹½Â¤ÂΤÎÃæ¿È¤Ï»²¾È¤¹¤ë¤À¤±¤Ç¡¤Ä¾ÀÜÊѹ¹¤·
-¤Ê¤¤¤³¤È¤Ç¤¹¡¥Ä¾ÀÜÊѹ¹¤·¤¿¾ì¹ç¡¤¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆâÍÆ¤ÎÀ°¹çÀ­¤¬
-¤È¤ì¤Ê¤¯¤Ê¤Ã¤Æ¡¤»×¤ï¤Ì¥Ð¥°¤Î¸¶°ø¤Ë¤Ê¤ê¤Þ¤¹¡¥
+== Cã®ãƒ‡ãƒ¼ã‚¿ã‚’VALUEã«å¤‰æ›ã™ã‚‹
-1.4 C¤Î¥Ç¡¼¥¿¤òVALUE¤ËÊÑ´¹¤¹¤ë
+VALUEã®å®Ÿéš›ã®æ§‹é€ ã¯
-VALUE¤Î¼ÂºÝ¤Î¹½Â¤¤Ï
+FIXNUMã®å ´åˆ ::
- * FIXNUM¤Î¾ì¹ç
+ 1bit左シフトã—ã¦ï¼ŒLSBã‚’ç«‹ã¦ã‚‹ï¼Ž
- 1bitº¸¥·¥Õ¥È¤·¤Æ¡¤LSB¤òΩ¤Æ¤ë¡¥
+ãã®ä»–ã®ãƒã‚¤ãƒ³ã‚¿ã®å ´åˆ ::
- * ¤½¤Î¾¤Î¥Ý¥¤¥ó¥¿¤Î¾ì¹ç
+ ãã®ã¾ã¾VALUEã«ã‚­ãƒ£ã‚¹ãƒˆã™ã‚‹ï¼Ž
- ¤½¤Î¤Þ¤ÞVALUE¤Ë¥­¥ã¥¹¥È¤¹¤ë¡¥
+ã¨ãªã£ã¦ã„ã¾ã™ï¼Žã‚ˆã£ã¦ï¼ŒLSBã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚Œã°VALUEãŒFIXNUMã‹ã©
+ã†ã‹ã‚ã‹ã‚‹ã‚ã‘ã§ã™(ãƒã‚¤ãƒ³ã‚¿ã®LSBãŒç«‹ã£ã¦ã„ãªã„ã“ã¨ã‚’仮定ã—ã¦
+ã„ã‚‹).
-¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡¥¤è¤Ã¤Æ¡¤LSB¤ò¥Á¥§¥Ã¥¯¤¹¤ì¤ÐVALUE¤¬FIXNUM¤«¤É
-¤¦¤«¤ï¤«¤ë¤ï¤±¤Ç¤¹(¥Ý¥¤¥ó¥¿¤ÎLSB¤¬Î©¤Ã¤Æ¤¤¤Ê¤¤¤³¤È¤ò²¾Äꤷ¤Æ
-¤¤¤ë)¡¥
+ã§ã™ã‹ã‚‰ï¼ŒFIXNUM以外ã®Rubyã®ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆã®æ§‹é€ ä½“ã¯å˜ã«VALUE
+ã«ã‚­ãƒ£ã‚¹ãƒˆã™ã‚‹ã ã‘ã§VALUEã«å¤‰æ›å‡ºæ¥ã¾ã™ï¼ŽãŸã ã—,任æ„ã®æ§‹é€ 
+体ãŒVALUEã«ã‚­ãƒ£ã‚¹ãƒˆå‡ºæ¥ã‚‹ã‚ã‘ã§ã¯ã‚りã¾ã›ã‚“.キャストã™ã‚‹ã®
+ã¯Rubyã®çŸ¥ã£ã¦ã„る構造体(ruby.hã§å®šç¾©ã•れã¦ã„ã‚‹struct RXxxx
+ã®ã‚‚ã®)ã ã‘ã§ã™ï¼Ž
-¤Ç¤¹¤«¤é¡¤FIXNUM°Ê³°¤ÎRuby¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤ÂΤÏñ¤ËVALUE
-¤Ë¥­¥ã¥¹¥È¤¹¤ë¤À¤±¤ÇVALUE¤ËÊÑ´¹½ÐÍè¤Þ¤¹¡¥¤¿¤À¤·¡¤Ç¤°Õ¤Î¹½Â¤
-ÂΤ¬VALUE¤Ë¥­¥ã¥¹¥È½ÐÍè¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡¥¥­¥ã¥¹¥È¤¹¤ë¤Î
-¤ÏRuby¤ÎÃΤäƤ¤¤ë¹½Â¤ÂÎ(ruby.h¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëstruct RXxxx
-¤Î¤â¤Î)¤À¤±¤Ç¤¹¡¥
+FIXNUMã«é–¢ã—ã¦ã¯å¤‰æ›ãƒžã‚¯ãƒ­ã‚’経由ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼ŽCã®æ•´æ•°
+ã‹ã‚‰VALUEã«å¤‰æ›ã™ã‚‹ãƒžã‚¯ãƒ­ã¯ä»¥ä¸‹ã®ã‚‚ã®ãŒã‚りã¾ã™ï¼Žå¿…è¦ã«å¿œã˜
+ã¦ä½¿ã„分ã‘ã¦ãã ã•ã„.
-FIXNUM¤Ë´Ø¤·¤Æ¤ÏÊÑ´¹¥Þ¥¯¥í¤ò·Ðͳ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥C¤ÎÀ°¿ô
-¤«¤éVALUE¤ËÊÑ´¹¤¹¤ë¥Þ¥¯¥í¤Ï°Ê²¼¤Î¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡¥É¬Íפ˱þ¤¸
-¤Æ»È¤¤Ê¬¤±¤Æ¤¯¤À¤µ¤¤¡¥
+INT2FIX() :: ã‚‚ã¨ã®æ•´æ•°ãŒ31bitã¾ãŸã¯63bit以内ã«åŽã¾ã‚‹è‡ªä¿¡
+ ãŒã‚る時
+INT2NUM() :: ä»»æ„ã®æ•´æ•°ã‹ã‚‰VALUEã¸
- INT2FIX() ¤â¤È¤ÎÀ°¿ô¤¬31bit°ÊÆâ¤Ë¼ý¤Þ¤ë¼«¿®¤¬¤¢¤ë»þ
- INT2NUM() Ǥ°Õ¤ÎÀ°¿ô¤«¤éVALUE¤Ø
+INT2NUM()ã¯æ•´æ•°ãŒFIXNUMã®ç¯„囲ã«åŽã¾ã‚‰ãªã„å ´åˆï¼ŒBignumã«å¤‰æ›
+ã—ã¦ãれã¾ã™(ãŒï¼Œå°‘ã—é…ã„).
-INT2NUM()¤ÏÀ°¿ô¤¬FIXNUM¤ÎÈϰϤ˼ý¤Þ¤é¤Ê¤¤¾ì¹ç¡¤Bignum¤ËÊÑ´¹
-¤·¤Æ¤¯¤ì¤Þ¤¹(¤¬¡¤¾¯¤·ÃÙ¤¤)¡¥
+== Rubyã®ãƒ‡ãƒ¼ã‚¿ã‚’æ“作ã™ã‚‹
-1.5 Ruby¤Î¥Ç¡¼¥¿¤òÁàºî¤¹¤ë
+先程も述ã¹ãŸé€šã‚Šï¼ŒRubyã®æ§‹é€ ä½“をアクセスã™ã‚‹æ™‚ã«å†…å®¹ã®æ›´æ–°ã‚’
+行ã†ã“ã¨ã¯å‹§ã‚られã¾ã›ã‚“.ã§ï¼ŒRubyã®ãƒ‡ãƒ¼ã‚¿ã‚’æ“作ã™ã‚‹æ™‚ã«ã¯
+RubyãŒç”¨æ„ã—ã¦ã„る関数を用ã„ã¦ãã ã•ã„.
-ÀèÄø¤â½Ò¤Ù¤¿Ä̤ꡤRuby¤Î¹½Â¤ÂΤò¥¢¥¯¥»¥¹¤¹¤ë»þ¤ËÆâÍÆ¤Î¹¹¿·¤ò
-¹Ô¤¦¤³¤È¤Ï´«¤á¤é¤ì¤Þ¤»¤ó¡¥¤Ç¡¤Ruby¤Î¥Ç¡¼¥¿¤òÁàºî¤¹¤ë»þ¤Ë¤Ï
-Ruby¤¬ÍѰդ·¤Æ¤¤¤ë´Ø¿ô¤òÍѤ¤¤Æ¤¯¤À¤µ¤¤¡¥
+ã“ã“ã§ã¯ã‚‚ã£ã¨ã‚‚使ã‚れるã§ã‚ã‚ã†æ–‡å­—列ã¨é…列ã®ç”Ÿæˆ/æ“作を行
+ã„関数をã‚ã’ã¾ã™(全部ã§ã¯ãªã„ã§ã™).
-¤³¤³¤Ç¤Ï¤â¤Ã¤È¤â»È¤ï¤ì¤ë¤Ç¤¢¤í¤¦Ê¸»úÎó¤ÈÇÛÎó¤ÎÀ¸À®/Áàºî¤ò¹Ô
-¤¤´Ø¿ô¤ò¤¢¤²¤Þ¤¹(Á´Éô¤Ç¤Ï¤Ê¤¤¤Ç¤¹)¡¥
+=== 文字列ã«å¯¾ã™ã‚‹é–¢æ•°
- ʸ»úÎó¤ËÂФ¹¤ë´Ø¿ô
+rb_str_new(const char *ptr, long len) ::
- rb_str_new(const char *ptr, long len)
+ æ–°ã—ã„Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
- ¿·¤·¤¤Ruby¤Îʸ»úÎó¤òÀ¸À®¤¹¤ë¡¥
+rb_str_new2(const char *ptr)
+rb_str_new_cstr(const char *ptr)
- rb_str_new2(const char *ptr)
+ Cã®æ–‡å­—列ã‹ã‚‰Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Žã“ã®é–¢æ•°ã®æ©Ÿèƒ½ã¯
+ rb_str_new(ptr, strlen(ptr))ã¨åŒç­‰ã§ã‚る.
- C¤Îʸ»úÎ󤫤éRuby¤Îʸ»úÎó¤òÀ¸À®¤¹¤ë¡¥¤³¤Î´Ø¿ô¤Îµ¡Ç½¤Ï
- rb_str_new(ptr, strlen(ptr))¤ÈƱÅù¤Ç¤¢¤ë¡¥
+rb_tainted_str_new(const char *ptr, long len)
- rb_tainted_str_new(const char *ptr, long len)
+ 汚染マークãŒä»˜åŠ ã•ã‚ŒãŸæ–°ã—ã„Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Žå¤–部
+ ã‹ã‚‰ã®ãƒ‡ãƒ¼ã‚¿ã«åŸºã¥ã文字列ã«ã¯æ±šæŸ“マークãŒä»˜åŠ ã•れるã¹ã
+ ã§ã‚る.
- ±øÀ÷¥Þ¡¼¥¯¤¬Éղ䵤줿¿·¤·¤¤Ruby¤Îʸ»úÎó¤òÀ¸À®¤¹¤ë¡¥³°Éô
- ¤«¤é¤Î¥Ç¡¼¥¿¤Ë´ð¤Å¤¯Ê¸»úÎó¤Ë¤Ï±øÀ÷¥Þ¡¼¥¯¤¬Éղ䵤ì¤ë¤Ù¤­
- ¤Ç¤¢¤ë¡¥
+rb_tainted_str_new2(const char *ptr)
+rb_tainted_str_new_cstr(const char *ptr)
- rb_tainted_str_new2(const char *ptr)
+ Cã®æ–‡å­—列ã‹ã‚‰æ±šæŸ“マークãŒä»˜åŠ ã•れãŸRubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
- C¤Îʸ»úÎ󤫤鱸À÷¥Þ¡¼¥¯¤¬Éղ䵤줿Ruby¤Îʸ»úÎó¤òÀ¸À®¤¹¤ë¡¥
+rb_sprintf(const char *format, ...)
+rb_vsprintf(const char *format, va_list ap)
- rb_str_cat(VALUE str, const char *ptr, long len)
+ Cã®æ–‡å­—列formatã¨ç¶šã引数をprintf(3)ã®ãƒ•ォーマットã«ã—ãŸãŒã£ã¦
+ æ•´å½¢ã—,Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
- Ruby¤Îʸ»úÎóstr¤Ëlen¥Ð¥¤¥È¤Îʸ»úÎóptr¤òÄɲ乤롥
+rb_str_cat(VALUE str, const char *ptr, long len)
- ÇÛÎó¤ËÂФ¹¤ë´Ø¿ô
+ Rubyã®æ–‡å­—列strã«lenãƒã‚¤ãƒˆã®æ–‡å­—列ptrを追加ã™ã‚‹ï¼Ž
- rb_ary_new()
+rb_str_cat2(VALUE str, const char* ptr)
- Í×ÁǤ¬0¤ÎÇÛÎó¤òÀ¸À®¤¹¤ë¡¥
+ Rubyã®æ–‡å­—列strã«Cã®æ–‡å­—列ptrを追加ã™ã‚‹ï¼Žã“ã®é–¢æ•°ã®æ©Ÿèƒ½ã¯
+ rb_str_cat(str, ptr, strlen(ptr))ã¨åŒç­‰ã§ã‚る.
- rb_ary_new2(long len)
+rb_str_catf(VALUE str, const char* format, ...)
+rb_str_vcatf(VALUE str, const char* format, va_list ap)
- Í×ÁǤ¬0¤ÎÇÛÎó¤òÀ¸À®¤¹¤ë¡¥lenÍ×ÁÇʬ¤ÎÎΰè¤ò¤¢¤é¤«¤¸¤á³ä¤ê
- Åö¤Æ¤Æ¤ª¤¯¡¥
+ Cã®æ–‡å­—列formatã¨ç¶šã引数をprintf(3)ã®ãƒ•ォーマットã«ã—ãŸãŒã£ã¦
+ æ•´å½¢ã—,Rubyã®æ–‡å­—列strã«è¿½åŠ ã™ã‚‹ï¼Žã“ã®é–¢æ•°ã®æ©Ÿèƒ½ã¯ï¼Œãれãžã‚Œ
+ rb_str_cat2(str, rb_sprintf(format, ...)) ã‚„
+ rb_str_cat2(str, rb_vsprintf(format, ap)) ã¨åŒç­‰ã§ã‚る.
- rb_ary_new3(long n, ...)
+rb_enc_str_new(const char *ptr, long len, rb_encoding *enc)
- °ú¿ô¤Ç»ØÄꤷ¤¿nÍ×ÁǤò´Þ¤àÇÛÎó¤òÀ¸À®¤¹¤ë¡¥
+ 指定ã•れãŸã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã§Rubyã®æ–‡å­—列を生æˆã™ã‚‹.
- rb_ary_new4(long n, VALUE *elts)
+rb_usascii_str_new(const char *ptr, long len)
+rb_usascii_str_new_cstr(const char *ptr)
- ÇÛÎó¤ÇÍ¿¤¨¤¿nÍ×ÁǤÎÇÛÎó¤òÀ¸À®¤¹¤ë¡¥
+ エンコーディングãŒUS-ASCIIã®Rubyã®æ–‡å­—列を生æˆã™ã‚‹.
- rb_ary_push(VALUE ary, VALUE val)
- rb_ary_pop(VALUE ary)
- rb_ary_shift(VALUE ary)
- rb_ary_unshift(VALUE ary, VALUE val)
+rb_str_resize(VALUE str, long len)
- Array¤ÎƱ̾¤Î¥á¥½¥Ã¥É¤ÈƱ¤¸Æ¯¤­¤ò¤¹¤ë´Ø¿ô¡¥Âè1°ú¿ô¤Ïɬ¤º
- ÇÛÎó¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡¥
+ Rubyã®æ–‡å­—列ã®ã‚µã‚¤ã‚ºã‚’lenãƒã‚¤ãƒˆã«å¤‰æ›´ã™ã‚‹ï¼Žstrã®é•·ã•ã¯å‰
+ 以ã¦ã‚»ãƒƒãƒˆã•れã¦ã„ãªã‘れã°ãªã‚‰ãªã„.lenãŒå…ƒã®é•·ã•よりも短
+ ã„æ™‚ã¯ï¼Œlenãƒã‚¤ãƒˆã‚’è¶ŠãˆãŸéƒ¨åˆ†ã®å†…å®¹ã¯æ¨ã¦ã‚‰ã‚Œã‚‹ï¼ŽlenãŒå…ƒ
+ ã®é•·ã•ã‚ˆã‚Šã‚‚é•·ã„æ™‚ã¯ï¼Œå…ƒã®é•·ã•ã‚’è¶ŠãˆãŸéƒ¨åˆ†ã®å†…容ã¯ä¿å­˜ã•
+ れãªã„ã§ã‚´ãƒŸã«ãªã‚‹ã ã‚ã†ï¼Žã“ã®é–¢æ•°ã®å‘¼ã³å‡ºã—ã«ã‚ˆã£ã¦
+ RSTRING_PTR(str)ãŒå¤‰æ›´ã•れるã‹ã‚‚ã—れãªã„ã“ã¨ã«æ³¨æ„.
-2¡¥Ruby¤Îµ¡Ç½¤ò»È¤¦
+rb_str_set_len(VALUE str, long len)
-¸¶ÍýŪ¤ËRuby¤Ç½ñ¤±¤ë¤³¤È¤ÏC¤Ç¤â½ñ¤±¤Þ¤¹¡¥Ruby¤½¤Î¤â¤Î¤¬C¤Çµ­
-½Ò¤µ¤ì¤Æ¤¤¤ë¤ó¤Ç¤¹¤«¤é¡¤ÅöÁ³¤È¤¤¤¨¤ÐÅöÁ³¤Ê¤ó¤Ç¤¹¤±¤É¡¥¤³¤³¤Ç
-¤ÏRuby¤Î³ÈÄ¥¤Ë»È¤¦¤³¤È¤¬Â¿¤¤¤À¤í¤¦¤Èͽ¬¤µ¤ì¤ëµ¡Ç½¤òÃæ¿´¤Ë¾Ò
-²ð¤·¤Þ¤¹¡¥
+ Rubyã®æ–‡å­—列ã®ã‚µã‚¤ã‚ºã‚’lenãƒã‚¤ãƒˆã«ã‚»ãƒƒãƒˆã™ã‚‹ï¼ŽstrãŒå¤‰æ›´å¯
+ 能ã§ãªã‘れã°ä¾‹å¤–ãŒç™ºç”Ÿã™ã‚‹ï¼ŽRSTRING_LEN(str)ã¨ã¯ç„¡é–¢ä¿‚ã«ï¼Œ
+ lenãƒã‚¤ãƒˆã¾ã§ã®å†…容ã¯ä¿å­˜ã•れる.lenã¯strã®å®¹é‡ã‚’è¶Šãˆã¦ã„
+ ã¦ã¯ãªã‚‰ãªã„.
-2.1 Ruby¤Ëµ¡Ç½¤òÄɲ乤ë
-Ruby¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë´Ø¿ô¤ò»È¤¨¤ÐRuby¥¤¥ó¥¿¥×¥ê¥¿¤Ë¿·¤·¤¤µ¡Ç½
-¤òÄɲ乤뤳¤È¤¬¤Ç¤­¤Þ¤¹¡¥Ruby¤Ç¤Ï°Ê²¼¤Îµ¡Ç½¤òÄɲä¹¤ë´Ø¿ô¤¬
-Ä󶡤µ¤ì¤Æ¤¤¤Þ¤¹¡¥
+== é…列ã«å¯¾ã™ã‚‹é–¢æ•°
- * ¥¯¥é¥¹¡¤¥â¥¸¥å¡¼¥ë
- * ¥á¥½¥Ã¥É¡¤ÆÃ°Û¥á¥½¥Ã¥É¤Ê¤É
- * Äê¿ô
+rb_ary_new()
-¤Ç¤Ï½ç¤Ë¾Ò²ð¤·¤Þ¤¹¡¥
+ è¦ç´ ãŒ0ã®é…列を生æˆã™ã‚‹ï¼Ž
-2.1.1 ¥¯¥é¥¹/¥â¥¸¥å¡¼¥ëÄêµÁ
+rb_ary_new2(long len)
-¥¯¥é¥¹¤ä¥â¥¸¥å¡¼¥ë¤òÄêµÁ¤¹¤ë¤¿¤á¤Ë¤Ï¡¤°Ê²¼¤Î´Ø¿ô¤ò»È¤¤¤Þ¤¹¡¥
+ è¦ç´ ãŒ0ã®é…列を生æˆã™ã‚‹ï¼Žlenè¦ç´ åˆ†ã®é ˜åŸŸã‚’ã‚らã‹ã˜ã‚割り
+ 当ã¦ã¦ãŠã.
+
+rb_ary_new3(long n, ...)
+
+ å¼•æ•°ã§æŒ‡å®šã—ãŸnè¦ç´ ã‚’å«ã‚€é…列を生æˆã™ã‚‹ï¼Ž
+
+rb_ary_new4(long n, VALUE *elts)
+
+ é…列ã§ä¸ŽãˆãŸnè¦ç´ ã®é…列を生æˆã™ã‚‹ï¼Ž
+
+rb_ary_to_ary(VALUE obj)
+
+ オブジェクトをé…列ã«å¤‰æ›ã™ã‚‹.
+ Object#to_aryã¨åŒç­‰ã§ã‚ã‚‹.
+
+ä»–ã«ã‚‚é…列をæ“作ã™ã‚‹é–¢æ•°ãŒå¤šæ•°ã‚ã‚‹. ã“れらã¯
+引数aryã«é…列を渡ã•ãªã‘れã°ãªã‚‰ãªã„. ã•ã‚‚ãªã„ã¨
+コアをåã.
+
+rb_ary_aref(argc, VALUE *argv, VALUE ary)
+
+ Array#[]ã¨åŒç­‰.
+
+rb_ary_entry(VALUE ary, long offset)
+
+ ary[offset]
+
+rb_ary_subseq(VALUE ary, long beg, long len)
+
+ ary[beg, len]
+
+rb_ary_push(VALUE ary, VALUE val)
+rb_ary_pop(VALUE ary)
+rb_ary_shift(VALUE ary)
+rb_ary_unshift(VALUE ary, VALUE val)
+
+rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
+
+ é…列aryã«ptrã‹ã‚‰len個ã®ã‚ªãƒ–ジェクトを追加ã™ã‚‹ï¼Ž
+
+= Rubyã®æ©Ÿèƒ½ã‚’使ã†
+
+原ç†çš„ã«Rubyã§æ›¸ã‘ã‚‹ã“ã¨ã¯Cã§ã‚‚書ã‘ã¾ã™ï¼ŽRubyãã®ã‚‚ã®ãŒCã§è¨˜
+è¿°ã•れã¦ã„ã‚‹ã‚“ã§ã™ã‹ã‚‰ï¼Œå½“ç„¶ã¨ã„ãˆã°å½“ç„¶ãªã‚“ã§ã™ã‘ã©ï¼Žã“ã“ã§
+ã¯Rubyã®æ‹¡å¼µã«ä½¿ã†ã“ã¨ãŒå¤šã„ã ã‚ã†ã¨äºˆæ¸¬ã•れる機能を中心ã«ç´¹
+介ã—ã¾ã™ï¼Ž
+
+== Rubyã«æ©Ÿèƒ½ã‚’追加ã™ã‚‹
+
+Rubyã§æä¾›ã•れã¦ã„る関数を使ãˆã°Rubyã‚¤ãƒ³ã‚¿ãƒ—ãƒªã‚¿ã«æ–°ã—ã„æ©Ÿèƒ½
+を追加ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ï¼ŽRubyã§ã¯ä»¥ä¸‹ã®æ©Ÿèƒ½ã‚’追加ã™ã‚‹é–¢æ•°ãŒ
+æä¾›ã•れã¦ã„ã¾ã™ï¼Ž
+
+* クラス,モジュール
+* メソッド,特異メソッドãªã©
+* 定数
+
+ã§ã¯é †ã«ç´¹ä»‹ã—ã¾ã™ï¼Ž
+
+=== クラス/モジュール定義
+
+クラスやモジュールを定義ã™ã‚‹ãŸã‚ã«ã¯ï¼Œä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
VALUE rb_define_class(const char *name, VALUE super)
VALUE rb_define_module(const char *name)
-¤³¤ì¤é¤Î´Ø¿ô¤Ï¿·¤·¤¯ÄêµÁ¤µ¤ì¤¿¥¯¥é¥¹¤ä¥â¥¸¥å¡¼¥ë¤òÊÖ¤·¤Þ¤¹¡¥
-¥á¥½¥Ã¥É¤äÄê¿ô¤ÎÄêµÁ¤Ë¤³¤ì¤é¤ÎÃͤ¬É¬ÍפʤΤǡ¤¤Û¤È¤ó¤É¤Î¾ì¹ç
-¤ÏÌá¤êÃͤòÊÑ¿ô¤Ë³ÊǼ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¤Ç¤·¤ç¤¦¡¥
+ã“れらã®é–¢æ•°ã¯æ–°ã—ã定義ã•れãŸã‚¯ãƒ©ã‚¹ã‚„モジュールを返ã—ã¾ã™ï¼Ž
+メソッドや定数ã®å®šç¾©ã«ã“れらã®å€¤ãŒå¿…è¦ãªã®ã§ï¼Œã»ã¨ã‚“ã©ã®å ´åˆ
+ã¯æˆ»ã‚Šå€¤ã‚’å¤‰æ•°ã«æ ¼ç´ã—ã¦ãŠãå¿…è¦ãŒã‚ã‚‹ã§ã—ょã†ï¼Ž
-¥¯¥é¥¹¤ä¥â¥¸¥å¡¼¥ë¤ò¾¤Î¥¯¥é¥¹¤ÎÆâÉô¤Ë¥Í¥¹¥È¤·¤ÆÄêµÁ¤¹¤ë»þ¤Ë
-¤Ï°Ê²¼¤Î´Ø¿ô¤ò»È¤¤¤Þ¤¹¡¥
+クラスやモジュールを他ã®ã‚¯ãƒ©ã‚¹ã®å†…部ã«ãƒã‚¹ãƒˆã—ã¦å®šç¾©ã™ã‚‹æ™‚ã«
+ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
VALUE rb_define_module_under(VALUE outer, const char *name)
-2.1.2 ¥á¥½¥Ã¥É/ÆÃ°Û¥á¥½¥Ã¥ÉÄêµÁ
+=== メソッド/特異メソッド定義
-¥á¥½¥Ã¥É¤äÆÃ°Û¥á¥½¥Ã¥É¤òÄêµÁ¤¹¤ë¤Ë¤Ï°Ê²¼¤Î´Ø¿ô¤ò»È¤¤¤Þ¤¹¡¥
+メソッドや特異メソッドを定義ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
- void rb_define_method(VALUE klass, const char *name,
- VALUE (*func)(), int argc)
+ void rb_define_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+
+ void rb_define_singleton_method(VALUE object, const char *name,
+ VALUE (*func)(), int argc)
- void rb_define_singleton_method(VALUE object, const char *name,
- VALUE (*func)(), int argc)
+念ã®ãŸã‚説明ã™ã‚‹ã¨ã€Œç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ã€ã¨ã¯ï¼Œãã®ç‰¹å®šã®ã‚ªãƒ–ジェク
+トã«å¯¾ã—ã¦ã ã‘有効ãªãƒ¡ã‚½ãƒƒãƒ‰ã§ã™ï¼ŽRubyã§ã¯ã‚ˆãSmalltalkã«ãŠ
+ã‘るクラスメソッドã¨ã—ã¦ï¼Œã‚¯ãƒ©ã‚¹ã«å¯¾ã™ã‚‹ç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ãŒä½¿ã‚れ
+ã¾ã™ï¼Ž
-ǰ¤Î¤¿¤áÀâÌÀ¤¹¤ë¤È¡ÖÆÃ°Û¥á¥½¥Ã¥É¡×¤È¤Ï¡¤¤½¤ÎÆÃÄê¤Î¥ª¥Ö¥¸¥§¥¯
-¥È¤ËÂФ·¤Æ¤À¤±Í­¸ú¤Ê¥á¥½¥Ã¥É¤Ç¤¹¡¥Ruby¤Ç¤Ï¤è¤¯Smalltalk¤Ë¤ª
-¤±¤ë¥¯¥é¥¹¥á¥½¥Ã¥É¤È¤·¤Æ¡¤¥¯¥é¥¹¤ËÂФ¹¤ëÆÃ°Û¥á¥½¥Ã¥É¤¬»È¤ï¤ì
-¤Þ¤¹¡¥
+ã“れらã®é–¢æ•°ã® argcã¨ã„ã†å¼•æ•°ã¯Cã®é–¢æ•°ã¸æ¸¡ã•ã‚Œã‚‹å¼•æ•°ã®æ•°(ã¨
+å½¢å¼)を決ã‚ã¾ã™ï¼ŽargcãŒ0ä»¥ä¸Šã®æ™‚ã¯é–¢æ•°ã«å¼•ãæ¸¡ã™å¼•æ•°ã®æ•°ã‚’æ„
+味ã—ã¾ã™ï¼Ž16個以上ã®å¼•æ•°ã¯ä½¿ãˆã¾ã›ã‚“(ãŒï¼Œè¦ã‚Šã¾ã›ã‚“よã­ï¼Œã
+ã‚“ãªã«).実際ã®é–¢æ•°ã«ã¯å…ˆé ­ã®å¼•æ•°ã¨ã—ã¦selfãŒä¸Žãˆã‚‰ã‚Œã¾ã™ã®
+ã§ï¼ŒæŒ‡å®šã—ãŸæ•°ã‚ˆã‚Š1多ã„引数をæŒã¤ã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž
-¤³¤ì¤é¤Î´Ø¿ô¤Î argc¤È¤¤¤¦°ú¿ô¤ÏC¤Î´Ø¿ô¤ØÅϤµ¤ì¤ë°ú¿ô¤Î¿ô(¤È
-·Á¼°)¤ò·è¤á¤Þ¤¹¡¥argc¤¬0°Ê¾å¤Î»þ¤Ï´Ø¿ô¤Ë°ú¤­ÅϤ¹°ú¿ô¤Î¿ô¤ò°Õ
-Ì£¤·¤Þ¤¹¡¥16¸Ä°Ê¾å¤Î°ú¿ô¤Ï»È¤¨¤Þ¤»¤ó(¤¬¡¤Íפê¤Þ¤»¤ó¤è¤Í¡¤¤½
-¤ó¤Ê¤Ë)¡¥¼ÂºÝ¤Î´Ø¿ô¤Ë¤ÏÀèÆ¬¤Î°ú¿ô¤È¤·¤Æself¤¬Í¿¤¨¤é¤ì¤Þ¤¹¤Î
-¤Ç¡¤»ØÄꤷ¤¿¿ô¤è¤ê1¿¤¤°ú¿ô¤ò»ý¤Ä¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥
+argcãŒè² ã®æ™‚ã¯å¼•æ•°ã®æ•°ã§ã¯ãªã,形å¼ã‚’指定ã—ãŸã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž
+argcãŒ-1ã®æ™‚ã¯å¼•æ•°ã‚’é…列ã«å…¥ã‚Œã¦æ¸¡ã•れã¾ã™ï¼ŽargcãŒ-2ã®æ™‚ã¯å¼•
+æ•°ã¯Rubyã®é…列ã¨ã—ã¦æ¸¡ã•れã¾ã™ï¼Ž
-argc¤¬Éé¤Î»þ¤Ï°ú¿ô¤Î¿ô¤Ç¤Ï¤Ê¤¯¡¤·Á¼°¤ò»ØÄꤷ¤¿¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥
-argc¤¬-1¤Î»þ¤Ï°ú¿ô¤òÇÛÎó¤ËÆþ¤ì¤ÆÅϤµ¤ì¤Þ¤¹¡¥argc¤¬-2¤Î»þ¤Ï°ú
-¿ô¤ÏRuby¤ÎÇÛÎó¤È¤·¤ÆÅϤµ¤ì¤Þ¤¹¡¥
+メソッドを定義ã™ã‚‹é–¢æ•°ã¯ã¾ã ã„ãã¤ã‹ã‚りã¾ã™. ã²ã¨ã¤ã¯ãƒ¡ã‚½ãƒƒãƒ‰
+åã¨ã—ã¦IDã‚’å–りã¾ã™. IDã«ã¤ã„ã¦ã¯2.2.2ã‚’å‚ç…§.
-¥á¥½¥Ã¥É¤òÄêµÁ¤¹¤ë´Ø¿ô¤Ï¤â¤¦Æó¤Ä¤¢¤ê¤Þ¤¹¡¥¤Ò¤È¤Ä¤Ïprivate¥á
-¥½¥Ã¥É¤òÄêµÁ¤¹¤ë´Ø¿ô¤Ç¡¤°ú¿ô¤Ïrb_define_method()¤ÈƱ¤¸¤Ç¤¹¡¥
+ void rb_define_method_id(VALUE klass, ID name,
+ VALUE (*func)(ANYARGS), int argc)
- void rb_define_private_method(VALUE klass, const char *name,
+private/protectedãªãƒ¡ã‚½ãƒƒãƒ‰ã‚’定義ã™ã‚‹ãµãŸã¤ã®é–¢æ•°ãŒã‚りã¾ã™.
+
+ void rb_define_private_method(VALUE klass, const char *name,
VALUE (*func)(), int argc)
+ void rb_define_protected_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
-private¥á¥½¥Ã¥É¤È¤Ï´Ø¿ô·Á¼°¤Ç¤·¤«¸Æ¤Ó½Ð¤¹¤³¤È¤Î½ÐÍè¤Ê¤¤¥á¥½¥Ã
-¥É¤Ç¤¹¡¥
+privateメソッドã¨ã¯é–¢æ•°å½¢å¼ã§ã—ã‹å‘¼ã³å‡ºã™ã“ã¨ã®å‡ºæ¥ãªã„メソッ
+ドã§ã™ï¼Ž
-¤â¤¦¤Ò¤È¤Ä¤Ï¥â¥¸¥å¡¼¥ë´Ø¿ô¤òÄêµÁ¤¹¤ë¤â¤Î¤Ç¤¹¡¥¥â¥¸¥å¡¼¥ë´Ø¿ô
-¤È¤Ï¥â¥¸¥å¡¼¥ë¤ÎÆÃ°Û¥á¥½¥Ã¥É¤Ç¤¢¤ê¡¤Æ±»þ¤Ëprivate¥á¥½¥Ã¥É¤Ç
-¤â¤¢¤ë¤â¤Î¤Ç¤¹¡¥Îã¤ò¤¢¤²¤ë¤ÈMath¥â¥¸¥å¡¼¥ë¤Îsqrt()¤Ê¤É¤¬¤¢¤²
-¤é¤ì¤Þ¤¹¡¥¤³¤Î¥á¥½¥Ã¥É¤Ï
+最後ã«ï¼Œ rb_define_module関数ã¯ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«é–¢æ•°ã‚’定義ã—ã¾ã™ï¼Ž
+モジュール関数ã¨ã¯ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã®ç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚ã‚Šï¼ŒåŒæ™‚ã«
+privateメソッドã§ã‚‚ã‚ã‚‹ã‚‚ã®ã§ã™ï¼Žä¾‹ã‚’ã‚ã’ã‚‹ã¨Mathモジュール
+ã®sqrt()ãªã©ãŒã‚ã’られã¾ã™ï¼Žã“ã®ãƒ¡ã‚½ãƒƒãƒ‰ã¯
Math.sqrt(4)
-¤È¤¤¤¦·Á¼°¤Ç¤â
+ã¨ã„ã†å½¢å¼ã§ã‚‚
include Math
sqrt(4)
-¤È¤¤¤¦·Á¼°¤Ç¤â»È¤¨¤Þ¤¹¡¥¥â¥¸¥å¡¼¥ë´Ø¿ô¤òÄêµÁ¤¹¤ë´Ø¿ô¤Ï°Ê²¼¤Î
-Ä̤ê¤Ç¤¹¡¥
+ã¨ã„ã†å½¢å¼ã§ã‚‚使ãˆã¾ã™ï¼Žãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«é–¢æ•°ã‚’定義ã™ã‚‹é–¢æ•°ã¯ä»¥ä¸‹ã®
+通りã§ã™ï¼Ž
- void rb_define_module_function(VALUE module, const char *name,
+ void rb_define_module_function(VALUE module, const char *name,
VALUE (*func)(), int argc)
-´Ø¿ôŪ¥á¥½¥Ã¥É(Kernel¥â¥¸¥å¡¼¥ë¤Îprivate method)¤òÄêµÁ¤¹¤ë¤¿
-¤á¤Î´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡¥
+関数的メソッド(Kernelモジュールã®private method)を定義ã™ã‚‹ãŸ
+ã‚ã®é–¢æ•°ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼Ž
void rb_define_global_function(const char *name, VALUE (*func)(), int argc)
-¥á¥½¥Ã¥É¤ÎÊÌ̾¤òÄêµÁ¤¹¤ë¤¿¤á¤Î´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£
+メソッドã®åˆ¥åを定義ã™ã‚‹ãŸã‚ã®é–¢æ•°ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼Ž
void rb_define_alias(VALUE module, const char* new, const char* old);
-¥¯¥é¥¹¥á¥½¥Ã¥Éallocate¤òÄêµÁ¤·¤¿¤êºï½ü¤·¤¿¤ê¤¹¤ë¤¿¤á¤Î´Ø¿ô¤Ï
-°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£
+属性ã®å–得・設定メソッドを定義ã™ã‚‹ã«ã¯
+
+ void rb_define_attr(VALUE klass, const char *name, int read, int write)
+
+クラスメソッドallocateを定義ã—ãŸã‚Šå‰Šé™¤ã—ãŸã‚Šã™ã‚‹ãŸã‚ã®é–¢æ•°ã¯
+以下ã®é€šã‚Šã§ã™ï¼Ž
void rb_define_alloc_func(VALUE klass, VALUE (*func)(VALUE klass));
void rb_undef_alloc_func(VALUE klass);
-func¤Ï¥¯¥é¥¹¤ò°ú¿ô¤È¤·¤Æ¼õ¤±¼è¤Ã¤Æ¡¢¿·¤·¤¯³ä¤êÅö¤Æ¤é¤ì¤¿¥¤¥ó
-¥¹¥¿¥ó¥¹¤òÊÖ¤µ¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£¤³¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤Ï¡¢³°Éô¥ê
-¥½¡¼¥¹¤Ê¤É¤ò´Þ¤Þ¤Ê¤¤¡¢¤Ç¤­¤ë¤À¤±¡Ö¶õ¡×¤Î¤Þ¤Þ¤Ë¤·¤Æ¤ª¤¤¤¿¤Û¤¦
-¤¬¤è¤¤¤Ç¤·¤ç¤¦¡£
+funcã¯ã‚¯ãƒ©ã‚¹ã‚’引数ã¨ã—ã¦å—ã‘å–ã£ã¦ï¼Œæ–°ã—ã割り当ã¦ã‚‰ã‚ŒãŸã‚¤ãƒ³
+スタンスを返ã•ãªãã¦ã¯ãªã‚Šã¾ã›ã‚“.ã“ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã¯ï¼Œå¤–部リ
+ソースãªã©ã‚’å«ã¾ãªã„,ã§ãã‚‹ã ã‘「空ã€ã®ã¾ã¾ã«ã—ã¦ãŠã„ãŸã»ã†
+ãŒã‚ˆã„ã§ã—ょã†ï¼Ž
-2.1.3 Äê¿ôÄêµÁ
+=== 定数定義
-³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤¬É¬ÍפÊÄê¿ô¤Ï¤¢¤é¤«¤¸¤áÄêµÁ¤·¤Æ¤ª¤¤¤¿Êý¤¬Îɤ¤
-¤Ç¤·¤ç¤¦¡¥Äê¿ô¤òÄêµÁ¤¹¤ë´Ø¿ô¤ÏÆó¤Ä¤¢¤ê¤Þ¤¹¡¥
+拡張ライブラリãŒå¿…è¦ãªå®šæ•°ã¯ã‚らã‹ã˜ã‚定義ã—ã¦ãŠã„ãŸæ–¹ãŒè‰¯ã„
+ã§ã—ょã†ï¼Žå®šæ•°ã‚’定義ã™ã‚‹é–¢æ•°ã¯äºŒã¤ã‚りã¾ã™ï¼Ž
void rb_define_const(VALUE klass, const char *name, VALUE val)
void rb_define_global_const(const char *name, VALUE val)
-Á°¼Ô¤ÏÆÃÄê¤Î¥¯¥é¥¹/¥â¥¸¥å¡¼¥ë¤Ë°¤¹¤ëÄê¿ô¤òÄêµÁ¤¹¤ë¤â¤Î¡¤¸å
-¼Ô¤Ï¥°¥í¡¼¥Ð¥ë¤ÊÄê¿ô¤òÄêµÁ¤¹¤ë¤â¤Î¤Ç¤¹¡¥
+å‰è€…ã¯ç‰¹å®šã®ã‚¯ãƒ©ã‚¹/モジュールã«å±žã™ã‚‹å®šæ•°ã‚’定義ã™ã‚‹ã‚‚ã®ï¼Œå¾Œ
+者ã¯ã‚°ãƒ­ãƒ¼ãƒãƒ«ãªå®šæ•°ã‚’定義ã™ã‚‹ã‚‚ã®ã§ã™ï¼Ž
-2.2 Ruby¤Îµ¡Ç½¤òC¤«¤é¸Æ¤Ó½Ð¤¹
+== Rubyã®æ©Ÿèƒ½ã‚’Cã‹ã‚‰å‘¼ã³å‡ºã™
-´û¤Ë¡Ø1.5 Ruby¤Î¥Ç¡¼¥¿¤òÁàºî¤¹¤ë¡Ù¤Ç°ìÉô¾Ò²ð¤·¤¿¤è¤¦¤Ê´Ø¿ô¤ò
-»È¤¨¤Ð¡¤Ruby¤Îµ¡Ç½¤ò¼Â¸½¤·¤Æ¤¤¤ë´Ø¿ô¤òľÀܸƤӽФ¹¤³¤È¤¬½ÐÍè
-¤Þ¤¹¡¥
+æ—¢ã«ã€Ž1.5 Rubyã®ãƒ‡ãƒ¼ã‚¿ã‚’æ“作ã™ã‚‹ã€ã§ä¸€éƒ¨ç´¹ä»‹ã—ãŸã‚ˆã†ãªé–¢æ•°ã‚’
+使ãˆã°ï¼ŒRubyã®æ©Ÿèƒ½ã‚’実ç¾ã—ã¦ã„る関数を直接呼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥
+ã¾ã™ï¼Ž
-# ¤³¤Î¤è¤¦¤Ê´Ø¿ô¤Î°ìÍ÷ɽ¤Ï¤¤¤Þ¤Î¤È¤³¤í¤¢¤ê¤Þ¤»¤ó¡¥¥½¡¼¥¹¤ò¸«
-# ¤ë¤·¤«¤Ê¤¤¤Ç¤¹¤Í¡¥
+# ã“ã®ã‚ˆã†ãªé–¢æ•°ã®ä¸€è¦§è¡¨ã¯ã„ã¾ã®ã¨ã“ã‚ã‚りã¾ã›ã‚“.ソースを見
+# ã‚‹ã—ã‹ãªã„ã§ã™ã­ï¼Ž
-¤½¤ì°Ê³°¤Ë¤âRuby¤Îµ¡Ç½¤ò¸Æ¤Ó½Ð¤¹ÊýË¡¤Ï¤¤¤¯¤Ä¤«¤¢¤ê¤Þ¤¹¡¥
+ãれ以外ã«ã‚‚Rubyã®æ©Ÿèƒ½ã‚’呼ã³å‡ºã™æ–¹æ³•ã¯ã„ãã¤ã‹ã‚りã¾ã™ï¼Ž
-2.2.1 Ruby¤Î¥×¥í¥°¥é¥à¤òeval¤¹¤ë
+=== Rubyã®ãƒ—ログラムをevalã™ã‚‹
-C¤«¤éRuby¤Îµ¡Ç½¤ò¸Æ¤Ó½Ð¤¹¤â¤Ã¤È¤â´Êñ¤ÊÊýË¡¤È¤·¤Æ¡¤Ê¸»úÎó¤Ç
-Í¿¤¨¤é¤ì¤¿Ruby¤Î¥×¥í¥°¥é¥à¤òɾ²Á¤¹¤ë°Ê²¼¤Î´Ø¿ô¤¬¤¢¤ê¤Þ¤¹¡¥
+Cã‹ã‚‰Rubyã®æ©Ÿèƒ½ã‚’呼ã³å‡ºã™ã‚‚ã£ã¨ã‚‚ç°¡å˜ãªæ–¹æ³•ã¨ã—ã¦ï¼Œæ–‡å­—列ã§
+与ãˆã‚‰ã‚ŒãŸRubyã®ãƒ—ログラムを評価ã™ã‚‹ä»¥ä¸‹ã®é–¢æ•°ãŒã‚りã¾ã™ï¼Ž
VALUE rb_eval_string(const char *str)
-¤³¤Îɾ²Á¤Ï¸½ºß¤Î´Ä¶­¤Ç¹Ô¤ï¤ì¤Þ¤¹¡¥¤Ä¤Þ¤ê¡¤¸½ºß¤Î¥í¡¼¥«¥ëÊÑ¿ô
-¤Ê¤É¤ò¼õ¤±·Ñ¤®¤Þ¤¹¡¥
+ã“ã®è©•価ã¯ç¾åœ¨ã®ç’°å¢ƒã§è¡Œã‚れã¾ã™ï¼Žã¤ã¾ã‚Šï¼Œç¾åœ¨ã®ãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°
+ãªã©ã‚’å—ã‘ç¶™ãŽã¾ã™ï¼Ž
-2.2.2 ID¤Þ¤¿¤Ï¥·¥ó¥Ü¥ë
+評価ã¯ä¾‹å¤–を発生ã™ã‚‹ã‹ã‚‚ã—れãªã„ã“ã¨ã«æ³¨æ„ã—ã¾ã—ょã†. より安全
+ãªé–¢æ•°ã‚‚ã‚りã¾ã™.
-C¤«¤éʸ»úÎó¤ò·Ðͳ¤»¤º¤ËRuby¤Î¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤â¤Ç¤­¤Þ
-¤¹¡¥¤½¤ÎÁ°¤Ë¡¤Ruby¥¤¥ó¥¿¥×¥ê¥¿Æâ¤Ç¥á¥½¥Ã¥É¤äÊÑ¿ô̾¤ò»ØÄꤹ¤ë
-»þ¤Ë»È¤ï¤ì¤Æ¤¤¤ëID¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤ª¤­¤Þ¤·¤ç¤¦¡¥
+ VALUE rb_eval_string_protect(const char *str, int *state)
-ID¤È¤ÏÊÑ¿ô̾¡¤¥á¥½¥Ã¥É̾¤òɽ¤¹À°¿ô¤Ç¤¹¡¥Ruby¤Ç¤ÏID¤ËÂбþ¤¹¤ë
-¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤Æ¥·¥ó¥Ü¥ë(Symbol)¤¬¤¢¤ê¡¤
+ã“ã®é–¢æ•°ã¯ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã™ã‚‹ã¨nilã‚’è¿”ã—ã¾ã™ï¼Žãã—ã¦ï¼ŒæˆåŠŸæ™‚ã«ã¯
+*stateã¯ã‚¼ãƒ­ã«ï¼Œã•ã‚‚ãªãã°éžã‚¼ãƒ­ã«ãªã‚Šã¾ã™ï¼Ž
- :¼±ÊÌ»Ò
+=== IDã¾ãŸã¯ã‚·ãƒ³ãƒœãƒ«
-¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤¹¡¥C¤«¤é¤³¤ÎÀ°¿ô¤òÆÀ¤ë¤¿¤á¤Ë¤Ï´Ø¿ô
+Cã‹ã‚‰æ–‡å­—列を経由ã›ãšã«Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™ã“ã¨ã‚‚ã§ãã¾
+ã™ï¼Žãã®å‰ã«ï¼ŒRubyインタプリタ内ã§ãƒ¡ã‚½ãƒƒãƒ‰ã‚„変数åを指定ã™ã‚‹
+時ã«ä½¿ã‚れã¦ã„ã‚‹IDã«ã¤ã„ã¦èª¬æ˜Žã—ã¦ãŠãã¾ã—ょã†ï¼Ž
- rb_intern(const char *name)
+IDã¨ã¯å¤‰æ•°å,メソッドåã‚’è¡¨ã™æ•´æ•°ã§ã™ï¼ŽRubyã®ä¸­ã§ã¯
-¤ò»È¤¤¤Þ¤¹¡¥Ruby¤«¤é°ú¿ô¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿¥·¥ó¥Ü¥ë(¤Þ¤¿¤Ïʸ»ú
-Îó)¤òID¤ËÊÑ´¹¤¹¤ë¤Ë¤Ï°Ê²¼¤Î´Ø¿ô¤ò»È¤¤¤Þ¤¹¡¥
+ :識別å­
- rb_to_id(VALUE symbol)
+ã¾ãŸã¯
+
+ :"ä»»æ„ã®æ–‡å­—列"
-ID¤«¤é¥·¥ó¥Ü¥ë¤òÆÀ¤ë¤¿¤á¤Ë¤Ï°Ê²¼¤Î¥Þ¥¯¥í¤ò»È¤¤¤Þ¤¹¡¥
+ã§ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã™ï¼ŽCã‹ã‚‰ã“ã®æ•´æ•°ã‚’å¾—ã‚‹ãŸã‚ã«ã¯é–¢æ•°
+
+ rb_intern(const char *name)
+ rb_intern_str(VALUE name)
- VALUE ID2SYM(ID id)
+を使ã„ã¾ã™ï¼ŽRubyã‹ã‚‰å¼•æ•°ã¨ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸã‚·ãƒ³ãƒœãƒ«(ã¾ãŸã¯æ–‡å­—
+列)ã‚’IDã«å¤‰æ›ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
-¥·¥ó¥Ü¥ë¤«¤éID¤òÆÀ¤ë¤¿¤á¤Ë¤Ï°Ê²¼¤Î¥Þ¥¯¥í¤ò»È¤¤¤Þ¤¹¡¥
+ rb_to_id(VALUE symbol)
+ rb_check_id(volatile VALUE *name)
+ rb_check_id_cstr(const char *name, long len, rb_encoding *enc)
- ID SYM2ID(VALUE symbol)
+ã‚‚ã—引数ãŒã‚·ãƒ³ãƒœãƒ«ã§ã‚‚文字列ã§ã‚‚ãªã‘れã°ã€to_strãƒ¡ã‚½ãƒƒãƒ‰ã§æ–‡
+字列ã«å¤‰æ›ã—よã†ã¨ã—ã¾ã™ï¼Žç¬¬äºŒã®é–¢æ•°ã¯ãã®å¤‰æ›çµæžœã‚’*nameã«ä¿
+å­˜ã—,ãã®åå‰ãŒæ—¢çŸ¥ã®ã‚·ãƒ³ãƒœãƒ«ã§ãªã„å ´åˆã¯0ã‚’è¿”ã—ã¾ã™ï¼Žã“ã®é–¢
+æ•°ãŒ0以外を返ã—ãŸå ´åˆã¯*nameã¯å¸¸ã«ã‚·ãƒ³ãƒœãƒ«ã‹æ–‡å­—列ã§ã‚りã€0ã‚’
+è¿”ã—ãŸå ´åˆã¯å¸¸ã«æ–‡å­—列ã§ã™ï¼Žç¬¬ä¸‰ã®é–¢æ•°ã¯Rubyã®æ–‡å­—列ã§ã¯ãªã
+NUL終端ã•れãŸCã®æ–‡å­—列を使ã„ã¾ã™ï¼Ž
-2.2.3 C¤«¤éRuby¤Î¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹
+=== Cã‹ã‚‰Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™
-C¤«¤éʸ»úÎó¤ò·Ðͳ¤»¤º¤ËRuby¤Î¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¤¿¤á¤Ë¤Ï°Ê²¼
-¤Î´Ø¿ô¤ò»È¤¤¤Þ¤¹¡¥
+Cã‹ã‚‰æ–‡å­—列を経由ã›ãšã«Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™ãŸã‚ã«ã¯ä»¥ä¸‹
+ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
VALUE rb_funcall(VALUE recv, ID mid, int argc, ...)
-¤³¤Î´Ø¿ô¤Ï¥ª¥Ö¥¸¥§¥¯¥Èrecv¤Îmid¤Ç»ØÄꤵ¤ì¤ë¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð
-¤·¤Þ¤¹¡¥¤½¤Î¾¤Ë°ú¿ô¤Î»ØÄê¤Î»ÅÊý¤¬°ã¤¦°Ê²¼¤Î´Ø¿ô¤â¤¢¤ê¤Þ¤¹¡¥
+ã“ã®é–¢æ•°ã¯ã‚ªãƒ–ジェクトrecvã®midã§æŒ‡å®šã•れるメソッドを呼ã³å‡º
+ã—ã¾ã™ï¼Žãã®ä»–ã«å¼•æ•°ã®æŒ‡å®šã®ä»•æ–¹ãŒé•ã†ä»¥ä¸‹ã®é–¢æ•°ã‚‚ã‚りã¾ã™ï¼Ž
VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
VALUE rb_apply(VALUE recv, ID mid, VALUE args)
-apply¤Ë¤Ï°ú¿ô¤È¤·¤ÆRuby¤ÎÇÛÎó¤òÍ¿¤¨¤Þ¤¹¡¥
+applyã«ã¯å¼•æ•°ã¨ã—ã¦Rubyã®é…列を与ãˆã¾ã™ï¼Ž
-2.2.4 ÊÑ¿ô/Äê¿ô¤ò»²¾È/¹¹¿·¤¹¤ë
+=== 変数/定数をå‚ç…§/æ›´æ–°ã™ã‚‹
-C¤«¤é´Ø¿ô¤ò»È¤Ã¤Æ»²¾È¡¦¹¹¿·¤Ç¤­¤ë¤Î¤Ï¡¤Äê¿ô¡¤¥¤¥ó¥¹¥¿¥ó¥¹ÊÑ
-¿ô¤Ç¤¹¡¥Âç°èÊÑ¿ô¤Ï°ìÉô¤Î¤â¤Î¤ÏC¤ÎÂç°èÊÑ¿ô¤È¤·¤Æ¥¢¥¯¥»¥¹¤Ç¤­
-¤Þ¤¹¡¥¥í¡¼¥«¥ëÊÑ¿ô¤ò»²¾È¤¹¤ëÊýË¡¤Ï¸ø³«¤·¤Æ¤¤¤Þ¤»¤ó¡¥
+Cã‹ã‚‰é–¢æ•°ã‚’使ã£ã¦å‚照・更新ã§ãã‚‹ã®ã¯ï¼Œå®šæ•°ï¼Œã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰
+æ•°ã§ã™ï¼Žå¤§åŸŸå¤‰æ•°ã¯ä¸€éƒ¨ã®ã‚‚ã®ã¯Cã®å¤§åŸŸå¤‰æ•°ã¨ã—ã¦ã‚¢ã‚¯ã‚»ã‚¹ã§ã
+ã¾ã™ï¼Žãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ã‚’å‚ç…§ã™ã‚‹æ–¹æ³•ã¯å…¬é–‹ã—ã¦ã„ã¾ã›ã‚“.
-¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¤¥ó¥¹¥¿¥ó¥¹ÊÑ¿ô¤ò»²¾È¡¦¹¹¿·¤¹¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄÌ
-¤ê¤Ç¤¹¡¥
+オブジェクトã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã‚’å‚照・更新ã™ã‚‹é–¢æ•°ã¯ä»¥ä¸‹ã®é€š
+りã§ã™ï¼Ž
VALUE rb_ivar_get(VALUE obj, ID id)
VALUE rb_ivar_set(VALUE obj, ID id, VALUE val)
-id¤Ïrb_intern()¤ÇÆÀ¤é¤ì¤ë¤â¤Î¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡¥
+idã¯rb_intern()ã§å¾—られるもã®ã‚’使ã£ã¦ãã ã•ã„.
-Äê¿ô¤ò»²¾È¤¹¤ë¤Ë¤Ï°Ê²¼¤Î´Ø¿ô¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡¥
+定数をå‚ç…§ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã£ã¦ãã ã•ã„.
VALUE rb_const_get(VALUE obj, ID id)
-Äê¿ô¤ò¿·¤·¤¯ÄêµÁ¤¹¤ë¤¿¤á¤Ë¤Ï¡Ø2.1.3 Äê¿ôÄêµÁ¡Ù¤Ç¾Ò²ð¤µ
-¤ì¤Æ¤¤¤ë´Ø¿ô¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡¥
+定数を新ã—ã定義ã™ã‚‹ãŸã‚ã«ã¯ã€Ž2.1.3 定数定義ã€ã§ç´¹ä»‹ã•
+れã¦ã„る関数を使ã£ã¦ãã ã•ã„.
-3¡¥Ruby¤ÈC¤È¤Î¾ðÊó¶¦Í­
+= Rubyã¨Cã¨ã®æƒ…報共有
-C¸À¸ì¤ÈRuby¤Î´Ö¤Ç¾ðÊó¤ò¶¦Í­¤¹¤ëÊýË¡¤Ë¤Ä¤¤¤Æ²òÀ⤷¤Þ¤¹¡¥
+C言語ã¨Rubyã®é–“ã§æƒ…報を共有ã™ã‚‹æ–¹æ³•ã«ã¤ã„ã¦è§£èª¬ã—ã¾ã™ï¼Ž
-3.1 C¤«¤é»²¾È¤Ç¤­¤ëRuby¤ÎÄê¿ô
+== Cã‹ã‚‰å‚ç…§ã§ãã‚‹Rubyã®å®šæ•°
-°Ê²¼¤ÎRuby¤ÎÄê¿ô¤ÏC¤Î¥ì¥Ù¥ë¤«¤é»²¾È¤Ç¤­¤Þ¤¹¡¥
+以下ã®Rubyã®å®šæ•°ã¯Cã®ãƒ¬ãƒ™ãƒ«ã‹ã‚‰å‚ç…§ã§ãã¾ã™ï¼Ž
Qtrue
Qfalse
- ¿¿µ¶ÃÍ¡¥Qfalse¤ÏC¸À¸ì¤Ç¤âµ¶¤È¤ß¤Ê¤µ¤ì¤Þ¤¹(¤Ä¤Þ¤ê0)¡¥
+真å½å€¤ï¼ŽQfalseã¯C言語ã§ã‚‚å½ã¨ã¿ãªã•れã¾ã™(ã¤ã¾ã‚Š0).
Qnil
- C¸À¸ì¤«¤é¸«¤¿¡Önil¡×¡¥
+C言語ã‹ã‚‰è¦‹ãŸã€Œnilã€ï¼Ž
-3.2 C¤ÈRuby¤Ç¶¦Í­¤µ¤ì¤ëÂç°èÊÑ¿ô
+== Cã¨Rubyã§å…±æœ‰ã•れる大域変数
-C¤ÈRuby¤ÇÂç°èÊÑ¿ô¤ò»È¤Ã¤Æ¾ðÊó¤ò¶¦Í­¤Ç¤­¤Þ¤¹¡¥¶¦Í­¤Ç¤­¤ëÂç°è
-ÊÑ¿ô¤Ë¤Ï¤¤¤¯¤Ä¤«¤Î¼ïÎब¤¢¤ê¤Þ¤¹¡¥¤½¤Î¤Ê¤«¤Ç¤â¤Ã¤È¤âÎɤ¯»È¤ï
-¤ì¤ë¤È»×¤ï¤ì¤ë¤Î¤Ïrb_define_variable()¤Ç¤¹¡¥
+Cã¨Rubyã§å¤§åŸŸå¤‰æ•°ã‚’使ã£ã¦æƒ…報を共有ã§ãã¾ã™ï¼Žå…±æœ‰ã§ãる大域
+変数ã«ã¯ã„ãã¤ã‹ã®ç¨®é¡žãŒã‚りã¾ã™ï¼Žãã®ãªã‹ã§ã‚‚ã£ã¨ã‚‚良ã使ã‚
+ã‚Œã‚‹ã¨æ€ã‚れるã®ã¯rb_define_variable()ã§ã™ï¼Ž
void rb_define_variable(const char *name, VALUE *var)
-¤³¤Î´Ø¿ô¤ÏRuby¤ÈC¤È¤Ç¶¦Í­¤¹¤ëÂç°èÊÑ¿ô¤òÄêµÁ¤·¤Þ¤¹¡¥ÊÑ¿ô̾¤¬
-`$'¤Ç»Ï¤Þ¤é¤Ê¤¤»þ¤Ë¤Ï¼«Æ°Åª¤ËÄɲ䵤ì¤Þ¤¹¡¥¤³¤ÎÊÑ¿ô¤ÎÃͤòÊÑ
-¹¹¤¹¤ë¤È¼«Æ°Åª¤ËRuby¤ÎÂбþ¤¹¤ëÊÑ¿ô¤ÎÃͤâÊѤï¤ê¤Þ¤¹¡¥
+ã“ã®é–¢æ•°ã¯Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹å¤§åŸŸå¤‰æ•°ã‚’定義ã—ã¾ã™ï¼Žå¤‰æ•°åãŒ
+`$'ã§å§‹ã¾ã‚‰ãªã„時ã«ã¯è‡ªå‹•çš„ã«è¿½åŠ ã•れã¾ã™ï¼Žã“ã®å¤‰æ•°ã®å€¤ã‚’変
+æ›´ã™ã‚‹ã¨è‡ªå‹•çš„ã«Rubyã®å¯¾å¿œã™ã‚‹å¤‰æ•°ã®å€¤ã‚‚変ã‚りã¾ã™ï¼Ž
-¤Þ¤¿Ruby¦¤«¤é¤Ï¹¹¿·¤Ç¤­¤Ê¤¤ÊÑ¿ô¤â¤¢¤ê¤Þ¤¹¡¥¤³¤Îread only¤Î
-ÊÑ¿ô¤Ï°Ê²¼¤Î´Ø¿ô¤ÇÄêµÁ¤·¤Þ¤¹¡¥
+ã¾ãŸRubyå´ã‹ã‚‰ã¯æ›´æ–°ã§ããªã„変数もã‚りã¾ã™ï¼Žã“ã®read onlyã®
+変数ã¯ä»¥ä¸‹ã®é–¢æ•°ã§å®šç¾©ã—ã¾ã™ï¼Ž
void rb_define_readonly_variable(const char *name, VALUE *var)
-¤³¤ì¤éÊÑ¿ô¤Î¾¤Ëhook¤ò¤Ä¤±¤¿Âç°èÊÑ¿ô¤òÄêµÁ¤Ç¤­¤Þ¤¹¡¥hookÉÕ¤­
-¤ÎÂç°èÊÑ¿ô¤Ï°Ê²¼¤Î´Ø¿ô¤òÍѤ¤¤ÆÄêµÁ¤·¤Þ¤¹¡¥hookÉÕ¤­Âç°èÊÑ¿ô¤Î
-Ãͤλ²¾È¤äÀßÄê¤Ïhook¤Ç¹Ô¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹¡¥
+ã“れら変数ã®ä»–ã«hookã‚’ã¤ã‘ãŸå¤§åŸŸå¤‰æ•°ã‚’定義ã§ãã¾ã™ï¼Žhook付ã
+ã®å¤§åŸŸå¤‰æ•°ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’用ã„ã¦å®šç¾©ã—ã¾ã™ï¼Žhook付ã大域変数ã®
+値ã®å‚照や設定ã¯hookã§è¡Œã†å¿…è¦ãŒã‚りã¾ã™ï¼Ž
void rb_define_hooked_variable(const char *name, VALUE *var,
VALUE (*getter)(), void (*setter)())
-¤³¤Î´Ø¿ô¤ÏC¤Î´Ø¿ô¤Ë¤è¤Ã¤Æhook¤Î¤Ä¤±¤é¤ì¤¿Âç°èÊÑ¿ô¤òÄêµÁ¤·¤Þ
-¤¹¡¥ÊÑ¿ô¤¬»²¾È¤µ¤ì¤¿»þ¤Ë¤Ï´Ø¿ôgetter¤¬¡¤ÊÑ¿ô¤ËÃͤ¬¥»¥Ã¥È¤µ¤ì
-¤¿»þ¤Ë¤Ï´Ø¿ôsetter¤¬¸Æ¤Ð¤ì¤ë¡¥hook¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤Ïgetter¤ä
-setter¤Ë0¤ò»ØÄꤷ¤Þ¤¹¡¥
+ã“ã®é–¢æ•°ã¯Cã®é–¢æ•°ã«ã‚ˆã£ã¦hookã®ã¤ã‘られãŸå¤§åŸŸå¤‰æ•°ã‚’定義ã—ã¾
+ã™ï¼Žå¤‰æ•°ãŒå‚ç…§ã•ã‚ŒãŸæ™‚ã«ã¯é–¢æ•°getterãŒï¼Œå¤‰æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•れ
+ãŸæ™‚ã«ã¯é–¢æ•°setterãŒå‘¼ã°ã‚Œã‚‹ï¼Žhookを指定ã—ãªã„å ´åˆã¯getterã‚„
+setterã«0を指定ã—ã¾ã™ï¼Ž
+# getterã‚‚setterã‚‚0ãªã‚‰ã°rb_define_variable()ã¨åŒã˜ã«ãªã‚‹ï¼Ž
+
+getterã¨setterã®ä»•æ§˜ã¯æ¬¡ã®é€šã‚Šã§ã™ï¼Ž
-# getter¤âsetter¤â0¤Ê¤é¤Ðrb_define_variable()¤ÈƱ¤¸¤Ë¤Ê¤ë¡¥
+ VALUE (*getter)(ID id, VALUE *var);
+ void (*setter)(VALUE val, ID id, VALUE *var);
-¤½¤ì¤«¤é¡¤C¤Î´Ø¿ô¤Ë¤è¤Ã¤Æ¼Â¸½¤µ¤ì¤ëRuby¤ÎÂç°èÊÑ¿ô¤òÄêµÁ¤¹¤ë
-´Ø¿ô¤¬¤¢¤ê¤Þ¤¹¡¥
+
+ãれã‹ã‚‰ï¼Œå¯¾å¿œã™ã‚‹Cã®å¤‰æ•°ã‚’æŒãŸãªã„Rubyã®å¤§åŸŸå¤‰æ•°ã‚’定義ã™ã‚‹
+ã“ã¨ã‚‚ã§ãã¾ã™. ãã®å¤‰æ•°ã®å€¤ã¯ãƒ•ック関数ã®ã¿ã«ã‚ˆã£ã¦å–得・設定
+ã•れã¾ã™.
void rb_define_virtual_variable(const char *name,
VALUE (*getter)(), void (*setter)())
-¤³¤Î´Ø¿ô¤Ë¤è¤Ã¤ÆÄêµÁ¤µ¤ì¤¿Ruby¤ÎÂç°èÊÑ¿ô¤¬»²¾È¤µ¤ì¤¿»þ¤Ë¤Ï
-getter¤¬¡¤ÊÑ¿ô¤ËÃͤ¬¥»¥Ã¥È¤µ¤ì¤¿»þ¤Ë¤Ïsetter¤¬¸Æ¤Ð¤ì¤Þ¤¹¡¥
+ã“ã®é–¢æ•°ã«ã‚ˆã£ã¦å®šç¾©ã•れãŸRubyã®å¤§åŸŸå¤‰æ•°ãŒå‚ç…§ã•ã‚ŒãŸæ™‚ã«ã¯
+getterãŒï¼Œå¤‰æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯setterãŒå‘¼ã°ã‚Œã¾ã™ï¼Ž
+
+getterã¨setterã®ä»•様ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼Ž
-getter¤Èsetter¤Î»ÅÍͤϰʲ¼¤ÎÄ̤ê¤Ç¤¹¡¥
+ (*getter)(ID id);
+ (*setter)(VALUE val, ID id);
- (*getter)(ID id, void *data, struct global_entry* entry);
- (*setter)(VALUE val, ID id, void *data, struct global_entry* entry);
+== Cã®ãƒ‡ãƒ¼ã‚¿ã‚’Rubyオブジェクトã«ã™ã‚‹
-3.3 C¤Î¥Ç¡¼¥¿¤òRuby¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤¹¤ë
+Cã®ä¸–界ã§å®šç¾©ã•れãŸãƒ‡ãƒ¼ã‚¿(構造体)ã‚’Rubyã®ã‚ªãƒ–ジェクトã¨ã—ã¦
+å–り扱ã„ãŸã„å ´åˆãŒã‚りãˆã¾ã™ï¼Žã“ã®ã‚ˆã†ãªå ´åˆã«ã¯ï¼ŒDataã¨ã„ã†
+Rubyオブジェクトã«Cã®æ§‹é€ ä½“(ã¸ã®ãƒã‚¤ãƒ³ã‚¿)ã‚’ãã‚‹ã‚€ã“ã¨ã§Ruby
+オブジェクトã¨ã—ã¦å–り扱ãˆã‚‹ã‚ˆã†ã«ãªã‚Šã¾ã™ï¼Ž
-C¤ÎÀ¤³¦¤ÇÄêµÁ¤µ¤ì¤¿¥Ç¡¼¥¿(¹½Â¤ÂÎ)¤òRuby¤Î¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤Æ
-¼è¤ê°·¤¤¤¿¤¤¾ì¹ç¤¬¤¢¤ê¤¨¤Þ¤¹¡¥¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï¡¤Data¤È¤¤¤¦
-Ruby¥ª¥Ö¥¸¥§¥¯¥È¤ËC¤Î¹½Â¤ÂÎ(¤Ø¤Î¥Ý¥¤¥ó¥¿)¤ò¤¯¤ë¤à¤³¤È¤ÇRuby
-¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤Æ¼è¤ê°·¤¨¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡¥
+Dataオブジェクトを生æˆã—ã¦æ§‹é€ ä½“ã‚’Rubyオブジェクトã«ã‚«ãƒ—セル
+化ã™ã‚‹ãŸã‚ã«ã¯ï¼Œä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ã‚’使ã„ã¾ã™ï¼Ž
-Data¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®¤·¤Æ¹½Â¤ÂΤòRuby¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥«¥×¥»¥ë
-²½¤¹¤ë¤¿¤á¤Ë¤Ï¡¤°Ê²¼¤Î¥Þ¥¯¥í¤ò»È¤¤¤Þ¤¹¡¥
+ Data_Wrap_Struct(klass, mark, free, sval)
- Data_Wrap_Struct(klass, mark, free, ptr)
+ã“ã®ãƒžã‚¯ãƒ­ã®æˆ»ã‚Šå€¤ã¯ç”Ÿæˆã•れãŸDataオブジェクトã§ã™ï¼Ž
-¤³¤Î¥Þ¥¯¥í¤ÎÌá¤êÃͤÏÀ¸À®¤µ¤ì¤¿Data¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¹¡¥
+klassã¯ã“ã®Dataオブジェクトã®ã‚¯ãƒ©ã‚¹ã§ã™ï¼Žptrã¯ã‚«ãƒ—セル化ã™ã‚‹
+Cã®æ§‹é€ ä½“ã¸ã®ãƒã‚¤ãƒ³ã‚¿ã§ã™ï¼Žmarkã¯ã“ã®æ§‹é€ ä½“ãŒRubyã®ã‚ªãƒ–ジェ
+クトã¸ã®å‚ç…§ãŒã‚る時ã«ä½¿ã†é–¢æ•°ã§ã™ï¼Žãã®ã‚ˆã†ãªå‚ç…§ã‚’å«ã¾ãªã„
+時ã«ã¯0を指定ã—ã¾ã™ï¼Ž
-klass¤Ï¤³¤ÎData¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¯¥é¥¹¤Ç¤¹¡¥ptr¤Ï¥«¥×¥»¥ë²½¤¹¤ë
-C¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¹¡¥mark¤Ï¤³¤Î¹½Â¤ÂΤ¬Ruby¤Î¥ª¥Ö¥¸¥§
-¥¯¥È¤Ø¤Î»²¾È¤¬¤¢¤ë»þ¤Ë»È¤¦´Ø¿ô¤Ç¤¹¡¥¤½¤Î¤è¤¦¤Ê»²¾È¤ò´Þ¤Þ¤Ê¤¤
-»þ¤Ë¤Ï0¤ò»ØÄꤷ¤Þ¤¹¡¥
+# ãã®ã‚ˆã†ãªå‚ç…§ã¯å‹§ã‚られã¾ã›ã‚“.
-# ¤½¤Î¤è¤¦¤Ê»²¾È¤Ï´«¤á¤é¤ì¤Þ¤»¤ó¡¥
+freeã¯ã“ã®æ§‹é€ ä½“ãŒã‚‚ã†ä¸è¦ã«ãªã£ãŸæ™‚ã«å‘¼ã°ã‚Œã‚‹é–¢æ•°ã§ã™ï¼Žã“ã®
+関数ãŒã‚¬ãƒ¼ãƒ™ãƒ¼ã‚¸ã‚³ãƒ¬ã‚¯ã‚¿ã‹ã‚‰å‘¼ã°ã‚Œã¾ã™ï¼Žã“れãŒ-1ã®å ´åˆã¯ï¼Œå˜
+ç´”ã«é–‹æ”¾ã•れã¾ã™ï¼Ž
-free¤Ï¤³¤Î¹½Â¤ÂΤ¬¤â¤¦ÉÔÍפˤʤä¿»þ¤Ë¸Æ¤Ð¤ì¤ë´Ø¿ô¤Ç¤¹¡¥¤³¤Î
-´Ø¿ô¤¬¥¬¡¼¥Ù¡¼¥¸¥³¥ì¥¯¥¿¤«¤é¸Æ¤Ð¤ì¤Þ¤¹¡¥¤³¤ì¤¬-1¤Î¾ì¹ç¤Ï¡¤Ã±
-½ã¤Ë³«Êü¤µ¤ì¤Þ¤¹¡¥
+markãŠã‚ˆã³free関数ã¯GC実行中ã«å‘¼ã³å‡ºã•れã¾ã™.
+ãªãŠ, GC実行中ã¯Rubyオブジェクトã®ã‚¢ãƒ­ã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã¯ç¦æ­¢ã•れã¾
+ã™. よã£ã¦, markãŠã‚ˆã³free関数ã§Rubyオブジェクトã®ã‚¢ãƒ­ã‚±ãƒ¼ã‚·
+ョンã¯è¡Œã‚ãªã„ã§ãã ã•ã„.
-C¤Î¹½Â¤ÂΤγäÅö¤ÈData¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀ¸À®¤òƱ»þ¤Ë¹Ô¤¦¥Þ¥¯¥í¤È
-¤·¤Æ°Ê²¼¤Î¤â¤Î¤¬Ä󶡤µ¤ì¤Æ¤¤¤Þ¤¹¡¥
+Cã®æ§‹é€ ä½“ã®å‰²å½“ã¨Dataオブジェクトã®ç”Ÿæˆã‚’åŒæ™‚ã«è¡Œã†ãƒžã‚¯ãƒ­ã¨
+ã—ã¦ä»¥ä¸‹ã®ã‚‚ã®ãŒæä¾›ã•れã¦ã„ã¾ã™ï¼Ž
Data_Make_Struct(klass, type, mark, free, sval)
-¤³¤Î¥Þ¥¯¥í¤ÎÌá¤êÃͤÏÀ¸À®¤µ¤ì¤¿Data¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¹¡¥
+ã“ã®ãƒžã‚¯ãƒ­ã®æˆ»ã‚Šå€¤ã¯ç”Ÿæˆã•れãŸDataオブジェクトã§ã™ï¼Ž
-klass, mark, free¤ÏData_Wrap_Struct¤ÈƱ¤¸Æ¯¤­¤ò¤·¤Þ¤¹¡¥type
-¤Ï³ä¤êÅö¤Æ¤ëC¹½Â¤ÂΤη¿¤Ç¤¹¡¥³ä¤êÅö¤Æ¤é¤ì¤¿¹½Â¤ÂΤÏÊÑ¿ôsval
-¤ËÂåÆþ¤µ¤ì¤Þ¤¹¡¥¤³¤ÎÊÑ¿ô¤Î·¿¤Ï (type*) ¤Ç¤¢¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥
+klass, mark, freeã¯Data_Wrap_Structã¨åŒã˜åƒãã‚’ã—ã¾ã™ï¼Žtype
+ã¯å‰²ã‚Šå½“ã¦ã‚‹C構造体ã®åž‹ã§ã™ï¼Žå‰²ã‚Šå½“ã¦ã‚‰ã‚ŒãŸæ§‹é€ ä½“ã¯å¤‰æ•°sval
+ã«ä»£å…¥ã•れã¾ã™ï¼Žã“ã®å¤‰æ•°ã®åž‹ã¯ (type*) ã§ã‚ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Ž
-Data¥ª¥Ö¥¸¥§¥¯¥È¤«¤é¥Ý¥¤¥ó¥¿¤ò¼è¤ê½Ð¤¹¤Î¤Ï°Ê²¼¤Î¥Þ¥¯¥í¤òÍѤ¤
-¤Þ¤¹¡¥
+Dataオブジェクトã‹ã‚‰ãƒã‚¤ãƒ³ã‚¿ã‚’å–り出ã™ã®ã¯ä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ã‚’用ã„
+ã¾ã™ï¼Ž
Data_Get_Struct(obj, type, sval)
-C¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ÏÊÑ¿ôsval¤ËÂåÆþ¤µ¤ì¤Þ¤¹¡¥
+Cã®æ§‹é€ ä½“ã¸ã®ãƒã‚¤ãƒ³ã‚¿ã¯å¤‰æ•°svalã«ä»£å…¥ã•れã¾ã™ï¼Ž
-¤³¤ì¤é¤ÎData¤Î»È¤¤Êý¤Ï¤Á¤ç¤Ã¤Èʬ¤«¤ê¤Ë¤¯¤¤¤Î¤Ç¡¤¸å¤ÇÀâÌÀ¤¹¤ë
-ÎãÂê¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥
+ã“れらã®Dataã®ä½¿ã„æ–¹ã¯ã¡ã‚‡ã£ã¨åˆ†ã‹ã‚Šã«ãã„ã®ã§ï¼Œå¾Œã§èª¬æ˜Žã™ã‚‹
+例題をå‚ç…§ã—ã¦ãã ã•ã„.
-4¡¥ÎãÂê - dbm¥Ñ¥Ã¥±¡¼¥¸¤òºî¤ë
+= 例題 - dbmパッケージを作る
-¤³¤³¤Þ¤Ç¤ÎÀâÌÀ¤Ç¤È¤ê¤¢¤¨¤º³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤Ïºî¤ì¤ë¤Ï¤º¤Ç¤¹¡¥
-Ruby¤Îext¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¹¤Ç¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ëdbm¥é¥¤¥Ö¥é¥ê¤òÎã¤Ë
-¤·¤ÆÃʳ¬Åª¤ËÀâÌÀ¤·¤Þ¤¹¡¥
+ã“ã“ã¾ã§ã®èª¬æ˜Žã§ã¨ã‚Šã‚ãˆãšæ‹¡å¼µãƒ©ã‚¤ãƒ–ãƒ©ãƒªã¯ä½œã‚Œã‚‹ã¯ãšã§ã™ï¼Ž
+Rubyã®extディレクトリã«ã™ã§ã«å«ã¾ã‚Œã¦ã„ã‚‹dbmライブラリを例ã«
+ã—ã¦æ®µéšŽçš„ã«èª¬æ˜Žã—ã¾ã™ï¼Ž
-(1) ¥Ç¥£¥ì¥¯¥È¥ê¤òºî¤ë
+== ディレクトリを作る
% mkdir ext/dbm
-Ruby 1.1¤«¤é¤ÏǤ°Õ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç¥À¥¤¥Ê¥ß¥Ã¥¯¥é¥¤¥Ö¥é¥ê¤òºî
-¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡¥Ruby¤ËÀÅŪ¤Ë¥ê¥ó¥¯¤¹¤ë¾ì¹ç¤Ë
-¤ÏRuby¤òŸ³«¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î²¼¡¤ext¥Ç¥£¥ì¥¯¥È¥ê¤ÎÃæ¤Ë³ÈÄ¥
-¥é¥¤¥Ö¥é¥êÍѤΥǥ£¥ì¥¯¥È¥ê¤òºî¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥Ì¾Á°¤ÏŬÅö¤Ë
-Áª¤ó¤Ç¹½¤¤¤Þ¤»¤ó¡¥
-
-(2) À߷פ¹¤ë
-
-¤Þ¤¢¡¤ÅöÁ³¤Ê¤ó¤Ç¤¹¤±¤É¡¤¤É¤¦¤¤¤¦µ¡Ç½¤ò¼Â¸½¤¹¤ë¤«¤É¤¦¤«¤Þ¤ºÀß
-·×¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥¤É¤ó¤Ê¥¯¥é¥¹¤ò¤Ä¤¯¤ë¤«¡¤¤½¤Î¥¯¥é¥¹¤Ë¤Ï
-¤É¤ó¤Ê¥á¥½¥Ã¥É¤¬¤¢¤ë¤«¡¤¥¯¥é¥¹¤¬Ä󶡤¹¤ëÄê¿ô¤Ê¤É¤Ë¤Ä¤¤¤ÆÀß·×
-¤·¤Þ¤¹¡¥
-
-(3) C¥³¡¼¥É¤ò½ñ¤¯
-
-³ÈÄ¥¥é¥¤¥Ö¥é¥êËÜÂΤȤʤëC¸À¸ì¤Î¥½¡¼¥¹¤ò½ñ¤­¤Þ¤¹¡¥C¸À¸ì¤Î¥½¡¼
-¥¹¤¬¤Ò¤È¤Ä¤Î»þ¤Ë¤Ï¡Ö¥é¥¤¥Ö¥é¥ê̾.c¡×¤òÁª¤Ö¤ÈÎɤ¤¤Ç¤·¤ç¤¦¡¥C
-¸À¸ì¤Î¥½¡¼¥¹¤¬Ê£¿ô¤Î¾ì¹ç¤Ë¤ÏµÕ¤Ë¡Ö¥é¥¤¥Ö¥é¥ê̾.c¡×¤È¤¤¤¦¥Õ¥¡
-¥¤¥ë̾¤ÏÈò¤±¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤È¥â¥¸¥å¡¼
-¥ëÀ¸À®»þ¤ËÃæ´ÖŪ¤ËÀ¸À®¤µ¤ì¤ë¡Ö¥é¥¤¥Ö¥é¥ê̾.o¡×¤È¤¤¤¦¥Õ¥¡¥¤¥ë
-¤È¤¬¾×ÆÍ¤¹¤ë¤«¤é¤Ç¤¹¡¥
-
-Ruby¤Ï³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤¹¤ë»þ¤Ë¡ÖInit_¥é¥¤¥Ö¥é¥ê̾¡×¤È
-¤¤¤¦´Ø¿ô¤ò¼«Æ°Åª¤Ë¼Â¹Ô¤·¤Þ¤¹¡¥dbm¥é¥¤¥Ö¥é¥ê¤Î¾ì¹ç¡ÖInit_dbm¡×
-¤Ç¤¹¡¥¤³¤Î´Ø¿ô¤ÎÃæ¤Ç¥¯¥é¥¹¡¤¥â¥¸¥å¡¼¥ë¡¤¥á¥½¥Ã¥É¡¤Äê¿ô¤Ê¤É¤Î
-ÄêµÁ¤ò¹Ô¤¤¤Þ¤¹¡¥dbm.c¤«¤é°ìÉô°úÍѤ·¤Þ¤¹¡¥
-
---
-Init_dbm()
-{
- /* DBM¥¯¥é¥¹¤òÄêµÁ¤¹¤ë */
- cDBM = rb_define_class("DBM", rb_cObject);
- /* DBM¤ÏEnumerate¥â¥¸¥å¡¼¥ë¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë */
- rb_include_module(cDBM, rb_mEnumerable);
-
- /* DBM¥¯¥é¥¹¤Î¥¯¥é¥¹¥á¥½¥Ã¥Éopen(): °ú¿ô¤ÏC¤ÎÇÛÎó¤Ç¼õ¤±¤ë */
- rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1);
-
- /* DBM¥¯¥é¥¹¤Î¥á¥½¥Ã¥Éclose(): °ú¿ô¤Ï¤Ê¤· */
- rb_define_method(cDBM, "close", fdbm_close, 0);
- /* DBM¥¯¥é¥¹¤Î¥á¥½¥Ã¥É[]: °ú¿ô¤Ï1¸Ä */
- rb_define_method(cDBM, "[]", fdbm_fetch, 1);
- :
-
- /* DBM¥Ç¡¼¥¿¤ò³ÊǼ¤¹¤ë¥¤¥ó¥¹¥¿¥ó¥¹ÊÑ¿ô̾¤Î¤¿¤á¤ÎID */
- id_dbm = rb_intern("dbm");
-}
---
-
-DBM¥é¥¤¥Ö¥é¥ê¤Ïdbm¤Î¥Ç¡¼¥¿¤ÈÂбþ¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ê¤ë¤Ï¤º¤Ç
-¤¹¤«¤é¡¤C¤ÎÀ¤³¦¤Îdbm¤òRuby¤ÎÀ¤³¦¤Ë¼è¤ê¹þ¤àɬÍפ¬¤¢¤ê¤Þ¤¹¡¥
-
-
-dbm.c¤Ç¤ÏData_Make_Struct¤ò°Ê²¼¤Î¤è¤¦¤Ë»È¤Ã¤Æ¤¤¤Þ¤¹¡¥
-
---
-struct dbmdata {
- int di_size;
- DBM *di_dbm;
-};
-
-
-obj = Data_Make_Struct(klass, struct dbmdata, 0, free_dbm, dbmp);
---
-
-¤³¤³¤Ç¤Ïdbmstruct¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òData¤Ë¥«¥×¥»¥ë²½¤·¤Æ¤¤
-¤Þ¤¹¡¥DBM*¤òľÀÜ¥«¥×¥»¥ë²½¤·¤Ê¤¤¤Î¤Ïclose()¤·¤¿»þ¤Î½èÍý¤ò¹Í
-¤¨¤Æ¤Î¤³¤È¤Ç¤¹¡¥
-
-Data¥ª¥Ö¥¸¥§¥¯¥È¤«¤édbmstruct¹½Â¤ÂΤΥݥ¤¥ó¥¿¤ò¼è¤ê½Ð¤¹¤¿¤á
-¤Ë°Ê²¼¤Î¥Þ¥¯¥í¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡¥
-
---
-#define GetDBM(obj, dbmp) {\
- Data_Get_Struct(obj, struct dbmdata, dbmp);\
- if (dbmp->di_dbm == 0) closed_dbm();\
-}
---
-
-¤Á¤ç¤Ã¤ÈÊ£»¨¤Ê¥Þ¥¯¥í¤Ç¤¹¤¬¡¤Íפ¹¤ë¤Ëdbmdata¹½Â¤ÂΤΥݥ¤¥ó¥¿
-¤Î¼è¤ê½Ð¤·¤È¡¤close¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯¤ò¤Þ¤È¤á¤Æ¤¤
-¤ë¤À¤±¤Ç¤¹¡¥
-
-DBM¥¯¥é¥¹¤Ë¤Ï¤¿¤¯¤µ¤ó¥á¥½¥Ã¥É¤¬¤¢¤ê¤Þ¤¹¤¬¡¤Ê¬Îह¤ë¤È3¼ïÎà¤Î
-°ú¿ô¤Î¼õ¤±Êý¤¬¤¢¤ê¤Þ¤¹¡¥¤Ò¤È¤Ä¤Ï°ú¿ô¤Î¿ô¤¬¸ÇÄê¤Î¤â¤Î¤Ç¡¤Îã¤È
-¤·¤Æ¤Ïdelete¥á¥½¥Ã¥É¤¬¤¢¤ê¤Þ¤¹¡¥delete¥á¥½¥Ã¥É¤ò¼ÂÁõ¤·¤Æ¤¤¤ë
-fdbm_delete()¤Ï¤³¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡¥
-
---
-static VALUE
-fdbm_delete(obj, keystr)
- VALUE obj, keystr;
-{
- :
-}
---
-
-°ú¿ô¤Î¿ô¤¬¸ÇÄê¤Î¥¿¥¤¥×¤ÏÂè1°ú¿ô¤¬self¡¤Âè2°ú¿ô°Ê¹ß¤¬¥á¥½¥Ã¥É
-¤Î°ú¿ô¤È¤Ê¤ê¤Þ¤¹¡¥
-
-°ú¿ô¤Î¿ô¤¬ÉÔÄê¤Î¤â¤Î¤ÏC¤ÎÇÛÎó¤Ç¼õ¤±¤ë¤â¤Î¤ÈRuby¤ÎÇÛÎó¤Ç¼õ¤±
-¤ë¤â¤Î¤È¤¬¤¢¤ê¤Þ¤¹¡¥dbm¥é¥¤¥Ö¥é¥ê¤ÎÃæ¤Ç¡¤C¤ÎÇÛÎó¤Ç¼õ¤±¤ë¤â¤Î
-¤ÏDBM¤Î¥¯¥é¥¹¥á¥½¥Ã¥É¤Ç¤¢¤ëopen()¤Ç¤¹¡¥¤³¤ì¤ò¼ÂÁõ¤·¤Æ¤¤¤ë´Ø
-¿ôfdbm_s_open()¤Ï¤³¤¦¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡¥
-
---
-static VALUE
-fdbm_s_open(argc, argv, klass)
- int argc;
- VALUE *argv;
- VALUE klass;
-{
- :
- if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
- mode = 0666; /* default value */
- }
- :
-}
---
-
-¤³¤Î¥¿¥¤¥×¤Î´Ø¿ô¤ÏÂè1°ú¿ô¤¬Í¿¤¨¤é¤ì¤¿°ú¿ô¤Î¿ô¡¤Âè2°ú¿ô¤¬Í¿¤¨
-¤é¤ì¤¿°ú¿ô¤ÎÆþ¤Ã¤Æ¤¤¤ëÇÛÎó¤Ë¤Ê¤ê¤Þ¤¹¡¥self¤ÏÂè3°ú¿ô¤È¤·¤ÆÍ¿
-¤¨¤é¤ì¤Þ¤¹¡¥
-
-¤³¤ÎÇÛÎó¤ÇÍ¿¤¨¤é¤ì¤¿°ú¿ô¤ò²òÀϤ¹¤ë¤¿¤á¤Î´Ø¿ô¤¬open()¤Ç¤â»È¤ï
-¤ì¤Æ¤¤¤ërb_scan_args()¤Ç¤¹¡¥Âè3°ú¿ô¤Ë»ØÄꤷ¤¿¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë
-½¾¤¤¡¤Âè4ÊÑ¿ô°Ê¹ß¤Ë»ØÄꤷ¤¿ÊÑ¿ô¤ËÃͤòÂåÆþ¤·¤Æ¤¯¤ì¤Þ¤¹¡¥¤³¤Î
-¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¤Âè1ʸ»úÌܤ¬¾Êά¤Ç¤­¤Ê¤¤°ú¿ô¤Î¿ô¡¤Âè2ʸ»úÌܤ¬
-¾Êά¤Ç¤­¤ë°ú¿ô¤Î¿ô¡¤Âè3ʸ»úÌܤ¬Âбþ¤¹¤ëÁê¼ê¤¬Ìµ¤¤¤¢¤Þ¤ê¤Î°ú
-¿ô¤¬¤¢¤ë¤«¤É¤¦¤«¤ò¼¨¤¹"*"¤Ç¤¹¡¥2ʸ»úÌܤÈ3ʸ»úÌܤϾÊά¤Ç¤­¤Þ
-¤¹¡¥dbm.c¤ÎÎã¤Ç¤Ï¡¤¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï"11"¤Ç¤¹¤«¤é¡¤°ú¿ô¤ÏºÇÄã1¤Ä
-¤Ç¡¤2¤Ä¤Þ¤Çµö¤µ¤ì¤ë¤È¤¤¤¦°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡¥¾Êά¤µ¤ì¤Æ¤¤¤ë»þ¤Î
-ÊÑ¿ô¤ÎÃͤÏnil(C¸À¸ì¤Î¥ì¥Ù¥ë¤Ç¤ÏQnil)¤Ë¤Ê¤ê¤Þ¤¹¡¥
-
-Ruby¤ÎÇÛÎó¤Ç°ú¿ô¤ò¼õ¤±¼è¤ë¤â¤Î¤Ïindexes¤¬¤¢¤ê¤Þ¤¹¡¥¼ÂÁõ¤Ï¤³
-¤¦¤Ç¤¹¡¥
-
---
-static VALUE
-fdbm_indexes(obj, args)
- VALUE obj, args;
-{
- :
-}
---
-
-Âè1°ú¿ô¤Ïself¡¤Âè2°ú¿ô¤ÏRuby¤ÎÇÛÎó¤Ç¤¹¡¥
-
-** Ãí°Õ»ö¹à
-
-Ruby¤È¶¦Í­¤Ï¤·¤Ê¤¤¤¬Ruby¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò³ÊǼ¤¹¤ë²ÄǽÀ­¤Î¤¢¤ë
-C¤ÎÂç°èÊÑ¿ô¤Ï°Ê²¼¤Î´Ø¿ô¤ò»È¤Ã¤ÆRuby¥¤¥ó¥¿¥×¥ê¥¿¤ËÊÑ¿ô¤Î¸ºß
-¤ò¶µ¤¨¤Æ¤¢¤²¤Æ¤¯¤À¤µ¤¤¡¥¤Ç¤Ê¤¤¤ÈGC¤Ç¥È¥é¥Ö¥ë¤òµ¯¤³¤·¤Þ¤¹¡¥
+Ruby 1.1ã‹ã‚‰ã¯ä»»æ„ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã§ãƒ€ã‚¤ãƒŠãƒŸãƒƒã‚¯ãƒ©ã‚¤ãƒ–ラリを作
+ã‚‹ã“ã¨ãŒã§ãるよã†ã«ãªã‚Šã¾ã—ãŸï¼ŽRubyã«é™çš„ã«ãƒªãƒ³ã‚¯ã™ã‚‹å ´åˆã«
+ã¯Rubyを展開ã—ãŸãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®ä¸‹ï¼Œextディレクトリã®ä¸­ã«æ‹¡å¼µ
+ライブラリ用ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’作る必è¦ãŒã‚りã¾ã™ï¼Žåå‰ã¯é©å½“ã«
+é¸ã‚“ã§æ§‹ã„ã¾ã›ã‚“.
+
+== 設計ã™ã‚‹
+
+ã¾ã‚,当然ãªã‚“ã§ã™ã‘ã©ï¼Œã©ã†ã„ã†æ©Ÿèƒ½ã‚’実ç¾ã™ã‚‹ã‹ã©ã†ã‹ã¾ãšè¨­
+計ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Žã©ã‚“ãªã‚¯ãƒ©ã‚¹ã‚’ã¤ãã‚‹ã‹ï¼Œãã®ã‚¯ãƒ©ã‚¹ã«ã¯
+ã©ã‚“ãªãƒ¡ã‚½ãƒƒãƒ‰ãŒã‚ã‚‹ã‹ï¼Œã‚¯ãƒ©ã‚¹ãŒæä¾›ã™ã‚‹å®šæ•°ãªã©ã«ã¤ã„ã¦è¨­è¨ˆ
+ã—ã¾ã™ï¼Ž
+
+== Cコードを書ã
+
+拡張ライブラリ本体ã¨ãªã‚‹C言語ã®ã‚½ãƒ¼ã‚¹ã‚’書ãã¾ã™ï¼ŽC言語ã®ã‚½ãƒ¼
+スãŒã²ã¨ã¤ã®æ™‚ã«ã¯ã€Œãƒ©ã‚¤ãƒ–ラリå.cã€ã‚’é¸ã¶ã¨è‰¯ã„ã§ã—ょã†ï¼ŽC
+言語ã®ã‚½ãƒ¼ã‚¹ãŒè¤‡æ•°ã®å ´åˆã«ã¯é€†ã«ã€Œãƒ©ã‚¤ãƒ–ラリå.cã€ã¨ã„ã†ãƒ•ã‚¡
+イルåã¯é¿ã‘ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Žã‚ªãƒ–ジェクトファイルã¨ãƒ¢ã‚¸ãƒ¥ãƒ¼
+ãƒ«ç”Ÿæˆæ™‚ã«ä¸­é–“çš„ã«ç”Ÿæˆã•れる「ライブラリå.oã€ã¨ã„ã†ãƒ•ァイル
+ã¨ãŒè¡çªã™ã‚‹ã‹ã‚‰ã§ã™ï¼Žã¾ãŸï¼Œå¾Œè¿°ã™ã‚‹ mkmf ライブラリã®ã„ãã¤
+ã‹ã®é–¢æ•°ãŒã‚³ãƒ³ãƒ‘イルをè¦ã™ã‚‹ãƒ†ã‚¹ãƒˆã®ãŸã‚ã«ã€Œconftest.cã€ã¨ã„
+ã†ãƒ•ァイルåを使用ã™ã‚‹ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„.ソースファイル
+åã¨ã—ã¦ã€Œconftest.cã€ã‚’使用ã—ã¦ã¯ãªã‚Šã¾ã›ã‚“.
+
+Rubyã¯æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリをロードã™ã‚‹æ™‚ã«ã€ŒInit_ライブラリåã€ã¨
+ã„ã†é–¢æ•°ã‚’自動的ã«å®Ÿè¡Œã—ã¾ã™ï¼Ždbmライブラリã®å ´åˆã€ŒInit_dbmã€
+ã§ã™ï¼Žã“ã®é–¢æ•°ã®ä¸­ã§ã‚¯ãƒ©ã‚¹ï¼Œãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ï¼Œãƒ¡ã‚½ãƒƒãƒ‰ï¼Œå®šæ•°ãªã©ã®
+定義を行ã„ã¾ã™ï¼Ždbm.cã‹ã‚‰ä¸€éƒ¨å¼•用ã—ã¾ã™ï¼Ž
+
+ void
+ Init_dbm(void)
+ {
+ /* DBMクラスを定義ã™ã‚‹ */
+ cDBM = rb_define_class("DBM", rb_cObject);
+ /* DBMã¯Enumerateモジュールをインクルードã™ã‚‹ */
+ rb_include_module(cDBM, rb_mEnumerable);
+
+ /* DBMクラスã®ã‚¯ãƒ©ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰open(): 引数ã¯Cã®é…列ã§å—ã‘ã‚‹ */
+ rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1);
+
+ /* DBMクラスã®ãƒ¡ã‚½ãƒƒãƒ‰close(): 引数ã¯ãªã— */
+ rb_define_method(cDBM, "close", fdbm_close, 0);
+ /* DBMクラスã®ãƒ¡ã‚½ãƒƒãƒ‰[]: 引数ã¯1個 */
+ rb_define_method(cDBM, "[]", fdbm_fetch, 1);
+
+ /* ... */
+
+ /* DBMデータを格ç´ã™ã‚‹ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°åã®ãŸã‚ã®ID */
+ id_dbm = rb_intern("dbm");
+ }
+
+DBMライブラリã¯dbmã®ãƒ‡ãƒ¼ã‚¿ã¨å¯¾å¿œã™ã‚‹ã‚ªãƒ–ジェクトã«ãªã‚‹ã¯ãšã§
+ã™ã‹ã‚‰ï¼ŒCã®ä¸–界ã®dbmã‚’Rubyã®ä¸–界ã«å–り込む必è¦ãŒã‚りã¾ã™ï¼Ž
+
+dbm.cã§ã¯Data_Make_Structを以下ã®ã‚ˆã†ã«ä½¿ã£ã¦ã„ã¾ã™ï¼Ž
+
+ struct dbmdata {
+ int di_size;
+ DBM *di_dbm;
+ };
+
+
+ obj = Data_Make_Struct(klass, struct dbmdata, 0, free_dbm, dbmp);
+
+ã“ã“ã§ã¯dbmstruct構造体ã¸ã®ãƒã‚¤ãƒ³ã‚¿ã‚’Dataã«ã‚«ãƒ—セル化ã—ã¦ã„
+ã¾ã™ï¼ŽDBM*を直接カプセル化ã—ãªã„ã®ã¯close()ã—ãŸæ™‚ã®å‡¦ç†ã‚’考
+ãˆã¦ã®ã“ã¨ã§ã™ï¼Ž
+
+Dataオブジェクトã‹ã‚‰dbmstruct構造体ã®ãƒã‚¤ãƒ³ã‚¿ã‚’å–り出ã™ãŸã‚
+ã«ä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ã‚’使ã£ã¦ã„ã¾ã™ï¼Ž
+
+ #define GetDBM(obj, dbmp) {\
+ Data_Get_Struct(obj, struct dbmdata, dbmp);\
+ if (dbmp->di_dbm == 0) closed_dbm();\
+ }
+
+ã¡ã‚‡ã£ã¨è¤‡é›‘ãªãƒžã‚¯ãƒ­ã§ã™ãŒï¼Œè¦ã™ã‚‹ã«dbmdata構造体ã®ãƒã‚¤ãƒ³ã‚¿
+ã®å–り出ã—ã¨ï¼Œcloseã•れã¦ã„ã‚‹ã‹ã©ã†ã‹ã®ãƒã‚§ãƒƒã‚¯ã‚’ã¾ã¨ã‚ã¦ã„
+ã‚‹ã ã‘ã§ã™ï¼Ž
+
+DBMクラスã«ã¯ãŸãã•んメソッドãŒã‚りã¾ã™ãŒï¼Œåˆ†é¡žã™ã‚‹ã¨3種類ã®
+引数ã®å—ã‘æ–¹ãŒã‚りã¾ã™ï¼Žã²ã¨ã¤ã¯å¼•æ•°ã®æ•°ãŒå›ºå®šã®ã‚‚ã®ã§ï¼Œä¾‹ã¨
+ã—ã¦ã¯deleteメソッドãŒã‚りã¾ã™ï¼Ždeleteメソッドを実装ã—ã¦ã„ã‚‹
+fdbm_delete()ã¯ã“ã®ã‚ˆã†ã«ãªã£ã¦ã„ã¾ã™ï¼Ž
+
+ static VALUE
+ fdbm_delete(VALUE obj, VALUE keystr)
+ {
+ /* ... */
+ }
+
+å¼•æ•°ã®æ•°ãŒå›ºå®šã®ã‚¿ã‚¤ãƒ—ã¯ç¬¬1引数ãŒself,第2引数以é™ãŒãƒ¡ã‚½ãƒƒãƒ‰
+ã®å¼•æ•°ã¨ãªã‚Šã¾ã™ï¼Ž
+
+å¼•æ•°ã®æ•°ãŒä¸å®šã®ã‚‚ã®ã¯Cã®é…列ã§å—ã‘ã‚‹ã‚‚ã®ã¨Rubyã®é…列ã§å—ã‘
+ã‚‹ã‚‚ã®ã¨ãŒã‚りã¾ã™ï¼Ždbmライブラリã®ä¸­ã§ï¼ŒCã®é…列ã§å—ã‘ã‚‹ã‚‚ã®
+ã¯DBMã®ã‚¯ãƒ©ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚ã‚‹open()ã§ã™ï¼Žã“れを実装ã—ã¦ã„ã‚‹é–¢
+æ•°fdbm_s_open()ã¯ã“ã†ãªã£ã¦ã„ã¾ã™ï¼Ž
+
+ static VALUE
+ fdbm_s_open(int argc, VALUE *argv, VALUE klass)
+ {
+ /* ... */
+
+ if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
+ mode = 0666; /* default value */
+ }
+
+ /* ... */
+ }
+
+ã“ã®ã‚¿ã‚¤ãƒ—ã®é–¢æ•°ã¯ç¬¬1引数ãŒä¸Žãˆã‚‰ã‚ŒãŸå¼•æ•°ã®æ•°ï¼Œç¬¬2引数ãŒä¸Žãˆ
+られãŸå¼•æ•°ã®å…¥ã£ã¦ã„ã‚‹é…列ã«ãªã‚Šã¾ã™ï¼Žselfã¯ç¬¬3引数ã¨ã—ã¦ä¸Ž
+ãˆã‚‰ã‚Œã¾ã™ï¼Ž
+
+ã“ã®é…列ã§ä¸Žãˆã‚‰ã‚ŒãŸå¼•æ•°ã‚’è§£æžã™ã‚‹ãŸã‚ã®é–¢æ•°ãŒopen()ã§ã‚‚使ã‚
+れã¦ã„ã‚‹rb_scan_args()ã§ã™ï¼Žç¬¬3å¼•æ•°ã«æŒ‡å®šã—ãŸãƒ•ォーマットã«å¾“
+ã„,第4変数以é™ã«æŒ‡å®šã—ãŸVALUEã¸ã®å‚ç…§ã«å€¤ã‚’代入ã—ã¦ãれã¾
+ã™ï¼Ž
+
+
+引数をRubyã®é…列ã¨ã—ã¦å—ã‘å–るメソッドã®ä¾‹ã«ã¯
+Thread#initializeãŒã‚りã¾ã™ï¼Žå®Ÿè£…ã¯ã“ã†ã§ã™ï¼Ž
+
+ static VALUE
+ thread_initialize(VALUE thread, VALUE args)
+ {
+ /* ... */
+ }
+
+第1引数ã¯self,第2引数ã¯Rubyã®é…列ã§ã™ï¼Ž
+
+*注æ„事項*
+
+Rubyã¨å…±æœ‰ã¯ã—ãªã„ãŒRubyã®ã‚ªãƒ–ジェクトを格ç´ã™ã‚‹å¯èƒ½æ€§ã®ã‚ã‚‹
+Cã®å¤§åŸŸå¤‰æ•°ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã£ã¦Rubyインタプリタã«å¤‰æ•°ã®å­˜åœ¨
+ã‚’æ•™ãˆã¦ã‚ã’ã¦ãã ã•ã„.ã§ãªã„ã¨GCã§ãƒˆãƒ©ãƒ–ルを起ã“ã—ã¾ã™ï¼Ž
void rb_global_variable(VALUE *var)
-(4) extconf.rb¤òÍѰդ¹¤ë
+== extconf.rbを用æ„ã™ã‚‹
-Makefile¤òºî¤ë¾ì¹ç¤Î¿÷·¿¤Ë¤Ê¤ëextconf.rb¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤òºî¤ê
-¤Þ¤¹¡¥extconf.rb¤Ï¥é¥¤¥Ö¥é¥ê¤Î¥³¥ó¥Ñ¥¤¥ë¤ËɬÍפʾò·ï¤Î¥Á¥§¥Ã
-¥¯¤Ê¤É¤ò¹Ô¤¦¤³¤È¤¬ÌÜŪ¤Ç¤¹¡¥¤Þ¤º¡¤
+Makefileを作る場åˆã®é››åž‹ã«ãªã‚‹extconf.rbã¨ã„ã†ãƒ•ァイルを作り
+ã¾ã™ï¼Žextconf.rbã¯ãƒ©ã‚¤ãƒ–ラリã®ã‚³ãƒ³ãƒ‘イルã«å¿…è¦ãªæ¡ä»¶ã®ãƒã‚§ãƒƒ
+クãªã©ã‚’行ã†ã“ã¨ãŒç›®çš„ã§ã™ï¼Žã¾ãšï¼Œ
require 'mkmf'
-¤òextconf.rb¤ÎÀèÆ¬¤ËÃÖ¤­¤Þ¤¹¡¥extconf.rb¤ÎÃæ¤Ç¤Ï°Ê²¼¤ÎRuby´Ø
-¿ô¤ò»È¤¦¤³¤È¤¬½ÐÍè¤Þ¤¹¡¥
+ã‚’extconf.rbã®å…ˆé ­ã«ç½®ãã¾ã™ï¼Žextconf.rbã®ä¸­ã§ã¯ä»¥ä¸‹ã®Rubyé–¢
+数を使ã†ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Ž
- have_library(lib, func): ¥é¥¤¥Ö¥é¥ê¤Î¸ºß¥Á¥§¥Ã¥¯
- have_func(func, header): ´Ø¿ô¤Î¸ºß¥Á¥§¥Ã¥¯
- have_header(header): ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¸ºß¥Á¥§¥Ã¥¯
- create_makefile(target): Makefile¤ÎÀ¸À®
+ have_library(lib, func): ライブラリã®å­˜åœ¨ãƒã‚§ãƒƒã‚¯
+ have_func(func, header): 関数ã®å­˜åœ¨ãƒã‚§ãƒƒã‚¯
+ have_header(header): ヘッダファイルã®å­˜åœ¨ãƒã‚§ãƒƒã‚¯
+ create_makefile(target[, target_prefix]): Makefileã®ç”Ÿæˆ
-°Ê²¼¤ÎÊÑ¿ô¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥
+以下ã®å¤‰æ•°ã‚’使ã†ã“ã¨ãŒã§ãã¾ã™ï¼Ž
- $CFLAGS: ¥³¥ó¥Ñ¥¤¥ë»þ¤ËÄɲÃŪ¤Ë»ØÄꤹ¤ë¥Õ¥é¥°(-O¤Ê¤É)
- $CPPFLAGS: ¥×¥ê¥×¥í¥»¥Ã¥µ¤ËÄɲÃŪ¤Ë»ØÄꤹ¤ë¥Õ¥é¥°(-I¤ä-D¤Ê¤É)
- $LDFLAGS: ¥ê¥ó¥¯»þ¤ËÄɲÃŪ¤Ë»ØÄꤹ¤ë¥Õ¥é¥°(-L¤Ê¤É)
- $objs: ¥ê¥ó¥¯¤µ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë̾¤Î¥ê¥¹¥È
+ $CFLAGS: コンパイル時ã«è¿½åŠ çš„ã«æŒ‡å®šã™ã‚‹ãƒ•ラグ(-Oãªã©)
+ $CPPFLAGS: プリプロセッサã«è¿½åŠ çš„ã«æŒ‡å®šã™ã‚‹ãƒ•ラグ(-Iã‚„-Dãªã©)
+ $LDFLAGS: リンク時ã«è¿½åŠ çš„ã«æŒ‡å®šã™ã‚‹ãƒ•ラグ(-Lãªã©)
+ $objs: リンクã•れるオブジェクトファイルåã®ãƒªã‚¹ãƒˆ
-¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Î¥ê¥¹¥È¤Ï¡¢Ä̾ï¤Ï¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò¸¡º÷¤·
-¤Æ¼«Æ°Åª¤ËÀ¸À®¤µ¤ì¤Þ¤¹¤¬¡¢make¤ÎÅÓÃæ¤Ç¥½¡¼¥¹¤òÀ¸À®¤¹¤ë¤è¤¦¤Ê
-¾ì¹ç¤ÏÌÀ¼¨Åª¤Ë»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
+オブジェクトファイルã®ãƒªã‚¹ãƒˆã¯ï¼Œé€šå¸¸ã¯ã‚½ãƒ¼ã‚¹ãƒ•ァイルを検索ã—
+ã¦è‡ªå‹•çš„ã«ç”Ÿæˆã•れã¾ã™ãŒï¼Œmakeã®é€”中ã§ã‚½ãƒ¼ã‚¹ã‚’生æˆã™ã‚‹ã‚ˆã†ãª
+å ´åˆã¯æ˜Žç¤ºçš„ã«æŒ‡å®šã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Ž
-¥é¥¤¥Ö¥é¥ê¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¾ò·ï¤¬Â·¤ï¤º¡¤¤½¤Î¥é¥¤¥Ö¥é¥ê¤ò¥³¥ó
-¥Ñ¥¤¥ë¤·¤Ê¤¤»þ¤Ë¤Ïcreate_makefile¤ò¸Æ¤Ð¤Ê¤±¤ì¤ÐMakefile¤ÏÀ¸
-À®¤µ¤ì¤º¡¤¥³¥ó¥Ñ¥¤¥ë¤â¹Ô¤ï¤ì¤Þ¤»¤ó¡¥
+ライブラリをコンパイルã™ã‚‹æ¡ä»¶ãŒæƒã‚ãšï¼Œãã®ãƒ©ã‚¤ãƒ–ラリをコン
+パイルã—ãªã„時ã«ã¯create_makefileを呼ã°ãªã‘れã°Makefileã¯ç”Ÿ
+æˆã•れãšï¼Œã‚³ãƒ³ãƒ‘イルも行ã‚れã¾ã›ã‚“.
-(5) depend¤òÍѰդ¹¤ë
+== dependを用æ„ã™ã‚‹
-¤â¤·¡¤¥Ç¥£¥ì¥¯¥È¥ê¤Ëdepend¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ì¤Ð¡¤
-Makefile¤¬°Í¸´Ø·¸¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤ì¤Þ¤¹¡¥
+ã‚‚ã—,ディレクトリã«dependã¨ã„ã†ãƒ•ァイルãŒå­˜åœ¨ã™ã‚Œã°ï¼Œ
+MakefileãŒä¾å­˜é–¢ä¿‚ã‚’ãƒã‚§ãƒƒã‚¯ã—ã¦ãれã¾ã™ï¼Ž
% gcc -MM *.c > depend
-¤Ê¤É¤Çºî¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡¥¤¢¤Ã¤ÆÂ»¤Ï̵¤¤¤Ç¤·¤ç¤¦¡¥
+ãªã©ã§ä½œã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Žã‚ã£ã¦æã¯ç„¡ã„ã§ã—ょã†ï¼Ž
-(6) Makefile¤òÀ¸À®¤¹¤ë
+== Makefileを生æˆã™ã‚‹
-Makefile¤ò¼ÂºÝ¤ËÀ¸À®¤¹¤ë¤¿¤á¤Ë¤Ï
+Makefileを実際ã«ç”Ÿæˆã™ã‚‹ãŸã‚ã«ã¯
ruby extconf.rb
-¤È¤·¤Þ¤¹¡¥extconf.rb¤Ë require 'mkmf' ¤Î¹Ô¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï¥¨¥é¡¼
-¤Ë¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¤°ú¿ô¤òÄɲä·¤Æ
+ã¨ã—ã¾ã™ï¼Žextconf.rbã« require 'mkmf' ã®è¡ŒãŒãªã„å ´åˆã«ã¯ã‚¨ãƒ©ãƒ¼
+ã«ãªã‚Šã¾ã™ã®ã§ï¼Œå¼•数を追加ã—ã¦
ruby -r mkmf extconf.rb
-¤È¤·¤Æ¤¯¤À¤µ¤¤¡¥
+ã¨ã—ã¦ãã ã•ã„.
-¥Ç¥£¥ì¥¯¥È¥ê¤òext°Ê²¼¤ËÍѰդ·¤¿¾ì¹ç¤Ë¤ÏRubyÁ´ÂΤÎmake¤Î»þ¤Ë
-¼«Æ°Åª¤ËMakefile¤¬À¸À®¤µ¤ì¤Þ¤¹¤Î¤Ç¡¤¤³¤Î¥¹¥Æ¥Ã¥×¤ÏÉÔÍפǤ¹¡¥
+site_ruby ディレクトリã§ãªã,
+vendor_ruby ディレクトリã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã™ã‚‹å ´åˆã«ã¯
+以下ã®ã‚ˆã†ã« --vendor オプションを加ãˆã¦ãã ã•ã„.
-(7) make¤¹¤ë
+ ruby extconf.rb --vendor
-ưŪ¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê¤òÀ¸À®¤¹¤ë¾ì¹ç¤Ë¤Ï¤½¤Î¾ì¤Çmake¤·¤Æ¤¯¤À¤µ
-¤¤¡¥É¬ÍפǤ¢¤ì¤Ð make install ¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Þ¤¹¡¥
+ディレクトリをext以下ã«ç”¨æ„ã—ãŸå ´åˆã«ã¯Ruby全体ã®makeã®æ™‚ã«
+自動的ã«MakefileãŒç”Ÿæˆã•れã¾ã™ã®ã§ï¼Œã“ã®ã‚¹ãƒ†ãƒƒãƒ—ã¯ä¸è¦ã§ã™ï¼Ž
-ext°Ê²¼¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤òÍѰդ·¤¿¾ì¹ç¤Ï¡¤Ruby¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç
-make¤ò¼Â¹Ô¤¹¤ë¤ÈMakefile¤òÀ¸À®¤«¤émake¡¤É¬Íפˤè¤Ã¤Æ¤Ï¤½¤Î¥â
-¥¸¥å¡¼¥ë¤ÎRuby¤Ø¤Î¥ê¥ó¥¯¤Þ¤Ç¼«Æ°Åª¤Ë¼Â¹Ô¤·¤Æ¤¯¤ì¤Þ¤¹¡¥
-extconf.rb¤ò½ñ¤­´¹¤¨¤ë¤Ê¤É¤·¤ÆMakefile¤ÎºÆÀ¸À®¤¬É¬Íפʻþ¤Ï¤Þ
-¤¿Ruby¥Ç¥£¥ì¥¯¥È¥ê¤Çmake¤·¤Æ¤¯¤À¤µ¤¤¡¥
+== makeã™ã‚‹
-³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤Ïmake install¤ÇRuby¥é¥¤¥Ö¥é¥ê¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î
-²¼¤Ë¥³¥Ô¡¼¤µ¤ì¤Þ¤¹¡¥¤â¤·³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤È¶¨Ä´¤·¤Æ»È¤¦Ruby¤Çµ­
-½Ò¤µ¤ì¤¿¥×¥í¥°¥é¥à¤¬¤¢¤ê¡¤Ruby¥é¥¤¥Ö¥é¥ê¤ËÃÖ¤­¤¿¤¤¾ì¹ç¤Ë¤Ï¡¤
-³ÈÄ¥¥é¥¤¥Ö¥é¥êÍѤΥǥ£¥ì¥¯¥È¥ê¤Î²¼¤Ë lib ¤È¤¤¤¦¥Ç¥£¥ì¥¯¥È¥ê
-¤òºî¤ê¡¤¤½¤³¤Ë ³ÈÄ¥»Ò .rb ¤Î¥Õ¥¡¥¤¥ë¤òÃÖ¤¤¤Æ¤ª¤±¤ÐƱ»þ¤Ë¥¤¥ó
-¥¹¥È¡¼¥ë¤µ¤ì¤Þ¤¹¡¥
+動的リンクライブラリを生æˆã™ã‚‹å ´åˆã«ã¯ãã®å ´ã§makeã—ã¦ãã ã•
+ã„.必è¦ã§ã‚れ㰠make install ã§ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¾ã™ï¼Ž
-(8) ¥Ç¥Ð¥Ã¥°
+ext以下ã«ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’用æ„ã—ãŸå ´åˆã¯ï¼ŒRubyã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã§
+makeを実行ã™ã‚‹ã¨Makefileを生æˆã‹ã‚‰make,必è¦ã«ã‚ˆã£ã¦ã¯ãã®ãƒ¢
+ジュールã®Rubyã¸ã®ãƒªãƒ³ã‚¯ã¾ã§è‡ªå‹•çš„ã«å®Ÿè¡Œã—ã¦ãれã¾ã™ï¼Ž
+extconf.rbã‚’æ›¸ãæ›ãˆã‚‹ãªã©ã—ã¦Makefileã®å†ç”ŸæˆãŒå¿…è¦ãªæ™‚ã¯ã¾
+ãŸRubyディレクトリã§makeã—ã¦ãã ã•ã„.
-¤Þ¤¢¡¤¥Ç¥Ð¥Ã¥°¤·¤Ê¤¤¤Èư¤«¤Ê¤¤¤Ç¤·¤ç¤¦¤Í¡¥ext/Setup¤Ë¥Ç¥£¥ì
-¥¯¥È¥ê̾¤ò½ñ¤¯¤ÈÀÅŪ¤Ë¥ê¥ó¥¯¤¹¤ë¤Î¤Ç¥Ç¥Ð¥Ã¥¬¤¬»È¤¨¤ë¤è¤¦¤Ë¤Ê
-¤ê¤Þ¤¹¡¥¤½¤Îʬ¥³¥ó¥Ñ¥¤¥ë¤¬ÃÙ¤¯¤Ê¤ê¤Þ¤¹¤±¤É¡¥
+拡張ライブラリã¯make installã§Rubyライブラリã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®
+下ã«ã‚³ãƒ”ーã•れã¾ã™ï¼Žã‚‚ã—æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã¨å”調ã—ã¦ä½¿ã†Rubyã§è¨˜
+è¿°ã•れãŸãƒ—ログラムãŒã‚り,Rubyライブラリã«ç½®ããŸã„å ´åˆã«ã¯ï¼Œ
+拡張ライブラリ用ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®ä¸‹ã« lib ã¨ã„ã†ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª
+を作り,ãã“ã« æ‹¡å¼µå­ .rb ã®ãƒ•ァイルを置ã„ã¦ãŠã‘ã°åŒæ™‚ã«ã‚¤ãƒ³
+ストールã•れã¾ã™ï¼Ž
-(9) ¤Ç¤­¤¢¤¬¤ê
+== デãƒãƒƒã‚°
-¸å¤Ï¤³¤Ã¤½¤ê»È¤¦¤Ê¤ê¡¤¹­¤¯¸ø³«¤¹¤ë¤Ê¤ê¡¤Çä¤ë¤Ê¤ê¡¤¤´¼«Í³¤Ë¤ª
-»È¤¤¤¯¤À¤µ¤¤¡¥Ruby¤Îºî¼Ô¤Ï³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤Ë´Ø¤·¤Æ°ìÀڤθ¢Íø¤ò
-¼çÄ¥¤·¤Þ¤»¤ó¡¥
+ã¾ã‚,デãƒãƒƒã‚°ã—ãªã„ã¨å‹•ã‹ãªã„ã§ã—ょã†ã­ï¼Žext/Setupã«ãƒ‡ã‚£ãƒ¬
+クトリåを書ãã¨é™çš„ã«ãƒªãƒ³ã‚¯ã™ã‚‹ã®ã§ãƒ‡ãƒãƒƒã‚¬ãŒä½¿ãˆã‚‹ã‚ˆã†ã«ãª
+りã¾ã™ï¼Žãã®åˆ†ã‚³ãƒ³ãƒ‘イルãŒé…ããªã‚Šã¾ã™ã‘ã©ï¼Ž
-Appendix A. Ruby¤Î¥½¡¼¥¹¥³¡¼¥É¤ÎʬÎà
+== ã§ãã‚ãŒã‚Š
-Ruby¤Î¥½¡¼¥¹¤Ï¤¤¤¯¤Ä¤«¤ËʬÎह¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡¥¤³¤Î¤¦¤Á¥¯¥é
-¥¹¥é¥¤¥Ö¥é¥ê¤ÎÉôʬ¤Ï´ðËÜŪ¤Ë³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤ÈƱ¤¸ºî¤êÊý¤Ë¤Ê¤Ã
-¤Æ¤¤¤Þ¤¹¡¥¤³¤ì¤é¤Î¥½¡¼¥¹¤Ïº£¤Þ¤Ç¤ÎÀâÌÀ¤Ç¤Û¤È¤ó¤ÉÍý²ò¤Ç¤­¤ë¤È
-»×¤¤¤Þ¤¹¡¥
+後ã¯ã“ã£ãり使ã†ãªã‚Šï¼Œåºƒã公開ã™ã‚‹ãªã‚Šï¼Œå£²ã‚‹ãªã‚Šï¼Œã”自由ã«ãŠ
+使ã„ãã ã•ã„.Rubyã®ä½œè€…ã¯æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«é–¢ã—ã¦ä¸€åˆ‡ã®æ¨©åˆ©ã‚’
+主張ã—ã¾ã›ã‚“.
-Ruby¸À¸ì¤Î¥³¥¢
+= Appendix A. Rubyã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã®åˆ†é¡ž
- class.c
- error.c
- eval.c
- gc.c
- object.c
- parse.y
- variable.c
+Rubyã®ã‚½ãƒ¼ã‚¹ã¯ã„ãã¤ã‹ã«åˆ†é¡žã™ã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Žã“ã®ã†ã¡ã‚¯ãƒ©
+スライブラリã®éƒ¨åˆ†ã¯åŸºæœ¬çš„ã«æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã¨åŒã˜ä½œã‚Šæ–¹ã«ãªã£
+ã¦ã„ã¾ã™ï¼Žã“れらã®ã‚½ãƒ¼ã‚¹ã¯ä»Šã¾ã§ã®èª¬æ˜Žã§ã»ã¨ã‚“ã©ç†è§£ã§ãã‚‹ã¨
+æ€ã„ã¾ã™ï¼Ž
+
+== Ruby言語ã®ã‚³ã‚¢
+
+class.c :: クラスã¨ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«
+error.c :: 例外クラスã¨ä¾‹å¤–機構
+gc.c :: 記憶領域管ç†
+load.c :: ライブラリã®ãƒ­ãƒ¼ãƒ‰
+object.c :: オブジェクト
+variable.c :: 変数ã¨å®šæ•°
-¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô
+== Rubyã®æ§‹æ–‡è§£æžå™¨
+
+ parse.y : å­—å¥è§£æžå™¨ã¨æ§‹æ–‡å®šç¾©
+ -> parse.c : 自動生æˆ
+ keywords : 予約語
+ -> lex.c : 自動生æˆ
+
+== Rubyã®è©•価器 (通称YARV)
+ compile.c
+ eval.c
+ eval_error.c
+ eval_jump.c
+ eval_safe.c
+ insns.def : 仮想機械語ã®å®šç¾©
+ iseq.c : VM::ISeqã®å®Ÿè£…
+ thread.c : スレッド管ç†ã¨ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆåˆ‡ã‚Šæ›¿ãˆ
+ thread_win32.c : スレッド実装
+ thread_pthread.c : åŒä¸Š
+ vm.c
+ vm_dump.c
+ vm_eval.c
+ vm_exec.c
+ vm_insnhelper.c
+ vm_method.c
+
+ opt_insns_unif.def : 命令èžåˆ
+ opt_operand.def : 最é©åŒ–ã®ãŸã‚ã®å®šç¾©
+
+ -> insn*.inc : 自動生æˆ
+ -> opt*.inc : 自動生æˆ
+ -> vm.inc : 自動生æˆ
+
+== æ­£è¦è¡¨ç¾ã‚¨ãƒ³ã‚¸ãƒ³ (鬼車)
- dln.c
regex.c
- st.c
- util.c
+ regcomp.c
+ regenc.c
+ regerror.c
+ regexec.c
+ regparse.c
+ regsyntax.c
+
+== ユーティリティ関数
-Ruby¥³¥Þ¥ó¥É¤Î¼ÂÁõ
+debug.c :: Cデãƒãƒƒã‚¬ç”¨ã®ãƒ‡ãƒãƒƒã‚°ã‚·ãƒ³ãƒœãƒ«
+dln.c :: 動的ローディング
+st.c :: 汎用ãƒãƒƒã‚·ãƒ¥è¡¨
+strftime.c :: 時刻整形
+util.c :: ãã®ä»–ã®ãƒ¦ãƒ¼ãƒ†ã‚£ãƒªãƒ†ã‚£
+
+== Rubyコマンドã®å®Ÿè£…
dmyext.c
+ dmydln.c
+ dmyencoding.c
+ id.c
inits.c
main.c
ruby.c
version.c
-¥¯¥é¥¹¥é¥¤¥Ö¥é¥ê
+ gem_prelude.rb
+ prelude.rb
+
+== クラスライブラリ
+
+array.c :: Array
+bignum.c :: Bignum
+compar.c :: Comparable
+complex.c :: Complex
+cont.c :: Fiber, Continuation
+dir.c :: Dir
+enum.c :: Enumerable
+enumerator.c :: Enumerator
+file.c :: File
+hash.c :: Hash
+io.c :: IO
+marshal.c :: Marshal
+math.c :: Math
+numeric.c :: Numeric, Integer, Fixnum, Float
+pack.c :: Array#pack, String#unpack
+proc.c :: Binding, Proc
+process.c :: Process
+random.c :: 乱数
+range.c :: Range
+rational.c :: Rational
+re.c :: Regexp, MatchData
+signal.c :: Signal
+sprintf.c :: String#sprintf
+string.c :: String
+struct.c :: Struct
+time.c :: Time
+defs/known_errors.def :: 例外クラス Errno::*
+-> known_errors.inc :: 自動生æˆ
- array.c
- bignum.c
- compar.c
- dir.c
- enum.c
- file.c
- hash.c
- io.c
- marshal.c
- math.c
- numeric.c
- pack.c
- prec.c
- process.c
- random.c
- range.c
- re.c
- signal.c
- sprintf.c
- string.c
- struct.c
- time.c
+== 多言語化
-Appendix B. ³ÈÄ¥ÍÑ´Ø¿ô¥ê¥Õ¥¡¥ì¥ó¥¹
+encoding.c :: Encoding
+transcode.c :: Encoding::Converter
+enc/*.c :: エンコーディングクラス群
+enc/trans/* :: コードãƒã‚¤ãƒ³ãƒˆå¯¾å¿œè¡¨
-C¸À¸ì¤«¤éRuby¤Îµ¡Ç½¤òÍøÍѤ¹¤ëAPI¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡¥
+== gorubyコマンドã®å®Ÿè£…
-** ·¿
+ goruby.c
+ golf_prelude.rb : goruby固有ã®ãƒ©ã‚¤ãƒ–ラリ
+ -> golf_prelude.c : 自動生æˆ
-VALUE
+= Appendix B. 拡張用関数リファレンス
- Ruby¥ª¥Ö¥¸¥§¥¯¥È¤òɽ¸½¤¹¤ë·¿¡¥É¬Íפ˱þ¤¸¤Æ¥­¥ã¥¹¥È¤·¤ÆÍѤ¤¤ë¡¥
- ÁȤ߹þ¤ß·¿¤òɽ¸½¤¹¤ëC¤Î·¿¤Ïruby.h¤Ëµ­½Ò¤·¤Æ¤¢¤ëR¤Ç»Ï¤Þ¤ë¹½Â¤
- ÂΤǤ¢¤ë¡¥VALUE·¿¤ò¤³¤ì¤é¤Ë¥­¥ã¥¹¥È¤¹¤ë¤¿¤á¤ËR¤Ç»Ï¤Þ¤ë¹½Â¤ÂÎ
- ̾¤òÁ´¤ÆÂçʸ»ú¤Ë¤·¤¿Ì¾Á°¤Î¥Þ¥¯¥í¤¬ÍѰդµ¤ì¤Æ¤¤¤ë¡¥
+C言語ã‹ã‚‰Rubyã®æ©Ÿèƒ½ã‚’利用ã™ã‚‹APIã¯ä»¥ä¸‹ã®é€šã‚Šã§ã‚る.
-** ÊÑ¿ô¡¦Äê¿ô
+== åž‹
-Qnil
+VALUE ::
- Äê¿ô: nil¥ª¥Ö¥¸¥§¥¯¥È
+ Rubyオブジェクトを表ç¾ã™ã‚‹åž‹ï¼Žå¿…è¦ã«å¿œã˜ã¦ã‚­ãƒ£ã‚¹ãƒˆã—ã¦ç”¨ã„る.
+ 組ã¿è¾¼ã¿åž‹ã‚’表ç¾ã™ã‚‹Cã®åž‹ã¯ruby.hã«è¨˜è¿°ã—ã¦ã‚ã‚‹Rã§å§‹ã¾ã‚‹æ§‹é€ 
+ 体ã§ã‚る.VALUE型をã“れらã«ã‚­ãƒ£ã‚¹ãƒˆã™ã‚‹ãŸã‚ã«Rã§å§‹ã¾ã‚‹æ§‹é€ ä½“
+ åã‚’å…¨ã¦å¤§æ–‡å­—ã«ã—ãŸåå‰ã®ãƒžã‚¯ãƒ­ãŒç”¨æ„ã•れã¦ã„る.
-Qtrue
+== 変数・定数
- Äê¿ô: true¥ª¥Ö¥¸¥§¥¯¥È(¿¿¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ)
+Qnil ::
-Qfalse
+ 定数: nilオブジェクト
- Äê¿ô: false¥ª¥Ö¥¸¥§¥¯¥È
+Qtrue ::
-** C¥Ç¡¼¥¿¤Î¥«¥×¥»¥ë²½
+ 定数: trueオブジェクト(真ã®ãƒ‡ãƒ•ォルト値)
-Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval)
+Qfalse ::
- C¤ÎǤ°Õ¤Î¥Ý¥¤¥ó¥¿¤ò¥«¥×¥»¥ë²½¤·¤¿Ruby¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹¡¥¤³
- ¤Î¥Ý¥¤¥ó¥¿¤¬Ruby¤«¤é¥¢¥¯¥»¥¹¤µ¤ì¤Ê¤¯¤Ê¤Ã¤¿»þ¡¤free¤Ç»ØÄꤷ¤¿
- ´Ø¿ô¤¬¸Æ¤Ð¤ì¤ë¡¥¤Þ¤¿¡¤¤³¤Î¥Ý¥¤¥ó¥¿¤Î»Ø¤¹¥Ç¡¼¥¿¤¬Â¾¤ÎRuby¥ª¥Ö
- ¥¸¥§¥¯¥È¤ò»Ø¤·¤Æ¤¤¤ë¾ì¹ç¡¤mark¤Ë»ØÄꤹ¤ë´Ø¿ô¤Ç¥Þ¡¼¥¯¤¹¤ëɬÍ×
- ¤¬¤¢¤ë¡¥
+ 定数: falseオブジェクト
-Data_Make_Struct(klass, type, mark, free, sval)
+== Cデータã®ã‚«ãƒ—セル化
- type·¿¤Î¥á¥â¥ê¤òmalloc¤·¡¤ÊÑ¿ôsval¤ËÂåÆþ¤·¤¿¸å¡¤¤½¤ì¤ò¥«¥×¥»
- ¥ë²½¤·¤¿¥Ç¡¼¥¿¤òÊÖ¤¹¥Þ¥¯¥í¡¥
+Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval) ::
-Data_Get_Struct(data, type, sval)
+ Cã®ä»»æ„ã®ãƒã‚¤ãƒ³ã‚¿ã‚’カプセル化ã—ãŸRubyオブジェクトを返ã™ï¼Žã“
+ ã®ãƒã‚¤ãƒ³ã‚¿ãŒRubyã‹ã‚‰ã‚¢ã‚¯ã‚»ã‚¹ã•れãªããªã£ãŸæ™‚,freeã§æŒ‡å®šã—ãŸ
+ 関数ãŒå‘¼ã°ã‚Œã‚‹ï¼Žã¾ãŸï¼Œã“ã®ãƒã‚¤ãƒ³ã‚¿ã®æŒ‡ã™ãƒ‡ãƒ¼ã‚¿ãŒä»–ã®Rubyオブ
+ ジェクトを指ã—ã¦ã„ã‚‹å ´åˆï¼Œmarkã«æŒ‡å®šã™ã‚‹é–¢æ•°ã§ãƒžãƒ¼ã‚¯ã™ã‚‹å¿…è¦
+ ãŒã‚る.
- data¤«¤étype·¿¤Î¥Ý¥¤¥ó¥¿¤ò¼è¤ê½Ð¤·ÊÑ¿ôsval¤ËÂåÆþ¤¹¤ë¥Þ¥¯¥í¡¥
+Data_Make_Struct(klass, type, mark, free, sval) ::
-** ·¿¥Á¥§¥Ã¥¯
+ typeåž‹ã®ãƒ¡ãƒ¢ãƒªã‚’mallocã—,変数svalã«ä»£å…¥ã—ãŸå¾Œï¼Œãれをカプセ
+ ル化ã—ãŸãƒ‡ãƒ¼ã‚¿ã‚’è¿”ã™ãƒžã‚¯ãƒ­ï¼Ž
-TYPE(value)
-FIXNUM_P(value)
-NIL_P(value)
-void Check_Type(VALUE value, int type)
-void Check_SafeStr(VALUE value)
+Data_Get_Struct(data, type, sval) ::
-** ·¿ÊÑ´¹
+ dataã‹ã‚‰typeåž‹ã®ãƒã‚¤ãƒ³ã‚¿ã‚’å–り出ã—変数svalã«ä»£å…¥ã™ã‚‹ãƒžã‚¯ãƒ­ï¼Ž
-FIX2INT(value)
-INT2FIX(i)
-NUM2INT(value)
-INT2NUM(i)
-NUM2DBL(value)
-rb_float_new(f)
-StringValue(value)
-StringValuePtr(value)
-StringValueCStr(value)
-rb_str_new2(s)
+== åž‹ãƒã‚§ãƒƒã‚¯
-** ¥¯¥é¥¹/¥â¥¸¥å¡¼¥ëÄêµÁ
+ TYPE(value)
+ FIXNUM_P(value)
+ NIL_P(value)
+ void Check_Type(VALUE value, int type)
+ SafeStringValue(value)
+
+== 型変æ›
+
+ FIX2INT(value), INT2FIX(i)
+ FIX2LONG(value), LONG2FIX(l)
+ NUM2INT(value), INT2NUM(i)
+ NUM2UINT(value), UINT2NUM(ui)
+ NUM2LONG(value), LONG2NUM(l)
+ NUM2ULONG(value), ULONG2NUM(ul)
+ NUM2LL(value), LL2NUM(ll)
+ NUM2ULL(value), ULL2NUM(ull)
+ NUM2OFFT(value), OFFT2NUM(off)
+ NUM2SIZET(value), SIZET2NUM(size)
+ NUM2SSIZET(value), SSIZET2NUM(ssize)
+ NUM2DBL(value)
+ rb_float_new(f)
+ StringValue(value)
+ StringValuePtr(value)
+ StringValueCStr(value)
+ rb_str_new2(s)
+
+== クラス/モジュール定義
-VALUE rb_define_class(const char *name, VALUE super)
+VALUE rb_define_class(const char *name, VALUE super) ::
- super¤Î¥µ¥Ö¥¯¥é¥¹¤È¤·¤Æ¿·¤·¤¤Ruby¥¯¥é¥¹¤òÄêµÁ¤¹¤ë¡¥
+ superã®ã‚µãƒ–クラスã¨ã—ã¦æ–°ã—ã„Rubyクラスを定義ã™ã‚‹ï¼Ž
-VALUE rb_define_class_under(VALUE module, const char *name, VALUE super)
+VALUE rb_define_class_under(VALUE module, const char *name, VALUE super) ::
- super¤Î¥µ¥Ö¥¯¥é¥¹¤È¤·¤Æ¿·¤·¤¤Ruby¥¯¥é¥¹¤òÄêµÁ¤·¡¤module¤Î
- Äê¿ô¤È¤·¤ÆÄêµÁ¤¹¤ë¡¥
+ superã®ã‚µãƒ–クラスã¨ã—ã¦æ–°ã—ã„Rubyクラスを定義ã—,moduleã®
+ 定数ã¨ã—ã¦å®šç¾©ã™ã‚‹ï¼Ž
-VALUE rb_define_module(const char *name)
+VALUE rb_define_module(const char *name) ::
- ¿·¤·¤¤Ruby¥â¥¸¥å¡¼¥ë¤òÄêµÁ¤¹¤ë¡¥
+ æ–°ã—ã„Rubyモジュールを定義ã™ã‚‹ï¼Ž
-VALUE rb_define_module_under(VALUE module, const char *name)
+VALUE rb_define_module_under(VALUE module, const char *name) ::
- ¿·¤·¤¤Ruby¥â¥¸¥å¡¼¥ë¤òÄêµÁ¤·¡¤module¤ÎÄê¿ô¤È¤·¤ÆÄêµÁ¤¹¤ë¡¥
+ æ–°ã—ã„Rubyモジュールを定義ã—,moduleã®å®šæ•°ã¨ã—ã¦å®šç¾©ã™ã‚‹ï¼Ž
-void rb_include_module(VALUE klass, VALUE module)
+void rb_include_module(VALUE klass, VALUE module) ::
- ¥â¥¸¥å¡¼¥ë¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¡¥class¤¬¤¹¤Ç¤Ëmodule¤ò¥¤¥ó¥¯
- ¥ë¡¼¥É¤·¤Æ¤¤¤ë»þ¤Ë¤Ï²¿¤â¤·¤Ê¤¤(¿½Å¥¤¥ó¥¯¥ë¡¼¥É¤Î¶Ø»ß)¡¥
+ モジュールをインクルードã™ã‚‹ï¼ŽclassãŒã™ã§ã«moduleをインク
+ ルードã—ã¦ã„る時ã«ã¯ä½•ã‚‚ã—ãªã„(多é‡ã‚¤ãƒ³ã‚¯ãƒ«ãƒ¼ãƒ‰ã®ç¦æ­¢).
-void rb_extend_object(VALUE object, VALUE module)
+void rb_extend_object(VALUE object, VALUE module) ::
- ¥ª¥Ö¥¸¥§¥¯¥È¤ò¥â¥¸¥å¡¼¥ë(¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥á¥½¥Ã¥É)¤Ç³ÈÄ¥¤¹¤ë¡¥
+ オブジェクトをモジュール(ã§å®šç¾©ã•れã¦ã„るメソッド)ã§æ‹¡å¼µã™ã‚‹ï¼Ž
-** Âç°èÊÑ¿ôÄêµÁ
+== 大域変数定義
-void rb_define_variable(const char *name, VALUE *var)
+void rb_define_variable(const char *name, VALUE *var) ::
- Ruby¤ÈC¤È¤Ç¶¦Í­¤¹¤ë¥°¥í¡¼¥Ð¥ëÊÑ¿ô¤òÄêµÁ¤¹¤ë¡¥ÊÑ¿ô̾¤¬`$'¤Ç
- »Ï¤Þ¤é¤Ê¤¤»þ¤Ë¤Ï¼«Æ°Åª¤ËÄɲ䵤ì¤ë¡¥name¤È¤·¤ÆRuby¤Î¼±ÊÌ»Ò
- ¤È¤·¤Æµö¤µ¤ì¤Ê¤¤Ê¸»ú(Î㤨¤Ð` ')¤ò´Þ¤à¾ì¹ç¤Ë¤ÏRuby¥×¥í¥°¥é
- ¥à¤«¤é¤Ï¸«¤¨¤Ê¤¯¤Ê¤ë¡¥
+ Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹ã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Žå¤‰æ•°åãŒ`$'ã§
+ å§‹ã¾ã‚‰ãªã„時ã«ã¯è‡ªå‹•çš„ã«è¿½åŠ ã•れる.nameã¨ã—ã¦Rubyã®è­˜åˆ¥å­
+ ã¨ã—ã¦è¨±ã•れãªã„文字(例ãˆã°` ')ã‚’å«ã‚€å ´åˆã«ã¯Rubyプログラ
+ ムã‹ã‚‰ã¯è¦‹ãˆãªããªã‚‹ï¼Ž
-void rb_define_readonly_variable(const char *name, VALUE *var)
+void rb_define_readonly_variable(const char *name, VALUE *var) ::
- Ruby¤ÈC¤È¤Ç¶¦Í­¤¹¤ëread only¤Î¥°¥í¡¼¥Ð¥ëÊÑ¿ô¤òÄêµÁ¤¹¤ë¡¥
- read only¤Ç¤¢¤ë¤³¤È°Ê³°¤Ïrb_define_variable()¤ÈƱ¤¸¡¥
+ Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹read onlyã®ã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Ž
+ read onlyã§ã‚ã‚‹ã“ã¨ä»¥å¤–ã¯rb_define_variable()ã¨åŒã˜ï¼Ž
-void rb_define_virtual_variable(const char *name,
- VALUE (*getter)(), void (*setter)())
+void rb_define_virtual_variable(const char *name, VALUE (*getter)(), void (*setter)()) ::
- ´Ø¿ô¤Ë¤è¤Ã¤Æ¼Â¸½¤µ¤ì¤ëRubyÊÑ¿ô¤òÄêµÁ¤¹¤ë¡¥ÊÑ¿ô¤¬»²¾È¤µ¤ì¤¿
- »þ¤Ë¤Ïgetter¤¬¡¤ÊÑ¿ô¤ËÃͤ¬¥»¥Ã¥È¤µ¤ì¤¿»þ¤Ë¤Ïsetter¤¬¸Æ¤Ð¤ì
- ¤ë¡¥
+ 関数ã«ã‚ˆã£ã¦å®Ÿç¾ã•れるRuby変数を定義ã™ã‚‹ï¼Žå¤‰æ•°ãŒå‚ç…§ã•れãŸ
+ 時ã«ã¯getterãŒï¼Œå¤‰æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯setterãŒå‘¼ã°ã‚Œ
+ る.
-void rb_define_hooked_variable(const char *name, VALUE *var,
- VALUE (*getter)(), void (*setter)())
+void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), void (*setter)()) ::
- ´Ø¿ô¤Ë¤è¤Ã¤Æhook¤Î¤Ä¤±¤é¤ì¤¿¥°¥í¡¼¥Ð¥ëÊÑ¿ô¤òÄêµÁ¤¹¤ë¡¥ÊÑ¿ô
- ¤¬»²¾È¤µ¤ì¤¿»þ¤Ë¤Ïgetter¤¬¡¤´Ø¿ô¤ËÃͤ¬¥»¥Ã¥È¤µ¤ì¤¿»þ¤Ë¤Ï
- setter¤¬¸Æ¤Ð¤ì¤ë¡¥getter¤äsetter¤Ë0¤ò»ØÄꤷ¤¿»þ¤Ë¤Ïhook¤ò
- »ØÄꤷ¤Ê¤¤¤Î¤ÈƱ¤¸»ö¤Ë¤Ê¤ë¡¥
+ 関数ã«ã‚ˆã£ã¦hookã®ã¤ã‘られãŸã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Žå¤‰æ•°
+ ãŒå‚ç…§ã•ã‚ŒãŸæ™‚ã«ã¯getterãŒï¼Œé–¢æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯
+ setterãŒå‘¼ã°ã‚Œã‚‹ï¼Žgetterã‚„setterã«0を指定ã—ãŸæ™‚ã«ã¯hookã‚’
+ 指定ã—ãªã„ã®ã¨åŒã˜äº‹ã«ãªã‚‹ï¼Ž
void rb_global_variable(VALUE *var)
- GC¤Î¤¿¤á¡¤Ruby¥×¥í¥°¥é¥à¤«¤é¤Ï¥¢¥¯¥»¥¹¤µ¤ì¤Ê¤¤¤¬, Ruby¥ª¥Ö
- ¥¸¥§¥¯¥È¤ò´Þ¤àÂç°èÊÑ¿ô¤ò¥Þ¡¼¥¯¤¹¤ë¡¥
+ GCã®ãŸã‚,Rubyプログラムã‹ã‚‰ã¯ã‚¢ã‚¯ã‚»ã‚¹ã•れãªã„ãŒ, Rubyオブ
+ ジェクトをå«ã‚€å¤§åŸŸå¤‰æ•°ã‚’マークã™ã‚‹ï¼Ž
+
+== 定数
+
+void rb_define_const(VALUE klass, const char *name, VALUE val) ::
+
+ 定数を定義ã™ã‚‹ï¼Ž
+
+void rb_define_global_const(const char *name, VALUE val) ::
-** Äê¿ô
+ 大域定数を定義ã™ã‚‹ï¼Ž
-void rb_define_const(VALUE klass, const char *name, VALUE val)
+ rb_define_const(rb_cObject, name, val)
- Äê¿ô¤òÄêµÁ¤¹¤ë¡¥
+ ã¨åŒã˜æ„味.
-void rb_define_global_const(const char *name, VALUE val)
+== メソッド定義
- Âç°èÄê¿ô¤òÄêµÁ¤¹¤ë¡¥
+rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
- rb_define_const(rb_cObject, name, val)
+ メソッドを定義ã™ã‚‹ï¼Žargcã¯selfを除ãå¼•æ•°ã®æ•°ï¼ŽargcãŒ-1ã®æ™‚,
+ 関数ã«ã¯å¼•æ•°ã®æ•°(selfã‚’å«ã¾ãªã„)を第1引数, 引数ã®é…列を第2
+ 引数ã¨ã™ã‚‹å½¢å¼ã§ä¸Žãˆã‚‰ã‚Œã‚‹(第3引数ã¯self).argcãŒ-2ã®æ™‚,
+ 第1引数ãŒself, 第2引数ãŒargs(argsã¯å¼•æ•°ã‚’å«ã‚€Rubyã®é…列)ã¨
+ ã„ã†å½¢å¼ã§ä¸Žãˆã‚‰ã‚Œã‚‹ï¼Ž
- ¤ÈƱ¤¸°ÕÌ£¡¥
+rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
-** ¥á¥½¥Ã¥ÉÄêµÁ
+ privateメソッドを定義ã™ã‚‹ï¼Žå¼•æ•°ã¯rb_define_method()ã¨åŒã˜ï¼Ž
-rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc)
+rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
- ¥á¥½¥Ã¥É¤òÄêµÁ¤¹¤ë¡¥argc¤Ïself¤ò½ü¤¯°ú¿ô¤Î¿ô¡¥argc¤¬-1¤Î»þ,
- ´Ø¿ô¤Ë¤Ï°ú¿ô¤Î¿ô(self¤ò´Þ¤Þ¤Ê¤¤)¤òÂè1°ú¿ô, °ú¿ô¤ÎÇÛÎó¤òÂè2
- °ú¿ô¤È¤¹¤ë·Á¼°¤ÇÍ¿¤¨¤é¤ì¤ë(Âè3°ú¿ô¤Ïself)¡¥argc¤¬-2¤Î»þ,
- Âè1°ú¿ô¤¬self, Âè2°ú¿ô¤¬args(args¤Ï°ú¿ô¤ò´Þ¤àRuby¤ÎÇÛÎó)¤È
- ¤¤¤¦·Á¼°¤ÇÍ¿¤¨¤é¤ì¤ë¡¥
-
-rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc)
+ 特異メソッドを定義ã™ã‚‹ï¼Žå¼•æ•°ã¯rb_define_method()ã¨åŒã˜ï¼Ž
- private¥á¥½¥Ã¥É¤òÄêµÁ¤¹¤ë¡¥°ú¿ô¤Ïrb_define_method()¤ÈƱ¤¸¡¥
+rb_scan_args(int argc, VALUE *argv, const char *fmt, ...) ::
-rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc)
+ argc, argvå½¢å¼ã§ä¸Žãˆã‚‰ã‚ŒãŸæŒ‡å®šã•れãŸãƒ•ォーマットã«å¾“ã£ã¦å¼•
+ 数を分解ã—,続ãVALUEã¸ã®å‚ç…§ã«ã‚»ãƒƒãƒˆã—ã¾ã™ï¼Žã“ã®ãƒ•ォーマッ
+ トã¯ï¼ŒABNFã§è¨˜è¿°ã™ã‚‹ã¨ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼Ž
- ÆÃ°Û¥á¥½¥Ã¥É¤òÄêµÁ¤¹¤ë¡¥°ú¿ô¤Ïrb_define_method()¤ÈƱ¤¸¡¥
+ scan-arg-spec := param-arg-spec [option-hash-arg-spec] [block-arg-spec]
-rb_scan_args(int argc, VALUE *argv, const char *fmt, ...)
+ param-arg-spec := pre-arg-spec [post-arg-spec] / post-arg-spec /
+ pre-opt-post-arg-spec
+ pre-arg-spec := num-of-leading-mandatory-args [num-of-optional-args]
+ post-arg-spec := sym-for-variable-length-args
+ [num-of-trailing-mandatory-args]
+ pre-opt-post-arg-spec := num-of-leading-mandatory-args num-of-optional-args
+ num-of-trailing-mandatory-args
+ option-hash-arg-spec := sym-for-option-hash-arg
+ block-arg-spec := sym-for-block-arg
- argc, argv·Á¼°¤ÇÍ¿¤¨¤é¤ì¤¿°ú¿ô¤òʬ²ò¤¹¤ë¡¥fmt¤Ïɬ¿Ü°ú¿ô¤Î¿ô,
- Éղðú¿ô¤Î¿ô, »Ä¤ê¤Î°ú¿ô¤¬¤¢¤ë¤«¤ò»ØÄꤹ¤ëʸ»úÎó¤Ç, "¿ô»ú
- ¿ô»ú*"¤È¤¤¤¦·Á¼°¤Ç¤¢¤ë¡¥ 2 ÈÖÌܤοô»ú¤È"*"¤Ï¤½¤ì¤¾¤ì¾Êά²Ä
- ǽ¤Ç¤¢¤ë¡¥É¬¿Ü°ú¿ô¤¬°ì¤Ä¤â¤Ê¤¤¾ì¹ç¤Ï0¤ò»ØÄꤹ¤ë¡¥Âè3°ú¿ô°Ê
- ¹ß¤ÏÊÑ¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç, ³ºÅö¤¹¤ëÍ×ÁǤ¬¤½¤ÎÊÑ¿ô¤Ë³ÊǼ¤µ¤ì¤ë¡¥
- Éղðú¿ô¤ËÂбþ¤¹¤ë°ú¿ô¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤ÏÊÑ¿ô¤ËQnil¤¬
- ÂåÆþ¤µ¤ì¤ë¡¥
+ num-of-leading-mandatory-args := DIGIT ; 先頭ã«ç½®ã‹ã‚Œã‚‹çœç•¥ä¸èƒ½ãªå¼•æ•°ã®æ•°
+ num-of-optional-args := DIGIT ; ç¶šã„ã¦ç½®ã‹ã‚Œã‚‹çœç•¥å¯èƒ½ãªå¼•æ•°ã®æ•°
+ sym-for-variable-length-args := "*" ; ç¶šã„ã¦ç½®ã‹ã‚Œã‚‹å¯å¤‰é•·å¼•æ•°ã‚’
+ ; Rubyã®é…列ã§å–å¾—ã™ã‚‹ãŸã‚ã®æŒ‡å®š
+ num-of-trailing-mandatory-args := DIGIT ; 終端ã«ç½®ã‹ã‚Œã‚‹çœç•¥ä¸èƒ½ãªå¼•æ•°ã®æ•°
+ sym-for-option-hash-arg := ":" ; オプションãƒãƒƒã‚·ãƒ¥ã‚’å–å¾—ã™ã‚‹
+ ; ãŸã‚ã®æŒ‡å®š; çœç•¥ä¸èƒ½ãªå¼•æ•°ã®
+ ; 数よりも多ãã®å¼•æ•°ãŒæŒ‡å®šã•れ,
+ ; 最後ã®å¼•æ•°ãŒãƒãƒƒã‚·ãƒ¥ï¼ˆã¾ãŸã¯
+ ; #to_hashã§å¤‰æ›å¯èƒ½ï¼‰ã®å ´åˆã«
+ ; å–å¾—ã•れる.最後ã®å¼•æ•°ãŒnilã®
+ ; å ´åˆï¼Œå¯å¤‰é•·å¼•数指定ãŒãªã,
+ ; çœç•¥ä¸èƒ½å¼•æ•°ã®æ•°ã‚ˆã‚Šã‚‚多ãã®
+ ; å¼•æ•°ãŒæŒ‡å®šã•れãŸå ´åˆã«å–å¾—ã•れる
+ sym-for-block-arg := "&" ; イテレータブロックをå–å¾—ã™ã‚‹ãŸã‚ã®
+ ; 指定
-** Ruby¥á¥½¥Ã¥É¸Æ¤Ó½Ð¤·
+ フォーマットãŒ"12"ã®å ´åˆï¼Œå¼•æ•°ã¯æœ€ä½Ž1ã¤ã§ï¼Œ3ã¤(1+2)ã¾ã§è¨±ã•
+ れるã¨ã„ã†æ„味ã«ãªã‚Šã¾ã™ï¼Žå¾“ã£ã¦ï¼Œãƒ•ォーマット文字列ã«ç¶šã„
+ ã¦3ã¤ã®VALUEã¸ã®å‚ç…§ã‚’ç½®ãå¿…è¦ãŒã‚りã¾ã™ï¼Žãれらã«ã¯å–å¾—ã—ãŸ
+ 変数ãŒã‚»ãƒƒãƒˆã•れã¾ã™ï¼Žå¤‰æ•°ã¸ã®å‚ç…§ã®ä»£ã‚りã«NULLを指定ã™ã‚‹
+ ã“ã¨ã‚‚ã§ã,ãã®å ´åˆã¯å–å¾—ã—ãŸå¼•æ•°ã®å€¤ã¯æ¨ã¦ã‚‰ã‚Œã¾ã™ï¼ŽãªãŠï¼Œ
+ çœç•¥å¯èƒ½å¼•æ•°ãŒçœç•¥ã•ã‚ŒãŸæ™‚ã®å¤‰æ•°ã®å€¤ã¯nil(C言語ã®ãƒ¬ãƒ™ãƒ«ã§ã¯
+ Qnil)ã«ãªã‚Šã¾ã™ï¼Ž
-VALUE rb_funcall(VALUE recv, ID mid, int narg, ...)
+ 返り値ã¯ä¸Žãˆã‚‰ã‚ŒãŸå¼•æ•°ã®æ•°ã§ã™ï¼Žã‚ªãƒ—ションãƒãƒƒã‚·ãƒ¥ãŠã‚ˆã³ã‚¤
+ ãƒ†ãƒ¬ãƒ¼ã‚¿ãƒ–ãƒ­ãƒƒã‚¯ã¯æ•°ãˆã¾ã›ã‚“.
- ¥á¥½¥Ã¥É¸Æ¤Ó½Ð¤·¡¥Ê¸»úÎ󤫤émid¤òÆÀ¤ë¤¿¤á¤Ë¤Ïrb_intern()¤ò
- »È¤¦¡¥
+== Rubyメソッド呼ã³å‡ºã—
-VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
+VALUE rb_funcall(VALUE recv, ID mid, int narg, ...) ::
- ¥á¥½¥Ã¥É¸Æ¤Ó½Ð¤·¡¥°ú¿ô¤òargc, argv·Á¼°¤ÇÅϤ¹¡¥
+ メソッド呼ã³å‡ºã—.文字列ã‹ã‚‰midã‚’å¾—ã‚‹ãŸã‚ã«ã¯rb_intern()ã‚’
+ 使ã†ï¼Ž
+
+VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ メソッド呼ã³å‡ºã—.引数をargc, argvå½¢å¼ã§æ¸¡ã™ï¼Ž
VALUE rb_eval_string(const char *str)
- ʸ»úÎó¤òRuby¥¹¥¯¥ê¥×¥È¤È¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¡¦¼Â¹Ô¤¹¤ë¡¥
+ 文字列をRubyスクリプトã¨ã—ã¦ã‚³ãƒ³ãƒ‘イル・実行ã™ã‚‹ï¼Ž
+
+ID rb_intern(const char *name) ::
+
+ 文字列ã«å¯¾å¿œã™ã‚‹IDã‚’è¿”ã™ï¼Ž
+
+char *rb_id2name(ID id) ::
+
+ IDã«å¯¾å¿œã™ã‚‹æ–‡å­—列を返ã™(デãƒãƒƒã‚°ç”¨).
+
+char *rb_class2name(VALUE klass) ::
+
+ クラスã®åå‰ã‚’è¿”ã™(デãƒãƒƒã‚°ç”¨).クラスãŒåå‰ã‚’æŒãŸãªã„時ã«
+ ã¯, 祖先をé¡ã£ã¦åå‰ã‚’æŒã¤ã‚¯ãƒ©ã‚¹ã®åå‰ã‚’è¿”ã™ï¼Ž
+
+int rb_respond_to(VALUE obj, ID id) ::
+
+ objãŒidã§ç¤ºã•れるメソッドをæŒã¤ã‹ã©ã†ã‹ã‚’è¿”ã™ï¼Ž
+
+== インスタンス変数
+
+VALUE rb_iv_get(VALUE obj, const char *name) ::
+
+ objã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã®å€¤ã‚’得る.`@'ã§å§‹ã¾ã‚‰ãªã„インスタン
+ ス変数㯠Rubyプログラムã‹ã‚‰ã‚¢ã‚¯ã‚»ã‚¹ã§ããªã„「隠れãŸã€ã‚¤ãƒ³
+ スタンス変数ã«ãªã‚‹ï¼Žå®šæ•°ã¯å¤§æ–‡å­—ã®åå‰ã‚’æŒã¤ã‚¯ãƒ©ã‚¹(ã¾ãŸã¯
+ モジュール)ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã¨ã—ã¦å®Ÿè£…ã•れã¦ã„る.
+
+VALUE rb_iv_set(VALUE obj, const char *name, VALUE val) ::
+
+ objã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã‚’valã«ã‚»ãƒƒãƒˆã™ã‚‹ï¼Ž
+
+== 制御構造
+
+VALUE rb_block_call(VALUE obj, ID mid, int argc, VALUE * argv, VALUE (*func) (ANYARGS), VALUE data2) ::
+
+ funcをブロックã¨ã—ã¦è¨­å®šã—,objをレシーãƒï¼Œargcã¨argvを引数
+ ã¨ã—ã¦midメソッドを呼ã³å‡ºã™ï¼Žfuncã¯ç¬¬ä¸€å¼•æ•°ã«yieldã•れãŸå€¤ï¼Œ
+ 第二引数ã«data2ã‚’å—ã‘å–る.複数ã®å€¤ãŒyieldã•れãŸå ´åˆ(Cã§ã¯
+ rb_yield_values()ã¨rb_yield_values2(), rb_yield_splat()),
+ data2ã¯Arrayã¨ã—ã¦ãƒ‘ックã•れã¦ã„る.第三, 第四引数ã®argcã¨
+ argvã«ã‚ˆã£ã¦yieldã•れãŸå€¤ã‚’å–り出ã™ã“ã¨ãŒã§ãる.
+
+[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ func2をブロックã¨ã—ã¦è¨­å®šã—, func1をイテレータã¨ã—ã¦å‘¼ã¶ï¼Ž
+ func1ã«ã¯ arg1ãŒå¼•æ•°ã¨ã—ã¦æ¸¡ã•れ, func2ã«ã¯ç¬¬1引数ã«ã‚¤ãƒ†ãƒ¬ãƒ¼
+ ã‚¿ã‹ã‚‰ä¸Žãˆã‚‰ã‚ŒãŸå€¤, 第2引数ã«arg2ãŒæ¸¡ã•れる.
+
+ 1.9ã§rb_iterateを使ã†å ´åˆã¯, func1ã®ä¸­ã§Rubyレベルã®ãƒ¡ã‚½ãƒƒãƒ‰
+ を呼ã³å‡ºã•ãªã‘れã°ãªã‚‰ãªã„.
+ 1.9ã§obsoleteã¨ãªã£ãŸ. 代ã‚りã«rb_block_callãŒç”¨æ„ã•れãŸ.
+
+VALUE rb_yield(VALUE val) ::
+
+ valを値ã¨ã—ã¦ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ãƒ–ロックを呼ã³å‡ºã™ï¼Ž
+
+VALUE rb_rescue(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ 関数func1ã‚’arg1を引数ã«å‘¼ã³å‡ºã™ï¼Žfunc1ã®å®Ÿè¡Œä¸­ã«ä¾‹å¤–ãŒç™ºç”Ÿ
+ ã—ãŸæ™‚ã«ã¯ func2ã‚’arg2を引数ã¨ã—ã¦å‘¼ã¶ï¼Žæˆ»ã‚Šå€¤ã¯ä¾‹å¤–ãŒç™ºç”Ÿ
+ ã—ãªã‹ã£ãŸæ™‚ã¯func1ã®æˆ»ã‚Šå€¤, 例外ãŒç™ºç”Ÿã—ãŸæ™‚ã«ã¯func2ã®æˆ»
+ り値ã§ã‚る.
+
+VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ 関数func1ã‚’arg1を引数ã¨ã—ã¦å®Ÿè¡Œã—, 実行終了後(ãŸã¨ãˆä¾‹å¤–ãŒ
+ 発生ã—ã¦ã‚‚) func2ã‚’arg2を引数ã¨ã—ã¦å®Ÿè¡Œã™ã‚‹ï¼Žæˆ»ã‚Šå€¤ã¯func1
+ ã®æˆ»ã‚Šå€¤ã§ã‚ã‚‹(例外ãŒç™ºç”Ÿã—ãŸæ™‚ã¯æˆ»ã‚‰ãªã„).
+
+VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state) ::
+
+ 関数funcã‚’argを引数ã¨ã—ã¦å®Ÿè¡Œã—, 例外ãŒç™ºç”Ÿã—ãªã‘れã°ãã®æˆ»
+ り値を返ã™ï¼Žä¾‹å¤–ãŒç™ºç”Ÿã—ãŸå ´åˆã¯, *stateã«éž0をセットã—ã¦
+ Qnilã‚’è¿”ã™ï¼Ž
+ rb_jump_tag()を呼ã°ãšã«æ•æ‰ã—ãŸä¾‹å¤–を無視ã™ã‚‹å ´åˆã«ã¯ï¼Œ
+ rb_set_errinfo(Qnil)ã§ã‚¨ãƒ©ãƒ¼æƒ…報をクリアã—ãªã‘れã°ãªã‚‰ãªã„.
+
+void rb_jump_tag(int state) ::
+
+ rb_protect()ã‚„rb_eval_string_protect()ã§æ•æ‰ã•れãŸä¾‹å¤–ã‚’å†
+ é€ã™ã‚‹ï¼Žstateã¯ãれらã®é–¢æ•°ã‹ã‚‰è¿”ã•れãŸå€¤ã§ãªã‘れã°ãªã‚‰ãªã„.
+ ã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡ºã—å…ƒã«æˆ»ã‚‰ãªã„.
+
+void rb_iter_break() ::
+
+ ç¾åœ¨ã®æœ€ã‚‚内å´ã®ãƒ–ロックを終了ã™ã‚‹ï¼Žã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡º
+ ã—å…ƒã«æˆ»ã‚‰ãªã„.
+
+void rb_iter_break_value(VALUE value) ::
+
+ ç¾åœ¨ã®æœ€ã‚‚内å´ã®ãƒ–ロックをvalueã§çµ‚了ã™ã‚‹ï¼Žãƒ–ロックã¯å¼•æ•°ã§
+ 与ãˆã‚‰ã‚ŒãŸvalueã‚’è¿”ã™ï¼Žã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡ºã—å…ƒã«æˆ»ã‚‰ãªã„.
+
+== 例外・エラー
+
+void rb_warning(const char *fmt, ...) ::
+
+ rb_verboseæ™‚ã«æ¨™æº–エラー出力ã«è­¦å‘Šæƒ…報を表示ã™ã‚‹ï¼Žå¼•æ•°ã¯
+ printf()ã¨åŒã˜ï¼Ž
-ID rb_intern(const char *name)
+void rb_raise(rb_eRuntimeError, const char *fmt, ...) ::
- ʸ»úÎó¤ËÂбþ¤¹¤ëID¤òÊÖ¤¹¡¥
+ RuntimeError例外を発生ã•ã›ã‚‹ï¼Žå¼•æ•°ã¯printf()ã¨åŒã˜ï¼Ž
-char *rb_id2name(ID id)
+void rb_raise(VALUE exception, const char *fmt, ...) ::
- ID¤ËÂбþ¤¹¤ëʸ»úÎó¤òÊÖ¤¹(¥Ç¥Ð¥Ã¥°ÍÑ)¡¥
+ exceptionã§æŒ‡å®šã—ãŸä¾‹å¤–を発生ã•ã›ã‚‹ï¼Žfmt以下ã®å¼•æ•°ã¯
+ printf()ã¨åŒã˜ï¼Ž
-char *rb_class2name(VALUE klass)
+void rb_fatal(const char *fmt, ...) ::
- ¥¯¥é¥¹¤Î̾Á°¤òÊÖ¤¹(¥Ç¥Ð¥Ã¥°ÍÑ)¡¥¥¯¥é¥¹¤¬Ì¾Á°¤ò»ý¤¿¤Ê¤¤»þ¤Ë¤Ï,
- ÁÄÀè¤òÁ̤äÆÌ¾Á°¤ò»ý¤Ä¥¯¥é¥¹¤Î̾Á°¤òÊÖ¤¹¡¥
+ 致命的例外を発生ã•ã›ã‚‹ï¼Žé€šå¸¸ã®ä¾‹å¤–処ç†ã¯è¡Œãªã‚れãš, インター
+ プリタãŒçµ‚了ã™ã‚‹(ãŸã ã—ensureã§æŒ‡å®šã•れãŸã‚³ãƒ¼ãƒ‰ã¯çµ‚了å‰ã«
+ 実行ã•れる).
-int rb_respond_to(VALUE obj, ID id)
+void rb_bug(const char *fmt, ...) ::
- obj¤¬id¤Ç¼¨¤µ¤ì¤ë¥á¥½¥Ã¥É¤ò»ý¤Ä¤«¤É¤¦¤«¤òÊÖ¤¹¡£
+ インタープリタãªã©ãƒ—ログラムã®ãƒã‚°ã§ã—ã‹ç™ºç”Ÿã™ã‚‹ã¯ãšã®ãªã„
+ 状æ³ã®æ™‚呼ã¶ï¼Žã‚¤ãƒ³ã‚¿ãƒ¼ãƒ—リタã¯ã‚³ã‚¢ãƒ€ãƒ³ãƒ—ã—ç›´ã¡ã«çµ‚了ã™ã‚‹ï¼Ž
+ 例外処ç†ã¯ä¸€åˆ‡è¡Œãªã‚れãªã„.
-** ¥¤¥ó¥¹¥¿¥ó¥¹ÊÑ¿ô
+== Rubyã®åˆæœŸåŒ–・実行
-VALUE rb_iv_get(VALUE obj, const char *name)
+Rubyをアプリケーションã«åŸ‹ã‚込む場åˆã«ã¯ä»¥ä¸‹ã®ã‚¤ãƒ³ã‚¿ãƒ•ェース
+を使ã†ï¼Žé€šå¸¸ã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«ã¯å¿…è¦ãªã„.
- obj¤Î¥¤¥ó¥¹¥¿¥ó¥¹ÊÑ¿ô¤ÎÃͤòÆÀ¤ë¡¥`@'¤Ç»Ï¤Þ¤é¤Ê¤¤¥¤¥ó¥¹¥¿¥ó
- ¥¹ÊÑ¿ô¤Ï Ruby¥×¥í¥°¥é¥à¤«¤é¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¡Ö±£¤ì¤¿¡×¥¤¥ó
- ¥¹¥¿¥ó¥¹ÊÑ¿ô¤Ë¤Ê¤ë¡¥Äê¿ô¤ÏÂçʸ»ú¤Î̾Á°¤ò»ý¤Ä¥¯¥é¥¹(¤Þ¤¿¤Ï
- ¥â¥¸¥å¡¼¥ë)¤Î¥¤¥ó¥¹¥¿¥ó¥¹ÊÑ¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡¥
+void ruby_init() ::
-VALUE rb_iv_set(VALUE obj, const char *name, VALUE val)
+ Rubyインタプリタã®åˆæœŸåŒ–を行ãªã†ï¼Ž
- obj¤Î¥¤¥ó¥¹¥¿¥ó¥¹ÊÑ¿ô¤òval¤Ë¥»¥Ã¥È¤¹¤ë¡¥
+void ruby_options(int argc, char **argv) ::
-** À©¸æ¹½Â¤
+ Rubyインタプリタã®ã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³å¼•æ•°ã®å‡¦ç†ã‚’行ãªã†ï¼Ž
-VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2)
+void ruby_run() ::
- func2¤ò¥Ö¥í¥Ã¥¯¤È¤·¤ÆÀßÄꤷ, func1¤ò¥¤¥Æ¥ì¡¼¥¿¤È¤·¤Æ¸Æ¤Ö¡¥
- func1¤Ë¤Ï arg1¤¬°ú¿ô¤È¤·¤ÆÅϤµ¤ì, func2¤Ë¤ÏÂè1°ú¿ô¤Ë¥¤¥Æ¥ì¡¼
- ¥¿¤«¤éÍ¿¤¨¤é¤ì¤¿ÃÍ, Âè2°ú¿ô¤Ëarg2¤¬ÅϤµ¤ì¤ë¡¥
-
-VALUE rb_yield(VALUE val)
+ Rubyインタプリタを実行ã™ã‚‹ï¼Ž
- val¤òÃͤȤ·¤Æ¥¤¥Æ¥ì¡¼¥¿¥Ö¥í¥Ã¥¯¤ò¸Æ¤Ó½Ð¤¹¡¥
+void ruby_script(char *name) ::
-VALUE rb_rescue(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2)
+ Rubyã®ã‚¹ã‚¯ãƒªãƒ—トå($0)を設定ã™ã‚‹ï¼Ž
- ´Ø¿ôfunc1¤òarg1¤ò°ú¿ô¤Ë¸Æ¤Ó½Ð¤¹¡¥func1¤Î¼Â¹ÔÃæ¤ËÎã³°¤¬È¯À¸
- ¤·¤¿»þ¤Ë¤Ï func2¤òarg2¤ò°ú¿ô¤È¤·¤Æ¸Æ¤Ö¡¥Ìá¤êÃͤÏÎã³°¤¬È¯À¸
- ¤·¤Ê¤«¤Ã¤¿»þ¤Ïfunc1¤ÎÌá¤êÃÍ, Îã³°¤¬È¯À¸¤·¤¿»þ¤Ë¤Ïfunc2¤ÎÌá
- ¤êÃͤǤ¢¤ë¡¥
+== インタプリタã®ã‚¤ãƒ™ãƒ³ãƒˆã®ãƒ•ック
-VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, void (*func2)(), VALUE arg2)
+ void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events,
+ VALUE data)
- ´Ø¿ôfunc1¤òarg1¤ò°ú¿ô¤È¤·¤Æ¼Â¹Ô¤·, ¼Â¹Ô½ªÎ»¸å(¤¿¤È¤¨Îã³°¤¬
- ȯÀ¸¤·¤Æ¤â) func2¤òarg2¤ò°ú¿ô¤È¤·¤Æ¼Â¹Ô¤¹¤ë¡¥Ìá¤êÃͤÏfunc1
- ¤ÎÌá¤êÃͤǤ¢¤ë(Îã³°¤¬È¯À¸¤·¤¿»þ¤ÏÌá¤é¤Ê¤¤)¡¥
+指定ã•れãŸã‚¤ãƒ³ã‚¿ãƒ—リタã®ã‚¤ãƒ™ãƒ³ãƒˆã«å¯¾ã™ã‚‹ãƒ•ック関数を追加ã—ã¾ã™ï¼Ž
+eventsã¯ä»¥ä¸‹ã®å€¤ã®orã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“:
-** Îã³°¡¦¥¨¥é¡¼
+ RUBY_EVENT_LINE
+ RUBY_EVENT_CLASS
+ RUBY_EVENT_END
+ RUBY_EVENT_CALL
+ RUBY_EVENT_RETURN
+ RUBY_EVENT_C_CALL
+ RUBY_EVENT_C_RETURN
+ RUBY_EVENT_RAISE
+ RUBY_EVENT_ALL
-void rb_warning(const char *fmt, ...)
+rb_event_hook_func_tã®å®šç¾©ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™:
- rb_verbose»þ¤Ëɸ½à¥¨¥é¡¼½ÐÎϤ˷ٹð¾ðÊó¤òɽ¼¨¤¹¤ë¡¥°ú¿ô¤Ï
- printf()¤ÈƱ¤¸¡¥
+ typedef void (*rb_event_hook_func_t)(rb_event_t event, VALUE data,
+ VALUE self, ID id, VALUE klass)
-void rb_raise(rb_eRuntimeError, const char *fmt, ...)
+rb_add_event_hook() ã®ç¬¬3引数 data ã¯ï¼Œãƒ•ック関数ã®ç¬¬2引数ã¨
+ã—ã¦æ¸¡ã•れã¾ã™ï¼Žã“れã¯1.8ã§ã¯ç¾åœ¨ã®NODEã¸ã®ãƒã‚¤ãƒ³ã‚¿ã§ã—ãŸï¼Žä»¥
+下㮠RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ã‚‚å‚ç…§ã—ã¦ãã ã•ã„.
- RuntimeErrorÎã³°¤òȯÀ¸¤µ¤»¤ë¡¥°ú¿ô¤Ïprintf()¤ÈƱ¤¸¡¥
+ int rb_remove_event_hook(rb_event_hook_func_t func)
-void rb_raise(VALUE exception, const char *fmt, ...)
+指定ã•れãŸãƒ•ック関数を削除ã—ã¾ã™ï¼Ž
- exception¤Ç»ØÄꤷ¤¿Îã³°¤òȯÀ¸¤µ¤»¤ë¡¥fmt°Ê²¼¤Î°ú¿ô¤Ï
- printf()¤ÈƱ¤¸¡¥
+== äº’æ›æ€§ã®ãŸã‚ã®ãƒžã‚¯ãƒ­
-void rb_fatal(const char *fmt, ...)
+APIã®äº’æ›æ€§ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ãŸã‚ã«ä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ãŒãƒ‡ãƒ•ォルトã§å®šç¾©ã•れã¦ã„ã¾ã™ï¼Ž
- Ã×̿ŪÎã³°¤òȯÀ¸¤µ¤»¤ë¡¥Ä̾ï¤ÎÎã³°½èÍý¤Ï¹Ô¤Ê¤ï¤ì¤º, ¥¤¥ó¥¿¡¼
- ¥×¥ê¥¿¤¬½ªÎ»¤¹¤ë(¤¿¤À¤·ensure¤Ç»ØÄꤵ¤ì¤¿¥³¡¼¥É¤Ï½ªÎ»Á°¤Ë
- ¼Â¹Ô¤µ¤ì¤ë)¡¥
+NORETURN_STYLE_NEW ::
-void rb_bug(const char *fmt, ...)
+ NORETURN マクロãŒé–¢æ•°åž‹ãƒžã‚¯ãƒ­ã¨ã—ã¦å®šç¾©ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
- ¥¤¥ó¥¿¡¼¥×¥ê¥¿¤Ê¤É¥×¥í¥°¥é¥à¤Î¥Ð¥°¤Ç¤·¤«È¯À¸¤¹¤ë¤Ï¤º¤Î¤Ê¤¤
- ¾õ¶·¤Î»þ¸Æ¤Ö¡¥¥¤¥ó¥¿¡¼¥×¥ê¥¿¤Ï¥³¥¢¥À¥ó¥×¤·Ä¾¤Á¤Ë½ªÎ»¤¹¤ë¡¥
- Îã³°½èÍý¤Ï°ìÀڹԤʤï¤ì¤Ê¤¤¡¥
+HAVE_RB_DEFINE_ALLOC_FUNC ::
-** Ruby¤Î½é´ü²½¡¦¼Â¹Ô
+ rb_define_alloc_func() é–¢æ•°ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨ï¼Œã¤ã¾ã‚Š
+ allocation framework ãŒä½¿ã‚れるã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+ have_func("rb_define_alloc_func", "ruby.h")
+ ã®çµæžœã¨åŒã˜ï¼Ž
-Ruby¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËËä¤á¹þ¤à¾ì¹ç¤Ë¤Ï°Ê²¼¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹
-¤ò»È¤¦¡¥Ä̾ï¤Î³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤Ë¤ÏɬÍפʤ¤¡¥
+HAVE_RB_REG_NEW_STR ::
-void ruby_init()
+ Stringオブジェクトã‹ã‚‰Regexpオブジェクトを作る
+ rb_reg_new_str() é–¢æ•°ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+ have_func("rb_reg_new_str", "ruby.h").
+ ã®çµæžœã¨åŒã˜ï¼Ž
- Ruby¥¤¥ó¥¿¥×¥ê¥¿¤Î½é´ü²½¤ò¹Ô¤Ê¤¦¡¥
+HAVE_RB_IO_T ::
-void ruby_options(int argc, char **argv)
+ rb_io_t åž‹ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
- Ruby¥¤¥ó¥¿¥×¥ê¥¿¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¿ô¤Î½èÍý¤ò¹Ô¤Ê¤¦¡¥
+USE_SYMBOL_AS_METHOD_NAME ::
-void ruby_run()
+ メソッドåã‚’è¿”ã™ãƒ¡ã‚½ãƒƒãƒ‰ï¼ŒModule#methods, #singleton_methods
+ ãªã©ãŒSymbolã‚’è¿”ã™ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
- Ruby¥¤¥ó¥¿¥×¥ê¥¿¤ò¼Â¹Ô¤¹¤ë¡¥
+HAVE_RUBY_*_H ::
-void ruby_script(char *name)
+ ruby.h ã§å®šç¾©ã•れã¦ã„る.対応ã™ã‚‹ãƒ˜ãƒƒãƒ€ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨
+ ã‚’æ„味ã™ã‚‹ï¼ŽãŸã¨ãˆã°ï¼ŒHAVE_RUBY_ST_H ãŒå®šç¾©ã•れã¦ã„ã‚‹å ´åˆã¯
+ å˜ãªã‚‹ st.h ã§ã¯ãªã ruby/st.h を使用ã™ã‚‹ï¼Ž
- Ruby¤Î¥¹¥¯¥ê¥×¥È̾($0)¤òÀßÄꤹ¤ë¡¥
+RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ::
+ rb_add_event_hook() ãŒãƒ•ãƒƒã‚¯é–¢æ•°ã«æ¸¡ã™ data を第3引数ã¨ã—ã¦
+ å—ã‘å–ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
-Appendix C. extconf.rb¤Ç»È¤¨¤ë´Ø¿ô¤¿¤Á
+= Appendix C. extconf.rbã§ä½¿ãˆã‚‹é–¢æ•°ãŸã¡
-extconf.rb¤ÎÃæ¤Ç¤ÏÍøÍѲÄǽ¤Ê¥³¥ó¥Ñ¥¤¥ë¾ò·ï¥Á¥§¥Ã¥¯¤Î´Ø¿ô¤Ï°Ê
-²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡¥
+extconf.rbã®ä¸­ã§ã¯åˆ©ç”¨å¯èƒ½ãªã‚³ãƒ³ãƒ‘イルæ¡ä»¶ãƒã‚§ãƒƒã‚¯ã®é–¢æ•°ã¯ä»¥
+下ã®é€šã‚Šã§ã‚る.
-have_macro(macro, headers)
+have_macro(macro, headers) ::
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëheader¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ¥Þ¥¯¥ímacro¤¬ÄêµÁ¤µ
- ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¥Á¥§¥Ã¥¯¤¹¤ë¡¥¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë»þtrue
- ¤òÊÖ¤¹¡¥
+ ヘッダファイルheaderをインクルードã—ã¦ãƒžã‚¯ãƒ­macroãŒå®šç¾©ã•
+ れã¦ã„ã‚‹ã‹ã©ã†ã‹ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒžã‚¯ãƒ­ãŒå®šç¾©ã•れã¦ã„る時true
+ ã‚’è¿”ã™ï¼Ž
-have_library(lib, func)
+have_library(lib, func) ::
- ´Ø¿ôfunc¤òÄêµÁ¤·¤Æ¤¤¤ë¥é¥¤¥Ö¥é¥êlib¤Î¸ºß¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡¥
- ¥é¥¤¥Ö¥é¥ê¤¬Â¸ºß¤¹¤ë»þ¡¤true¤òÊÖ¤¹¡¥
+ 関数funcを定義ã—ã¦ã„るライブラリlibã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Ž
+ ライブラリãŒå­˜åœ¨ã™ã‚‹æ™‚,trueã‚’è¿”ã™ï¼Ž
-find_library(lib, func, path...)
+find_library(lib, func, path...) ::
- ´Ø¿ôfunc¤òÄêµÁ¤·¤Æ¤¤¤ë¥é¥¤¥Ö¥é¥êlib¤Î¸ºß¤ò -Lpath ¤òÄɲÃ
- ¤·¤Ê¤¬¤é¥Á¥§¥Ã¥¯¤¹¤ë¡¥¥é¥¤¥Ö¥é¥ê¤¬¸«ÉÕ¤«¤Ã¤¿»þ¡¤true¤òÊÖ¤¹¡¥
+ 関数funcを定義ã—ã¦ã„るライブラリlibã®å­˜åœ¨ã‚’ -Lpath を追加
+ ã—ãªãŒã‚‰ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒ©ã‚¤ãƒ–ラリãŒè¦‹ä»˜ã‹ã£ãŸæ™‚,trueã‚’è¿”ã™ï¼Ž
-have_func(func, header)
+have_func(func, header) ::
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëheader¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ´Ø¿ôfunc¤Î¸ºß¤ò¥Á¥§¥Ã
- ¥¯¤¹¤ë¡¥func¤¬É¸½à¤Ç¤Ï¥ê¥ó¥¯¤µ¤ì¤Ê¤¤¥é¥¤¥Ö¥é¥êÆâ¤Î¤â¤Î¤Ç¤¢
- ¤ë»þ¤Ë¤ÏÀè¤Ëhave_library¤Ç¤½¤Î¥é¥¤¥Ö¥é¥ê¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤ª¤¯
- »ö¡¥´Ø¿ô¤¬Â¸ºß¤¹¤ë»þtrue¤òÊÖ¤¹¡¥
+ ヘッダファイルheaderをインクルードã—ã¦é–¢æ•°funcã®å­˜åœ¨ã‚’ãƒã‚§
+ ックã™ã‚‹ï¼ŽfuncãŒæ¨™æº–ã§ã¯ãƒªãƒ³ã‚¯ã•れãªã„ライブラリ内ã®ã‚‚ã®ã§
+ ã‚る時ã«ã¯å…ˆã«have_libraryã§ãã®ãƒ©ã‚¤ãƒ–ラリをãƒã‚§ãƒƒã‚¯ã—ã¦ãŠ
+ ã事.関数ãŒå­˜åœ¨ã™ã‚‹æ™‚trueã‚’è¿”ã™ï¼Ž
-have_var(var, header)
+have_var(var, header) ::
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëheader¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤ÆÊÑ¿ôvar¤Î¸ºß¤ò¥Á¥§¥Ã
- ¥¯¤¹¤ë¡¥var¤¬É¸½à¤Ç¤Ï¥ê¥ó¥¯¤µ¤ì¤Ê¤¤¥é¥¤¥Ö¥é¥êÆâ¤Î¤â¤Î¤Ç¤¢
- ¤ë»þ¤Ë¤ÏÀè¤Ëhave_library¤Ç¤½¤Î¥é¥¤¥Ö¥é¥ê¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤ª¤¯
- »ö¡¥ÊÑ¿ô¤¬Â¸ºß¤¹¤ë»þtrue¤òÊÖ¤¹¡¥
+ ヘッダファイルheaderをインクルードã—ã¦å¤‰æ•°varã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒ
+ クã™ã‚‹ï¼ŽvarãŒæ¨™æº–ã§ã¯ãƒªãƒ³ã‚¯ã•れãªã„ライブラリ内ã®ã‚‚ã®ã§ã‚
+ る時ã«ã¯å…ˆã«have_libraryã§ãã®ãƒ©ã‚¤ãƒ–ラリをãƒã‚§ãƒƒã‚¯ã—ã¦ãŠã
+ 事.変数ãŒå­˜åœ¨ã™ã‚‹æ™‚trueã‚’è¿”ã™ï¼Ž
-have_header(header)
+have_header(header) ::
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¸ºß¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡¥¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹
- ¤ë»þtrue¤òÊÖ¤¹¡¥
+ ヘッダファイルã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒ˜ãƒƒãƒ€ãƒ•ァイルãŒå­˜åœ¨ã™
+ る時trueã‚’è¿”ã™ï¼Ž
-find_header(header, path...)
+find_header(header, path...) ::
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëheader¤Î¸ºß¤ò -Ipath ¤òÄɲ䷤ʤ¬¤é¥Á¥§¥Ã¥¯
- ¤¹¤ë¡¥¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬¸«ÉÕ¤«¤Ã¤¿»þ¡¤true¤òÊÖ¤¹¡¥
+ ヘッダファイルheaderã®å­˜åœ¨ã‚’ -Ipath を追加ã—ãªãŒã‚‰ãƒã‚§ãƒƒã‚¯
+ ã™ã‚‹ï¼Žãƒ˜ãƒƒãƒ€ãƒ•ァイルãŒè¦‹ä»˜ã‹ã£ãŸæ™‚,trueã‚’è¿”ã™ï¼Ž
-have_struct_member(type, member, header)
+have_struct_member(type, member[, header[, opt]]) ::
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëheader¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ·¿type¤Ë¥á¥ó¥Ðmember
- ¤¬Â¸ºß¤¹¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡¥type¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Æ¡¤member¤ò
- »ý¤Ä¤¹¤ë»þtrue¤òÊÖ¤¹¡¥
+ ヘッダファイルheaderをインクルードã—ã¦åž‹typeã«ãƒ¡ãƒ³ãƒmember
+ ãŒå­˜åœ¨ã™ã‚‹ã‹ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼ŽtypeãŒå®šç¾©ã•れã¦ã„ã¦ï¼Œmemberã‚’
+ æŒã¤ã™ã‚‹æ™‚trueã‚’è¿”ã™ï¼Ž
-have_type(type, header, opt)
+have_type(type, header, opt) ::
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëheader¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ·¿type¤¬Â¸ºß¤¹¤ë¤«¤ò
- ¥Á¥§¥Ã¥¯¤¹¤ë¡¥type¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë»þtrue¤òÊÖ¤¹¡¥
+ ヘッダファイルheaderをインクルードã—ã¦åž‹typeãŒå­˜åœ¨ã™ã‚‹ã‹ã‚’
+ ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼ŽtypeãŒå®šç¾©ã•れã¦ã„る時trueã‚’è¿”ã™ï¼Ž
-check_sizeof(type, header)
+check_sizeof(type, header) ::
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëheader¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ·¿type¤Îcharñ°Ì¥µ¥¤
- ¥º¤òÄ´¤Ù¤ë¡¥type¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë»þ¤½¤Î¥µ¥¤¥º¤òÊÖ¤¹¡¥ÄêµÁ¤µ
- ¤ì¤Æ¤¤¤Ê¤¤¤È¤­¤Ïnil¤òÊÖ¤¹¡¥
+ ヘッダファイルheaderをインクルードã—ã¦åž‹typeã®charå˜ä½ã‚µã‚¤
+ ズを調ã¹ã‚‹ï¼ŽtypeãŒå®šç¾©ã•れã¦ã„る時ãã®ã‚µã‚¤ã‚ºã‚’è¿”ã™ï¼Žå®šç¾©ã•
+ れã¦ã„ãªã„ã¨ãã¯nilã‚’è¿”ã™ï¼Ž
-create_makefile(target)
+create_makefile(target[, target_prefix]) ::
- ³ÈÄ¥¥é¥¤¥Ö¥é¥êÍѤÎMakefile¤òÀ¸À®¤¹¤ë¡¥¤³¤Î´Ø¿ô¤ò¸Æ¤Ð¤Ê¤±¤ì
- ¤Ð¤½¤Î¥é¥¤¥Ö¥é¥ê¤Ï¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Ê¤¤¡¥target¤Ï¥â¥¸¥å¡¼¥ë̾
- ¤òɽ¤¹¡¥
+ 拡張ライブラリ用ã®Makefileを生æˆã™ã‚‹ï¼Žã“ã®é–¢æ•°ã‚’呼ã°ãªã‘れ
+ ã°ãã®ãƒ©ã‚¤ãƒ–ラリã¯ã‚³ãƒ³ãƒ‘イルã•れãªã„.targetã¯ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«å
+ を表ã™ï¼Ž
-find_executable(command, path)
+find_executable(command, path) ::
- ¥³¥Þ¥ó¥Écommand¤òFile::PATH_SEPARATOR¤Ç¶èÀÚ¤é¤ì¤¿¥Ñ¥¹Ì¾¤Î
- ¥ê¥¹¥Èpath¤«¤éõ¤¹¡¥path¤¬nil¤Þ¤¿¤Ï¾Êά¤µ¤ì¤¿¾ì¹ç¤Ï¡¤´Ä¶­
- ÊÑ¿ôPATH¤ÎÃͤò»ÈÍѤ¹¤ë¡¥¼Â¹Ô²Äǽ¤Ê¥³¥Þ¥ó¥É¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç
- ¤Ï¥Ñ¥¹¤ò´Þ¤à¥Õ¥¡¥¤¥ë̾¡¤¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ïnil¤òÊÖ¤¹¡¥
+ コマンドcommandã‚’File::PATH_SEPARATORã§åŒºåˆ‡ã‚‰ã‚ŒãŸãƒ‘スåã®
+ リストpathã‹ã‚‰æŽ¢ã™ï¼ŽpathãŒnilã¾ãŸã¯çœç•¥ã•れãŸå ´åˆã¯ï¼Œç’°å¢ƒ
+ 変数PATHã®å€¤ã‚’使用ã™ã‚‹ï¼Žå®Ÿè¡Œå¯èƒ½ãªã‚³ãƒžãƒ³ãƒ‰ãŒè¦‹ã¤ã‹ã£ãŸå ´åˆ
+ ã¯ãƒ‘スをå«ã‚€ãƒ•ァイルå,見ã¤ã‹ã‚‰ãªã‹ã£ãŸå ´åˆã¯nilã‚’è¿”ã™ï¼Ž
-with_config(withval[, default=nil])
+with_config(withval[, default=nil]) ::
- ¥³¥Þ¥ó¥É¥é¥¤¥ó¾å¤Î--with-<withval>¤Ç»ØÄꤵ¤ì¤¿¥ª¥×¥·¥ç¥óÃͤòÆÀ¤ë¡¥
+ コマンドライン上ã®--with-<withval>ã§æŒ‡å®šã•れãŸã‚ªãƒ—ション値
+ を得る.
-enable_config(config, *defaults)
-disable_config(config, *defaults)
+enable_config(config, *defaults) ::
+disable_config(config, *defaults) ::
- ¥³¥Þ¥ó¥É¥é¥¤¥ó¾å¤Î--enable-<config>¤Þ¤¿¤Ï
- --disable-<config>¤Ç»ØÄꤵ¤ì¤¿¿¿µ¶ÃͤòÆÀ¤ë¡¥
- --enable-<config>¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ïtrue¡¤
- --disable-<config>¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ïfalse¤òÊÖ¤¹¡¥
- ¤É¤Á¤é¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¤¥Ö¥í¥Ã¥¯¤Ä¤­¤Ç¸Æ¤Ó½Ð¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï
- *defaults¤òyield¤·¤¿·ë²Ì¡¤¥Ö¥í¥Ã¥¯¤Ê¤·¤Ê¤é*defaults¤òÊÖ¤¹¡¥
+ コマンドライン上ã®--enable-<config>ã¾ãŸã¯
+ --disable-<config>ã§æŒ‡å®šã•れãŸçœŸå½å€¤ã‚’得る.
+ --enable-<config>ãŒæŒ‡å®šã•れã¦ã„ãŸå ´åˆã¯true,
+ --disable-<config>ãŒæŒ‡å®šã•れã¦ã„ãŸå ´åˆã¯falseã‚’è¿”ã™ï¼Ž
+ ã©ã¡ã‚‰ã‚‚指定ã•れã¦ã„ãªã„å ´åˆã¯ï¼Œãƒ–ロックã¤ãã§å‘¼ã³å‡ºã•れã¦
+ ã„ã‚‹å ´åˆã¯*defaultsã‚’yieldã—ãŸçµæžœï¼Œãƒ–ロックãªã—ãªã‚‰
+ *defaultsã‚’è¿”ã™ï¼Ž
-dir_config(target[, default_dir])
-dir_config(target[, default_include, default_lib])
+dir_config(target[, default_dir]) ::
+dir_config(target[, default_include, default_lib]) ::
- ¥³¥Þ¥ó¥É¥é¥¤¥ó¾å¤Î--with-<target>-dir, --with-<target>-include,
- --with-<target>-lib¤Î¤¤¤º¤ì¤«¤Ç»ØÄꤵ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò
- $CFLAGS ¤ä $LDFLAGS ¤ËÄɲ乤롥--with-<target>-dir=/path¤Ï
+ コマンドライン上ã®--with-<target>-dir, --with-<target>-include,
+ --with-<target>-libã®ã„ãšã‚Œã‹ã§æŒ‡å®šã•れるディレクトリを
+ $CFLAGS ã‚„ $LDFLAGS ã«è¿½åŠ ã™ã‚‹ï¼Ž--with-<target>-dir=/pathã¯
--with-<target>-include=/path/include --with-<target>-lib=/path/lib
- ¤ÈÅù²Á¤Ç¤¢¤ë¡¥Äɲ䵤줿 include ¥Ç¥£¥ì¥¯¥È¥ê¤È lib ¥Ç¥£¥ì¥¯¥È¥ê¤Î
- ÇÛÎó¤òÊÖ¤¹¡¥ ([include_dir, lib_dir])
+ ã¨ç­‰ä¾¡ã§ã‚る.追加ã•れ㟠include ディレクトリ㨠lib ディレ
+ クトリã®é…列を返ã™ï¼Ž ([include_dir, lib_dir])
-pkg_config(pkg)
+pkg_config(pkg) ::
- pkg-config¥³¥Þ¥ó¥É¤«¤é¥Ñ¥Ã¥±¡¼¥¸pkg¤Î¾ðÊó¤òÆÀ¤ë¡¥
- pkg-config¤Î¼ÂºÝ¤Î¥³¥Þ¥ó¥É̾¤Ï¡¤--with-pkg-config¥³¥Þ¥ó¥É
- ¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤Ç»ØÄê²Äǽ¡¥
+ pkg-configコマンドã‹ã‚‰ãƒ‘ッケージpkgã®æƒ…報を得る.
+ pkg-configã®å®Ÿéš›ã®ã‚³ãƒžãƒ³ãƒ‰åã¯ï¼Œ--with-pkg-configコマンド
+ ãƒ©ã‚¤ãƒ³ã‚ªãƒ—ã‚·ãƒ§ãƒ³ã§æŒ‡å®šå¯èƒ½ï¼Ž
/*
* Local variables:
diff --git a/README.ja b/README.ja
index df8cfc03f4..03c007af7c 100644
--- a/README.ja
+++ b/README.ja
@@ -1,160 +1,192 @@
-* Ruby¤È¤Ï
+= Rubyã¨ã¯
-Ruby¤Ï¥·¥ó¥×¥ë¤«¤Ä¶¯ÎϤʥª¥Ö¥¸¥§¥¯¥È»Ø¸þ¥¹¥¯¥ê¥×¥È¸À¸ì¤Ç¤¹¡¥
-Ruby¤ÏºÇ½é¤«¤é½ã¿è¤Ê¥ª¥Ö¥¸¥§¥¯¥È»Ø¸þ¸À¸ì¤È¤·¤ÆÀ߷פµ¤ì¤Æ¤¤¤Þ
-¤¹¤«¤é¡¤¥ª¥Ö¥¸¥§¥¯¥È»Ø¸þ¥×¥í¥°¥é¥ß¥ó¥°¤ò¼ê·Ú¤Ë¹Ô¤¦»ö¤¬½ÐÍè¤Þ
-¤¹¡¥¤â¤Á¤í¤óÄ̾ï¤Î¼ê³¤­·¿¤Î¥×¥í¥°¥é¥ß¥ó¥°¤â²Äǽ¤Ç¤¹¡¥
+Rubyã¯ã‚·ãƒ³ãƒ—ルã‹ã¤å¼·åŠ›ãªã‚ªãƒ–ジェクト指å‘スクリプト言語ã§ã™ï¼Ž
+Rubyã¯æœ€åˆã‹ã‚‰ç´”粋ãªã‚ªãƒ–ジェクト指å‘言語ã¨ã—ã¦è¨­è¨ˆã•れã¦ã„ã¾
+ã™ã‹ã‚‰ï¼Œã‚ªãƒ–ジェクト指å‘プログラミングを手軽ã«è¡Œã†äº‹ãŒå‡ºæ¥ã¾
+ã™ï¼Žã‚‚ã¡ã‚ã‚“é€šå¸¸ã®æ‰‹ç¶šãåž‹ã®ãƒ—ログラミングもå¯èƒ½ã§ã™ï¼Ž
-Ruby¤Ï¥Æ¥­¥¹¥È½èÍý´Ø·¸¤ÎǽÎϤʤɤËÍ¥¤ì¡¤Perl¤ÈƱ¤¸¤¯¤é¤¤¶¯ÎÏ
-¤Ç¤¹¡¥¤µ¤é¤Ë¥·¥ó¥×¥ë¤Êʸˡ¤È¡¤Îã³°½èÍý¤ä¥¤¥Æ¥ì¡¼¥¿¤Ê¤É¤Îµ¡¹½
-¤Ë¤è¤Ã¤Æ¡¤¤è¤êʬ¤«¤ê¤ä¤¹¤¤¥×¥í¥°¥é¥ß¥ó¥°¤¬½ÐÍè¤Þ¤¹¡¥
+Rubyã¯ãƒ†ã‚­ã‚¹ãƒˆå‡¦ç†é–¢ä¿‚ã®èƒ½åŠ›ãªã©ã«å„ªã‚Œï¼ŒPerlã¨åŒã˜ãらã„強力
+ã§ã™ï¼Žã•らã«ã‚·ãƒ³ãƒ—ãƒ«ãªæ–‡æ³•ã¨ï¼Œä¾‹å¤–処ç†ã‚„イテレータãªã©ã®æ©Ÿæ§‹
+ã«ã‚ˆã£ã¦ï¼Œã‚ˆã‚Šåˆ†ã‹ã‚Šã‚„ã™ã„プログラミングãŒå‡ºæ¥ã¾ã™ï¼Ž
-* Ruby¤ÎÆÃĹ
+== Rubyã®ç‰¹é•·
- + ¥·¥ó¥×¥ë¤Êʸˡ
- + ÉáÄ̤Υª¥Ö¥¸¥§¥¯¥È»Ø¸þµ¡Ç½(¥¯¥é¥¹¡¤¥á¥½¥Ã¥É¥³¡¼¥ë¤Ê¤É)
- + ÆÃ¼ì¤Ê¥ª¥Ö¥¸¥§¥¯¥È»Ø¸þµ¡Ç½(Mixin, ÆÃ°Û¥á¥½¥Ã¥É¤Ê¤É)
- + ±é»»»Ò¥ª¡¼¥Ð¡¼¥í¡¼¥É
- + Îã³°½èÍýµ¡Ç½
- + ¥¤¥Æ¥ì¡¼¥¿¤È¥¯¥í¡¼¥¸¥ã
- + ¥¬¡¼¥Ù¡¼¥¸¥³¥ì¥¯¥¿
- + ¥À¥¤¥Ê¥ß¥Ã¥¯¥í¡¼¥Ç¥£¥ó¥° (¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤è¤ë)
- + °Ü¿¢À­¤¬¹â¤¤¡¥Â¿¤¯¤ÎUNIX¾å¤Çư¤¯¤À¤±¤Ç¤Ê¤¯¡¤DOS¤äWindows¡¤
- Mac¡¤BeOS¤Ê¤É¤Î¾å¤Ç¤âư¤¯
+* ã‚·ãƒ³ãƒ—ãƒ«ãªæ–‡æ³•
+* 普通ã®ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆæŒ‡å‘æ©Ÿèƒ½(クラス,メソッドコールãªã©)
+* 特殊ãªã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆæŒ‡å‘æ©Ÿèƒ½(Mixin, 特異メソッドãªã©)
+* 演算å­ã‚ªãƒ¼ãƒãƒ¼ãƒ­ãƒ¼ãƒ‰
+* ä¾‹å¤–å‡¦ç†æ©Ÿèƒ½
+* イテレータã¨ã‚¯ãƒ­ãƒ¼ã‚¸ãƒ£
+* ガーベージコレクタ
+* ダイナミックローディング (アーキテクãƒãƒ£ã«ã‚ˆã‚‹)
+* ç§»æ¤æ€§ãŒé«˜ã„.多ãã®Unix-like/POSIX互æ›ãƒ—ラットフォーム上ã§
+ å‹•ãã ã‘ã§ãªã,Windows, Mac OS X,BeOSãªã©ã®ä¸Šã§ã‚‚å‹•ã
+ cf. http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatformsJa
+== 入手法
-* Æþ¼êË¡
+=== FTPã§
-** FTP¤Ç
+以下ã®å ´æ‰€ã«ãŠã„ã¦ã‚りã¾ã™ï¼Ž
-°Ê²¼¤Î¾ì½ê¤Ë¤ª¤¤¤Æ¤¢¤ê¤Þ¤¹¡¥
+ftp://ftp.ruby-lang.org/pub/ruby/
- ftp://ftp.ruby-lang.org/pub/ruby/
+=== Subversionã§
-** Subversion¤Ç
-
-ËÜ¥Ö¥é¥ó¥Á¤ÎRuby¤ÎºÇ¿·¤Î¥½¡¼¥¹¥³¡¼¥É¤Ï¼¡¤Î¥³¥Þ¥ó¥É¤Ç¼èÆÀ¤Ç¤­¤Þ¤¹¡¥
-
- $ svn co http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_6/
-
-³«È¯Àèü¤Î¥½¡¼¥¹¥³¡¼¥É¤Ï¼¡¤Î¥³¥Þ¥ó¥É¤Ç¼èÆÀ¤Ç¤­¤Þ¤¹¡¥
+開発先端ã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã¯æ¬¡ã®ã‚³ãƒžãƒ³ãƒ‰ã§å–å¾—ã§ãã¾ã™ï¼Ž
$ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
-¾¤Ë³«È¯Ãæ¤Î¥Ö¥é¥ó¥Á¤Î°ìÍ÷¤Ï¼¡¤Î¥³¥Þ¥ó¥É¤Ç¸«¤é¤ì¤Þ¤¹¡¥
+ä»–ã«é–‹ç™ºä¸­ã®ãƒ–ランãƒã®ä¸€è¦§ã¯æ¬¡ã®ã‚³ãƒžãƒ³ãƒ‰ã§è¦‹ã‚‰ã‚Œã¾ã™ï¼Ž
$ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
+=== Gitã§
+
+Subversionã®ãƒŸãƒ©ãƒ¼ã‚’GitHubã«å…¬é–‹ã—ã¦ã„ã¾ã™ï¼Ž
+以下ã®ã‚³ãƒžãƒ³ãƒ‰ã§ãƒªãƒã‚¸ãƒˆãƒªã‚’å–å¾—ã§ãã¾ã™ï¼Ž
+
+ $ git clone git://github.com/ruby/ruby.git
-* ¥Û¡¼¥à¥Ú¡¼¥¸
+== ホームページ
-Ruby¤Î¥Û¡¼¥à¥Ú¡¼¥¸¤ÎURL¤Ï
+Rubyã®ãƒ›ãƒ¼ãƒ ãƒšãƒ¼ã‚¸ã®URLã¯
- http://www.ruby-lang.org/
+http://www.ruby-lang.org/
-¤Ç¤¹¡¥
+ã§ã™ï¼Ž
-* ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È
+== メーリングリスト
-Ruby¤Î¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤¬¤¢¤ê¤Þ¤¹¡£»²²Ã´õ˾¤ÎÊý¤Ï
+Rubyã®ãƒ¡ãƒ¼ãƒªãƒ³ã‚°ãƒªã‚¹ãƒˆãŒã‚りã¾ã™ã€‚å‚åŠ å¸Œæœ›ã®æ–¹ã¯
- ruby-list-ctl@ruby-lang.org
+mailto:ruby-list-ctl@ruby-lang.org
-¤Þ¤ÇËÜʸ¤Ë
+ã¾ã§æœ¬æ–‡ã«
subscribe YourFirstName YourFamilyName
-
-¤È½ñ¤¤¤ÆÁ÷¤Ã¤Æ²¼¤µ¤¤¡£
-Ruby³«È¯¼Ô¸þ¤±¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤â¤¢¤ê¤Þ¤¹¡£¤³¤Á¤é¤Ç¤Ïruby¤Î¥Ð
-¥°¡¢¾­Íè¤Î»ÅÍͳÈÄ¥¤Ê¤É¼ÂÁõ¾å¤ÎÌäÂê¤Ë¤Ä¤¤¤ÆµÄÏÀ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-»²²Ã´õ˾¤ÎÊý¤Ï
+ã¨æ›¸ã„ã¦é€ã£ã¦ä¸‹ã•ã„。
+
+Ruby開発者å‘ã‘メーリングリストもã‚りã¾ã™ã€‚ã“ã¡ã‚‰ã§ã¯rubyã®ãƒ
+ã‚°ã€å°†æ¥ã®ä»•様拡張ãªã©å®Ÿè£…上ã®å•題ã«ã¤ã„ã¦è­°è«–ã•れã¦ã„ã¾ã™ã€‚
+å‚åŠ å¸Œæœ›ã®æ–¹ã¯
+
+mailto:ruby-dev-ctl@ruby-lang.org
+
+ã¾ã§ruby-listã¨åŒæ§˜ã®æ–¹æ³•ã§ãƒ¡ãƒ¼ãƒ«ã—ã¦ãã ã•ã„。
+
+Ruby拡張モジュールã«ã¤ã„ã¦è©±ã—åˆã†ruby-extメーリングリストã¨
+数学関係ã®è©±é¡Œã«ã¤ã„ã¦è©±ã—åˆã†ruby-mathメーリングリストã¨
+英語ã§è©±ã—åˆã†ruby-talkメーリングリストもã‚りã¾ã™ã€‚å‚加方法
+ã¯ã©ã‚Œã‚‚åŒã˜ã§ã™ã€‚
+
- ruby-dev-ctl@ruby-lang.org
+== コンパイル・インストール
-¤Þ¤Çruby-list¤ÈƱÍͤÎÊýË¡¤Ç¥á¡¼¥ë¤·¤Æ¤¯¤À¤µ¤¤¡£
+ä»¥ä¸‹ã®æ‰‹é †ã§è¡Œã£ã¦ãã ã•ã„.
-Ruby³ÈÄ¥¥â¥¸¥å¡¼¥ë¤Ë¤Ä¤¤¤ÆÏ䷹礦ruby-ext¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤È
-¿ô³Ø´Ø·¸¤ÎÏÃÂê¤Ë¤Ä¤¤¤ÆÏ䷹礦ruby-math¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤È
-±Ñ¸ì¤ÇÏ䷹礦ruby-talk¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤â¤¢¤ê¤Þ¤¹¡£»²²ÃÊýË¡
-¤Ï¤É¤ì¤âƱ¤¸¤Ç¤¹¡£
+1. ã‚‚ã— +configure+ ファイルãŒè¦‹ã¤ã‹ã‚‰ãªã„ã€ã‚‚ã—ãã¯
+ +configure.in+ よりå¤ã„よã†ãªã‚‰ã€ +autoconf+ を実行ã—ã¦
+ æ–°ã—ã +configure+ を生æˆã™ã‚‹
+2. +configure+ を実行ã—㦠+Makefile+ ãªã©ã‚’生æˆã™ã‚‹
-* ¥³¥ó¥Ñ¥¤¥ë¡¦¥¤¥ó¥¹¥È¡¼¥ë
+ 環境ã«ã‚ˆã£ã¦ã¯ãƒ‡ãƒ•ォルトã®Cコンパイラ用オプションãŒä»˜ã
+ ã¾ã™ï¼Ž +configure+ オプション㧠<tt>optflags=..</tt> <tt>warnflags=..</tt> ç­‰
+ ã§ä¸Šæ›¸ãã§ãã¾ã™ï¼Ž
-°Ê²¼¤Î¼ê½ç¤Ç¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡¥
+3. (å¿…è¦ãªã‚‰ã°)+defines.h+ を編集ã™ã‚‹
- 1. ¤â¤·configure¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤é¤Ê¤¤¡¢¤â¤·¤¯¤Ï
- configure.in¤è¤ê¸Å¤¤¤è¤¦¤Ê¤é¡¢autoconf¤ò¼Â¹Ô¤·¤Æ
- ¿·¤·¤¯configure¤òÀ¸À®¤¹¤ë
+ 多分,必è¦ç„¡ã„ã¨æ€ã„ã¾ã™ï¼Ž
- 2. configure¤ò¼Â¹Ô¤·¤ÆMakefile¤Ê¤É¤òÀ¸À®¤¹¤ë
+4. (å¿…è¦ãªã‚‰ã°)+ext/Setup+ ã«é™çš„ã«ãƒªãƒ³ã‚¯ã™ã‚‹æ‹¡å¼µãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã‚’
+ 指定ã™ã‚‹
- 3. (ɬÍפʤé¤Ð)defines.h¤òÊÔ½¸¤¹¤ë
+ +ext/Setup+ ã«è¨˜è¿°ã—ãŸãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã¯é™çš„ã«ãƒªãƒ³ã‚¯ã•れã¾ã™ï¼Ž
- ¿ʬ¡¤É¬Í×̵¤¤¤È»×¤¤¤Þ¤¹¡¥
+ ダイナミックローディングをサãƒãƒ¼ãƒˆã—ã¦ã„ãªã„アーキテク
+ ãƒãƒ£ã§ã¯ +Setup+ ã®1行目ã®ã€Œ<tt>option nodynamic</tt>ã€ã¨ã„ã†è¡Œã®ã‚³
+ メントを外ã™å¿…è¦ãŒã‚りã¾ã™ï¼Žã¾ãŸï¼Œã“ã®ã‚¢ãƒ¼ã‚­ãƒ†ã‚¯ãƒãƒ£ã§
+ 拡張モジュールを利用ã™ã‚‹ãŸã‚ã«ã¯ï¼Œã‚らã‹ã˜ã‚é™çš„ã«ãƒªãƒ³
+ クã—ã¦ãŠãå¿…è¦ãŒã‚りã¾ã™ï¼Ž
- 4. (ɬÍפʤé¤Ð)ext/Setup¤ËÀÅŪ¤Ë¥ê¥ó¥¯¤¹¤ë³ÈÄ¥¥â¥¸¥å¡¼¥ë¤ò
- »ØÄꤹ¤ë
+5. +make+ を実行ã—ã¦ã‚³ãƒ³ãƒ‘イルã™ã‚‹
- ext/Setup¤Ëµ­½Ò¤·¤¿¥â¥¸¥å¡¼¥ë¤ÏÀÅŪ¤Ë¥ê¥ó¥¯¤µ¤ì¤Þ¤¹¡¥
+6. <tt>make check</tt>ã§ãƒ†ã‚¹ãƒˆã‚’行ã†ï¼Ž
- ¥À¥¤¥Ê¥ß¥Ã¥¯¥í¡¼¥Ç¥£¥ó¥°¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥¢¡¼¥­¥Æ¥¯
- ¥Á¥ã¤Ç¤ÏSetup¤Î1¹ÔÌܤΡÖoption nodynamic¡×¤È¤¤¤¦¹Ô¤Î¥³
- ¥á¥ó¥È¤ò³°¤¹É¬Íפ¬¤¢¤ê¤Þ¤¹¡¥¤Þ¤¿¡¤¤³¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç
- ³ÈÄ¥¥â¥¸¥å¡¼¥ë¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¤¤¢¤é¤«¤¸¤áÀÅŪ¤Ë¥ê¥ó
- ¥¯¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡¥
+ 「<tt>check succeeded</tt>ã€ã¨è¡¨ç¤ºã•ã‚Œã‚Œã°æˆåŠŸã§ã™ï¼ŽãŸã ã—テスト
+ ã«æˆåŠŸã—ã¦ã‚‚完璧ã ã¨ä¿è¨¼ã•れã¦ã„る訳ã§ã¯ã‚りã¾ã›ã‚“.
- 5. make¤ò¼Â¹Ô¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤¹¤ë
+7. <tt>make install</tt>
- 6. make test¤Ç¥Æ¥¹¥È¤ò¹Ô¤¦¡¥
+ 以下ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’作ã£ã¦ï¼Œãã“ã«ãƒ•ァイルをインストー
+ ルã—ã¾ã™ï¼Ž
- ¡Ötest succeeded¡×¤Èɽ¼¨¤µ¤ì¤ì¤ÐÀ®¸ù¤Ç¤¹¡¥¤¿¤À¤·¥Æ¥¹¥È
- ¤ËÀ®¸ù¤·¤Æ¤â´°àú¤À¤ÈÊݾڤµ¤ì¤Æ¤¤¤ëÌõ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡¥
+ * <tt>${DESTDIR}${prefix}/bin</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/share/man/man1</tt>
+ * <tt>${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system</tt>
- 7. make install
+ Rubyã®APIãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒ'_x.y.z_'ã§ã‚れã°ï¼Œ<tt>${MAJOR}</tt>ã¯
+ '_x_'ã§ï¼Œ<tt>${MINOR}</tt>ã¯'_y_',<tt>${TEENY}</tt>ã¯'_z_'ã§ã™ï¼Ž
- root¤Çºî¶È¤¹¤ëɬÍפ¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡¥
+ <b>注æ„</b>: APIãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® +teeny+ ã¯ï¼ŒRubyプログラムã®ãƒãƒ¼ã‚¸ãƒ§
+ ンã¨ã¯ç•°ãªã‚‹ã“ã¨ãŒã‚りã¾ã™ï¼Ž
-¤â¤·¡¤¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤Ï¥¨¥é¡¼¤Î¥í¥°¤È¥Þ
-¥·¥ó¡¤OS¤Î¼ïÎà¤ò´Þ¤à¤Ç¤­¤ë¤À¤±¾Ü¤·¤¤¥ì¥Ý¡¼¥È¤òºî¼Ô¤ËÁ÷¤Ã¤Æ¤¯
-¤À¤µ¤ë¤È¾¤ÎÊý¤Î¤¿¤á¤Ë¤â¤Ê¤ê¤Þ¤¹¡¥
+ +root+ ã§ä½œæ¥­ã™ã‚‹å¿…è¦ãŒã‚ã‚‹ã‹ã‚‚ã—れã¾ã›ã‚“.
+ã‚‚ã—,コンパイル時ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ãŸå ´åˆã«ã¯ã‚¨ãƒ©ãƒ¼ã®ãƒ­ã‚°ã¨ãƒž
+シン,OSã®ç¨®é¡žã‚’å«ã‚€ã§ãã‚‹ã ã‘詳ã—ã„レãƒãƒ¼ãƒˆã‚’作者ã«é€ã£ã¦ã
+ã ã•ã‚‹ã¨ä»–ã®æ–¹ã®ãŸã‚ã«ã‚‚ãªã‚Šã¾ã™ï¼Ž
-* °Ü¿¢
-UNIX¤Ç¤¢¤ì¤Ðconfigure¤¬¤Û¤È¤ó¤É¤Îº¹°Û¤òµÛ¼ý¤·¤Æ¤¯¤ì¤ë¤Ï¤º¤Ç
-¤¹¤¬¡¤»×¤ï¤Ì¸«Íî¤È¤·¤¬¤¢¤Ã¤¿¾ì¹ç(¤¢¤ë¤Ë°ã¤¤¤Ê¤¤)¡¤ºî¼Ô¤Ë¤½¤Î
-¤³¤È¤ò¥ì¥Ý¡¼¥È¤¹¤ì¤Ð¡¤²ò·è¤Ç¤­¤ë¤«¤âÃΤì¤Þ¤»¤ó¡¥
+== ç§»æ¤
-¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤â¤Ã¤È¤â°Í¸¤¹¤ë¤Î¤ÏGCÉô¤Ç¤¹¡¥Ruby¤ÎGC¤ÏÂоÝ
-¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤¬setjmp()¤Ë¤è¤Ã¤ÆÁ´¤Æ¤Î¥ì¥¸¥¹¥¿¤ò jmp_buf¤Ë
-³ÊǼ¤¹¤ë¤³¤È¤È¡¤jmp_buf¤È¥¹¥¿¥Ã¥¯¤¬32bit¥¢¥é¥¤¥ó¥á¥ó¥È¤µ¤ì¤Æ
-¤¤¤ë¤³¤È¤ò²¾Äꤷ¤Æ¤¤¤Þ¤¹¡¥ÆÃ¤ËÁ°¼Ô¤¬À®Î©¤·¤Ê¤¤¾ì¹ç¤ÎÂбþ¤ÏÈó
-¾ï¤Ëº¤Æñ¤Ç¤·¤ç¤¦¡¥¸å¼Ô¤Î²ò·è¤ÏÈæ³ÓŪ´Êñ¤Ç¡¤gc.c¤Ç¥¹¥¿¥Ã¥¯¤ò
-¥Þ¡¼¥¯¤·¤Æ¤¤¤ëÉôʬ¤Ë¥¢¥é¥¤¥ó¥á¥ó¥È¤Î¥Ð¥¤¥È¿ô¤À¤±¤º¤é¤·¤Æ¥Þ¡¼
-¥¯¤¹¤ë¥³¡¼¥É¤òÄɲ乤ë¤À¤±¤ÇºÑ¤ß¤Þ¤¹¡¥¡Ödefined(THINK_C)¡×¤Ç
-³ç¤é¤ì¤Æ¤¤¤ëÉôʬ¤ò»²¹Í¤Ë¤·¤Æ¤¯¤À¤µ¤¤
+UNIXã§ã‚れ㰠+configure+ ãŒã»ã¨ã‚“ã©ã®å·®ç•°ã‚’å¸åŽã—ã¦ãれるã¯ãšã§
+ã™ãŒï¼Œæ€ã‚ã¬è¦‹è½ã¨ã—ãŒã‚ã£ãŸå ´åˆ(ã‚ã‚‹ã«é•ã„ãªã„),作者ã«ãã®
+ã“ã¨ã‚’レãƒãƒ¼ãƒˆã™ã‚Œã°ï¼Œè§£æ±ºã§ãã‚‹ã‹ã‚‚知れã¾ã›ã‚“.
-# ¼ÂºÝ¤Ë¤ÏRuby¤ÏThink C¤Ç¤Ï¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤Þ¤»¤ó¡¥
+アーキテクãƒãƒ£ã«ã‚‚ã£ã¨ã‚‚ä¾å­˜ã™ã‚‹ã®ã¯GC部ã§ã™ï¼ŽRubyã®GCã¯å¯¾è±¡
+ã®ã‚¢ãƒ¼ã‚­ãƒ†ã‚¯ãƒãƒ£ãŒ<tt>setjmp()</tt>ã¾ãŸã¯<tt>getcontext()</tt>ã«ã‚ˆã£ã¦å…¨ã¦ã®ãƒ¬
+ジスタを +jmp_buf+ ã‚„ +ucontext_t+ ã«æ ¼ç´ã™ã‚‹ã“ã¨ã¨ï¼Œ +jmp_buf+ ã‚„
++ucontext_t+ ã¨ã‚¹ã‚¿ãƒƒã‚¯ãŒ32bitアラインメントã•れã¦ã„ã‚‹ã“ã¨ã‚’仮定
+ã—ã¦ã„ã¾ã™ï¼Žç‰¹ã«å‰è€…ãŒæˆç«‹ã—ãªã„å ´åˆã®å¯¾å¿œã¯éžå¸¸ã«å›°é›£ã§ã—ょã†ï¼Ž
+後者ã®è§£æ±ºã¯æ¯”較的簡å˜ã§ï¼Œ +gc.c+ ã§ã‚¹ã‚¿ãƒƒã‚¯ã‚’マークã—ã¦ã„ã‚‹
+部分ã«ã‚¢ãƒ©ã‚¤ãƒ³ãƒ¡ãƒ³ãƒˆã®ãƒã‚¤ãƒˆæ•°ã ã‘ãšã‚‰ã—ã¦ãƒžãƒ¼ã‚¯ã™ã‚‹ã‚³ãƒ¼ãƒ‰ã‚’
+追加ã™ã‚‹ã ã‘ã§æ¸ˆã¿ã¾ã™ï¼Ž<tt>defined(\_\_mc68000\_\_)</tt>ã§æ‹¬ã‚‰ã‚Œã¦ã„
+る部分をå‚考ã«ã—ã¦ãã ã•ã„.
-¥ì¥¸¥¹¥¿¥¦¥£¥ó¥É¥¦¤ò»ý¤ÄCPU¤Ç¤Ï¡¤¥ì¥¸¥¹¥¿¥¦¥£¥ó¥É¥¦¤ò¥¹¥¿¥Ã
-¥¯¤Ë¥Õ¥é¥Ã¥·¥å¤¹¤ë¥¢¥»¥ó¥Ö¥é¥³¡¼¥É¤òÄɲ乤ëɬÍפ¬¤¢¤ë¤«¤âÃÎ
-¤ì¤Þ¤»¤ó¡¥
+レジスタウィンドウをæŒã¤CPUã§ã¯ï¼Œãƒ¬ã‚¸ã‚¹ã‚¿ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’スタッ
+クã«ãƒ•ラッシュã™ã‚‹ã‚¢ã‚»ãƒ³ãƒ–ラコードを追加ã™ã‚‹å¿…è¦ãŒã‚ã‚‹ã‹ã‚‚知
+れã¾ã›ã‚“.
-* ÇÛÉÛ¾ò·ï
+== é…布æ¡ä»¶
-COPYING.ja¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
++COPYING.ja+ ファイルをå‚ç…§ã—ã¦ãã ã•ã„。
-* Ãø¼Ô
+== 著者
-¥³¥á¥ó¥È¡¤¥Ð¥°¥ì¥Ý¡¼¥È¤½¤Î¾¤Ï matz@netlab.jp ¤Þ¤Ç¡¥
+コメント,ãƒã‚°ãƒ¬ãƒãƒ¼ãƒˆãã®ä»–㯠mailto:matz@ruby-lang.jp ã¾ã§ï¼Ž
-------------------------------------------------------
created at: Thu Aug 3 11:57:36 JST 1995
+--
Local variables:
-mode: indented-text
+mode: rdoc
end:
diff --git a/ToDo b/ToDo
deleted file mode 100644
index b55e399edf..0000000000
--- a/ToDo
+++ /dev/null
@@ -1,126 +0,0 @@
-Language Spec.
-
-- Class#allocate - basicNew
-- class Foo::Bar<Baz .. end, module Boo::Bar .. end
-* operator !! for rescue. ???
-* objectify characters
-* ../... outside condition invokes operator method too.
-* ... inside condition turns off just before right condition.???
-* package or access control for global variables??
-* named arguments like foo(nation:="german") or foo(nation: "german").
-* method to retrieve argument information (needs new C API)
-* multiple return values, yield values. maybe incompatible ???
-* cascading method invocation ???
-* def Class#method .. end ??
-* def Foo::Bar::baz() .. end ??
-* I18N (or M17N) script/string/regexp
-* Fixnum 0 as false ????
-* discourage use of symbol variables (e.g. $/, etc.) in manual
-* discourage use of Perlish features by giving warnings.
-* non confusing in-block local variable (is it possible?)
- + remove scope by block
- + variables appears within block may have independent values.
-* Regexp: make /o thread safe.
-* decide whether begin with rescue or ensure make do..while loop.
-* a +1 to be a+1, not a(+1).
-* unify == and eql? again
-* to_i returns nil if str contains no digit.
-* raise exception by `` error
-* jar like combined library package. -> RubyGems?
-* resumable Exception via Exception#resume.
-* method combination, e.g. before, after, around, etc.
-* .. or something like defadvice in Emacs.
-* property - for methods, or for objects in general.
-* "in" modifier, to annotate, or to encourage assertion.
-* selector namespace - something like generic-flet in CLOS, to help RubyBehavior
-* private instance variable (as in Python?) @_foo in class Foo => @_Foo_foo
-* warn/error "bare word" method, like "foo", you should type "foo()"
-* clarify evaluation order of operator argument (=~, .., ...)
-* :symbol => value hash in the form of {symbol: value, ...} ??
-
-Hacking Interpreter
-
-- generational GC
-* non-blocking open (e.g. for named pipe) for thread
-* avoid blocking with gethostbyname/gethostbyaddr (use fork ???)
-* objectify interpreters ???
-* remove rb_eval() recursions
-* syntax tree -> bytecode ???
-* scrambled script, or script filter
-* setuid ruby
-* performance tune for in-block (dynamic) local variables.
-* give warnings to assign magic variables.
-* export rb_io_{addstr,printf,puts,print}
-* autoload should work with threads [ruby-talk:4589]
-* remove stdio dependency from IOs.
-* warn for inconsistent local variable usage (lv m and method m at the same time).
-* MicroRuby
-* Built-in Interactive Ruby.
-* Parser API
-* trap every method invocation, which can be enabled by e.g. trap_call :method.
-* unify Errno exceptions of same errno, or new exception comparison scheme.
-* 2.times{|i| if i==0 then a = 15 else puts eval("a") end} should print nil.
-* Thread#max_stack_size attribute (possible??)
-
-Standard Libraries
-
-- Module#define_method which takes a name and a body (block, proc or method).
-- Enume#inject
-- Array#fetch
-- IO::for_fd
-- Process::waitall [ruby-talk:4557]
-- Process::Status
-- File::lchown, File::lchmod; xxx - still need work for non existing platforms
-- move Time::times to Process.
-- Enumerable#sort_by for Schwartzian transformation
-- fork_and_kill_other_threads.
-- signal list (Signal::trap, Signal::list).
-- move NameError under StandardError.
-- Integer#to_s(base)
-- Hash::new{default}
-- hash etc. should handle self referenceing array/hash
-- Array#select(n1,n2...) works like Array#indexes(n1,n2...)
-- use Mersenne Twister RNG for random.
-- deprecate Array#indexes, and Array#indices.
-- remove dependency on MAXPATHLEN.
-* String#scanf(?)
-* Object#fmt(?)
-* Time::strptime
-* Integer[num], Float[num]; Fixnum[num]?
-* method to retrieve non-number trailer for to_i/to_f.
-* Stream or Port, abstract superclass of IO ?
-* String#{pred,prev}, String#downto
-* optional stepsize argument for succ()
-* Ruby module -- Ruby::Version, Ruby::Interpreter
-* introduce Boolean class; super of TrueClass, FalseClass
-* synchronized method - synchronized{...}, synchronized :foo, :bar
-* Array#&, Array#| to allow duplication. ???
-* way to specify immortal (fork endurance) thread;
-* or raise ForkException to every thread but fork caller.
-* new user-defined marshal scheme. _dump(dumper), _load(restorer)
-* library to load per-user profile seeking .ruby_profile or ruby.ini file.
-* warning framework (warn, warning for Ruby level)
-* marshal should not depend on sprintf (works bad with locale).
-* ternary arg pow: a.pow(b,c) == a**b%c
-* new caller(), e.g. call_stack; needs better name.
-* pointer share mechanism similar to one in String for Array.
-* require "1.6" etc. by /usr/lib/ruby/1.6/1.6.rb ;-)
-* save both "feature names" and "normalized path" in $"
-* implement Mutex_m (or MutexMixin) using Mutex.
-
-Extension Libraries
-
-* ptk.rb pTk wrapper that is compatible to tk.rb
-* Berkeley DB extension
-* BitVector
-* thread-safe fcgi
-
-Ruby Libraries
-
-* urllib.rb, nttplib.rb, etc.
-* format like perl's
-
-Tools
-
-* freeze or undump to bundle everything
-* bundle using zlib
diff --git a/addr2line.c b/addr2line.c
new file mode 100644
index 0000000000..04a48e751d
--- /dev/null
+++ b/addr2line.c
@@ -0,0 +1,649 @@
+/**********************************************************************
+
+ addr2line.c -
+
+ $Author$
+
+ Copyright (C) 2010 Shinichiro Hamaji
+
+**********************************************************************/
+
+#include "ruby/config.h"
+#include "addr2line.h"
+
+#include <stdio.h>
+#include <errno.h>
+
+#ifdef USE_ELF
+
+#ifdef __OpenBSD__
+#include <elf_abi.h>
+#else
+#include <elf.h>
+#endif
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+/* Make alloca work the best possible way. */
+#ifdef __GNUC__
+# ifndef atarist
+# ifndef alloca
+# define alloca __builtin_alloca
+# endif
+# endif /* atarist */
+#else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+#pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+void *alloca();
+# endif
+# endif /* AIX */
+# endif /* HAVE_ALLOCA_H */
+#endif /* __GNUC__ */
+
+#ifdef HAVE_DL_ITERATE_PHDR
+# ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+# endif
+# include <link.h>
+#endif
+
+#define DW_LNS_copy 0x01
+#define DW_LNS_advance_pc 0x02
+#define DW_LNS_advance_line 0x03
+#define DW_LNS_set_file 0x04
+#define DW_LNS_set_column 0x05
+#define DW_LNS_negate_stmt 0x06
+#define DW_LNS_set_basic_block 0x07
+#define DW_LNS_const_add_pc 0x08
+#define DW_LNS_fixed_advance_pc 0x09
+#define DW_LNS_set_prologue_end 0x0a /* DWARF3 */
+#define DW_LNS_set_epilogue_begin 0x0b /* DWARF3 */
+#define DW_LNS_set_isa 0x0c /* DWARF3 */
+
+/* Line number extended opcode name. */
+#define DW_LNE_end_sequence 0x01
+#define DW_LNE_set_address 0x02
+#define DW_LNE_define_file 0x03
+#define DW_LNE_set_discriminator 0x04 /* DWARF4 */
+
+#ifndef ElfW
+# if SIZEOF_VOIDP == 8
+# define ElfW(x) Elf64##_##x
+# else
+# define ElfW(x) Elf32##_##x
+# endif
+#endif
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
+typedef struct {
+ const char *dirname;
+ const char *filename;
+ int line;
+
+ int fd;
+ void *mapped;
+ size_t mapped_size;
+ unsigned long base_addr;
+} line_info_t;
+
+/* Avoid consuming stack as this module may be used from signal handler */
+static char binary_filename[PATH_MAX];
+
+static unsigned long
+uleb128(char **p)
+{
+ unsigned long r = 0;
+ int s = 0;
+ for (;;) {
+ unsigned char b = *(unsigned char *)(*p)++;
+ if (b < 0x80) {
+ r += (unsigned long)b << s;
+ break;
+ }
+ r += (b & 0x7f) << s;
+ s += 7;
+ }
+ return r;
+}
+
+static long
+sleb128(char **p)
+{
+ long r = 0;
+ int s = 0;
+ for (;;) {
+ unsigned char b = *(unsigned char *)(*p)++;
+ if (b < 0x80) {
+ if (b & 0x40) {
+ r -= (0x80 - b) << s;
+ }
+ else {
+ r += (b & 0x3f) << s;
+ }
+ break;
+ }
+ r += (b & 0x7f) << s;
+ s += 7;
+ }
+ return r;
+}
+
+static const char *
+get_nth_dirname(unsigned long dir, char *p)
+{
+ if (!dir--) {
+ return "";
+ }
+ while (dir--) {
+ while (*p) p++;
+ p++;
+ if (!*p) {
+ fprintf(stderr, "Unexpected directory number %lu in %s\n",
+ dir, binary_filename);
+ return "";
+ }
+ }
+ return p;
+}
+
+static void
+fill_filename(int file, char *include_directories, char *filenames,
+ line_info_t *line)
+{
+ int i;
+ char *p = filenames;
+ char *filename;
+ unsigned long dir;
+ for (i = 1; i <= file; i++) {
+ filename = p;
+ if (!*p) {
+ /* Need to output binary file name? */
+ fprintf(stderr, "Unexpected file number %d in %s\n",
+ file, binary_filename);
+ return;
+ }
+ while (*p) p++;
+ p++;
+ dir = uleb128(&p);
+ /* last modified. */
+ uleb128(&p);
+ /* size of the file. */
+ uleb128(&p);
+
+ if (i == file) {
+ line->filename = filename;
+ line->dirname = get_nth_dirname(dir, include_directories);
+ }
+ }
+}
+
+static int
+get_path_from_symbol(const char *symbol, const char **p, size_t *len)
+{
+ if (symbol[0] == '0') {
+ /* libexecinfo */
+ *p = strchr(symbol, '/');
+ if (*p == NULL) return 0;
+ *len = strlen(*p);
+ }
+ else {
+ /* glibc */
+ const char *q;
+ *p = symbol;
+ q = strchr(symbol, '(');
+ if (q == NULL) return 0;
+ *len = q - symbol;
+ }
+ return 1;
+}
+
+static void
+fill_line(int num_traces, void **traces,
+ unsigned long addr, int file, int line,
+ char *include_directories, char *filenames, line_info_t *lines)
+{
+ int i;
+ for (i = 0; i < num_traces; i++) {
+ unsigned long a = (unsigned long)traces[i] - lines[i].base_addr;
+ /* We assume one line code doesn't result >100 bytes of native code.
+ We may want more reliable way eventually... */
+ if (addr < a && a < addr + 100) {
+ fill_filename(file, include_directories, filenames, &lines[i]);
+ lines[i].line = line;
+ }
+ }
+}
+
+static void
+parse_debug_line_cu(int num_traces, void **traces,
+ char **debug_line, line_info_t *lines)
+{
+ char *p, *cu_end, *cu_start, *include_directories, *filenames;
+ unsigned long unit_length;
+ int default_is_stmt, line_base;
+ unsigned int header_length, minimum_instruction_length, line_range,
+ opcode_base;
+ /* unsigned char *standard_opcode_lengths; */
+
+ /* The registers. */
+ unsigned long addr = 0;
+ unsigned int file = 1;
+ unsigned int line = 1;
+ /* unsigned int column = 0; */
+ int is_stmt;
+ /* int basic_block = 0; */
+ /* int end_sequence = 0; */
+ /* int prologue_end = 0; */
+ /* int epilogue_begin = 0; */
+ /* unsigned int isa = 0; */
+
+ p = *debug_line;
+
+ unit_length = *(unsigned int *)p;
+ p += sizeof(unsigned int);
+ if (unit_length == 0xffffffff) {
+ unit_length = *(unsigned long *)p;
+ p += sizeof(unsigned long);
+ }
+
+ cu_end = p + unit_length;
+
+ /*dwarf_version = *(unsigned short *)p;*/
+ p += 2;
+
+ header_length = *(unsigned int *)p;
+ p += sizeof(unsigned int);
+
+ cu_start = p + header_length;
+
+ minimum_instruction_length = *(unsigned char *)p;
+ p++;
+
+ is_stmt = default_is_stmt = *(unsigned char *)p;
+ p++;
+
+ line_base = *(char *)p;
+ p++;
+
+ line_range = *(unsigned char *)p;
+ p++;
+
+ opcode_base = *(unsigned char *)p;
+ p++;
+
+ /* standard_opcode_lengths = (unsigned char *)p - 1; */
+ p += opcode_base - 1;
+
+ include_directories = p;
+
+ /* skip include directories */
+ while (*p) {
+ while (*p) p++;
+ p++;
+ }
+ p++;
+
+ filenames = p;
+
+ p = cu_start;
+
+#define FILL_LINE() \
+ do { \
+ fill_line(num_traces, traces, addr, file, line, \
+ include_directories, filenames, lines); \
+ /*basic_block = prologue_end = epilogue_begin = 0;*/ \
+ } while (0)
+
+ while (p < cu_end) {
+ unsigned long a;
+ unsigned char op = *p++;
+ switch (op) {
+ case DW_LNS_copy:
+ FILL_LINE();
+ break;
+ case DW_LNS_advance_pc:
+ a = uleb128(&p);
+ addr += a;
+ break;
+ case DW_LNS_advance_line: {
+ long a = sleb128(&p);
+ line += a;
+ break;
+ }
+ case DW_LNS_set_file:
+ file = (unsigned int)uleb128(&p);
+ break;
+ case DW_LNS_set_column:
+ /*column = (unsigned int)*/(void)uleb128(&p);
+ break;
+ case DW_LNS_negate_stmt:
+ is_stmt = !is_stmt;
+ break;
+ case DW_LNS_set_basic_block:
+ /*basic_block = 1; */
+ break;
+ case DW_LNS_const_add_pc:
+ a = ((255 - opcode_base) / line_range) *
+ minimum_instruction_length;
+ addr += a;
+ break;
+ case DW_LNS_fixed_advance_pc:
+ a = *(unsigned char *)p++;
+ addr += a;
+ break;
+ case DW_LNS_set_prologue_end:
+ /* prologue_end = 1; */
+ break;
+ case DW_LNS_set_epilogue_begin:
+ /* epilogue_begin = 1; */
+ break;
+ case DW_LNS_set_isa:
+ /* isa = (unsigned int)*/(void)uleb128(&p);
+ break;
+ case 0:
+ a = *(unsigned char *)p++;
+ op = *p++;
+ switch (op) {
+ case DW_LNE_end_sequence:
+ /* end_sequence = 1; */
+ FILL_LINE();
+ addr = 0;
+ file = 1;
+ line = 1;
+ /* column = 0; */
+ is_stmt = default_is_stmt;
+ /* end_sequence = 0; */
+ /* isa = 0; */
+ break;
+ case DW_LNE_set_address:
+ addr = *(unsigned long *)p;
+ p += sizeof(unsigned long);
+ break;
+ case DW_LNE_define_file:
+ fprintf(stderr, "Unsupported operation in %s\n",
+ binary_filename);
+ break;
+ case DW_LNE_set_discriminator:
+ /* TODO:currently ignore */
+ uleb128(&p);
+ break;
+ default:
+ fprintf(stderr, "Unknown extended opcode: %d in %s\n",
+ op, binary_filename);
+ }
+ break;
+ default: {
+ unsigned long addr_incr;
+ unsigned long line_incr;
+ a = op - opcode_base;
+ addr_incr = (a / line_range) * minimum_instruction_length;
+ line_incr = line_base + (a % line_range);
+ addr += (unsigned int)addr_incr;
+ line += (unsigned int)line_incr;
+ FILL_LINE();
+ }
+ }
+ }
+ *debug_line = p;
+}
+
+static void
+parse_debug_line(int num_traces, void **traces,
+ char *debug_line, unsigned long size, line_info_t *lines)
+{
+ char *debug_line_end = debug_line + size;
+ while (debug_line < debug_line_end) {
+ parse_debug_line_cu(num_traces, traces, &debug_line, lines);
+ }
+ if (debug_line != debug_line_end) {
+ fprintf(stderr, "Unexpected size of .debug_line in %s\n",
+ binary_filename);
+ }
+}
+
+/* read file and fill lines */
+static void
+fill_lines(int num_traces, void **traces, char **syms, int check_debuglink,
+ line_info_t *current_line, line_info_t *lines);
+
+static void
+follow_debuglink(char *debuglink, int num_traces, void **traces, char **syms,
+ line_info_t *current_line, line_info_t *lines)
+{
+ /* Ideally we should check 4 paths to follow gnu_debuglink,
+ but we handle only one case for now as this format is used
+ by some linux distributions. See GDB's info for detail. */
+ static const char global_debug_dir[] = "/usr/lib/debug";
+ char *p, *subdir;
+
+ p = strrchr(binary_filename, '/');
+ if (!p) {
+ return;
+ }
+ p[1] = '\0';
+
+ subdir = (char *)alloca(strlen(binary_filename) + 1);
+ strcpy(subdir, binary_filename);
+ strcpy(binary_filename, global_debug_dir);
+ strncat(binary_filename, subdir,
+ PATH_MAX - strlen(binary_filename) - 1);
+ strncat(binary_filename, debuglink,
+ PATH_MAX - strlen(binary_filename) - 1);
+
+ munmap(current_line->mapped, current_line->mapped_size);
+ close(current_line->fd);
+ fill_lines(num_traces, traces, syms, 0, current_line, lines);
+}
+
+/* read file and fill lines */
+static void
+fill_lines(int num_traces, void **traces, char **syms, int check_debuglink,
+ line_info_t *current_line, line_info_t *lines)
+{
+ int i;
+ char *shstr;
+ char *section_name;
+ ElfW(Ehdr) *ehdr;
+ ElfW(Shdr) *shdr, *shstr_shdr;
+ ElfW(Shdr) *debug_line_shdr = NULL, *gnu_debuglink_shdr = NULL;
+ int fd;
+ off_t filesize;
+ char *file;
+
+ fd = open(binary_filename, O_RDONLY);
+ if (fd < 0) {
+ return;
+ }
+ filesize = lseek(fd, 0, SEEK_END);
+ if (filesize < 0) {
+ int e = errno;
+ close(fd);
+ fprintf(stderr, "lseek: %s\n", strerror(e));
+ return;
+ }
+#if SIZEOF_OFF_T > SIZEOF_SIZE_T
+ if (filesize > (off_t)SIZE_MAX) {
+ close(fd);
+ fprintf(stderr, "Too large file %s\n", binary_filename);
+ return;
+ }
+#endif
+ lseek(fd, 0, SEEK_SET);
+ /* async-signal unsafe */
+ file = (char *)mmap(NULL, (size_t)filesize, PROT_READ, MAP_SHARED, fd, 0);
+ if (file == MAP_FAILED) {
+ int e = errno;
+ close(fd);
+ fprintf(stderr, "mmap: %s\n", strerror(e));
+ return;
+ }
+
+ ehdr = (ElfW(Ehdr) *)file;
+ if (memcmp(ehdr->e_ident, "\177ELF", 4) != 0) {
+ /*
+ * Huh? Maybe filename was overridden by setproctitle() and
+ * it match non-elf file.
+ */
+ close(fd);
+ return;
+ }
+
+ current_line->fd = fd;
+ current_line->mapped = file;
+ current_line->mapped_size = (size_t)filesize;
+
+ for (i = 0; i < num_traces; i++) {
+ const char *path;
+ size_t len;
+ if (get_path_from_symbol(syms[i], &path, &len) &&
+ !strncmp(path, binary_filename, len)) {
+ lines[i].line = -1;
+ }
+ }
+
+ shdr = (ElfW(Shdr) *)(file + ehdr->e_shoff);
+
+ shstr_shdr = shdr + ehdr->e_shstrndx;
+ shstr = file + shstr_shdr->sh_offset;
+
+ for (i = 0; i < ehdr->e_shnum; i++) {
+ section_name = shstr + shdr[i].sh_name;
+ if (!strcmp(section_name, ".debug_line")) {
+ debug_line_shdr = shdr + i;
+ break;
+ } else if (!strcmp(section_name, ".gnu_debuglink")) {
+ gnu_debuglink_shdr = shdr + i;
+ }
+ }
+
+ if (!debug_line_shdr) {
+ /* This file doesn't have .debug_line section,
+ let's check .gnu_debuglink section instead. */
+ if (gnu_debuglink_shdr && check_debuglink) {
+ follow_debuglink(file + gnu_debuglink_shdr->sh_offset,
+ num_traces, traces, syms,
+ current_line, lines);
+ }
+ return;
+ }
+
+ parse_debug_line(num_traces, traces,
+ file + debug_line_shdr->sh_offset,
+ debug_line_shdr->sh_size,
+ lines);
+}
+
+#ifdef HAVE_DL_ITERATE_PHDR
+
+typedef struct {
+ int num_traces;
+ char **syms;
+ line_info_t *lines;
+} fill_base_addr_state_t;
+
+static int
+fill_base_addr(struct dl_phdr_info *info, size_t size, void *data)
+{
+ int i;
+ fill_base_addr_state_t *st = (fill_base_addr_state_t *)data;
+ for (i = 0; i < st->num_traces; i++) {
+ const char *path;
+ size_t len;
+ size_t name_len = strlen(info->dlpi_name);
+
+ if (get_path_from_symbol(st->syms[i], &path, &len) &&
+ (len == name_len || (len > name_len && path[len-name_len-1] == '/')) &&
+ !strncmp(path+len-name_len, info->dlpi_name, name_len)) {
+ st->lines[i].base_addr = info->dlpi_addr;
+ }
+ }
+ return 0;
+}
+
+#endif /* HAVE_DL_ITERATE_PHDR */
+
+void
+rb_dump_backtrace_with_lines(int num_traces, void **trace, char **syms)
+{
+ int i;
+ /* async-signal unsafe */
+ line_info_t *lines = (line_info_t *)calloc(num_traces,
+ sizeof(line_info_t));
+
+ /* Note that line info of shared objects might not be shown
+ if we don't have dl_iterate_phdr */
+#ifdef HAVE_DL_ITERATE_PHDR
+ fill_base_addr_state_t fill_base_addr_state;
+
+ fill_base_addr_state.num_traces = num_traces;
+ fill_base_addr_state.syms = syms;
+ fill_base_addr_state.lines = lines;
+ /* maybe async-signal unsafe */
+ dl_iterate_phdr(fill_base_addr, &fill_base_addr_state);
+#endif /* HAVE_DL_ITERATE_PHDR */
+
+ for (i = 0; i < num_traces; i++) {
+ const char *path;
+ size_t len;
+ if (lines[i].line) {
+ continue;
+ }
+
+ if (!get_path_from_symbol(syms[i], &path, &len)) {
+ continue;
+ }
+
+ strncpy(binary_filename, path, len);
+ binary_filename[len] = '\0';
+
+ fill_lines(num_traces, trace, syms, 1, &lines[i], lines);
+ }
+
+ /* fprintf may not be async-signal safe */
+ for (i = 0; i < num_traces; i++) {
+ line_info_t *line = &lines[i];
+
+ if (line->line > 0) {
+ fprintf(stderr, "%s ", syms[i]);
+ if (line->filename) {
+ if (line->dirname && line->dirname[0]) {
+ fprintf(stderr, "%s/", line->dirname);
+ }
+ fprintf(stderr, "%s", line->filename);
+ } else {
+ fprintf(stderr, "???");
+ }
+ fprintf(stderr, ":%d\n", line->line);
+ } else {
+ fprintf(stderr, "%s\n", syms[i]);
+ }
+ }
+
+ for (i = 0; i < num_traces; i++) {
+ line_info_t *line = &lines[i];
+ if (line->fd) {
+ munmap(line->mapped, line->mapped_size);
+ close(line->fd);
+ }
+ }
+ free(lines);
+}
+
+#else /* defined(USE_ELF) */
+#error not supported
+#endif
diff --git a/addr2line.h b/addr2line.h
new file mode 100644
index 0000000000..3782d89e07
--- /dev/null
+++ b/addr2line.h
@@ -0,0 +1,21 @@
+/**********************************************************************
+
+ addr2line.h -
+
+ $Author$
+
+ Copyright (C) 2010 Shinichiro Hamaji
+
+**********************************************************************/
+
+#ifndef RUBY_ADDR2LINE_H
+#define RUBY_ADDR2LINE_H
+
+#ifdef USE_ELF
+
+void
+rb_dump_backtrace_with_lines(int num_traces, void **traces, char **syms);
+
+#endif /* USE_ELF */
+
+#endif /* RUBY_ADDR2LINE_H */
diff --git a/array.c b/array.c
index baae2706e5..6f14b99933 100644
--- a/array.c
+++ b/array.c
@@ -2,29 +2,39 @@
array.c -
- $Author: akr $
- $Date: 2006/06/24 14:53:36 $
+ $Author$
created at: Fri Aug 6 09:46:12 JST 1993
- Copyright (C) 1993-2003 Yukihiro Matsumoto
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby.h"
-#include "util.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/util.h"
+#include "ruby/st.h"
+#include "ruby/encoding.h"
+#include "internal.h"
+#include "probes.h"
+#include "id.h"
+
+#ifndef ARRAY_DEBUG
+# define NDEBUG
+#endif
+#include <assert.h>
+
+#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
VALUE rb_cArray;
-static ID id_cmp;
+
+static ID id_cmp, id_div, id_power;
#define ARY_DEFAULT_SIZE 16
+#define ARY_MAX_SIZE (LONG_MAX / (int)sizeof(VALUE))
void
-rb_mem_clear(mem, size)
- register VALUE *mem;
- register long size;
+rb_mem_clear(register VALUE *mem, register long size)
{
while (size--) {
*mem++ = Qnil;
@@ -32,134 +42,395 @@ rb_mem_clear(mem, size)
}
static inline void
-memfill(mem, size, val)
- register VALUE *mem;
- register long size;
- register VALUE val;
+memfill(register VALUE *mem, register long size, register VALUE val)
{
while (size--) {
*mem++ = val;
}
}
-#define ARY_TMPLOCK FL_USER1
+# define ARY_SHARED_P(ary) \
+ (assert(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
+ FL_TEST((ary),ELTS_SHARED)!=0)
+# define ARY_EMBED_P(ary) \
+ (assert(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
+ FL_TEST((ary), RARRAY_EMBED_FLAG)!=0)
+
+#define ARY_HEAP_PTR(a) (assert(!ARY_EMBED_P(a)), RARRAY(a)->as.heap.ptr)
+#define ARY_HEAP_LEN(a) (assert(!ARY_EMBED_P(a)), RARRAY(a)->as.heap.len)
+#define ARY_EMBED_PTR(a) (assert(ARY_EMBED_P(a)), RARRAY(a)->as.ary)
+#define ARY_EMBED_LEN(a) \
+ (assert(ARY_EMBED_P(a)), \
+ (long)((RBASIC(a)->flags >> RARRAY_EMBED_LEN_SHIFT) & \
+ (RARRAY_EMBED_LEN_MASK >> RARRAY_EMBED_LEN_SHIFT)))
+
+#define ARY_OWNS_HEAP_P(a) (!FL_TEST((a), ELTS_SHARED|RARRAY_EMBED_FLAG))
+#define FL_SET_EMBED(a) do { \
+ assert(!ARY_SHARED_P(a)); \
+ assert(!OBJ_FROZEN(a)); \
+ FL_SET((a), RARRAY_EMBED_FLAG); \
+} while (0)
+#define FL_UNSET_EMBED(ary) FL_UNSET((ary), RARRAY_EMBED_FLAG|RARRAY_EMBED_LEN_MASK)
+#define FL_SET_SHARED(ary) do { \
+ assert(!ARY_EMBED_P(ary)); \
+ FL_SET((ary), ELTS_SHARED); \
+} while (0)
+#define FL_UNSET_SHARED(ary) FL_UNSET((ary), ELTS_SHARED)
+
+#define ARY_SET_PTR(ary, p) do { \
+ assert(!ARY_EMBED_P(ary)); \
+ assert(!OBJ_FROZEN(ary)); \
+ RARRAY(ary)->as.heap.ptr = (p); \
+} while (0)
+#define ARY_SET_EMBED_LEN(ary, n) do { \
+ long tmp_n = (n); \
+ assert(ARY_EMBED_P(ary)); \
+ assert(!OBJ_FROZEN(ary)); \
+ RBASIC(ary)->flags &= ~RARRAY_EMBED_LEN_MASK; \
+ RBASIC(ary)->flags |= (tmp_n) << RARRAY_EMBED_LEN_SHIFT; \
+} while (0)
+#define ARY_SET_HEAP_LEN(ary, n) do { \
+ assert(!ARY_EMBED_P(ary)); \
+ RARRAY(ary)->as.heap.len = (n); \
+} while (0)
+#define ARY_SET_LEN(ary, n) do { \
+ if (ARY_EMBED_P(ary)) { \
+ ARY_SET_EMBED_LEN((ary), (n)); \
+ } \
+ else { \
+ ARY_SET_HEAP_LEN((ary), (n)); \
+ } \
+ assert(RARRAY_LEN(ary) == (n)); \
+} while (0)
+#define ARY_INCREASE_PTR(ary, n) do { \
+ assert(!ARY_EMBED_P(ary)); \
+ assert(!OBJ_FROZEN(ary)); \
+ RARRAY(ary)->as.heap.ptr += (n); \
+} while (0)
+#define ARY_INCREASE_LEN(ary, n) do { \
+ assert(!OBJ_FROZEN(ary)); \
+ if (ARY_EMBED_P(ary)) { \
+ ARY_SET_EMBED_LEN((ary), RARRAY_LEN(ary)+(n)); \
+ } \
+ else { \
+ RARRAY(ary)->as.heap.len += (n); \
+ } \
+} while (0)
+
+#define ARY_CAPA(ary) (ARY_EMBED_P(ary) ? RARRAY_EMBED_LEN_MAX : \
+ ARY_SHARED_ROOT_P(ary) ? RARRAY_LEN(ary) : RARRAY(ary)->as.heap.aux.capa)
+#define ARY_SET_CAPA(ary, n) do { \
+ assert(!ARY_EMBED_P(ary)); \
+ assert(!ARY_SHARED_P(ary)); \
+ assert(!OBJ_FROZEN(ary)); \
+ RARRAY(ary)->as.heap.aux.capa = (n); \
+} while (0)
+
+#define ARY_SHARED(ary) (assert(ARY_SHARED_P(ary)), RARRAY(ary)->as.heap.aux.shared)
+#define ARY_SET_SHARED(ary, value) do { \
+ assert(!ARY_EMBED_P(ary)); \
+ assert(ARY_SHARED_P(ary)); \
+ assert(ARY_SHARED_ROOT_P(value)); \
+ RARRAY(ary)->as.heap.aux.shared = (value); \
+} while (0)
+#define RARRAY_SHARED_ROOT_FLAG FL_USER5
+#define ARY_SHARED_ROOT_P(ary) (FL_TEST((ary), RARRAY_SHARED_ROOT_FLAG))
+#define ARY_SHARED_NUM(ary) \
+ (assert(ARY_SHARED_ROOT_P(ary)), RARRAY(ary)->as.heap.aux.capa)
+#define ARY_SET_SHARED_NUM(ary, value) do { \
+ assert(ARY_SHARED_ROOT_P(ary)); \
+ RARRAY(ary)->as.heap.aux.capa = (value); \
+} while (0)
+#define FL_SET_SHARED_ROOT(ary) do { \
+ assert(!ARY_EMBED_P(ary)); \
+ FL_SET((ary), RARRAY_SHARED_ROOT_FLAG); \
+} while (0)
+
+static void
+ary_resize_capa(VALUE ary, long capacity)
+{
+ assert(RARRAY_LEN(ary) <= capacity);
+ assert(!OBJ_FROZEN(ary));
+ assert(!ARY_SHARED_P(ary));
+ if (capacity > RARRAY_EMBED_LEN_MAX) {
+ if (ARY_EMBED_P(ary)) {
+ long len = ARY_EMBED_LEN(ary);
+ VALUE *ptr = ALLOC_N(VALUE, (capacity));
+ MEMCPY(ptr, ARY_EMBED_PTR(ary), VALUE, len);
+ FL_UNSET_EMBED(ary);
+ ARY_SET_PTR(ary, ptr);
+ ARY_SET_HEAP_LEN(ary, len);
+ }
+ else {
+ REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, (capacity));
+ }
+ ARY_SET_CAPA(ary, (capacity));
+ }
+ else {
+ if (!ARY_EMBED_P(ary)) {
+ long len = RARRAY_LEN(ary);
+ VALUE *ptr = RARRAY_PTR(ary);
+ if (len > capacity) len = capacity;
+ MEMCPY(RARRAY(ary)->as.ary, ptr, VALUE, len);
+ FL_SET_EMBED(ary);
+ ARY_SET_LEN(ary, len);
+ xfree(ptr);
+ }
+ }
+}
+
+static void
+ary_double_capa(VALUE ary, long min)
+{
+ long new_capa = ARY_CAPA(ary) / 2;
+
+ if (new_capa < ARY_DEFAULT_SIZE) {
+ new_capa = ARY_DEFAULT_SIZE;
+ }
+ if (new_capa >= ARY_MAX_SIZE - min) {
+ new_capa = (ARY_MAX_SIZE - min) / 2;
+ }
+ new_capa += min;
+ ary_resize_capa(ary, new_capa);
+}
+
+static void
+rb_ary_decrement_share(VALUE shared)
+{
+ if (shared) {
+ long num = ARY_SHARED_NUM(shared) - 1;
+ if (num == 0) {
+ rb_ary_free(shared);
+ rb_gc_force_recycle(shared);
+ }
+ else if (num > 0) {
+ ARY_SET_SHARED_NUM(shared, num);
+ }
+ }
+}
+
+static void
+rb_ary_unshare(VALUE ary)
+{
+ VALUE shared = RARRAY(ary)->as.heap.aux.shared;
+ rb_ary_decrement_share(shared);
+ FL_UNSET_SHARED(ary);
+}
static inline void
-rb_ary_modify_check(ary)
- VALUE ary;
+rb_ary_unshare_safe(VALUE ary)
{
- if (OBJ_FROZEN(ary)) rb_error_frozen("array");
- if (FL_TEST(ary, ARY_TMPLOCK))
- rb_raise(rb_eRuntimeError, "can't modify array during iteration");
- if (!OBJ_TAINTED(ary) && rb_safe_level() >= 4)
- rb_raise(rb_eSecurityError, "Insecure: can't modify array");
+ if (ARY_SHARED_P(ary) && !ARY_EMBED_P(ary)) {
+ rb_ary_unshare(ary);
+ }
+}
+
+static VALUE
+rb_ary_increment_share(VALUE shared)
+{
+ long num = ARY_SHARED_NUM(shared);
+ if (num >= 0) {
+ ARY_SET_SHARED_NUM(shared, num + 1);
+ }
+ return shared;
}
static void
-rb_ary_modify(ary)
- VALUE ary;
+rb_ary_set_shared(VALUE ary, VALUE shared)
{
- VALUE *ptr;
+ rb_ary_increment_share(shared);
+ FL_SET_SHARED(ary);
+ ARY_SET_SHARED(ary, shared);
+}
+static inline void
+rb_ary_modify_check(VALUE ary)
+{
+ rb_check_frozen(ary);
+ if (!OBJ_UNTRUSTED(ary) && rb_safe_level() >= 4)
+ rb_raise(rb_eSecurityError, "Insecure: can't modify array");
+}
+
+void
+rb_ary_modify(VALUE ary)
+{
rb_ary_modify_check(ary);
- if (FL_TEST(ary, ELTS_SHARED)) {
- ptr = ALLOC_N(VALUE, RARRAY(ary)->len);
- FL_UNSET(ary, ELTS_SHARED);
- RARRAY(ary)->aux.capa = RARRAY(ary)->len;
- MEMCPY(ptr, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
- RARRAY(ary)->ptr = ptr;
+ if (ARY_SHARED_P(ary)) {
+ long len = RARRAY_LEN(ary);
+ VALUE shared = ARY_SHARED(ary);
+ if (len <= RARRAY_EMBED_LEN_MAX) {
+ VALUE *ptr = ARY_HEAP_PTR(ary);
+ FL_UNSET_SHARED(ary);
+ FL_SET_EMBED(ary);
+ MEMCPY(ARY_EMBED_PTR(ary), ptr, VALUE, len);
+ rb_ary_decrement_share(shared);
+ ARY_SET_EMBED_LEN(ary, len);
+ }
+ else if (ARY_SHARED_NUM(shared) == 1 && len > (RARRAY_LEN(shared)>>1)) {
+ long shift = RARRAY_PTR(ary) - RARRAY_PTR(shared);
+ ARY_SET_PTR(ary, RARRAY_PTR(shared));
+ ARY_SET_CAPA(ary, RARRAY_LEN(shared));
+ MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+shift, VALUE, len);
+ FL_UNSET_SHARED(ary);
+ FL_SET_EMBED(shared);
+ rb_ary_decrement_share(shared);
+ }
+ else {
+ VALUE *ptr = ALLOC_N(VALUE, len);
+ MEMCPY(ptr, RARRAY_PTR(ary), VALUE, len);
+ rb_ary_unshare(ary);
+ ARY_SET_CAPA(ary, len);
+ ARY_SET_PTR(ary, ptr);
+ }
+ }
+}
+
+static void
+ary_ensure_room_for_push(VALUE ary, long add_len)
+{
+ long new_len = RARRAY_LEN(ary) + add_len;
+ long capa;
+
+ if (ARY_SHARED_P(ary)) {
+ if (new_len > RARRAY_EMBED_LEN_MAX) {
+ VALUE shared = ARY_SHARED(ary);
+ if (ARY_SHARED_NUM(shared) == 1) {
+ if (RARRAY_PTR(ary) - RARRAY_PTR(shared) + new_len <= RARRAY_LEN(shared)) {
+ rb_ary_modify_check(ary);
+ }
+ else {
+ /* if array is shared, than it is likely it participate in push/shift pattern */
+ rb_ary_modify(ary);
+ capa = ARY_CAPA(ary);
+ if (new_len > capa - (capa >> 6)) {
+ ary_double_capa(ary, new_len);
+ }
+ }
+ return;
+ }
+ }
+ }
+ rb_ary_modify(ary);
+ capa = ARY_CAPA(ary);
+ if (new_len > capa) {
+ ary_double_capa(ary, new_len);
}
}
+/*
+ * call-seq:
+ * ary.freeze -> ary
+ *
+ * Calls Object#freeze on +ary+ to prevent any further
+ * modification. A RuntimeError will be raised if a modification
+ * attempt is made.
+ *
+ */
+
VALUE
-rb_ary_freeze(ary)
- VALUE ary;
+rb_ary_freeze(VALUE ary)
{
return rb_obj_freeze(ary);
}
/*
* call-seq:
- * array.frozen? -> true or false
+ * ary.frozen? -> true or false
*
- * Return <code>true</code> if this array is frozen (or temporarily frozen
- * while being sorted).
+ * Return +true+ if this array is frozen (or temporarily frozen
+ * while being sorted). See also Object#frozen?
*/
static VALUE
-rb_ary_frozen_p(ary)
- VALUE ary;
+rb_ary_frozen_p(VALUE ary)
{
if (OBJ_FROZEN(ary)) return Qtrue;
- if (FL_TEST(ary, ARY_TMPLOCK)) return Qtrue;
return Qfalse;
}
-static VALUE ary_alloc _((VALUE));
-static VALUE
-ary_alloc(klass)
- VALUE klass;
+/* This can be used to take a snapshot of an array (with
+ e.g. rb_ary_replace) and check later whether the array has been
+ modified from the snapshot. The snapshot is cheap, though if
+ something does modify the array it will pay the cost of copying
+ it. If Array#pop or Array#shift has been called, the array will
+ be still shared with the snapshot, but the array length will
+ differ. */
+VALUE
+rb_ary_shared_with_p(VALUE ary1, VALUE ary2)
{
- NEWOBJ(ary, struct RArray);
- OBJSETUP(ary, klass, T_ARRAY);
+ if (!ARY_EMBED_P(ary1) && ARY_SHARED_P(ary1) &&
+ !ARY_EMBED_P(ary2) && ARY_SHARED_P(ary2) &&
+ RARRAY(ary1)->as.heap.aux.shared == RARRAY(ary2)->as.heap.aux.shared &&
+ RARRAY(ary1)->as.heap.len == RARRAY(ary2)->as.heap.len) {
+ return Qtrue;
+ }
+ return Qfalse;
+}
- ary->len = 0;
- ary->ptr = 0;
- ary->aux.capa = 0;
+static VALUE
+ary_alloc(VALUE klass)
+{
+ NEWOBJ_OF(ary, struct RArray, klass, T_ARRAY);
+ FL_SET_EMBED((VALUE)ary);
+ ARY_SET_EMBED_LEN((VALUE)ary, 0);
return (VALUE)ary;
}
static VALUE
-ary_new(klass, len)
- VALUE klass;
- long len;
+empty_ary_alloc(VALUE klass)
{
- VALUE ary = ary_alloc(klass);
+ if (RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
+ RUBY_DTRACE_ARRAY_CREATE(0, rb_sourcefile(), rb_sourceline());
+ }
- if (len < 0) {
+ return ary_alloc(klass);
+}
+
+static VALUE
+ary_new(VALUE klass, long capa)
+{
+ VALUE ary;
+
+ if (capa < 0) {
rb_raise(rb_eArgError, "negative array size (or size too big)");
}
- if (len > 0 && len * sizeof(VALUE) <= len) {
+ if (capa > ARY_MAX_SIZE) {
rb_raise(rb_eArgError, "array size too big");
}
- if (len == 0) len++;
- RARRAY(ary)->ptr = ALLOC_N(VALUE, len);
- RARRAY(ary)->aux.capa = len;
+
+ if (RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
+ RUBY_DTRACE_ARRAY_CREATE(capa, rb_sourcefile(), rb_sourceline());
+ }
+
+ ary = ary_alloc(klass);
+ if (capa > RARRAY_EMBED_LEN_MAX) {
+ FL_UNSET_EMBED(ary);
+ ARY_SET_PTR(ary, ALLOC_N(VALUE, capa));
+ ARY_SET_CAPA(ary, capa);
+ ARY_SET_HEAP_LEN(ary, 0);
+ }
return ary;
}
VALUE
-rb_ary_new2(len)
- long len;
+rb_ary_new2(long capa)
{
- return ary_new(rb_cArray, len);
+ return ary_new(rb_cArray, capa);
}
VALUE
-rb_ary_new()
+rb_ary_new(void)
{
- return rb_ary_new2(ARY_DEFAULT_SIZE);
+ return rb_ary_new2(RARRAY_EMBED_LEN_MAX);
}
-#ifdef HAVE_STDARG_PROTOTYPES
#include <stdarg.h>
-#define va_init_list(a,b) va_start(a,b)
-#else
-#include <varargs.h>
-#define va_init_list(a,b) va_start(a)
-#endif
VALUE
-#ifdef HAVE_STDARG_PROTOTYPES
rb_ary_new3(long n, ...)
-#else
-rb_ary_new3(n, va_alist)
- long n;
- va_dcl
-#endif
{
va_list ar;
VALUE ary;
@@ -167,63 +438,152 @@ rb_ary_new3(n, va_alist)
ary = rb_ary_new2(n);
- va_init_list(ar, n);
+ va_start(ar, n);
for (i=0; i<n; i++) {
- RARRAY(ary)->ptr[i] = va_arg(ar, VALUE);
+ RARRAY_PTR(ary)[i] = va_arg(ar, VALUE);
}
va_end(ar);
- RARRAY(ary)->len = n;
+ ARY_SET_LEN(ary, n);
return ary;
}
VALUE
-rb_ary_new4(n, elts)
- long n;
- const VALUE *elts;
+rb_ary_new4(long n, const VALUE *elts)
{
VALUE ary;
ary = rb_ary_new2(n);
if (n > 0 && elts) {
- MEMCPY(RARRAY(ary)->ptr, elts, VALUE, n);
+ MEMCPY(RARRAY_PTR(ary), elts, VALUE, n);
+ ARY_SET_LEN(ary, n);
}
- /* This assignment to len will be moved to the above "if" block in Ruby 1.9 */
- RARRAY(ary)->len = n;
-
return ary;
}
VALUE
-rb_assoc_new(car, cdr)
- VALUE car, cdr;
+rb_ary_tmp_new(long capa)
{
- VALUE ary;
+ return ary_new(0, capa);
+}
- ary = rb_ary_new2(2);
- RARRAY(ary)->ptr[0] = car;
- RARRAY(ary)->ptr[1] = cdr;
- RARRAY(ary)->len = 2;
+void
+rb_ary_free(VALUE ary)
+{
+ if (ARY_OWNS_HEAP_P(ary)) {
+ xfree(ARY_HEAP_PTR(ary));
+ }
+}
- return ary;
+RUBY_FUNC_EXPORTED size_t
+rb_ary_memsize(VALUE ary)
+{
+ if (ARY_OWNS_HEAP_P(ary)) {
+ return RARRAY(ary)->as.heap.aux.capa * sizeof(VALUE);
+ }
+ else {
+ return 0;
+ }
+}
+
+static inline void
+ary_discard(VALUE ary)
+{
+ rb_ary_free(ary);
+ RBASIC(ary)->flags |= RARRAY_EMBED_FLAG;
+ RBASIC(ary)->flags &= ~RARRAY_EMBED_LEN_MASK;
}
static VALUE
-to_ary(ary)
- VALUE ary;
+ary_make_shared(VALUE ary)
+{
+ assert(!ARY_EMBED_P(ary));
+ if (ARY_SHARED_P(ary)) {
+ return ARY_SHARED(ary);
+ }
+ else if (ARY_SHARED_ROOT_P(ary)) {
+ return ary;
+ }
+ else if (OBJ_FROZEN(ary)) {
+ ary_resize_capa(ary, ARY_HEAP_LEN(ary));
+ FL_SET_SHARED_ROOT(ary);
+ ARY_SET_SHARED_NUM(ary, 1);
+ return ary;
+ }
+ else {
+ NEWOBJ_OF(shared, struct RArray, 0, T_ARRAY);
+ FL_UNSET_EMBED(shared);
+
+ ARY_SET_LEN((VALUE)shared, ARY_CAPA(ary));
+ ARY_SET_PTR((VALUE)shared, RARRAY_PTR(ary));
+ rb_mem_clear(RARRAY_PTR(shared) + RARRAY_LEN(ary), ARY_CAPA(ary) - RARRAY_LEN(ary));
+ FL_SET_SHARED_ROOT(shared);
+ ARY_SET_SHARED_NUM((VALUE)shared, 1);
+ FL_SET_SHARED(ary);
+ ARY_SET_SHARED(ary, (VALUE)shared);
+ OBJ_FREEZE(shared);
+ return (VALUE)shared;
+ }
+}
+
+
+static VALUE
+ary_make_substitution(VALUE ary)
+{
+ if (RARRAY_LEN(ary) <= RARRAY_EMBED_LEN_MAX) {
+ VALUE subst = rb_ary_new2(RARRAY_LEN(ary));
+ MEMCPY(ARY_EMBED_PTR(subst), RARRAY_PTR(ary), VALUE, RARRAY_LEN(ary));
+ ARY_SET_EMBED_LEN(subst, RARRAY_LEN(ary));
+ return subst;
+ }
+ else {
+ return rb_ary_increment_share(ary_make_shared(ary));
+ }
+}
+
+VALUE
+rb_assoc_new(VALUE car, VALUE cdr)
+{
+ return rb_ary_new3(2, car, cdr);
+}
+
+static VALUE
+to_ary(VALUE ary)
{
return rb_convert_type(ary, T_ARRAY, "Array", "to_ary");
}
VALUE
-rb_check_array_type(ary)
- VALUE ary;
+rb_check_array_type(VALUE ary)
{
return rb_check_convert_type(ary, T_ARRAY, "Array", "to_ary");
}
-static VALUE rb_ary_replace _((VALUE, VALUE));
+/*
+ * call-seq:
+ * Array.try_convert(obj) -> array or nil
+ *
+ * Tries to convert +obj+ into an array, using +to_ary+ method. Returns the
+ * converted array or +nil+ if +obj+ cannot be converted for any reason.
+ * This method can be used to check if an argument is an array.
+ *
+ * Array.try_convert([1]) #=> [1]
+ * Array.try_convert("1") #=> nil
+ *
+ * if tmp = Array.try_convert(arg)
+ * # the argument is an array
+ * elsif tmp = String.try_convert(arg)
+ * # the argument is a string
+ * end
+ *
+ */
+
+static VALUE
+rb_ary_s_try_convert(VALUE dummy, VALUE ary)
+{
+ return rb_check_array_type(ary);
+}
/*
* call-seq:
@@ -231,56 +591,76 @@ static VALUE rb_ary_replace _((VALUE, VALUE));
* Array.new(array)
* Array.new(size) {|index| block }
*
- * Returns a new array. In the first form, the new array is
- * empty. In the second it is created with _size_ copies of _obj_
- * (that is, _size_ references to the same
- * _obj_). The third form creates a copy of the array
- * passed as a parameter (the array is generated by calling
- * to_ary on the parameter). In the last form, an array
- * of the given size is created. Each element in this array is
- * calculated by passing the element's index to the given block and
- * storing the return value.
- *
- * Array.new
- * Array.new(2)
- * Array.new(5, "A")
- *
- * # only one copy of the object is created
+ * Returns a new array.
+ *
+ * In the first form, if no arguments are sent, the new array will be empty.
+ * When a +size+ and an optional +obj+ are sent, an array is created with
+ * +size+ copies of +obj+. Take notice that all elements will reference the
+ * same object +obj+.
+ *
+ * The second form creates a copy of the array passed as a parameter (the
+ * array is generated by calling to_ary on the parameter).
+ *
+ * first_array = ["Matz", "Guido"]
+ *
+ * second_array = Array.new(first_array) #=> ["Matz", "Guido"]
+ *
+ * first_array.equal? second_array #=> false
+ *
+ * In the last form, an array of the given size is created. Each element in
+ * this array is created by passing the element's index to the given block
+ * and storing the return value.
+ *
+ * Array.new(3){ |index| index ** 2 }
+ * # => [0, 1, 4]
+ *
+ * == Common gotchas
+ *
+ * When sending the second parameter, the same object will be used as the
+ * value for all the array elements:
+ *
* a = Array.new(2, Hash.new)
+ * # => [{}, {}]
+ *
* a[0]['cat'] = 'feline'
- * a
+ * a # => [{"cat"=>"feline"}, {"cat"=>"feline"}]
+ *
* a[1]['cat'] = 'Felix'
- * a
- *
- * # here multiple copies are created
+ * a # => [{"cat"=>"Felix"}, {"cat"=>"Felix"}]
+ *
+ * Since all the Array elements store the same hash, changes to one of them
+ * will affect them all.
+ *
+ * If multiple copies are what you want, you should use the block
+ * version which uses the result of that block each time an element
+ * of the array needs to be initialized:
+ *
* a = Array.new(2) { Hash.new }
* a[0]['cat'] = 'feline'
- * a
- *
- * squares = Array.new(5) {|i| i*i}
- * squares
- *
- * copy = Array.new(squares)
+ * a # => [{"cat"=>"feline"}, {}]
+ *
*/
static VALUE
-rb_ary_initialize(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
{
long len;
VALUE size, val;
rb_ary_modify(ary);
- if (rb_scan_args(argc, argv, "02", &size, &val) == 0) {
- RARRAY(ary)->len = 0;
+ if (argc == 0) {
+ if (ARY_OWNS_HEAP_P(ary) && RARRAY_PTR(ary)) {
+ xfree(RARRAY_PTR(ary));
+ }
+ rb_ary_unshare_safe(ary);
+ FL_SET_EMBED(ary);
+ ARY_SET_EMBED_LEN(ary, 0);
if (rb_block_given_p()) {
rb_warning("given block not used");
}
return ary;
}
-
+ rb_scan_args(argc, argv, "02", &size, &val);
if (argc == 1 && !FIXNUM_P(size)) {
val = rb_check_array_type(size);
if (!NIL_P(val)) {
@@ -293,13 +673,11 @@ rb_ary_initialize(argc, argv, ary)
if (len < 0) {
rb_raise(rb_eArgError, "negative array size");
}
- if (len > 0 && len * (long)sizeof(VALUE) <= len) {
+ if (len > ARY_MAX_SIZE) {
rb_raise(rb_eArgError, "array size too big");
}
- if (len > RARRAY(ary)->aux.capa) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, len);
- RARRAY(ary)->aux.capa = len;
- }
+ rb_ary_modify(ary);
+ ary_resize_capa(ary, len);
if (rb_block_given_p()) {
long i;
@@ -308,86 +686,130 @@ rb_ary_initialize(argc, argv, ary)
}
for (i=0; i<len; i++) {
rb_ary_store(ary, i, rb_yield(LONG2NUM(i)));
- RARRAY(ary)->len = i + 1;
+ ARY_SET_LEN(ary, i + 1);
}
}
else {
- memfill(RARRAY(ary)->ptr, len, val);
- RARRAY(ary)->len = len;
+ memfill(RARRAY_PTR(ary), len, val);
+ ARY_SET_LEN(ary, len);
}
-
return ary;
}
-
-/*
-* Returns a new array populated with the given objects.
-*
-* Array.[]( 1, 'a', /^A/ )
-* Array[ 1, 'a', /^A/ ]
-* [ 1, 'a', /^A/ ]
-*/
+/*
+ * Returns a new array populated with the given objects.
+ *
+ * Array.[]( 1, 'a', /^A/ ) # => [1, "a", /^A/]
+ * Array[ 1, 'a', /^A/ ] # => [1, "a", /^A/]
+ * [ 1, 'a', /^A/ ] # => [1, "a", /^A/]
+ */
static VALUE
-rb_ary_s_create(argc, argv, klass)
- int argc;
- VALUE *argv;
- VALUE klass;
+rb_ary_s_create(int argc, VALUE *argv, VALUE klass)
{
- VALUE ary = ary_alloc(klass);
-
- if (argc > 0) {
- RARRAY(ary)->ptr = ALLOC_N(VALUE, argc);
- MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc);
+ VALUE ary = ary_new(klass, argc);
+ if (argc > 0 && argv) {
+ MEMCPY(RARRAY_PTR(ary), argv, VALUE, argc);
+ ARY_SET_LEN(ary, argc);
}
- RARRAY(ary)->len = RARRAY(ary)->aux.capa = argc;
return ary;
}
void
-rb_ary_store(ary, idx, val)
- VALUE ary;
- long idx;
- VALUE val;
+rb_ary_store(VALUE ary, long idx, VALUE val)
{
if (idx < 0) {
- idx += RARRAY(ary)->len;
+ idx += RARRAY_LEN(ary);
if (idx < 0) {
- rb_raise(rb_eIndexError, "index %ld out of array",
- idx - RARRAY(ary)->len);
+ rb_raise(rb_eIndexError, "index %ld too small for array; minimum: %ld",
+ idx - RARRAY_LEN(ary), -RARRAY_LEN(ary));
}
}
+ else if (idx >= ARY_MAX_SIZE) {
+ rb_raise(rb_eIndexError, "index %ld too big", idx);
+ }
rb_ary_modify(ary);
- if (idx >= RARRAY(ary)->aux.capa) {
- long new_capa = RARRAY(ary)->aux.capa / 2;
+ if (idx >= ARY_CAPA(ary)) {
+ ary_double_capa(ary, idx);
+ }
+ if (idx > RARRAY_LEN(ary)) {
+ rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary),
+ idx-RARRAY_LEN(ary) + 1);
+ }
- if (new_capa < ARY_DEFAULT_SIZE) {
- new_capa = ARY_DEFAULT_SIZE;
- }
- new_capa += idx;
- if (new_capa * (long)sizeof(VALUE) <= new_capa) {
- rb_raise(rb_eArgError, "index too big");
- }
- REALLOC_N(RARRAY(ary)->ptr, VALUE, new_capa);
- RARRAY(ary)->aux.capa = new_capa;
+ if (idx >= RARRAY_LEN(ary)) {
+ ARY_SET_LEN(ary, idx + 1);
}
- if (idx > RARRAY(ary)->len) {
- rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len,
- idx-RARRAY(ary)->len + 1);
+ RARRAY_PTR(ary)[idx] = val;
+}
+
+static VALUE
+ary_make_partial(VALUE ary, VALUE klass, long offset, long len)
+{
+ assert(offset >= 0);
+ assert(len >= 0);
+ assert(offset+len <= RARRAY_LEN(ary));
+
+ if (len <= RARRAY_EMBED_LEN_MAX) {
+ VALUE result = ary_alloc(klass);
+ MEMCPY(ARY_EMBED_PTR(result), RARRAY_PTR(ary) + offset, VALUE, len);
+ ARY_SET_EMBED_LEN(result, len);
+ return result;
}
+ else {
+ VALUE shared, result = ary_alloc(klass);
+ FL_UNSET_EMBED(result);
+
+ shared = ary_make_shared(ary);
+ ARY_SET_PTR(result, RARRAY_PTR(ary));
+ ARY_SET_LEN(result, RARRAY_LEN(ary));
+ rb_ary_set_shared(result, shared);
+
+ ARY_INCREASE_PTR(result, offset);
+ ARY_SET_LEN(result, len);
+ return result;
+ }
+}
+
+static VALUE
+ary_make_shared_copy(VALUE ary)
+{
+ return ary_make_partial(ary, rb_obj_class(ary), 0, RARRAY_LEN(ary));
+}
+
+enum ary_take_pos_flags
+{
+ ARY_TAKE_FIRST = 0,
+ ARY_TAKE_LAST = 1
+};
+
+static VALUE
+ary_take_first_or_last(int argc, VALUE *argv, VALUE ary, enum ary_take_pos_flags last)
+{
+ VALUE nv;
+ long n;
+ long offset = 0;
- if (idx >= RARRAY(ary)->len) {
- RARRAY(ary)->len = idx + 1;
+ rb_scan_args(argc, argv, "1", &nv);
+ n = NUM2LONG(nv);
+ if (n > RARRAY_LEN(ary)) {
+ n = RARRAY_LEN(ary);
}
- RARRAY(ary)->ptr[idx] = val;
+ else if (n < 0) {
+ rb_raise(rb_eArgError, "negative array size");
+ }
+ if (last) {
+ offset = RARRAY_LEN(ary) - n;
+ }
+ return ary_make_partial(ary, rb_cArray, offset, n);
}
/*
* call-seq:
- * array << obj -> array
- *
+ * ary << obj -> ary
+ *
* Append---Pushes the given object on to the end of this array. This
* expression returns the array itself, so several appends
* may be chained together.
@@ -398,241 +820,329 @@ rb_ary_store(ary, idx, val)
*/
VALUE
-rb_ary_push(ary, item)
- VALUE ary;
- VALUE item;
+rb_ary_push(VALUE ary, VALUE item)
+{
+ long idx = RARRAY_LEN(ary);
+
+ ary_ensure_room_for_push(ary, 1);
+ RARRAY_PTR(ary)[idx] = item;
+ ARY_SET_LEN(ary, idx + 1);
+ return ary;
+}
+
+static VALUE
+rb_ary_push_1(VALUE ary, VALUE item)
{
- rb_ary_store(ary, RARRAY(ary)->len, item);
+ long idx = RARRAY_LEN(ary);
+
+ if (idx >= ARY_CAPA(ary)) {
+ ary_double_capa(ary, idx);
+ }
+ RARRAY_PTR(ary)[idx] = item;
+ ARY_SET_LEN(ary, idx + 1);
return ary;
}
-/*
+VALUE
+rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
+{
+ long oldlen = RARRAY_LEN(ary);
+
+ ary_ensure_room_for_push(ary, len);
+ MEMCPY(RARRAY_PTR(ary) + oldlen, ptr, VALUE, len);
+ ARY_SET_LEN(ary, oldlen + len);
+ return ary;
+}
+
+/*
* call-seq:
- * array.push(obj, ... ) -> array
- *
- * Append---Pushes the given object(s) on to the end of this array. This
+ * ary.push(obj, ... ) -> ary
+ *
+ * Append --- Pushes the given object(s) on to the end of this array. This
* expression returns the array itself, so several appends
- * may be chained together.
+ * may be chained together. See also Array#pop for the opposite
+ * effect.
*
* a = [ "a", "b", "c" ]
- * a.push("d", "e", "f")
+ * a.push("d", "e", "f")
* #=> ["a", "b", "c", "d", "e", "f"]
+ * [1, 2, 3,].push(4).push(5)
+ * #=> [1, 2, 3, 4, 5]
*/
static VALUE
-rb_ary_push_m(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_push_m(int argc, VALUE *argv, VALUE ary)
{
- while (argc--) {
- rb_ary_push(ary, *argv++);
- }
- return ary;
+ return rb_ary_cat(ary, argv, argc);
+}
+
+VALUE
+rb_ary_pop(VALUE ary)
+{
+ long n;
+ rb_ary_modify_check(ary);
+ if (RARRAY_LEN(ary) == 0) return Qnil;
+ if (ARY_OWNS_HEAP_P(ary) &&
+ RARRAY_LEN(ary) * 3 < ARY_CAPA(ary) &&
+ ARY_CAPA(ary) > ARY_DEFAULT_SIZE)
+ {
+ ary_resize_capa(ary, RARRAY_LEN(ary) * 2);
+ }
+ n = RARRAY_LEN(ary)-1;
+ ARY_SET_LEN(ary, n);
+ return RARRAY_PTR(ary)[n];
}
/*
* call-seq:
- * array.pop -> obj or nil
- *
- * Removes the last element from <i>self</i> and returns it, or
- * <code>nil</code> if the array is empty.
- *
- * a = [ "a", "m", "z" ]
- * a.pop #=> "z"
- * a #=> ["a", "m"]
+ * ary.pop -> obj or nil
+ * ary.pop(n) -> new_ary
+ *
+ * Removes the last element from +self+ and returns it, or
+ * +nil+ if the array is empty.
+ *
+ * If a number +n+ is given, returns an array of the last +n+ elements
+ * (or less) just like <code>array.slice!(-n, n)</code> does. See also
+ * Array#push for the opposite effect.
+ *
+ * a = [ "a", "b", "c", "d" ]
+ * a.pop #=> "d"
+ * a.pop(2) #=> ["b", "c"]
+ * a #=> ["a"]
*/
-VALUE
-rb_ary_pop(ary)
- VALUE ary;
+static VALUE
+rb_ary_pop_m(int argc, VALUE *argv, VALUE ary)
{
- rb_ary_modify_check(ary);
- if (RARRAY(ary)->len == 0) return Qnil;
- if (!FL_TEST(ary, ELTS_SHARED) &&
- RARRAY(ary)->len * 2 < RARRAY(ary)->aux.capa &&
- RARRAY(ary)->aux.capa > ARY_DEFAULT_SIZE) {
- RARRAY(ary)->aux.capa = RARRAY(ary)->len * 2;
- REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->aux.capa);
+ VALUE result;
+
+ if (argc == 0) {
+ return rb_ary_pop(ary);
}
- return RARRAY(ary)->ptr[--RARRAY(ary)->len];
+
+ rb_ary_modify_check(ary);
+ result = ary_take_first_or_last(argc, argv, ary, ARY_TAKE_LAST);
+ ARY_INCREASE_LEN(ary, -RARRAY_LEN(result));
+ return result;
}
-static VALUE
-ary_make_shared(ary)
- VALUE ary;
+VALUE
+rb_ary_shift(VALUE ary)
{
- if (!FL_TEST(ary, ELTS_SHARED)) {
- NEWOBJ(shared, struct RArray);
- OBJSETUP(shared, rb_cArray, T_ARRAY);
+ VALUE top;
- shared->len = RARRAY(ary)->len;
- shared->ptr = RARRAY(ary)->ptr;
- shared->aux.capa = RARRAY(ary)->aux.capa;
- RARRAY(ary)->aux.shared = (VALUE)shared;
- FL_SET(ary, ELTS_SHARED);
- OBJ_FREEZE(shared);
- return (VALUE)shared;
+ rb_ary_modify_check(ary);
+ if (RARRAY_LEN(ary) == 0) return Qnil;
+ top = RARRAY_PTR(ary)[0];
+ if (!ARY_SHARED_P(ary)) {
+ if (RARRAY_LEN(ary) < ARY_DEFAULT_SIZE) {
+ MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+1, VALUE, RARRAY_LEN(ary)-1);
+ ARY_INCREASE_LEN(ary, -1);
+ return top;
+ }
+ assert(!ARY_EMBED_P(ary)); /* ARY_EMBED_LEN_MAX < ARY_DEFAULT_SIZE */
+
+ RARRAY_PTR(ary)[0] = Qnil;
+ ary_make_shared(ary);
}
- else {
- return RARRAY(ary)->aux.shared;
+ else if (ARY_SHARED_NUM(ARY_SHARED(ary)) == 1) {
+ RARRAY_PTR(ary)[0] = Qnil;
}
+ ARY_INCREASE_PTR(ary, 1); /* shift ptr */
+ ARY_INCREASE_LEN(ary, -1);
+
+ return top;
}
/*
* call-seq:
- * array.shift -> obj or nil
- *
- * Returns the first element of <i>self</i> and removes it (shifting all
- * other elements down by one). Returns <code>nil</code> if the array
+ * ary.shift -> obj or nil
+ * ary.shift(n) -> new_ary
+ *
+ * Removes the first element of +self+ and returns it (shifting all
+ * other elements down by one). Returns +nil+ if the array
* is empty.
- *
+ *
+ * If a number +n+ is given, returns an array of the first +n+ elements
+ * (or less) just like <code>array.slice!(0, n)</code> does. With +ary+
+ * containing only the remainder elements, not including what was shifted to
+ * +new_ary+. See also Array#unshift for the opposite effect.
+ *
+ * args = [ "-m", "-q", "filename" ]
+ * args.shift #=> "-m"
+ * args #=> ["-q", "filename"]
+ *
* args = [ "-m", "-q", "filename" ]
- * args.shift #=> "-m"
- * args #=> ["-q", "filename"]
+ * args.shift(2) #=> ["-m", "-q"]
+ * args #=> ["filename"]
*/
-VALUE
-rb_ary_shift(ary)
- VALUE ary;
+static VALUE
+rb_ary_shift_m(int argc, VALUE *argv, VALUE ary)
{
- VALUE top;
+ VALUE result;
+ long n;
+
+ if (argc == 0) {
+ return rb_ary_shift(ary);
+ }
rb_ary_modify_check(ary);
- if (RARRAY(ary)->len == 0) return Qnil;
- top = RARRAY(ary)->ptr[0];
- ary_make_shared(ary);
- RARRAY(ary)->ptr++; /* shift ptr */
- RARRAY(ary)->len--;
+ result = ary_take_first_or_last(argc, argv, ary, ARY_TAKE_FIRST);
+ n = RARRAY_LEN(result);
+ if (ARY_SHARED_P(ary)) {
+ if (ARY_SHARED_NUM(ARY_SHARED(ary)) == 1) {
+ rb_mem_clear(RARRAY_PTR(ary), n);
+ }
+ ARY_INCREASE_PTR(ary, n);
+ }
+ else {
+ MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+n, VALUE, RARRAY_LEN(ary)-n);
+ }
+ ARY_INCREASE_LEN(ary, -n);
- return top;
+ return result;
}
-VALUE
-rb_ary_unshift(ary, item)
- VALUE ary, item;
+static void
+ary_ensure_room_for_unshift(VALUE ary, int argc)
{
- rb_ary_modify(ary);
- if (RARRAY(ary)->len == RARRAY(ary)->aux.capa) {
- long capa_inc = RARRAY(ary)->aux.capa / 2;
- if (capa_inc < ARY_DEFAULT_SIZE) {
- capa_inc = ARY_DEFAULT_SIZE;
+ long len = RARRAY_LEN(ary);
+ long new_len = len + argc;
+ long capa;
+ VALUE *head, *sharedp;
+
+ if (ARY_SHARED_P(ary)) {
+ VALUE shared = ARY_SHARED(ary);
+ capa = RARRAY_LEN(shared);
+ if (ARY_SHARED_NUM(shared) == 1 && capa > new_len) {
+ head = RARRAY_PTR(ary);
+ sharedp = RARRAY_PTR(shared);
+ goto makeroom_if_need;
}
- RARRAY(ary)->aux.capa += capa_inc;
- REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->aux.capa);
}
- /* sliding items */
- MEMMOVE(RARRAY(ary)->ptr + 1, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
-
- RARRAY(ary)->len++;
- RARRAY(ary)->ptr[0] = item;
-
- return ary;
+ rb_ary_modify(ary);
+ capa = ARY_CAPA(ary);
+ if (capa - (capa >> 6) <= new_len) {
+ ary_double_capa(ary, new_len);
+ }
+
+ /* use shared array for big "queues" */
+ if (new_len > ARY_DEFAULT_SIZE * 4) {
+ /* make a room for unshifted items */
+ capa = ARY_CAPA(ary);
+ ary_make_shared(ary);
+
+ head = sharedp = RARRAY_PTR(ary);
+ goto makeroom;
+ makeroom_if_need:
+ if (head - sharedp < argc) {
+ long room;
+ makeroom:
+ room = capa - new_len;
+ room -= room >> 4;
+ MEMMOVE(sharedp + argc + room, head, VALUE, len);
+ head = sharedp + argc + room;
+ }
+ ARY_SET_PTR(ary, head - argc);
+ }
+ else {
+ /* sliding items */
+ MEMMOVE(RARRAY_PTR(ary) + argc, RARRAY_PTR(ary), VALUE, len);
+ }
}
/*
* call-seq:
- * array.unshift(obj, ...) -> array
- *
- * Prepends objects to the front of <i>array</i>.
- * other elements up one.
- *
+ * ary.unshift(obj, ...) -> ary
+ *
+ * Prepends objects to the front of +self+, moving other elements upwards.
+ * See also Array#shift for the opposite effect.
+ *
* a = [ "b", "c", "d" ]
* a.unshift("a") #=> ["a", "b", "c", "d"]
* a.unshift(1, 2) #=> [ 1, 2, "a", "b", "c", "d"]
*/
static VALUE
-rb_ary_unshift_m(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary)
{
- long len = RARRAY(ary)->len;
-
- if (argc == 0) return ary;
+ long len = RARRAY_LEN(ary);
- /* make rooms by setting the last item */
- rb_ary_store(ary, len + argc - 1, Qnil);
+ if (argc == 0) {
+ rb_ary_modify_check(ary);
+ return ary;
+ }
- /* sliding items */
- MEMMOVE(RARRAY(ary)->ptr + argc, RARRAY(ary)->ptr, VALUE, len);
- MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc);
-
+ ary_ensure_room_for_unshift(ary, argc);
+ MEMCPY(RARRAY_PTR(ary), argv, VALUE, argc);
+ ARY_SET_LEN(ary, len + argc);
return ary;
}
+VALUE
+rb_ary_unshift(VALUE ary, VALUE item)
+{
+ return rb_ary_unshift_m(1,&item,ary);
+}
+
/* faster version - use this if you don't need to treat negative offset */
static inline VALUE
-rb_ary_elt(ary, offset)
- VALUE ary;
- long offset;
+rb_ary_elt(VALUE ary, long offset)
{
- if (RARRAY(ary)->len == 0) return Qnil;
- if (offset < 0 || RARRAY(ary)->len <= offset) {
+ if (RARRAY_LEN(ary) == 0) return Qnil;
+ if (offset < 0 || RARRAY_LEN(ary) <= offset) {
return Qnil;
}
- return RARRAY(ary)->ptr[offset];
+ return RARRAY_PTR(ary)[offset];
}
VALUE
-rb_ary_entry(ary, offset)
- VALUE ary;
- long offset;
+rb_ary_entry(VALUE ary, long offset)
{
if (offset < 0) {
- offset += RARRAY(ary)->len;
+ offset += RARRAY_LEN(ary);
}
return rb_ary_elt(ary, offset);
}
-static VALUE
-rb_ary_subseq(ary, beg, len)
- VALUE ary;
- long beg, len;
+VALUE
+rb_ary_subseq(VALUE ary, long beg, long len)
{
- VALUE klass, ary2, shared;
- VALUE *ptr;
+ VALUE klass;
- if (beg > RARRAY(ary)->len) return Qnil;
+ if (beg > RARRAY_LEN(ary)) return Qnil;
if (beg < 0 || len < 0) return Qnil;
- if (RARRAY(ary)->len < len || RARRAY(ary)->len < beg + len) {
- len = RARRAY(ary)->len - beg;
- if (len < 0)
- len = 0;
+ if (RARRAY_LEN(ary) < len || RARRAY_LEN(ary) < beg + len) {
+ len = RARRAY_LEN(ary) - beg;
}
klass = rb_obj_class(ary);
if (len == 0) return ary_new(klass, 0);
- shared = ary_make_shared(ary);
- ptr = RARRAY(ary)->ptr;
- ary2 = ary_alloc(klass);
- RARRAY(ary2)->ptr = ptr + beg;
- RARRAY(ary2)->len = len;
- RARRAY(ary2)->aux.shared = shared;
- FL_SET(ary2, ELTS_SHARED);
-
- return ary2;
+ return ary_make_partial(ary, klass, beg, len);
}
-/*
+/*
* call-seq:
- * array[index] -> obj or nil
- * array[start, length] -> an_array or nil
- * array[range] -> an_array or nil
- * array.slice(index) -> obj or nil
- * array.slice(start, length) -> an_array or nil
- * array.slice(range) -> an_array or nil
+ * ary[index] -> obj or nil
+ * ary[start, length] -> new_ary or nil
+ * ary[range] -> new_ary or nil
+ * ary.slice(index) -> obj or nil
+ * ary.slice(start, length) -> new_ary or nil
+ * ary.slice(range) -> new_ary or nil
*
- * Element Reference---Returns the element at _index_,
- * or returns a subarray starting at _start_ and
- * continuing for _length_ elements, or returns a subarray
- * specified by _range_.
- * Negative indices count backward from the end of the
- * array (-1 is the last element). Returns nil if the index
- * (or starting index) are out of range.
+ * Element Reference --- Returns the element at +index+, or returns a
+ * subarray starting at the +start+ index and continuing for +length+
+ * elements, or returns a subarray specified by +range+ of indices.
+ *
+ * Negative indices count backward from the end of the array (-1 is the last
+ * element). For +start+ and +range+ cases the starting index is just before
+ * an element. Additionally, an empty array is returned when the starting
+ * index for an element range is at the end of the array.
+ *
+ * Returns +nil+ if the index (or starting index) are out of range.
*
* a = [ "a", "b", "c", "d", "e" ]
* a[2] + a[0] + a[1] #=> "cab"
@@ -644,44 +1154,36 @@ rb_ary_subseq(ary, beg, len)
* a[-3, 3] #=> [ "c", "d", "e" ]
* # special cases
* a[5] #=> nil
+ * a[6, 1] #=> nil
* a[5, 1] #=> []
* a[5..10] #=> []
*
*/
VALUE
-rb_ary_aref(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_aref(int argc, VALUE *argv, VALUE ary)
{
VALUE arg;
long beg, len;
if (argc == 2) {
- if (SYMBOL_P(argv[0])) {
- rb_raise(rb_eTypeError, "Symbol as array index");
- }
beg = NUM2LONG(argv[0]);
len = NUM2LONG(argv[1]);
if (beg < 0) {
- beg += RARRAY(ary)->len;
+ beg += RARRAY_LEN(ary);
}
return rb_ary_subseq(ary, beg, len);
}
if (argc != 1) {
- rb_scan_args(argc, argv, "11", 0, 0);
+ rb_scan_args(argc, argv, "11", NULL, NULL);
}
arg = argv[0];
/* special case - speeding up */
if (FIXNUM_P(arg)) {
return rb_ary_entry(ary, FIX2LONG(arg));
}
- if (SYMBOL_P(arg)) {
- rb_raise(rb_eTypeError, "Symbol as array index");
- }
/* check if idx is Range */
- switch (rb_range_beg_len(arg, &beg, &len, RARRAY(ary)->len, 0)) {
+ switch (rb_range_beg_len(arg, &beg, &len, RARRAY_LEN(ary), 0)) {
case Qfalse:
break;
case Qnil:
@@ -692,15 +1194,13 @@ rb_ary_aref(argc, argv, ary)
return rb_ary_entry(ary, NUM2LONG(arg));
}
-/*
+/*
* call-seq:
- * array.at(index) -> obj or nil
+ * ary.at(index) -> obj or nil
*
- * Returns the element at _index_. A
- * negative index counts from the end of _self_. Returns +nil+
- * if the index is out of range. See also <code>Array#[]</code>.
- * (<code>Array#at</code> is slightly faster than <code>Array#[]</code>,
- * as it does not accept ranges and so on.)
+ * Returns the element at +index+. A negative index counts from the end of
+ * +self+. Returns +nil+ if the index is out of range. See also
+ * Array#[].
*
* a = [ "a", "b", "c", "d", "e" ]
* a.at(0) #=> "a"
@@ -708,113 +1208,90 @@ rb_ary_aref(argc, argv, ary)
*/
static VALUE
-rb_ary_at(ary, pos)
- VALUE ary, pos;
+rb_ary_at(VALUE ary, VALUE pos)
{
return rb_ary_entry(ary, NUM2LONG(pos));
}
/*
* call-seq:
- * array.first -> obj or nil
- * array.first(n) -> an_array
+ * ary.first -> obj or nil
+ * ary.first(n) -> new_ary
*
* Returns the first element, or the first +n+ elements, of the array.
- * If the array is empty, the first form returns <code>nil</code>, and the
- * second form returns an empty array.
+ * If the array is empty, the first form returns +nil+, and the
+ * second form returns an empty array. See also Array#last for
+ * the opposite effect.
*
* a = [ "q", "r", "s", "t" ]
- * a.first #=> "q"
- * a.first(1) #=> ["q"]
- * a.first(3) #=> ["q", "r", "s"]
+ * a.first #=> "q"
+ * a.first(2) #=> ["q", "r"]
*/
static VALUE
-rb_ary_first(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_first(int argc, VALUE *argv, VALUE ary)
{
if (argc == 0) {
- if (RARRAY(ary)->len == 0) return Qnil;
- return RARRAY(ary)->ptr[0];
+ if (RARRAY_LEN(ary) == 0) return Qnil;
+ return RARRAY_PTR(ary)[0];
}
else {
- VALUE nv, result;
- long n, i;
-
- rb_scan_args(argc, argv, "01", &nv);
- n = NUM2LONG(nv);
- if (n > RARRAY(ary)->len) n = RARRAY(ary)->len;
- result = rb_ary_new2(n);
- for (i=0; i<n; i++) {
- rb_ary_push(result, RARRAY(ary)->ptr[i]);
- }
- return result;
+ return ary_take_first_or_last(argc, argv, ary, ARY_TAKE_FIRST);
}
}
/*
* call-seq:
- * array.last -> obj or nil
- * array.last(n) -> an_array
- *
- * Returns the last element(s) of <i>self</i>. If the array is empty,
- * the first form returns <code>nil</code>.
- *
- * [ "w", "x", "y", "z" ].last #=> "z"
+ * ary.last -> obj or nil
+ * ary.last(n) -> new_ary
+ *
+ * Returns the last element(s) of +self+. If the array is empty,
+ * the first form returns +nil+.
+ *
+ * See also Array#first for the opposite effect.
+ *
+ * a = [ "w", "x", "y", "z" ]
+ * a.last #=> "z"
+ * a.last(2) #=> ["y", "z"]
*/
-static VALUE
-rb_ary_last(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+VALUE
+rb_ary_last(int argc, VALUE *argv, VALUE ary)
{
if (argc == 0) {
- if (RARRAY(ary)->len == 0) return Qnil;
- return RARRAY(ary)->ptr[RARRAY(ary)->len-1];
+ if (RARRAY_LEN(ary) == 0) return Qnil;
+ return RARRAY_PTR(ary)[RARRAY_LEN(ary)-1];
}
else {
- VALUE nv, result;
- long n, i;
-
- rb_scan_args(argc, argv, "01", &nv);
- n = NUM2LONG(nv);
- if (n > RARRAY(ary)->len) n = RARRAY(ary)->len;
- result = rb_ary_new2(n);
- for (i=RARRAY(ary)->len-n; n--; i++) {
- rb_ary_push(result, RARRAY(ary)->ptr[i]);
- }
- return result;
+ return ary_take_first_or_last(argc, argv, ary, ARY_TAKE_LAST);
}
}
/*
* call-seq:
- * array.fetch(index) -> obj
- * array.fetch(index, default ) -> obj
- * array.fetch(index) {|index| block } -> obj
- *
- * Tries to return the element at position <i>index</i>. If the index
- * lies outside the array, the first form throws an
- * <code>IndexError</code> exception, the second form returns
- * <i>default</i>, and the third form returns the value of invoking
- * the block, passing in the index. Negative values of <i>index</i>
- * count from the end of the array.
- *
+ * ary.fetch(index) -> obj
+ * ary.fetch(index, default) -> obj
+ * ary.fetch(index) { |index| block } -> obj
+ *
+ * Tries to return the element at position +index+, but throws an IndexError
+ * exception if the referenced +index+ lies outside of the array bounds. This
+ * error can be prevented by supplying a second argument, which will act as a
+ * +default+ value.
+ *
+ * Alternatively, if a block is given it will only be executed when an
+ * invalid +index+ is referenced. Negative values of +index+ count from the
+ * end of the array.
+ *
* a = [ 11, 22, 33, 44 ]
* a.fetch(1) #=> 22
* a.fetch(-1) #=> 44
* a.fetch(4, 'cat') #=> "cat"
- * a.fetch(4) { |i| i*i } #=> 16
+ * a.fetch(100) { |i| puts "#{i} is out of bounds" }
+ * #=> "100 is out of bounds"
*/
static VALUE
-rb_ary_fetch(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_fetch(int argc, VALUE *argv, VALUE ary)
{
VALUE pos, ifnone;
long block_given;
@@ -828,40 +1305,64 @@ rb_ary_fetch(argc, argv, ary)
idx = NUM2LONG(pos);
if (idx < 0) {
- idx += RARRAY(ary)->len;
+ idx += RARRAY_LEN(ary);
}
- if (idx < 0 || RARRAY(ary)->len <= idx) {
+ if (idx < 0 || RARRAY_LEN(ary) <= idx) {
if (block_given) return rb_yield(pos);
if (argc == 1) {
- rb_raise(rb_eIndexError, "index %ld out of array", idx);
+ rb_raise(rb_eIndexError, "index %ld outside of array bounds: %ld...%ld",
+ idx - (idx < 0 ? RARRAY_LEN(ary) : 0), -RARRAY_LEN(ary), RARRAY_LEN(ary));
}
return ifnone;
}
- return RARRAY(ary)->ptr[idx];
+ return RARRAY_PTR(ary)[idx];
}
/*
* call-seq:
- * array.index(obj) -> int or nil
- *
- * Returns the index of the first object in <i>self</i> such that is
- * <code>==</code> to <i>obj</i>. Returns <code>nil</code> if
- * no match is found.
- *
+ * ary.index(obj) -> int or nil
+ * ary.index { |item| block } -> int or nil
+ * ary.index -> Enumerator
+ *
+ * Returns the _index_ of the first object in +ary+ such that the object is
+ * <code>==</code> to +obj+.
+ *
+ * If a block is given instead of an argument, returns the _index_ of the
+ * first object for which the block returns +true+. Returns +nil+ if no
+ * match is found.
+ *
+ * See also Array#rindex.
+ *
+ * An Enumerator is returned if neither a block nor argument is given.
+ *
* a = [ "a", "b", "c" ]
- * a.index("b") #=> 1
- * a.index("z") #=> nil
+ * a.index("b") #=> 1
+ * a.index("z") #=> nil
+ * a.index { |x| x == "b" } #=> 1
+ *
+ * This is an alias of Array#find_index.
*/
static VALUE
-rb_ary_index(ary, val)
- VALUE ary;
- VALUE val;
+rb_ary_index(int argc, VALUE *argv, VALUE ary)
{
+ VALUE val;
long i;
- for (i=0; i<RARRAY(ary)->len; i++) {
- if (rb_equal(RARRAY(ary)->ptr[i], val))
+ if (argc == 0) {
+ RETURN_ENUMERATOR(ary, 0, 0);
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ if (RTEST(rb_yield(RARRAY_PTR(ary)[i]))) {
+ return LONG2NUM(i);
+ }
+ }
+ return Qnil;
+ }
+ rb_scan_args(argc, argv, "1", &val);
+ if (rb_block_given_p())
+ rb_warn("given block not used");
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ if (rb_equal(RARRAY_PTR(ary)[i], val))
return LONG2NUM(i);
}
return Qnil;
@@ -869,157 +1370,206 @@ rb_ary_index(ary, val)
/*
* call-seq:
- * array.rindex(obj) -> int or nil
- *
- * Returns the index of the last object in <i>array</i>
- * <code>==</code> to <i>obj</i>. Returns <code>nil</code> if
- * no match is found.
- *
+ * ary.rindex(obj) -> int or nil
+ * ary.rindex { |item| block } -> int or nil
+ * ary.rindex -> Enumerator
+ *
+ * Returns the _index_ of the last object in +self+ <code>==</code> to +obj+.
+ *
+ * If a block is given instead of an argument, returns the _index_ of the
+ * first object for which the block returns +true+, starting from the last
+ * object.
+ *
+ * Returns +nil+ if no match is found.
+ *
+ * See also Array#index.
+ *
+ * If neither block nor argument is given, an Enumerator is returned instead.
+ *
* a = [ "a", "b", "b", "b", "c" ]
- * a.rindex("b") #=> 3
- * a.rindex("z") #=> nil
+ * a.rindex("b") #=> 3
+ * a.rindex("z") #=> nil
+ * a.rindex { |x| x == "b" } #=> 3
*/
static VALUE
-rb_ary_rindex(ary, val)
- VALUE ary;
- VALUE val;
+rb_ary_rindex(int argc, VALUE *argv, VALUE ary)
{
- long i = RARRAY(ary)->len;
+ VALUE val;
+ long i = RARRAY_LEN(ary);
- while (i--) {
- if (i > RARRAY(ary)->len) {
- i = RARRAY(ary)->len;
- continue;
+ if (argc == 0) {
+ RETURN_ENUMERATOR(ary, 0, 0);
+ while (i--) {
+ if (RTEST(rb_yield(RARRAY_PTR(ary)[i])))
+ return LONG2NUM(i);
+ if (i > RARRAY_LEN(ary)) {
+ i = RARRAY_LEN(ary);
+ }
}
- if (rb_equal(RARRAY(ary)->ptr[i], val))
+ return Qnil;
+ }
+ rb_scan_args(argc, argv, "1", &val);
+ if (rb_block_given_p())
+ rb_warn("given block not used");
+ while (i--) {
+ if (rb_equal(RARRAY_PTR(ary)[i], val))
return LONG2NUM(i);
+ if (i > RARRAY_LEN(ary)) {
+ i = RARRAY_LEN(ary);
+ }
}
return Qnil;
}
-/*
- * call-seq:
- * array.indexes( i1, i2, ... iN ) -> an_array
- * array.indices( i1, i2, ... iN ) -> an_array
- *
- * Deprecated; use <code>Array#values_at</code>.
- */
-
-static VALUE
-rb_ary_indexes(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- VALUE new_ary;
- long i;
-
- rb_warn("Array#%s is deprecated; use Array#values_at", rb_id2name(rb_frame_last_func()));
- new_ary = rb_ary_new2(argc);
- for (i=0; i<argc; i++) {
- rb_ary_push(new_ary, rb_ary_aref(1, argv+i, ary));
- }
-
- return new_ary;
-}
-
VALUE
-rb_ary_to_ary(obj)
- VALUE obj;
+rb_ary_to_ary(VALUE obj)
{
- if (TYPE(obj) == T_ARRAY) {
- return obj;
- }
- if (rb_respond_to(obj, rb_intern("to_ary"))) {
- return rb_convert_type(obj, T_ARRAY, "Array", "to_ary");
- }
+ VALUE tmp = rb_check_array_type(obj);
+
+ if (!NIL_P(tmp)) return tmp;
return rb_ary_new3(1, obj);
}
static void
-rb_ary_splice(ary, beg, len, rpl)
- VALUE ary;
- long beg, len;
- VALUE rpl;
+rb_ary_splice(VALUE ary, long beg, long len, VALUE rpl)
{
long rlen;
if (len < 0) rb_raise(rb_eIndexError, "negative length (%ld)", len);
if (beg < 0) {
- beg += RARRAY(ary)->len;
+ beg += RARRAY_LEN(ary);
if (beg < 0) {
- beg -= RARRAY(ary)->len;
- rb_raise(rb_eIndexError, "index %ld out of array", beg);
+ rb_raise(rb_eIndexError, "index %ld too small for array; minimum: %ld",
+ beg - RARRAY_LEN(ary), -RARRAY_LEN(ary));
}
}
- if (RARRAY(ary)->len < len || RARRAY(ary)->len < beg + len) {
- len = RARRAY(ary)->len - beg;
+ if (RARRAY_LEN(ary) < len || RARRAY_LEN(ary) < beg + len) {
+ len = RARRAY_LEN(ary) - beg;
}
- if (NIL_P(rpl)) {
+ if (rpl == Qundef) {
rlen = 0;
}
else {
rpl = rb_ary_to_ary(rpl);
- rlen = RARRAY(rpl)->len;
+ rlen = RARRAY_LEN(rpl);
}
- rb_ary_modify(ary);
-
- if (beg >= RARRAY(ary)->len) {
- len = beg + rlen;
- if (len >= RARRAY(ary)->aux.capa) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, len);
- RARRAY(ary)->aux.capa = len;
+ if (beg >= RARRAY_LEN(ary)) {
+ if (beg > ARY_MAX_SIZE - rlen) {
+ rb_raise(rb_eIndexError, "index %ld too big", beg);
}
- rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len, beg - RARRAY(ary)->len);
+ ary_ensure_room_for_push(ary, rlen-len); /* len is 0 or negative */
+ len = beg + rlen;
+ rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary), beg - RARRAY_LEN(ary));
if (rlen > 0) {
- MEMCPY(RARRAY(ary)->ptr + beg, RARRAY(rpl)->ptr, VALUE, rlen);
+ MEMCPY(RARRAY_PTR(ary) + beg, RARRAY_PTR(rpl), VALUE, rlen);
}
- RARRAY(ary)->len = len;
+ ARY_SET_LEN(ary, len);
}
else {
long alen;
- if (beg + len > RARRAY(ary)->len) {
- len = RARRAY(ary)->len - beg;
- }
-
- alen = RARRAY(ary)->len + rlen - len;
- if (alen >= RARRAY(ary)->aux.capa) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, alen);
- RARRAY(ary)->aux.capa = alen;
+ rb_ary_modify(ary);
+ alen = RARRAY_LEN(ary) + rlen - len;
+ if (alen >= ARY_CAPA(ary)) {
+ ary_double_capa(ary, alen);
}
if (len != rlen) {
- MEMMOVE(RARRAY(ary)->ptr + beg + rlen, RARRAY(ary)->ptr + beg + len,
- VALUE, RARRAY(ary)->len - (beg + len));
- RARRAY(ary)->len = alen;
+ MEMMOVE(RARRAY_PTR(ary) + beg + rlen, RARRAY_PTR(ary) + beg + len,
+ VALUE, RARRAY_LEN(ary) - (beg + len));
+ ARY_SET_LEN(ary, alen);
}
if (rlen > 0) {
- MEMMOVE(RARRAY(ary)->ptr + beg, RARRAY(rpl)->ptr, VALUE, rlen);
+ MEMMOVE(RARRAY_PTR(ary) + beg, RARRAY_PTR(rpl), VALUE, rlen);
+ }
+ }
+}
+
+void
+rb_ary_set_len(VALUE ary, long len)
+{
+ long capa;
+
+ rb_ary_modify_check(ary);
+ if (ARY_SHARED_P(ary)) {
+ rb_raise(rb_eRuntimeError, "can't set length of shared ");
+ }
+ if (len > (capa = (long)ARY_CAPA(ary))) {
+ rb_bug("probable buffer overflow: %ld for %ld", len, capa);
+ }
+ ARY_SET_LEN(ary, len);
+}
+
+/*!
+ * expands or shrinks \a ary to \a len elements.
+ * expanded region will be filled with Qnil.
+ * \param ary an array
+ * \param len new size
+ * \return \a ary
+ * \post the size of \a ary is \a len.
+ */
+VALUE
+rb_ary_resize(VALUE ary, long len)
+{
+ long olen;
+
+ rb_ary_modify(ary);
+ olen = RARRAY_LEN(ary);
+ if (len == olen) return ary;
+ if (len > ARY_MAX_SIZE) {
+ rb_raise(rb_eIndexError, "index %ld too big", len);
+ }
+ if (len > olen) {
+ if (len >= ARY_CAPA(ary)) {
+ ary_double_capa(ary, len);
}
+ rb_mem_clear(RARRAY_PTR(ary) + olen, len - olen);
+ ARY_SET_LEN(ary, len);
}
+ else if (ARY_EMBED_P(ary)) {
+ ARY_SET_EMBED_LEN(ary, len);
+ }
+ else if (len <= RARRAY_EMBED_LEN_MAX) {
+ VALUE tmp[RARRAY_EMBED_LEN_MAX];
+ MEMCPY(tmp, ARY_HEAP_PTR(ary), VALUE, len);
+ ary_discard(ary);
+ MEMCPY(ARY_EMBED_PTR(ary), tmp, VALUE, len);
+ ARY_SET_EMBED_LEN(ary, len);
+ }
+ else {
+ if (olen > len + ARY_DEFAULT_SIZE) {
+ REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, len);
+ ARY_SET_CAPA(ary, len);
+ }
+ ARY_SET_HEAP_LEN(ary, len);
+ }
+ return ary;
}
-/*
+/*
* call-seq:
- * array[index] = obj -> obj
- * array[start, length] = obj or an_array or nil -> obj or an_array or nil
- * array[range] = obj or an_array or nil -> obj or an_array or nil
+ * ary[index] = obj -> obj
+ * ary[start, length] = obj or other_ary or nil -> obj or other_ary or nil
+ * ary[range] = obj or other_ary or nil -> obj or other_ary or nil
+ *
+ * Element Assignment --- Sets the element at +index+, or replaces a subarray
+ * from the +start+ index for +length+ elements, or replaces a subarray
+ * specified by the +range+ of indices.
+ *
+ * If indices are greater than the current capacity of the array, the array
+ * grows automatically. Elements are inserted into the array at +start+ if
+ * +length+ is zero.
+ *
+ * Negative indices will count backward from the end of the array. For
+ * +start+ and +range+ cases the starting index is just before an element.
+ *
+ * An IndexError is raised if a negative index points past the beginning of
+ * the array.
+ *
+ * See also Array#push, and Array#unshift.
*
- * Element Assignment---Sets the element at _index_,
- * or replaces a subarray starting at _start_ and
- * continuing for _length_ elements, or replaces a subarray
- * specified by _range_. If indices are greater than
- * the current capacity of the array, the array grows
- * automatically. A negative indices will count backward
- * from the end of the array. Inserts elements if _length_ is
- * zero. If +nil+ is used in the second and third form,
- * deletes elements from _self_. An +IndexError+ is raised if a
- * negative index points past the beginning of the array. See also
- * <code>Array#push</code>, and <code>Array#unshift</code>.
- *
* a = Array.new
* a[4] = "4"; #=> [nil, nil, nil, nil, "4"]
* a[0, 3] = [ 'a', 'b', 'c' ] #=> ["a", "b", "c", nil, "4"]
@@ -1027,38 +1577,31 @@ rb_ary_splice(ary, beg, len, rpl)
* a[0, 2] = "?" #=> ["?", 2, nil, "4"]
* a[0..2] = "A" #=> ["A", "4"]
* a[-1] = "Z" #=> ["A", "Z"]
- * a[1..-1] = nil #=> ["A"]
+ * a[1..-1] = nil #=> ["A", nil]
+ * a[1..-1] = [] #=> ["A"]
+ * a[0, 0] = [ 1, 2 ] #=> [1, 2, "A"]
+ * a[3, 0] = "B" #=> [1, 2, "A", "B"]
*/
static VALUE
-rb_ary_aset(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_aset(int argc, VALUE *argv, VALUE ary)
{
long offset, beg, len;
if (argc == 3) {
- if (SYMBOL_P(argv[0])) {
- rb_raise(rb_eTypeError, "Symbol as array index");
- }
- if (SYMBOL_P(argv[1])) {
- rb_raise(rb_eTypeError, "Symbol as subarray length");
- }
- rb_ary_splice(ary, NUM2LONG(argv[0]), NUM2LONG(argv[1]), argv[2]);
+ rb_ary_modify_check(ary);
+ beg = NUM2LONG(argv[0]);
+ len = NUM2LONG(argv[1]);
+ rb_ary_splice(ary, beg, len, argv[2]);
return argv[2];
}
- if (argc != 2) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc);
- }
+ rb_check_arity(argc, 2, 2);
+ rb_ary_modify_check(ary);
if (FIXNUM_P(argv[0])) {
offset = FIX2LONG(argv[0]);
goto fixnum;
}
- if (SYMBOL_P(argv[0])) {
- rb_raise(rb_eTypeError, "Symbol as array index");
- }
- if (rb_range_beg_len(argv[0], &beg, &len, RARRAY(ary)->len, 1)) {
+ if (rb_range_beg_len(argv[0], &beg, &len, RARRAY_LEN(ary), 1)) {
/* check if idx is Range */
rb_ary_splice(ary, beg, len, argv[1]);
return argv[1];
@@ -1072,31 +1615,29 @@ fixnum:
/*
* call-seq:
- * array.insert(index, obj...) -> array
- *
- * Inserts the given values before the element with the given index
- * (which may be negative).
- *
+ * ary.insert(index, obj...) -> ary
+ *
+ * Inserts the given values before the element with the given +index+.
+ *
+ * Negative indices count backwards from the end of the array, where +-1+ is
+ * the last element.
+ *
* a = %w{ a b c d }
* a.insert(2, 99) #=> ["a", "b", 99, "c", "d"]
* a.insert(-2, 1, 2, 3) #=> ["a", "b", 99, "c", 1, 2, 3, "d"]
*/
static VALUE
-rb_ary_insert(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_insert(int argc, VALUE *argv, VALUE ary)
{
long pos;
+ rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
+ rb_ary_modify_check(ary);
if (argc == 1) return ary;
- if (argc < 1) {
- rb_raise(rb_eArgError, "wrong number of arguments (at least 1)");
- }
pos = NUM2LONG(argv[0]);
if (pos == -1) {
- pos = RARRAY(ary)->len;
+ pos = RARRAY_LEN(ary);
}
if (pos < 0) {
pos++;
@@ -1105,55 +1646,65 @@ rb_ary_insert(argc, argv, ary)
return ary;
}
+static VALUE
+rb_ary_length(VALUE ary);
+
/*
* call-seq:
- * array.each {|item| block } -> array
- *
- * Calls <i>block</i> once for each element in <i>self</i>, passing that
- * element as a parameter.
- *
+ * ary.each { |item| block } -> ary
+ * ary.each -> Enumerator
+ *
+ * Calls the given block once for each element in +self+, passing that element
+ * as a parameter.
+ *
+ * An Enumerator is returned if no block is given.
+ *
* a = [ "a", "b", "c" ]
* a.each {|x| print x, " -- " }
- *
+ *
* produces:
- *
+ *
* a -- b -- c --
*/
VALUE
-rb_ary_each(ary)
- VALUE ary;
+rb_ary_each(VALUE array)
{
long i;
+ volatile VALUE ary = array;
- for (i=0; i<RARRAY(ary)->len; i++) {
- rb_yield(RARRAY(ary)->ptr[i]);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ rb_yield(RARRAY_PTR(ary)[i]);
}
return ary;
}
/*
* call-seq:
- * array.each_index {|index| block } -> array
- *
- * Same as <code>Array#each</code>, but passes the index of the element
- * instead of the element itself.
- *
+ * ary.each_index { |index| block } -> ary
+ * ary.each_index -> Enumerator
+ *
+ * Same as Array#each, but passes the +index+ of the element instead of the
+ * element itself.
+ *
+ * An Enumerator is returned if no block is given.
+ *
* a = [ "a", "b", "c" ]
* a.each_index {|x| print x, " -- " }
- *
+ *
* produces:
- *
+ *
* 0 -- 1 -- 2 --
*/
static VALUE
-rb_ary_each_index(ary)
- VALUE ary;
+rb_ary_each_index(VALUE ary)
{
long i;
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
- for (i=0; i<RARRAY(ary)->len; i++) {
+ for (i=0; i<RARRAY_LEN(ary); i++) {
rb_yield(LONG2NUM(i));
}
return ary;
@@ -1161,29 +1712,30 @@ rb_ary_each_index(ary)
/*
* call-seq:
- * array.reverse_each {|item| block }
- *
- * Same as <code>Array#each</code>, but traverses <i>self</i> in reverse
- * order.
- *
+ * ary.reverse_each { |item| block } -> ary
+ * ary.reverse_each -> Enumerator
+ *
+ * Same as Array#each, but traverses +self+ in reverse order.
+ *
* a = [ "a", "b", "c" ]
* a.reverse_each {|x| print x, " " }
- *
+ *
* produces:
- *
+ *
* c b a
*/
static VALUE
-rb_ary_reverse_each(ary)
- VALUE ary;
+rb_ary_reverse_each(VALUE ary)
{
- long len = RARRAY(ary)->len;
+ long len;
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+ len = RARRAY_LEN(ary);
while (len--) {
- rb_yield(RARRAY(ary)->ptr[len]);
- if (RARRAY(ary)->len < len) {
- len = RARRAY(ary)->len;
+ rb_yield(RARRAY_PTR(ary)[len]);
+ if (RARRAY_LEN(ary) < len) {
+ len = RARRAY_LEN(ary);
}
}
return ary;
@@ -1191,286 +1743,274 @@ rb_ary_reverse_each(ary)
/*
* call-seq:
- * array.length -> int
- *
- * Returns the number of elements in <i>self</i>. May be zero.
- *
+ * ary.length -> int
+ *
+ * Returns the number of elements in +self+. May be zero.
+ *
* [ 1, 2, 3, 4, 5 ].length #=> 5
+ * [].length #=> 0
*/
static VALUE
-rb_ary_length(ary)
- VALUE ary;
+rb_ary_length(VALUE ary)
{
- return LONG2NUM(RARRAY(ary)->len);
+ long len = RARRAY_LEN(ary);
+ return LONG2NUM(len);
}
/*
* call-seq:
- * array.empty? -> true or false
- *
- * Returns <code>true</code> if <i>self</i> array contains no elements.
- *
+ * ary.empty? -> true or false
+ *
+ * Returns +true+ if +self+ contains no elements.
+ *
* [].empty? #=> true
*/
static VALUE
-rb_ary_empty_p(ary)
- VALUE ary;
+rb_ary_empty_p(VALUE ary)
{
- if (RARRAY(ary)->len == 0)
+ if (RARRAY_LEN(ary) == 0)
return Qtrue;
return Qfalse;
}
VALUE
-rb_ary_dup(ary)
- VALUE ary;
+rb_ary_dup(VALUE ary)
{
- VALUE dup = rb_ary_new2(RARRAY(ary)->len);
-
- DUPSETUP(dup, ary);
- MEMCPY(RARRAY(dup)->ptr, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
- RARRAY(dup)->len = RARRAY(ary)->len;
+ VALUE dup = rb_ary_new2(RARRAY_LEN(ary));
+ MEMCPY(RARRAY_PTR(dup), RARRAY_PTR(ary), VALUE, RARRAY_LEN(ary));
+ ARY_SET_LEN(dup, RARRAY_LEN(ary));
return dup;
}
+VALUE
+rb_ary_resurrect(VALUE ary)
+{
+ return rb_ary_new4(RARRAY_LEN(ary), RARRAY_PTR(ary));
+}
+
extern VALUE rb_output_fs;
+static void ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result, int *first);
+
static VALUE
-inspect_join(ary, arg)
- VALUE ary;
- VALUE *arg;
+recursive_join(VALUE obj, VALUE argp, int recur)
{
- return rb_ary_join(arg[0], arg[1]);
+ VALUE *arg = (VALUE *)argp;
+ VALUE ary = arg[0];
+ VALUE sep = arg[1];
+ VALUE result = arg[2];
+ int *first = (int *)arg[3];
+
+ if (recur) {
+ rb_raise(rb_eArgError, "recursive array join");
+ }
+ else {
+ ary_join_1(obj, ary, sep, 0, result, first);
+ }
+ return Qnil;
}
-VALUE
-rb_ary_join(ary, sep)
- VALUE ary, sep;
+static void
+ary_join_0(VALUE ary, VALUE sep, long max, VALUE result)
{
- long len = 1, i;
- int taint = Qfalse;
- VALUE result, tmp;
-
- if (RARRAY(ary)->len == 0) return rb_str_new(0, 0);
- if (OBJ_TAINTED(ary) || OBJ_TAINTED(sep)) taint = Qtrue;
+ long i;
+ VALUE val;
- for (i=0; i<RARRAY(ary)->len; i++) {
- tmp = rb_check_string_type(RARRAY(ary)->ptr[i]);
- len += NIL_P(tmp) ? 10 : RSTRING(tmp)->len;
- }
- if (!NIL_P(sep)) {
- StringValue(sep);
- len += RSTRING(sep)->len * (RARRAY(ary)->len - 1);
+ if (max > 0) rb_enc_copy(result, RARRAY_PTR(ary)[0]);
+ for (i=0; i<max; i++) {
+ val = RARRAY_PTR(ary)[i];
+ if (i > 0 && !NIL_P(sep))
+ rb_str_buf_append(result, sep);
+ rb_str_buf_append(result, val);
+ if (OBJ_TAINTED(val)) OBJ_TAINT(result);
+ if (OBJ_UNTRUSTED(val)) OBJ_TAINT(result);
}
- result = rb_str_buf_new(len);
- for (i=0; i<RARRAY(ary)->len; i++) {
- tmp = RARRAY(ary)->ptr[i];
- switch (TYPE(tmp)) {
+}
+
+static void
+ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result, int *first)
+{
+ VALUE val, tmp;
+
+ for (; i<RARRAY_LEN(ary); i++) {
+ if (i > 0 && !NIL_P(sep))
+ rb_str_buf_append(result, sep);
+
+ val = RARRAY_PTR(ary)[i];
+ switch (TYPE(val)) {
case T_STRING:
+ str_join:
+ rb_str_buf_append(result, val);
+ *first = FALSE;
break;
case T_ARRAY:
- if (rb_inspecting_p(tmp)) {
- tmp = rb_str_new2("[...]");
+ obj = val;
+ ary_join:
+ if (val == ary) {
+ rb_raise(rb_eArgError, "recursive array join");
}
else {
- VALUE args[2];
+ VALUE args[4];
- args[0] = tmp;
+ args[0] = val;
args[1] = sep;
- tmp = rb_protect_inspect(inspect_join, ary, (VALUE)args);
+ args[2] = result;
+ args[3] = (VALUE)first;
+ rb_exec_recursive(recursive_join, obj, (VALUE)args);
}
break;
default:
- tmp = rb_obj_as_string(tmp);
+ tmp = rb_check_string_type(val);
+ if (!NIL_P(tmp)) {
+ val = tmp;
+ goto str_join;
+ }
+ tmp = rb_check_convert_type(val, T_ARRAY, "Array", "to_ary");
+ if (!NIL_P(tmp)) {
+ obj = val;
+ val = tmp;
+ goto ary_join;
+ }
+ val = rb_obj_as_string(val);
+ if (*first) {
+ rb_enc_copy(result, val);
+ *first = FALSE;
+ }
+ goto str_join;
}
- if (i > 0 && !NIL_P(sep))
- rb_str_buf_append(result, sep);
- rb_str_buf_append(result, tmp);
- if (OBJ_TAINTED(tmp)) taint = Qtrue;
}
+}
+
+VALUE
+rb_ary_join(VALUE ary, VALUE sep)
+{
+ long len = 1, i;
+ int taint = FALSE;
+ int untrust = FALSE;
+ VALUE val, tmp, result;
+ if (RARRAY_LEN(ary) == 0) return rb_usascii_str_new(0, 0);
+ if (OBJ_TAINTED(ary)) taint = TRUE;
+ if (OBJ_UNTRUSTED(ary)) untrust = TRUE;
+
+ if (!NIL_P(sep)) {
+ StringValue(sep);
+ len += RSTRING_LEN(sep) * (RARRAY_LEN(ary) - 1);
+ }
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ val = RARRAY_PTR(ary)[i];
+ tmp = rb_check_string_type(val);
+
+ if (NIL_P(tmp) || tmp != val) {
+ int first;
+ result = rb_str_buf_new(len + (RARRAY_LEN(ary)-i)*10);
+ rb_enc_associate(result, rb_usascii_encoding());
+ if (taint) OBJ_TAINT(result);
+ if (untrust) OBJ_UNTRUST(result);
+ ary_join_0(ary, sep, i, result);
+ first = i == 0;
+ ary_join_1(ary, ary, sep, i, result, &first);
+ return result;
+ }
+
+ len += RSTRING_LEN(tmp);
+ }
+
+ result = rb_str_buf_new(len);
if (taint) OBJ_TAINT(result);
+ if (untrust) OBJ_UNTRUST(result);
+ ary_join_0(ary, sep, RARRAY_LEN(ary), result);
+
return result;
}
/*
* call-seq:
- * array.join(sep=$,) -> str
- *
+ * ary.join(separator=$,) -> str
+ *
* Returns a string created by converting each element of the array to
- * a string, separated by <i>sep</i>.
- *
+ * a string, separated by the given +separator+.
+ * If the +separator+ is +nil+, it uses current $,.
+ * If both the +separator+ and $, are nil, it uses empty string.
+ *
* [ "a", "b", "c" ].join #=> "abc"
* [ "a", "b", "c" ].join("-") #=> "a-b-c"
*/
static VALUE
-rb_ary_join_m(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_join_m(int argc, VALUE *argv, VALUE ary)
{
VALUE sep;
rb_scan_args(argc, argv, "01", &sep);
if (NIL_P(sep)) sep = rb_output_fs;
-
- return rb_ary_join(ary, sep);
-}
-/*
- * call-seq:
- * array.to_s -> string
- *
- * Returns _self_<code>.join</code>.
- *
- * [ "a", "e", "i", "o" ].to_s #=> "aeio"
- *
- */
-
-VALUE
-rb_ary_to_s(ary)
- VALUE ary;
-{
- if (RARRAY(ary)->len == 0) return rb_str_new(0, 0);
-
- return rb_ary_join(ary, rb_output_fs);
-}
-
-static ID inspect_key;
-
-struct inspect_arg {
- VALUE (*func)();
- VALUE arg1, arg2;
-};
-
-static VALUE
-inspect_call(arg)
- struct inspect_arg *arg;
-{
- return (*arg->func)(arg->arg1, arg->arg2);
-}
-
-static VALUE
-get_inspect_tbl(create)
- int create;
-{
- VALUE inspect_tbl = rb_thread_local_aref(rb_thread_current(), inspect_key);
-
- if (NIL_P(inspect_tbl)) {
- if (create) {
- tbl_init:
- inspect_tbl = rb_ary_new();
- rb_thread_local_aset(rb_thread_current(), inspect_key, inspect_tbl);
- }
- }
- else if (TYPE(inspect_tbl) != T_ARRAY) {
- rb_warn("invalid inspect_tbl value");
- if (create) goto tbl_init;
- rb_thread_local_aset(rb_thread_current(), inspect_key, Qnil);
- return Qnil;
- }
- return inspect_tbl;
-}
-
-static VALUE
-inspect_ensure(obj)
- VALUE obj;
-{
- VALUE inspect_tbl;
-
- inspect_tbl = get_inspect_tbl(Qfalse);
- if (!NIL_P(inspect_tbl)) {
- rb_ary_pop(inspect_tbl);
- }
- return 0;
-}
-
-VALUE
-rb_protect_inspect(func, obj, arg)
- VALUE (*func)(ANYARGS);
- VALUE obj, arg;
-{
- struct inspect_arg iarg;
- VALUE inspect_tbl;
- VALUE id;
-
- inspect_tbl = get_inspect_tbl(Qtrue);
- id = rb_obj_id(obj);
- if (rb_ary_includes(inspect_tbl, id)) {
- return (*func)(obj, arg);
- }
- rb_ary_push(inspect_tbl, id);
- iarg.func = func;
- iarg.arg1 = obj;
- iarg.arg2 = arg;
-
- return rb_ensure(inspect_call, (VALUE)&iarg, inspect_ensure, obj);
-}
-
-VALUE
-rb_inspecting_p(obj)
- VALUE obj;
-{
- VALUE inspect_tbl;
-
- inspect_tbl = get_inspect_tbl(Qfalse);
- if (NIL_P(inspect_tbl)) return Qfalse;
- return rb_ary_includes(inspect_tbl, rb_obj_id(obj));
+ return rb_ary_join(ary, sep);
}
static VALUE
-inspect_ary(ary)
- VALUE ary;
+inspect_ary(VALUE ary, VALUE dummy, int recur)
{
int tainted = OBJ_TAINTED(ary);
+ int untrust = OBJ_UNTRUSTED(ary);
long i;
VALUE s, str;
+ if (recur) return rb_usascii_str_new_cstr("[...]");
str = rb_str_buf_new2("[");
- for (i=0; i<RARRAY(ary)->len; i++) {
- s = rb_inspect(RARRAY(ary)->ptr[i]);
- if (OBJ_TAINTED(s)) tainted = Qtrue;
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ s = rb_inspect(RARRAY_PTR(ary)[i]);
+ if (OBJ_TAINTED(s)) tainted = TRUE;
+ if (OBJ_UNTRUSTED(s)) untrust = TRUE;
if (i > 0) rb_str_buf_cat2(str, ", ");
+ else rb_enc_copy(str, s);
rb_str_buf_append(str, s);
}
rb_str_buf_cat2(str, "]");
if (tainted) OBJ_TAINT(str);
+ if (untrust) OBJ_UNTRUST(str);
return str;
}
/*
* call-seq:
- * array.inspect -> string
+ * ary.inspect -> string
+ * ary.to_s -> string
+ *
+ * Creates a string representation of +self+.
*
- * Create a printable version of <i>array</i>.
+ * [ "a", "b", "c" ].to_s #=> "[\"a\", \"b\", \"c\"]"
*/
static VALUE
-rb_ary_inspect(ary)
- VALUE ary;
+rb_ary_inspect(VALUE ary)
{
- if (RARRAY(ary)->len == 0) return rb_str_new2("[]");
- if (rb_inspecting_p(ary)) return rb_str_new2("[...]");
- return rb_protect_inspect(inspect_ary, ary, 0);
+ if (RARRAY_LEN(ary) == 0) return rb_usascii_str_new2("[]");
+ return rb_exec_recursive(inspect_ary, ary, 0);
+}
+
+VALUE
+rb_ary_to_s(VALUE ary)
+{
+ return rb_ary_inspect(ary);
}
/*
* call-seq:
- * array.to_a -> array
- *
- * Returns _self_. If called on a subclass of Array, converts
- * the receiver to an Array object.
+ * ary.to_a -> ary
+ *
+ * Returns +self+.
+ *
+ * If called on a subclass of Array, converts the receiver to an Array object.
*/
static VALUE
-rb_ary_to_a(ary)
- VALUE ary;
+rb_ary_to_a(VALUE ary)
{
if (rb_obj_class(ary) != rb_cArray) {
- VALUE dup = rb_ary_new2(RARRAY(ary)->len);
+ VALUE dup = rb_ary_new2(RARRAY_LEN(ary));
rb_ary_replace(dup, ary);
return dup;
}
@@ -1479,195 +2019,359 @@ rb_ary_to_a(ary)
/*
* call-seq:
- * array.to_ary -> array
- *
- * Returns _self_.
+ * ary.to_ary -> ary
+ *
+ * Returns +self+.
*/
static VALUE
-rb_ary_to_ary_m(ary)
- VALUE ary;
+rb_ary_to_ary_m(VALUE ary)
{
return ary;
}
+static void
+ary_reverse(VALUE *p1, VALUE *p2)
+{
+ while (p1 < p2) {
+ VALUE tmp = *p1;
+ *p1++ = *p2;
+ *p2-- = tmp;
+ }
+}
+
VALUE
-rb_ary_reverse(ary)
- VALUE ary;
+rb_ary_reverse(VALUE ary)
{
VALUE *p1, *p2;
- VALUE tmp;
rb_ary_modify(ary);
- if (RARRAY(ary)->len > 1) {
- p1 = RARRAY(ary)->ptr;
- p2 = p1 + RARRAY(ary)->len - 1; /* points last item */
-
- while (p1 < p2) {
- tmp = *p1;
- *p1++ = *p2;
- *p2-- = tmp;
- }
+ if (RARRAY_LEN(ary) > 1) {
+ p1 = RARRAY_PTR(ary);
+ p2 = p1 + RARRAY_LEN(ary) - 1; /* points last item */
+ ary_reverse(p1, p2);
}
return ary;
}
/*
* call-seq:
- * array.reverse! -> array
- *
- * Reverses _self_ in place.
- *
+ * ary.reverse! -> ary
+ *
+ * Reverses +self+ in place.
+ *
* a = [ "a", "b", "c" ]
* a.reverse! #=> ["c", "b", "a"]
* a #=> ["c", "b", "a"]
*/
static VALUE
-rb_ary_reverse_bang(ary)
- VALUE ary;
+rb_ary_reverse_bang(VALUE ary)
{
return rb_ary_reverse(ary);
}
/*
* call-seq:
- * array.reverse -> an_array
- *
- * Returns a new array containing <i>self</i>'s elements in reverse order.
- *
+ * ary.reverse -> new_ary
+ *
+ * Returns a new array containing +self+'s elements in reverse order.
+ *
* [ "a", "b", "c" ].reverse #=> ["c", "b", "a"]
* [ 1 ].reverse #=> [1]
*/
static VALUE
-rb_ary_reverse_m(ary)
- VALUE ary;
+rb_ary_reverse_m(VALUE ary)
+{
+ long len = RARRAY_LEN(ary);
+ VALUE dup = rb_ary_new2(len);
+
+ if (len > 0) {
+ VALUE *p1 = RARRAY_PTR(ary);
+ VALUE *p2 = RARRAY_PTR(dup) + len - 1;
+ do *p2-- = *p1++; while (--len > 0);
+ }
+ ARY_SET_LEN(dup, RARRAY_LEN(ary));
+ return dup;
+}
+
+static inline long
+rotate_count(long cnt, long len)
+{
+ return (cnt < 0) ? (len - (~cnt % len) - 1) : (cnt % len);
+}
+
+VALUE
+rb_ary_rotate(VALUE ary, long cnt)
+{
+ rb_ary_modify(ary);
+
+ if (cnt != 0) {
+ VALUE *ptr = RARRAY_PTR(ary);
+ long len = RARRAY_LEN(ary);
+
+ if (len > 0 && (cnt = rotate_count(cnt, len)) > 0) {
+ --len;
+ if (cnt < len) ary_reverse(ptr + cnt, ptr + len);
+ if (--cnt > 0) ary_reverse(ptr, ptr + cnt);
+ if (len > 0) ary_reverse(ptr, ptr + len);
+ return ary;
+ }
+ }
+
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * ary.rotate!(count=1) -> ary
+ *
+ * Rotates +self+ in place so that the element at +count+ comes first, and
+ * returns +self+.
+ *
+ * If +count+ is negative then it rotates in the opposite direction, starting
+ * from the end of the array where +-1+ is the last element.
+ *
+ * a = [ "a", "b", "c", "d" ]
+ * a.rotate! #=> ["b", "c", "d", "a"]
+ * a #=> ["b", "c", "d", "a"]
+ * a.rotate!(2) #=> ["d", "a", "b", "c"]
+ * a.rotate!(-3) #=> ["a", "b", "c", "d"]
+ */
+
+static VALUE
+rb_ary_rotate_bang(int argc, VALUE *argv, VALUE ary)
{
- return rb_ary_reverse(rb_ary_dup(ary));
+ long n = 1;
+
+ switch (argc) {
+ case 1: n = NUM2LONG(argv[0]);
+ case 0: break;
+ default: rb_scan_args(argc, argv, "01", NULL);
+ }
+ rb_ary_rotate(ary, n);
+ return ary;
+}
+
+/*
+ * call-seq:
+ * ary.rotate(count=1) -> new_ary
+ *
+ * Returns a new array by rotating +self+ so that the element at +count+ is
+ * the first element of the new array.
+ *
+ * If +count+ is negative then it rotates in the opposite direction, starting
+ * from the end of +self+ where +-1+ is the last element.
+ *
+ * a = [ "a", "b", "c", "d" ]
+ * a.rotate #=> ["b", "c", "d", "a"]
+ * a #=> ["a", "b", "c", "d"]
+ * a.rotate(2) #=> ["c", "d", "a", "b"]
+ * a.rotate(-3) #=> ["b", "c", "d", "a"]
+ */
+
+static VALUE
+rb_ary_rotate_m(int argc, VALUE *argv, VALUE ary)
+{
+ VALUE rotated, *ptr, *ptr2;
+ long len, cnt = 1;
+
+ switch (argc) {
+ case 1: cnt = NUM2LONG(argv[0]);
+ case 0: break;
+ default: rb_scan_args(argc, argv, "01", NULL);
+ }
+
+ len = RARRAY_LEN(ary);
+ rotated = rb_ary_new2(len);
+ if (len > 0) {
+ cnt = rotate_count(cnt, len);
+ ptr = RARRAY_PTR(ary);
+ ptr2 = RARRAY_PTR(rotated);
+ len -= cnt;
+ MEMCPY(ptr2, ptr + cnt, VALUE, len);
+ MEMCPY(ptr2 + len, ptr, VALUE, cnt);
+ }
+ ARY_SET_LEN(rotated, RARRAY_LEN(ary));
+ return rotated;
}
struct ary_sort_data {
VALUE ary;
- VALUE *ptr;
- long len;
+ int opt_methods;
+ int opt_inited;
};
-static void
-ary_sort_check(data)
- struct ary_sort_data *data;
+enum {
+ sort_opt_Fixnum,
+ sort_opt_String,
+ sort_optimizable_count
+};
+
+#define STRING_P(s) (RB_TYPE_P((s), T_STRING) && CLASS_OF(s) == rb_cString)
+
+#define SORT_OPTIMIZABLE_BIT(type) (1U << TOKEN_PASTE(sort_opt_,type))
+#define SORT_OPTIMIZABLE(data, type) \
+ (((data)->opt_inited & SORT_OPTIMIZABLE_BIT(type)) ? \
+ ((data)->opt_methods & SORT_OPTIMIZABLE_BIT(type)) : \
+ (((data)->opt_inited |= SORT_OPTIMIZABLE_BIT(type)), \
+ rb_method_basic_definition_p(TOKEN_PASTE(rb_c,type), id_cmp) && \
+ ((data)->opt_methods |= SORT_OPTIMIZABLE_BIT(type))))
+
+static VALUE
+sort_reentered(VALUE ary)
{
- if (RARRAY(data->ary)->ptr != data->ptr || RARRAY(data->ary)->len != data->len) {
- rb_raise(rb_eArgError, "array modified during sort");
+ if (RBASIC(ary)->klass) {
+ rb_raise(rb_eRuntimeError, "sort reentered");
}
+ return Qnil;
}
static int
-sort_1(a, b, data)
- VALUE *a, *b;
- struct ary_sort_data *data;
+sort_1(const void *ap, const void *bp, void *dummy)
{
- VALUE retval = rb_yield_values(2, *a, *b);
+ struct ary_sort_data *data = dummy;
+ VALUE retval = sort_reentered(data->ary);
+ VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
int n;
- n = rb_cmpint(retval, *a, *b);
- ary_sort_check(data);
+ retval = rb_yield_values(2, a, b);
+ n = rb_cmpint(retval, a, b);
+ sort_reentered(data->ary);
return n;
}
static int
-sort_2(ap, bp, data)
- VALUE *ap, *bp;
- struct ary_sort_data *data;
+sort_2(const void *ap, const void *bp, void *dummy)
{
- VALUE retval;
- VALUE a = *ap, b = *bp;
+ struct ary_sort_data *data = dummy;
+ VALUE retval = sort_reentered(data->ary);
+ VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
int n;
- if (FIXNUM_P(a) && FIXNUM_P(b)) {
+ if (FIXNUM_P(a) && FIXNUM_P(b) && SORT_OPTIMIZABLE(data, Fixnum)) {
if ((long)a > (long)b) return 1;
if ((long)a < (long)b) return -1;
return 0;
}
- if (TYPE(a) == T_STRING) {
- if (TYPE(b) == T_STRING) return rb_str_cmp(a, b);
+ if (STRING_P(a) && STRING_P(b) && SORT_OPTIMIZABLE(data, String)) {
+ return rb_str_cmp(a, b);
}
retval = rb_funcall(a, id_cmp, 1, b);
n = rb_cmpint(retval, a, b);
- ary_sort_check(data);
+ sort_reentered(data->ary);
return n;
}
-static VALUE
-sort_internal(ary)
- VALUE ary;
-{
- struct ary_sort_data data;
-
- data.ary = ary;
- data.ptr = RARRAY(ary)->ptr; data.len = RARRAY(ary)->len;
- qsort(RARRAY(ary)->ptr, RARRAY(ary)->len, sizeof(VALUE),
- rb_block_given_p()?sort_1:sort_2, &data);
- return ary;
-}
-
-static VALUE
-sort_unlock(ary)
- VALUE ary;
-{
- FL_UNSET(ary, ARY_TMPLOCK);
- return ary;
-}
-
/*
* call-seq:
- * array.sort! -> array
- * array.sort! {| a,b | block } -> array
- *
- * Sorts _self_. Comparisons for
- * the sort will be done using the <code><=></code> operator or using
- * an optional code block. The block implements a comparison between
- * <i>a</i> and <i>b</i>, returning -1, 0, or +1. See also
- * <code>Enumerable#sort_by</code>.
- *
+ * ary.sort! -> ary
+ * ary.sort! { |a, b| block } -> ary
+ *
+ * Sorts +self+ in place.
+ *
+ * Comparisons for the sort will be done using the <code><=></code> operator
+ * or using an optional code block.
+ *
+ * The block must implement a comparison between +a+ and +b+, and return
+ * +-1+, when +a+ follows +b+, +0+ when +a+ and +b+ are equivalent, or ++1+
+ * if +b+ follows +a+.
+ *
+ * See also Enumerable#sort_by.
+ *
* a = [ "d", "a", "e", "c", "b" ]
- * a.sort #=> ["a", "b", "c", "d", "e"]
- * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
+ * a.sort! #=> ["a", "b", "c", "d", "e"]
+ * a.sort! { |x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
*/
VALUE
-rb_ary_sort_bang(ary)
- VALUE ary;
+rb_ary_sort_bang(VALUE ary)
{
rb_ary_modify(ary);
- if (RARRAY(ary)->len > 1) {
- FL_SET(ary, ARY_TMPLOCK); /* prohibit modification during sort */
- rb_ensure(sort_internal, ary, sort_unlock, ary);
+ assert(!ARY_SHARED_P(ary));
+ if (RARRAY_LEN(ary) > 1) {
+ VALUE tmp = ary_make_substitution(ary); /* only ary refers tmp */
+ struct ary_sort_data data;
+ long len = RARRAY_LEN(ary);
+
+ RBASIC(tmp)->klass = 0;
+ data.ary = tmp;
+ data.opt_methods = 0;
+ data.opt_inited = 0;
+ ruby_qsort(RARRAY_PTR(tmp), len, sizeof(VALUE),
+ rb_block_given_p()?sort_1:sort_2, &data);
+
+ if (ARY_EMBED_P(tmp)) {
+ assert(ARY_EMBED_P(tmp));
+ if (ARY_SHARED_P(ary)) { /* ary might be destructively operated in the given block */
+ rb_ary_unshare(ary);
+ }
+ FL_SET_EMBED(ary);
+ MEMCPY(RARRAY_PTR(ary), ARY_EMBED_PTR(tmp), VALUE, ARY_EMBED_LEN(tmp));
+ ARY_SET_LEN(ary, ARY_EMBED_LEN(tmp));
+ }
+ else {
+ assert(!ARY_EMBED_P(tmp));
+ if (ARY_HEAP_PTR(ary) == ARY_HEAP_PTR(tmp)) {
+ assert(!ARY_EMBED_P(ary));
+ FL_UNSET_SHARED(ary);
+ ARY_SET_CAPA(ary, RARRAY_LEN(tmp));
+ }
+ else {
+ assert(!ARY_SHARED_P(tmp));
+ if (ARY_EMBED_P(ary)) {
+ FL_UNSET_EMBED(ary);
+ }
+ else if (ARY_SHARED_P(ary)) {
+ /* ary might be destructively operated in the given block */
+ rb_ary_unshare(ary);
+ }
+ else {
+ xfree(ARY_HEAP_PTR(ary));
+ }
+ ARY_SET_PTR(ary, RARRAY_PTR(tmp));
+ ARY_SET_HEAP_LEN(ary, len);
+ ARY_SET_CAPA(ary, RARRAY_LEN(tmp));
+ }
+ /* tmp was lost ownership for the ptr */
+ FL_UNSET(tmp, FL_FREEZE);
+ FL_SET_EMBED(tmp);
+ ARY_SET_EMBED_LEN(tmp, 0);
+ FL_SET(tmp, FL_FREEZE);
+ }
+ /* tmp will be GC'ed. */
+ RBASIC(tmp)->klass = rb_cArray;
}
return ary;
}
/*
* call-seq:
- * array.sort -> an_array
- * array.sort {| a,b | block } -> an_array
- *
- * Returns a new array created by sorting <i>self</i>. Comparisons for
- * the sort will be done using the <code><=></code> operator or using
- * an optional code block. The block implements a comparison between
- * <i>a</i> and <i>b</i>, returning -1, 0, or +1. See also
- * <code>Enumerable#sort_by</code>.
- *
+ * ary.sort -> new_ary
+ * ary.sort { |a, b| block } -> new_ary
+ *
+ * Returns a new array created by sorting +self+.
+ *
+ * Comparisons for the sort will be done using the <code><=></code> operator
+ * or using an optional code block.
+ *
+ * The block must implement a comparison between +a+ and +b+, and return
+ * +-1+, when +a+ follows +b+, +0+ when +a+ and +b+ are equivalent, or ++1+
+ * if +b+ follows +a+.
+ *
+ *
+ * See also Enumerable#sort_by.
+ *
* a = [ "d", "a", "e", "c", "b" ]
* a.sort #=> ["a", "b", "c", "d", "e"]
- * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
+ * a.sort { |x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
*/
VALUE
-rb_ary_sort(ary)
- VALUE ary;
+rb_ary_sort(VALUE ary)
{
ary = rb_ary_dup(ary);
rb_ary_sort_bang(ary);
@@ -1676,70 +2380,202 @@ rb_ary_sort(ary)
/*
* call-seq:
- * array.collect {|item| block } -> an_array
- * array.map {|item| block } -> an_array
- *
- * Invokes <i>block</i> once for each element of <i>self</i>. Creates a
- * new array containing the values returned by the block.
- * See also <code>Enumerable#collect</code>.
- *
+ * ary.bsearch {|x| block } -> elem
+ *
+ * By using binary search, finds a value from this array which meets
+ * the given condition in O(log n) where n is the size of the array.
+ *
+ * You can use this method in two use cases: a find-minimum mode and
+ * a find-any mode. In either case, the elements of the array must be
+ * monotone (or sorted) with respect to the block.
+ *
+ * In find-minimum mode (this is a good choice for typical use case),
+ * the block must return true or false, and there must be an index i
+ * (0 <= i <= ary.size) so that:
+ *
+ * - the block returns false for any element whose index is less than
+ * i, and
+ * - the block returns true for any element whose index is greater
+ * than or equal to i.
+ *
+ * This method returns the i-th element. If i is equal to ary.size,
+ * it returns nil.
+ *
+ * ary = [0, 4, 7, 10, 12]
+ * ary.bsearch {|x| x >= 4 } #=> 4
+ * ary.bsearch {|x| x >= 6 } #=> 7
+ * ary.bsearch {|x| x >= -1 } #=> 0
+ * ary.bsearch {|x| x >= 100 } #=> nil
+ *
+ * In find-any mode (this behaves like libc's bsearch(3)), the block
+ * must return a number, and there must be two indices i and j
+ * (0 <= i <= j <= ary.size) so that:
+ *
+ * - the block returns a positive number for ary[k] if 0 <= k < i,
+ * - the block returns zero for ary[k] if i <= k < j, and
+ * - the block returns a negative number for ary[k] if
+ * j <= k < ary.size.
+ *
+ * Under this condition, this method returns any element whose index
+ * is within i...j. If i is equal to j (i.e., there is no element
+ * that satisfies the block), this method returns nil.
+ *
+ * ary = [0, 4, 7, 10, 12]
+ * # try to find v such that 4 <= v < 8
+ * ary.bsearch {|x| 1 - x / 4 } #=> 4 or 7
+ * # try to find v such that 8 <= v < 10
+ * ary.bsearch {|x| 4 - x / 2 } #=> nil
+ *
+ * You must not mix the two modes at a time; the block must always
+ * return either true/false, or always return a number. It is
+ * undefined which value is actually picked up at each iteration.
+ */
+
+static VALUE
+rb_ary_bsearch(VALUE ary)
+{
+ long low = 0, high = RARRAY_LEN(ary), mid;
+ int smaller = 0, satisfied = 0;
+ VALUE v, val;
+
+ while (low < high) {
+ mid = low + ((high - low) / 2);
+ val = rb_ary_entry(ary, mid);
+ v = rb_yield(val);
+ if (FIXNUM_P(v)) {
+ if (FIX2INT(v) == 0) return val;
+ smaller = FIX2INT(v) < 0;
+ }
+ else if (v == Qtrue) {
+ satisfied = 1;
+ smaller = 1;
+ }
+ else if (v == Qfalse || v == Qnil) {
+ smaller = 0;
+ }
+ else if (rb_obj_is_kind_of(v, rb_cNumeric)) {
+ switch (rb_cmpint(rb_funcall(v, id_cmp, 1, INT2FIX(0)), v, INT2FIX(0))) {
+ case 0: return val;
+ case 1: smaller = 1; break;
+ case -1: smaller = 0;
+ }
+ }
+ else {
+ smaller = RTEST(v);
+ }
+ if (smaller) {
+ high = mid;
+ }
+ else {
+ low = mid + 1;
+ }
+ }
+ if (low == RARRAY_LEN(ary)) return Qnil;
+ if (!satisfied) return Qnil;
+ return rb_ary_entry(ary, low);
+}
+
+
+static VALUE
+sort_by_i(VALUE i)
+{
+ return rb_yield(i);
+}
+
+/*
+ * call-seq:
+ * ary.sort_by! { |obj| block } -> ary
+ * ary.sort_by! -> Enumerator
+ *
+ * Sorts +self+ in place using a set of keys generated by mapping the
+ * values in +self+ through the given block.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ */
+
+static VALUE
+rb_ary_sort_by_bang(VALUE ary)
+{
+ VALUE sorted;
+
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+ rb_ary_modify(ary);
+ sorted = rb_block_call(ary, rb_intern("sort_by"), 0, 0, sort_by_i, 0);
+ rb_ary_replace(ary, sorted);
+ return ary;
+}
+
+
+/*
+ * call-seq:
+ * ary.collect { |item| block } -> new_ary
+ * ary.map { |item| block } -> new_ary
+ * ary.collect -> Enumerator
+ * ary.map -> Enumerator
+ *
+ * Invokes the given block once for each element of +self+.
+ *
+ * Creates a new array containing the values returned by the block.
+ *
+ * See also Enumerable#collect.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
* a = [ "a", "b", "c", "d" ]
- * a.collect {|x| x + "!" } #=> ["a!", "b!", "c!", "d!"]
- * a #=> ["a", "b", "c", "d"]
+ * a.map { |x| x + "!" } #=> ["a!", "b!", "c!", "d!"]
+ * a #=> ["a", "b", "c", "d"]
*/
static VALUE
-rb_ary_collect(ary)
- VALUE ary;
+rb_ary_collect(VALUE ary)
{
long i;
VALUE collect;
- if (!rb_block_given_p()) {
- return rb_ary_new4(RARRAY(ary)->len, RARRAY(ary)->ptr);
- }
-
- collect = rb_ary_new2(RARRAY(ary)->len);
- for (i = 0; i < RARRAY(ary)->len; i++) {
- rb_ary_push(collect, rb_yield(RARRAY(ary)->ptr[i]));
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+ collect = rb_ary_new2(RARRAY_LEN(ary));
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ rb_ary_push(collect, rb_yield(RARRAY_PTR(ary)[i]));
}
return collect;
}
-/*
+
+/*
* call-seq:
- * array.collect! {|item| block } -> array
- * array.map! {|item| block } -> array
+ * ary.collect! {|item| block } -> ary
+ * ary.map! {|item| block } -> ary
+ * ary.collect! -> Enumerator
+ * ary.map! -> Enumerator
+ *
+ * Invokes the given block once for each element of +self+, replacing the
+ * element with the value returned by the block.
+ *
+ * See also Enumerable#collect.
+ *
+ * If no block is given, an Enumerator is returned instead.
*
- * Invokes the block once for each element of _self_, replacing the
- * element with the value returned by _block_.
- * See also <code>Enumerable#collect</code>.
- *
* a = [ "a", "b", "c", "d" ]
- * a.collect! {|x| x + "!" }
- * a #=> [ "a!", "b!", "c!", "d!" ]
+ * a.map! {|x| x + "!" }
+ * a #=> [ "a!", "b!", "c!", "d!" ]
*/
static VALUE
-rb_ary_collect_bang(ary)
- VALUE ary;
+rb_ary_collect_bang(VALUE ary)
{
long i;
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
rb_ary_modify(ary);
- for (i = 0; i < RARRAY(ary)->len; i++) {
- rb_ary_store(ary, i, rb_yield(RARRAY(ary)->ptr[i]));
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ rb_ary_store(ary, i, rb_yield(RARRAY_PTR(ary)[i]));
}
return ary;
}
VALUE
-rb_values_at(obj, olen, argc, argv, func)
- VALUE obj;
- long olen;
- int argc;
- VALUE *argv;
- VALUE (*func) _((VALUE,long));
+rb_get_values_at(VALUE obj, long olen, int argc, VALUE *argv, VALUE (*func) (VALUE, long))
{
VALUE result = rb_ary_new2(argc);
long beg, len, i, j;
@@ -1750,15 +2586,13 @@ rb_values_at(obj, olen, argc, argv, func)
continue;
}
/* check if idx is Range */
- switch (rb_range_beg_len(argv[i], &beg, &len, olen, 0)) {
- case Qfalse:
- break;
- case Qnil:
- continue;
- default:
- for (j=0; j<len; j++) {
- rb_ary_push(result, (*func)(obj, j+beg));
+ if (rb_range_beg_len(argv[i], &beg, &len, olen, 1)) {
+ long end = olen < beg+len ? olen : beg+len;
+ for (j = beg; j < end; j++) {
+ rb_ary_push(result, (*func)(obj, j));
}
+ if (beg + len > j)
+ rb_ary_resize(result, RARRAY_LEN(result) + (beg + len) - j);
continue;
}
rb_ary_push(result, (*func)(obj, NUM2LONG(argv[i])));
@@ -1766,53 +2600,59 @@ rb_values_at(obj, olen, argc, argv, func)
return result;
}
-/*
+/*
* call-seq:
- * array.values_at(selector,... ) -> an_array
+ * ary.values_at(selector, ...) -> new_ary
+ *
+ * Returns an array containing the elements in +self+ corresponding to the
+ * given +selector+(s).
+ *
+ * The selectors may be either integer indices or ranges.
+ *
+ * See also Array#select.
*
- * Returns an array containing the elements in
- * _self_ corresponding to the given selector(s). The selectors
- * may be either integer indices or ranges.
- * See also <code>Array#select</code>.
- *
* a = %w{ a b c d e f }
- * a.values_at(1, 3, 5)
- * a.values_at(1, 3, 5, 7)
- * a.values_at(-1, -3, -5, -7)
- * a.values_at(1..3, 2...5)
+ * a.values_at(1, 3, 5) # => ["b", "d", "f"]
+ * a.values_at(1, 3, 5, 7) # => ["b", "d", "f", nil]
+ * a.values_at(-1, -2, -2, -7) # => ["f", "e", "e", nil]
+ * a.values_at(4..6, 3...6) # => ["e", "f", nil, "d", "e", "f"]
*/
static VALUE
-rb_ary_values_at(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_values_at(int argc, VALUE *argv, VALUE ary)
{
- return rb_values_at(ary, RARRAY(ary)->len, argc, argv, rb_ary_entry);
+ return rb_get_values_at(ary, RARRAY_LEN(ary), argc, argv, rb_ary_entry);
}
+
/*
* call-seq:
- * array.select {|item| block } -> an_array
- *
- * Invokes the block passing in successive elements from <i>array</i>,
- * returning an array containing those elements for which the block
- * returns a true value (equivalent to <code>Enumerable#select</code>).
- *
+ * ary.select { |item| block } -> new_ary
+ * ary.select -> Enumerator
+ *
+ * Returns a new array containing all elements of +ary+
+ * for which the given +block+ returns a true value.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * [1,2,3,4,5].select { |num| num.even? } #=> [2, 4]
+ *
* a = %w{ a b c d e f }
- * a.select {|v| v =~ /[aeiou]/} #=> ["a", "e"]
+ * a.select { |v| v =~ /[aeiou]/ } #=> ["a", "e"]
+ *
+ * See also Enumerable#select.
*/
static VALUE
-rb_ary_select(ary)
- VALUE ary;
+rb_ary_select(VALUE ary)
{
VALUE result;
long i;
- result = rb_ary_new2(RARRAY(ary)->len);
- for (i = 0; i < RARRAY(ary)->len; i++) {
- if (RTEST(rb_yield(RARRAY(ary)->ptr[i]))) {
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+ result = rb_ary_new2(RARRAY_LEN(ary));
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ if (RTEST(rb_yield(RARRAY_PTR(ary)[i]))) {
rb_ary_push(result, rb_ary_elt(ary, i));
}
}
@@ -1821,14 +2661,92 @@ rb_ary_select(ary)
/*
* call-seq:
- * array.delete(obj) -> obj or nil
- * array.delete(obj) { block } -> obj or nil
- *
- * Deletes items from <i>self</i> that are equal to <i>obj</i>. If
- * the item is not found, returns <code>nil</code>. If the optional
- * code block is given, returns the result of <i>block</i> if the item
- * is not found.
- *
+ * ary.select! {|item| block } -> ary or nil
+ * ary.select! -> Enumerator
+ *
+ * Invokes the given block passing in successive elements from +self+,
+ * deleting elements for which the block returns a +false+ value.
+ *
+ * If changes were made, it will return +self+, otherwise it returns +nil+.
+ *
+ * See also Array#keep_if
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ */
+
+static VALUE
+rb_ary_select_bang(VALUE ary)
+{
+ long i1, i2;
+
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+ rb_ary_modify(ary);
+ for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
+ VALUE v = RARRAY_PTR(ary)[i1];
+ if (!RTEST(rb_yield(v))) continue;
+ if (i1 != i2) {
+ rb_ary_store(ary, i2, v);
+ }
+ i2++;
+ }
+
+ if (RARRAY_LEN(ary) == i2) return Qnil;
+ if (i2 < RARRAY_LEN(ary))
+ ARY_SET_LEN(ary, i2);
+ return ary;
+}
+
+/*
+ * call-seq:
+ * ary.keep_if { |item| block } -> ary
+ * ary.keep_if -> Enumerator
+ *
+ * Deletes every element of +self+ for which the given block evaluates to
+ * +false+.
+ *
+ * See also Array#select!
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * a = %w{ a b c d e f }
+ * a.keep_if { |v| v =~ /[aeiou]/ } #=> ["a", "e"]
+ */
+
+static VALUE
+rb_ary_keep_if(VALUE ary)
+{
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+ rb_ary_select_bang(ary);
+ return ary;
+}
+
+static void
+ary_resize_smaller(VALUE ary, long len)
+{
+ rb_ary_modify(ary);
+ if (RARRAY_LEN(ary) > len) {
+ ARY_SET_LEN(ary, len);
+ if (len * 2 < ARY_CAPA(ary) &&
+ ARY_CAPA(ary) > ARY_DEFAULT_SIZE) {
+ ary_resize_capa(ary, len * 2);
+ }
+ }
+}
+
+/*
+ * call-seq:
+ * ary.delete(obj) -> item or nil
+ * ary.delete(obj) { block } -> item or result of block
+ *
+ * Deletes all items from +self+ that are equal to +obj+.
+ *
+ * Returns the last deleted item, or +nil+ if no matching item is found.
+ *
+ * If the optional code block is given, the result of the block is returned if
+ * the item is not found. (To remove +nil+ elements and get an informative
+ * return value, use Array#compact!)
+ *
* a = [ "a", "b", "b", "b", "c" ]
* a.delete("b") #=> "b"
* a #=> ["a", "c"]
@@ -1837,47 +2755,62 @@ rb_ary_select(ary)
*/
VALUE
-rb_ary_delete(ary, item)
- VALUE ary;
- VALUE item;
+rb_ary_delete(VALUE ary, VALUE item)
{
+ VALUE v = item;
long i1, i2;
- for (i1 = i2 = 0; i1 < RARRAY(ary)->len; i1++) {
- VALUE e = RARRAY(ary)->ptr[i1];
+ for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
+ VALUE e = RARRAY_PTR(ary)[i1];
- if (rb_equal(e, item)) continue;
+ if (rb_equal(e, item)) {
+ v = e;
+ continue;
+ }
if (i1 != i2) {
rb_ary_store(ary, i2, e);
}
i2++;
}
- if (RARRAY(ary)->len == i2) {
+ if (RARRAY_LEN(ary) == i2) {
if (rb_block_given_p()) {
return rb_yield(item);
}
return Qnil;
}
- rb_ary_modify(ary);
- if (RARRAY(ary)->len > i2) {
- RARRAY(ary)->len = i2;
- if (i2 * 2 < RARRAY(ary)->aux.capa &&
- RARRAY(ary)->aux.capa > ARY_DEFAULT_SIZE) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, i2 * 2);
- RARRAY(ary)->aux.capa = i2 * 2;
+ ary_resize_smaller(ary, i2);
+
+ return v;
+}
+
+void
+rb_ary_delete_same(VALUE ary, VALUE item)
+{
+ long i1, i2;
+
+ for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
+ VALUE e = RARRAY_PTR(ary)[i1];
+
+ if (e == item) {
+ continue;
}
+ if (i1 != i2) {
+ rb_ary_store(ary, i2, e);
+ }
+ i2++;
+ }
+ if (RARRAY_LEN(ary) == i2) {
+ return;
}
- return item;
+ ary_resize_smaller(ary, i2);
}
VALUE
-rb_ary_delete_at(ary, pos)
- VALUE ary;
- long pos;
+rb_ary_delete_at(VALUE ary, long pos)
{
- long i, len = RARRAY(ary)->len;
+ long len = RARRAY_LEN(ary);
VALUE del;
if (pos >= len) return Qnil;
@@ -1887,52 +2820,47 @@ rb_ary_delete_at(ary, pos)
}
rb_ary_modify(ary);
- del = RARRAY(ary)->ptr[pos];
- for (i = pos + 1; i < len; i++, pos++) {
- RARRAY(ary)->ptr[pos] = RARRAY(ary)->ptr[i];
- }
- RARRAY(ary)->len = pos;
+ del = RARRAY_PTR(ary)[pos];
+ MEMMOVE(RARRAY_PTR(ary)+pos, RARRAY_PTR(ary)+pos+1, VALUE,
+ RARRAY_LEN(ary)-pos-1);
+ ARY_INCREASE_LEN(ary, -1);
return del;
}
/*
* call-seq:
- * array.delete_at(index) -> obj or nil
- *
- * Deletes the element at the specified index, returning that element,
- * or <code>nil</code> if the index is out of range. See also
- * <code>Array#slice!</code>.
- *
- * a = %w( ant bat cat dog )
+ * ary.delete_at(index) -> obj or nil
+ *
+ * Deletes the element at the specified +index+, returning that element, or
+ * +nil+ if the +index+ is out of range.
+ *
+ * See also Array#slice!
+ *
+ * a = ["ant", "bat", "cat", "dog"]
* a.delete_at(2) #=> "cat"
* a #=> ["ant", "bat", "dog"]
* a.delete_at(99) #=> nil
*/
static VALUE
-rb_ary_delete_at_m(ary, pos)
- VALUE ary, pos;
+rb_ary_delete_at_m(VALUE ary, VALUE pos)
{
return rb_ary_delete_at(ary, NUM2LONG(pos));
}
/*
* call-seq:
- * array.slice!(index) -> obj or nil
- * array.slice!(start, length) -> sub_array or nil
- * array.slice!(range) -> sub_array or nil
- *
- * Deletes the element(s) given by an index (optionally with a length)
- * or by a range. Returns the deleted object, subarray, or
- * <code>nil</code> if the index is out of range. Equivalent to:
- *
- * def slice!(*args)
- * result = self[*args]
- * self[*args] = nil
- * result
- * end
- *
+ * ary.slice!(index) -> obj or nil
+ * ary.slice!(start, length) -> new_ary or nil
+ * ary.slice!(range) -> new_ary or nil
+ *
+ * Deletes the element(s) given by an +index+ (optionally up to +length+
+ * elements) or by a +range+.
+ *
+ * Returns the deleted object (or objects), or +nil+ if the +index+ is out of
+ * range.
+ *
* a = [ "a", "b", "c" ]
* a.slice!(1) #=> "b"
* a #=> ["a", "c"]
@@ -1943,194 +2871,276 @@ rb_ary_delete_at_m(ary, pos)
*/
static VALUE
-rb_ary_slice_bang(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_slice_bang(int argc, VALUE *argv, VALUE ary)
{
VALUE arg1, arg2;
- long pos, len;
+ long pos, len, orig_len;
- if (rb_scan_args(argc, argv, "11", &arg1, &arg2) == 2) {
- pos = NUM2LONG(arg1);
- len = NUM2LONG(arg2);
+ rb_ary_modify_check(ary);
+ if (argc == 2) {
+ pos = NUM2LONG(argv[0]);
+ len = NUM2LONG(argv[1]);
delete_pos_len:
+ if (len < 0) return Qnil;
+ orig_len = RARRAY_LEN(ary);
if (pos < 0) {
- pos = RARRAY(ary)->len + pos;
+ pos += orig_len;
+ if (pos < 0) return Qnil;
+ }
+ else if (orig_len < pos) return Qnil;
+ if (orig_len < pos + len) {
+ len = orig_len - pos;
}
- arg2 = rb_ary_subseq(ary, pos, len);
- rb_ary_splice(ary, pos, len, Qnil); /* Qnil/rb_ary_new2(0) */
+ if (len == 0) return rb_ary_new2(0);
+ arg2 = rb_ary_new4(len, RARRAY_PTR(ary)+pos);
+ RBASIC(arg2)->klass = rb_obj_class(ary);
+ rb_ary_splice(ary, pos, len, Qundef);
return arg2;
}
- if (!FIXNUM_P(arg1) && rb_range_beg_len(arg1, &pos, &len, RARRAY(ary)->len, 1)) {
- goto delete_pos_len;
+ if (argc != 1) {
+ /* error report */
+ rb_scan_args(argc, argv, "11", NULL, NULL);
+ }
+ arg1 = argv[0];
+
+ if (!FIXNUM_P(arg1)) {
+ switch (rb_range_beg_len(arg1, &pos, &len, RARRAY_LEN(ary), 0)) {
+ case Qtrue:
+ /* valid range */
+ goto delete_pos_len;
+ case Qnil:
+ /* invalid range */
+ return Qnil;
+ default:
+ /* not a range */
+ break;
+ }
}
return rb_ary_delete_at(ary, NUM2LONG(arg1));
}
-/*
- * call-seq:
- * array.reject! {|item| block } -> array or nil
- *
- * Equivalent to <code>Array#delete_if</code>, deleting elements from
- * _self_ for which the block evaluates to true, but returns
- * <code>nil</code> if no changes were made. Also see
- * <code>Enumerable#reject</code>.
- */
+static VALUE
+ary_reject(VALUE orig, VALUE result)
+{
+ long i;
+
+ for (i = 0; i < RARRAY_LEN(orig); i++) {
+ VALUE v = RARRAY_PTR(orig)[i];
+ if (!RTEST(rb_yield(v))) {
+ rb_ary_push_1(result, v);
+ }
+ }
+ return result;
+}
static VALUE
-rb_ary_reject_bang(ary)
- VALUE ary;
+ary_reject_bang(VALUE ary)
{
- long i1, i2;
+ long i;
+ VALUE result = Qnil;
- rb_ary_modify(ary);
- for (i1 = i2 = 0; i1 < RARRAY(ary)->len; i1++) {
- VALUE v = RARRAY(ary)->ptr[i1];
- if (RTEST(rb_yield(v))) continue;
- if (i1 != i2) {
- rb_ary_store(ary, i2, v);
+ rb_ary_modify_check(ary);
+ for (i = 0; i < RARRAY_LEN(ary); ) {
+ VALUE v = RARRAY_PTR(ary)[i];
+ if (RTEST(rb_yield(v))) {
+ rb_ary_delete_at(ary, i);
+ result = ary;
+ }
+ else {
+ i++;
}
- i2++;
}
- if (RARRAY(ary)->len == i2) return Qnil;
- if (i2 < RARRAY(ary)->len)
- RARRAY(ary)->len = i2;
+ return result;
+}
- return ary;
+/*
+ * call-seq:
+ * ary.reject! { |item| block } -> ary or nil
+ * ary.reject! -> Enumerator
+ *
+ * Equivalent to Array#delete_if, deleting elements from +self+ for which the
+ * block evaluates to +true+, but returns +nil+ if no changes were made.
+ *
+ * The array is changed instantly every time the block is called, not after
+ * the iteration is over.
+ *
+ * See also Enumerable#reject and Array#delete_if.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ */
+
+static VALUE
+rb_ary_reject_bang(VALUE ary)
+{
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+ return ary_reject_bang(ary);
}
/*
* call-seq:
- * array.reject {|item| block } -> an_array
- *
- * Returns a new array containing the items in _self_
- * for which the block is not true.
+ * ary.reject {|item| block } -> new_ary
+ * ary.reject -> Enumerator
+ *
+ * Returns a new array containing the items in +self+ for which the given
+ * block is not +true+.
+ *
+ * See also Array#delete_if
+ *
+ * If no block is given, an Enumerator is returned instead.
*/
static VALUE
-rb_ary_reject(ary)
- VALUE ary;
+rb_ary_reject(VALUE ary)
{
- ary = rb_ary_dup(ary);
- rb_ary_reject_bang(ary);
- return ary;
+ VALUE rejected_ary;
+
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+ rejected_ary = rb_ary_new();
+ ary_reject(ary, rejected_ary);
+ return rejected_ary;
}
/*
* call-seq:
- * array.delete_if {|item| block } -> array
- *
- * Deletes every element of <i>self</i> for which <i>block</i> evaluates
- * to <code>true</code>.
- *
+ * ary.delete_if { |item| block } -> ary
+ * ary.delete_if -> Enumerator
+ *
+ * Deletes every element of +self+ for which block evaluates to +true+.
+ *
+ * The array is changed instantly every time the block is called, not after
+ * the iteration is over.
+ *
+ * See also Array#reject!
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
* a = [ "a", "b", "c" ]
* a.delete_if {|x| x >= "b" } #=> ["a"]
*/
static VALUE
-rb_ary_delete_if(ary)
- VALUE ary;
+rb_ary_delete_if(VALUE ary)
{
- rb_ary_reject_bang(ary);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+ ary_reject_bang(ary);
return ary;
}
+static VALUE
+take_i(VALUE val, VALUE *args, int argc, VALUE *argv)
+{
+ if (args[1]-- == 0) rb_iter_break();
+ if (argc > 1) val = rb_ary_new4(argc, argv);
+ rb_ary_push(args[0], val);
+ return Qnil;
+}
+
+static VALUE
+take_items(VALUE obj, long n)
+{
+ VALUE result = rb_check_array_type(obj);
+ VALUE args[2];
+
+ if (!NIL_P(result)) return rb_ary_subseq(result, 0, n);
+ result = rb_ary_new2(n);
+ args[0] = result; args[1] = (VALUE)n;
+ if (rb_check_block_call(obj, idEach, 0, 0, take_i, (VALUE)args) == Qundef)
+ Check_Type(obj, T_ARRAY);
+ return result;
+}
+
+
/*
* call-seq:
- * array.zip(arg, ...) -> an_array
- * array.zip(arg, ...) {| arr | block } -> nil
- *
- * Converts any arguments to arrays, then merges elements of
- * <i>self</i> with corresponding elements from each argument. This
- * generates a sequence of <code>self.size</code> <em>n</em>-element
- * arrays, where <em>n</em> is one more that the count of arguments. If
- * the size of any argument is less than <code>enumObj.size</code>,
- * <code>nil</code> values are supplied. If a block given, it is
- * invoked for each output array, otherwise an array of arrays is
- * returned.
- *
+ * ary.zip(arg, ...) -> new_ary
+ * ary.zip(arg, ...) { |arr| block } -> nil
+ *
+ * Converts any arguments to arrays, then merges elements of +self+ with
+ * corresponding elements from each argument.
+ *
+ * This generates a sequence of <code>ary.size</code> _n_-element arrays,
+ * where _n_ is one more that the count of arguments.
+ *
+ * If the size of any argument is less than the size of the initial array,
+ * +nil+ values are supplied.
+ *
+ * If a block is given, it is invoked for each output +array+, otherwise an
+ * array of arrays is returned.
+ *
* a = [ 4, 5, 6 ]
* b = [ 7, 8, 9 ]
- *
- * [1,2,3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
- * [1,2].zip(a,b) #=> [[1, 4, 7], [2, 5, 8]]
- * a.zip([1,2],[8]) #=> [[4,1,8], [5,2,nil], [6,nil,nil]]
+ * [1, 2, 3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
+ * [1, 2].zip(a, b) #=> [[1, 4, 7], [2, 5, 8]]
+ * a.zip([1, 2], [8]) #=> [[4, 1, 8], [5, 2, nil], [6, nil, nil]]
*/
static VALUE
-rb_ary_zip(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_zip(int argc, VALUE *argv, VALUE ary)
{
int i, j;
long len;
- VALUE result;
+ VALUE result = Qnil;
+ len = RARRAY_LEN(ary);
for (i=0; i<argc; i++) {
- argv[i] = to_ary(argv[i]);
+ argv[i] = take_items(argv[i], len);
}
- if (rb_block_given_p()) {
- for (i=0; i<RARRAY(ary)->len; i++) {
- VALUE tmp = rb_ary_new2(argc+1);
-
- rb_ary_push(tmp, rb_ary_elt(ary, i));
- for (j=0; j<argc; j++) {
- rb_ary_push(tmp, rb_ary_elt(argv[j], i));
- }
- rb_yield(tmp);
- }
- return Qnil;
+ if (!rb_block_given_p()) {
+ result = rb_ary_new2(len);
}
- len = RARRAY(ary)->len;
- result = rb_ary_new2(len);
- for (i=0; i<len; i++) {
+
+ for (i=0; i<RARRAY_LEN(ary); i++) {
VALUE tmp = rb_ary_new2(argc+1);
rb_ary_push(tmp, rb_ary_elt(ary, i));
for (j=0; j<argc; j++) {
rb_ary_push(tmp, rb_ary_elt(argv[j], i));
}
- rb_ary_push(result, tmp);
+ if (NIL_P(result)) {
+ rb_yield(tmp);
+ }
+ else {
+ rb_ary_push(result, tmp);
+ }
}
return result;
}
/*
* call-seq:
- * array.transpose -> an_array
- *
- * Assumes that <i>self</i> is an array of arrays and transposes the
- * rows and columns.
- *
+ * ary.transpose -> new_ary
+ *
+ * Assumes that +self+ is an array of arrays and transposes the rows and
+ * columns.
+ *
* a = [[1,2], [3,4], [5,6]]
* a.transpose #=> [[1, 3, 5], [2, 4, 6]]
+ *
+ * If the length of the subarrays don't match, an IndexError is raised.
*/
static VALUE
-rb_ary_transpose(ary)
- VALUE ary;
+rb_ary_transpose(VALUE ary)
{
long elen = -1, alen, i, j;
VALUE tmp, result = 0;
- alen = RARRAY(ary)->len;
+ alen = RARRAY_LEN(ary);
if (alen == 0) return rb_ary_dup(ary);
for (i=0; i<alen; i++) {
tmp = to_ary(rb_ary_elt(ary, i));
if (elen < 0) { /* first element */
- elen = RARRAY(tmp)->len;
+ elen = RARRAY_LEN(tmp);
result = rb_ary_new2(elen);
for (j=0; j<elen; j++) {
rb_ary_store(result, j, rb_ary_new2(alen));
}
}
- else if (elen != RARRAY(tmp)->len) {
- rb_raise(rb_eIndexError, "element size differs (%d should be %d)",
- RARRAY(tmp)->len, elen);
+ else if (elen != RARRAY_LEN(tmp)) {
+ rb_raise(rb_eIndexError, "element size differs (%ld should be %ld)",
+ RARRAY_LEN(tmp), elen);
}
for (j=0; j<elen; j++) {
rb_ary_store(rb_ary_elt(result, j), i, rb_ary_elt(tmp, j));
@@ -2141,96 +3151,125 @@ rb_ary_transpose(ary)
/*
* call-seq:
- * array.replace(other_array) -> array
- *
- * Replaces the contents of <i>self</i> with the contents of
- * <i>other_array</i>, truncating or expanding if necessary.
- *
+ * ary.replace(other_ary) -> ary
+ *
+ * Replaces the contents of +self+ with the contents of +other_ary+,
+ * truncating or expanding if necessary.
+ *
* a = [ "a", "b", "c", "d", "e" ]
* a.replace([ "x", "y", "z" ]) #=> ["x", "y", "z"]
* a #=> ["x", "y", "z"]
*/
-static VALUE
-rb_ary_replace(copy, orig)
- VALUE copy, orig;
+VALUE
+rb_ary_replace(VALUE copy, VALUE orig)
{
- VALUE shared;
-
- rb_ary_modify(copy);
+ rb_ary_modify_check(copy);
orig = to_ary(orig);
if (copy == orig) return copy;
- shared = ary_make_shared(orig);
- if (RARRAY(copy)->ptr && !FL_TEST(copy, ELTS_SHARED))
- free(RARRAY(copy)->ptr);
- RARRAY(copy)->ptr = RARRAY(orig)->ptr;
- RARRAY(copy)->len = RARRAY(orig)->len;
- RARRAY(copy)->aux.shared = shared;
- FL_SET(copy, ELTS_SHARED);
+ if (RARRAY_LEN(orig) <= RARRAY_EMBED_LEN_MAX) {
+ VALUE *ptr;
+ VALUE shared = 0;
+
+ if (ARY_OWNS_HEAP_P(copy)) {
+ xfree(RARRAY_PTR(copy));
+ }
+ else if (ARY_SHARED_P(copy)) {
+ shared = ARY_SHARED(copy);
+ FL_UNSET_SHARED(copy);
+ }
+ FL_SET_EMBED(copy);
+ ptr = RARRAY_PTR(orig);
+ MEMCPY(RARRAY_PTR(copy), ptr, VALUE, RARRAY_LEN(orig));
+ if (shared) {
+ rb_ary_decrement_share(shared);
+ }
+ ARY_SET_LEN(copy, RARRAY_LEN(orig));
+ }
+ else {
+ VALUE shared = ary_make_shared(orig);
+ if (ARY_OWNS_HEAP_P(copy)) {
+ xfree(RARRAY_PTR(copy));
+ }
+ else {
+ rb_ary_unshare_safe(copy);
+ }
+ FL_UNSET_EMBED(copy);
+ ARY_SET_PTR(copy, RARRAY_PTR(orig));
+ ARY_SET_LEN(copy, RARRAY_LEN(orig));
+ rb_ary_set_shared(copy, shared);
+ }
return copy;
}
-/*
+/*
* call-seq:
- * array.clear -> array
+ * ary.clear -> ary
*
- * Removes all elements from _self_.
+ * Removes all elements from +self+.
*
* a = [ "a", "b", "c", "d", "e" ]
* a.clear #=> [ ]
*/
VALUE
-rb_ary_clear(ary)
- VALUE ary;
+rb_ary_clear(VALUE ary)
{
- rb_ary_modify(ary);
- RARRAY(ary)->len = 0;
- if (ARY_DEFAULT_SIZE * 2 < RARRAY(ary)->aux.capa) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, ARY_DEFAULT_SIZE * 2);
- RARRAY(ary)->aux.capa = ARY_DEFAULT_SIZE * 2;
+ rb_ary_modify_check(ary);
+ ARY_SET_LEN(ary, 0);
+ if (ARY_SHARED_P(ary)) {
+ if (!ARY_EMBED_P(ary)) {
+ rb_ary_unshare(ary);
+ FL_SET_EMBED(ary);
+ }
+ }
+ else if (ARY_DEFAULT_SIZE * 2 < ARY_CAPA(ary)) {
+ ary_resize_capa(ary, ARY_DEFAULT_SIZE * 2);
}
return ary;
}
/*
* call-seq:
- * array.fill(obj) -> array
- * array.fill(obj, start [, length]) -> array
- * array.fill(obj, range ) -> array
- * array.fill {|index| block } -> array
- * array.fill(start [, length] ) {|index| block } -> array
- * array.fill(range) {|index| block } -> array
- *
- * The first three forms set the selected elements of <i>self</i> (which
- * may be the entire array) to <i>obj</i>. A <i>start</i> of
- * <code>nil</code> is equivalent to zero. A <i>length</i> of
- * <code>nil</code> is equivalent to <i>self.length</i>. The last three
- * forms fill the array with the value of the block. The block is
- * passed the absolute index of each element to be filled.
- *
+ * ary.fill(obj) -> ary
+ * ary.fill(obj, start [, length]) -> ary
+ * ary.fill(obj, range ) -> ary
+ * ary.fill { |index| block } -> ary
+ * ary.fill(start [, length] ) { |index| block } -> ary
+ * ary.fill(range) { |index| block } -> ary
+ *
+ * The first three forms set the selected elements of +self+ (which
+ * may be the entire array) to +obj+.
+ *
+ * A +start+ of +nil+ is equivalent to zero.
+ *
+ * A +length+ of +nil+ is equivalent to the length of the array.
+ *
+ * The last three forms fill the array with the value of the given block,
+ * which is passed the absolute index of each element to be filled.
+ *
+ * Negative values of +start+ count from the end of the array, where +-1+ is
+ * the last element.
+ *
* a = [ "a", "b", "c", "d" ]
* a.fill("x") #=> ["x", "x", "x", "x"]
* a.fill("z", 2, 2) #=> ["x", "x", "z", "z"]
* a.fill("y", 0..1) #=> ["y", "y", "z", "z"]
- * a.fill {|i| i*i} #=> [0, 1, 4, 9]
- * a.fill(-2) {|i| i*i*i} #=> [0, 1, 8, 27]
+ * a.fill { |i| i*i } #=> [0, 1, 4, 9]
+ * a.fill(-2) { |i| i*i*i } #=> [0, 1, 8, 27]
*/
static VALUE
-rb_ary_fill(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_fill(int argc, VALUE *argv, VALUE ary)
{
VALUE item, arg1, arg2;
long beg = 0, end = 0, len = 0;
VALUE *p, *pend;
- int block_p = Qfalse;
+ int block_p = FALSE;
if (rb_block_given_p()) {
- block_p = Qtrue;
+ block_p = TRUE;
rb_scan_args(argc, argv, "02", &arg1, &arg2);
argc += 1; /* hackish */
}
@@ -2240,34 +3279,36 @@ rb_ary_fill(argc, argv, ary)
switch (argc) {
case 1:
beg = 0;
- len = RARRAY(ary)->len;
+ len = RARRAY_LEN(ary);
break;
case 2:
- if (rb_range_beg_len(arg1, &beg, &len, RARRAY(ary)->len, 1)) {
+ if (rb_range_beg_len(arg1, &beg, &len, RARRAY_LEN(ary), 1)) {
break;
}
/* fall through */
case 3:
beg = NIL_P(arg1) ? 0 : NUM2LONG(arg1);
if (beg < 0) {
- beg = RARRAY(ary)->len + beg;
+ beg = RARRAY_LEN(ary) + beg;
if (beg < 0) beg = 0;
}
- len = NIL_P(arg2) ? RARRAY(ary)->len - beg : NUM2LONG(arg2);
+ len = NIL_P(arg2) ? RARRAY_LEN(ary) - beg : NUM2LONG(arg2);
break;
}
rb_ary_modify(ary);
- end = beg + len;
- if (end < 0) {
+ if (len < 0) {
+ return ary;
+ }
+ if (beg >= ARY_MAX_SIZE || len > ARY_MAX_SIZE - beg) {
rb_raise(rb_eArgError, "argument too big");
}
- if (end > RARRAY(ary)->len) {
- if (end >= RARRAY(ary)->aux.capa) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, end);
- RARRAY(ary)->aux.capa = end;
+ end = beg + len;
+ if (RARRAY_LEN(ary) < end) {
+ if (end >= ARY_CAPA(ary)) {
+ ary_resize_capa(ary, end);
}
- rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len, end - RARRAY(ary)->len);
- RARRAY(ary)->len = end;
+ rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary), end - RARRAY_LEN(ary));
+ ARY_SET_LEN(ary, end);
}
if (block_p) {
@@ -2276,12 +3317,12 @@ rb_ary_fill(argc, argv, ary)
for (i=beg; i<end; i++) {
v = rb_yield(LONG2NUM(i));
- if (i>=RARRAY(ary)->len) break;
- RARRAY(ary)->ptr[i] = v;
+ if (i>=RARRAY_LEN(ary)) break;
+ RARRAY_PTR(ary)[i] = v;
}
}
else {
- p = RARRAY(ary)->ptr + beg;
+ p = RARRAY_PTR(ary) + beg;
pend = p + len;
while (p < pend) {
*p++ = item;
@@ -2290,62 +3331,72 @@ rb_ary_fill(argc, argv, ary)
return ary;
}
-/*
+/*
* call-seq:
- * array + other_array -> an_array
+ * ary + other_ary -> new_ary
*
- * Concatenation---Returns a new array built by concatenating the
+ * Concatenation --- Returns a new array built by concatenating the
* two arrays together to produce a third array.
- *
+ *
* [ 1, 2, 3 ] + [ 4, 5 ] #=> [ 1, 2, 3, 4, 5 ]
+ * a = [ "a", "b", "c" ]
+ * a + [ "d", "e", "f" ]
+ * a #=> [ "a", "b", "c", "d", "e", "f" ]
+ *
+ * See also Array#concat.
*/
VALUE
-rb_ary_plus(x, y)
- VALUE x, y;
+rb_ary_plus(VALUE x, VALUE y)
{
VALUE z;
long len;
y = to_ary(y);
- len = RARRAY(x)->len + RARRAY(y)->len;
+ len = RARRAY_LEN(x) + RARRAY_LEN(y);
z = rb_ary_new2(len);
- MEMCPY(RARRAY(z)->ptr, RARRAY(x)->ptr, VALUE, RARRAY(x)->len);
- MEMCPY(RARRAY(z)->ptr + RARRAY(x)->len, RARRAY(y)->ptr, VALUE, RARRAY(y)->len);
- RARRAY(z)->len = len;
+ MEMCPY(RARRAY_PTR(z), RARRAY_PTR(x), VALUE, RARRAY_LEN(x));
+ MEMCPY(RARRAY_PTR(z) + RARRAY_LEN(x), RARRAY_PTR(y), VALUE, RARRAY_LEN(y));
+ ARY_SET_LEN(z, len);
return z;
}
-/*
+/*
* call-seq:
- * array.concat(other_array) -> array
+ * ary.concat(other_ary) -> ary
+ *
+ * Appends the elements of +other_ary+ to +self+.
*
- * Appends the elements in other_array to _self_.
- *
* [ "a", "b" ].concat( ["c", "d"] ) #=> [ "a", "b", "c", "d" ]
+ * a = [ 1, 2, 3 ]
+ * a.concat( [ 4, 5 ] )
+ * a #=> [ 1, 2, 3, 4, 5 ]
+ *
+ * See also Array#+.
*/
-
VALUE
-rb_ary_concat(x, y)
- VALUE x, y;
+rb_ary_concat(VALUE x, VALUE y)
{
+ rb_ary_modify_check(x);
y = to_ary(y);
- if (RARRAY(y)->len > 0) {
- rb_ary_splice(x, RARRAY(x)->len, 0, y);
+ if (RARRAY_LEN(y) > 0) {
+ rb_ary_splice(x, RARRAY_LEN(x), 0, y);
}
return x;
}
-/*
+/*
* call-seq:
- * array * int -> an_array
- * array * str -> a_string
+ * ary * int -> new_ary
+ * ary * str -> new_string
*
- * Repetition---With a String argument, equivalent to
- * self.join(str). Otherwise, returns a new array
- * built by concatenating the _int_ copies of _self_.
+ * Repetition --- With a String argument, equivalent to
+ * <code>ary.join(str)</code>.
+ *
+ * Otherwise, returns a new array built by concatenating the +int+ copies of
+ * +self+.
*
*
* [ 1, 2, 3 ] * 3 #=> [ 1, 2, 3, 1, 2, 3, 1, 2, 3 ]
@@ -2354,11 +3405,10 @@ rb_ary_concat(x, y)
*/
static VALUE
-rb_ary_times(ary, times)
- VALUE ary, times;
+rb_ary_times(VALUE ary, VALUE times)
{
- VALUE ary2, tmp;
- long i, len;
+ VALUE ary2, tmp, *ptr, *ptr2;
+ long t, len;
tmp = rb_check_string_type(times);
if (!NIL_P(tmp)) {
@@ -2366,37 +3416,51 @@ rb_ary_times(ary, times)
}
len = NUM2LONG(times);
- if (len == 0) return ary_new(rb_obj_class(ary), 0);
+ if (len == 0) {
+ ary2 = ary_new(rb_obj_class(ary), 0);
+ goto out;
+ }
if (len < 0) {
rb_raise(rb_eArgError, "negative argument");
}
- if (LONG_MAX/len < RARRAY(ary)->len) {
+ if (ARY_MAX_SIZE/len < RARRAY_LEN(ary)) {
rb_raise(rb_eArgError, "argument too big");
}
- len *= RARRAY(ary)->len;
+ len *= RARRAY_LEN(ary);
ary2 = ary_new(rb_obj_class(ary), len);
- RARRAY(ary2)->len = len;
-
- for (i=0; i<len; i+=RARRAY(ary)->len) {
- MEMCPY(RARRAY(ary2)->ptr+i, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
- }
+ ARY_SET_LEN(ary2, len);
+
+ ptr = RARRAY_PTR(ary);
+ ptr2 = RARRAY_PTR(ary2);
+ t = RARRAY_LEN(ary);
+ if (0 < t) {
+ MEMCPY(ptr2, ptr, VALUE, t);
+ while (t <= len/2) {
+ MEMCPY(ptr2+t, ptr2, VALUE, t);
+ t *= 2;
+ }
+ if (t < len) {
+ MEMCPY(ptr2+t, ptr2, VALUE, len-t);
+ }
+ }
+ out:
OBJ_INFECT(ary2, ary);
return ary2;
}
-/*
+/*
* call-seq:
- * array.assoc(obj) -> an_array or nil
+ * ary.assoc(obj) -> new_ary or nil
*
- * Searches through an array whose elements are also arrays
- * comparing _obj_ with the first element of each contained array
- * using obj.==.
- * Returns the first contained array that matches (that
- * is, the first associated array),
- * or +nil+ if no match is found.
- * See also <code>Array#rassoc</code>.
+ * Searches through an array whose elements are also arrays comparing +obj+
+ * with the first element of each contained array using <code>obj.==</code>.
+ *
+ * Returns the first contained array that matches (that is, the first
+ * associated array), or +nil+ if no match is found.
+ *
+ * See also Array#rassoc
*
* s1 = [ "colors", "red", "blue", "green" ]
* s2 = [ "letters", "a", "b", "c" ]
@@ -2407,17 +3471,15 @@ rb_ary_times(ary, times)
*/
VALUE
-rb_ary_assoc(ary, key)
- VALUE ary, key;
+rb_ary_assoc(VALUE ary, VALUE key)
{
long i;
VALUE v;
- for (i = 0; i < RARRAY(ary)->len; ++i) {
- v = RARRAY(ary)->ptr[i];
- if (TYPE(v) == T_ARRAY &&
- RARRAY(v)->len > 0 &&
- rb_equal(RARRAY(v)->ptr[0], key))
+ for (i = 0; i < RARRAY_LEN(ary); ++i) {
+ v = rb_check_array_type(RARRAY_PTR(ary)[i]);
+ if (!NIL_P(v) && RARRAY_LEN(v) > 0 &&
+ rb_equal(RARRAY_PTR(v)[0], key))
return v;
}
return Qnil;
@@ -2425,42 +3487,78 @@ rb_ary_assoc(ary, key)
/*
* call-seq:
- * array.rassoc(key) -> an_array or nil
- *
- * Searches through the array whose elements are also arrays. Compares
- * <em>key</em> with the second element of each contained array using
- * <code>==</code>. Returns the first contained array that matches. See
- * also <code>Array#assoc</code>.
- *
+ * ary.rassoc(obj) -> new_ary or nil
+ *
+ * Searches through the array whose elements are also arrays.
+ *
+ * Compares +obj+ with the second element of each contained array using
+ * <code>obj.==</code>.
+ *
+ * Returns the first contained array that matches +obj+.
+ *
+ * See also Array#assoc.
+ *
* a = [ [ 1, "one"], [2, "two"], [3, "three"], ["ii", "two"] ]
* a.rassoc("two") #=> [2, "two"]
* a.rassoc("four") #=> nil
*/
VALUE
-rb_ary_rassoc(ary, value)
- VALUE ary, value;
+rb_ary_rassoc(VALUE ary, VALUE value)
{
long i;
VALUE v;
- for (i = 0; i < RARRAY(ary)->len; ++i) {
- v = RARRAY(ary)->ptr[i];
- if (TYPE(v) == T_ARRAY &&
- RARRAY(v)->len > 1 &&
- rb_equal(RARRAY(v)->ptr[1], value))
+ for (i = 0; i < RARRAY_LEN(ary); ++i) {
+ v = RARRAY_PTR(ary)[i];
+ if (RB_TYPE_P(v, T_ARRAY) &&
+ RARRAY_LEN(v) > 1 &&
+ rb_equal(RARRAY_PTR(v)[1], value))
return v;
}
return Qnil;
}
-/*
+static VALUE
+recursive_equal(VALUE ary1, VALUE ary2, int recur)
+{
+ long i, len1;
+ VALUE *p1, *p2;
+
+ if (recur) return Qtrue; /* Subtle! */
+
+ p1 = RARRAY_PTR(ary1);
+ p2 = RARRAY_PTR(ary2);
+ len1 = RARRAY_LEN(ary1);
+
+ for (i = 0; i < len1; i++) {
+ if (*p1 != *p2) {
+ if (rb_equal(*p1, *p2)) {
+ len1 = RARRAY_LEN(ary1);
+ if (len1 != RARRAY_LEN(ary2))
+ return Qfalse;
+ if (len1 < i)
+ return Qtrue;
+ p1 = RARRAY_PTR(ary1) + i;
+ p2 = RARRAY_PTR(ary2) + i;
+ }
+ else {
+ return Qfalse;
+ }
+ }
+ p1++;
+ p2++;
+ }
+ return Qtrue;
+}
+
+/*
* call-seq:
- * array == other_array -> bool
+ * ary == other_ary -> bool
*
- * Equality---Two arrays are equal if they contain the same number
- * of elements and if each element is equal to (according to
- * Object.==) the corresponding element in the other array.
+ * Equality --- Two arrays are equal if they contain the same number of
+ * elements and if each element is equal to (according to Object#==) the
+ * corresponding element in +other_ary+.
*
* [ "a", "c" ] == [ "a", "c", 7 ] #=> false
* [ "a", "c", 7 ] == [ "a", "c", 7 ] #=> true
@@ -2469,21 +3567,27 @@ rb_ary_rassoc(ary, value)
*/
static VALUE
-rb_ary_equal(ary1, ary2)
- VALUE ary1, ary2;
+rb_ary_equal(VALUE ary1, VALUE ary2)
{
- long i;
-
if (ary1 == ary2) return Qtrue;
- if (TYPE(ary2) != T_ARRAY) {
+ if (!RB_TYPE_P(ary2, T_ARRAY)) {
if (!rb_respond_to(ary2, rb_intern("to_ary"))) {
return Qfalse;
}
return rb_equal(ary2, ary1);
}
- if (RARRAY(ary1)->len != RARRAY(ary2)->len) return Qfalse;
- for (i=0; i<RARRAY(ary1)->len; i++) {
- if (!rb_equal(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i)))
+ if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return Qfalse;
+ return rb_exec_recursive_paired(recursive_equal, ary1, ary2, ary2);
+}
+
+static VALUE
+recursive_eql(VALUE ary1, VALUE ary2, int recur)
+{
+ long i;
+
+ if (recur) return Qtrue; /* Subtle! */
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
+ if (!rb_eql(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i)))
return Qfalse;
}
return Qtrue;
@@ -2491,74 +3595,77 @@ rb_ary_equal(ary1, ary2)
/*
* call-seq:
- * array.eql?(other) -> true or false
+ * ary.eql?(other) -> true or false
*
- * Returns <code>true</code> if _array_ and _other_ are the same object,
+ * Returns +true+ if +self+ and +other+ are the same object,
* or are both arrays with the same content.
*/
static VALUE
-rb_ary_eql(ary1, ary2)
- VALUE ary1, ary2;
+rb_ary_eql(VALUE ary1, VALUE ary2)
+{
+ if (ary1 == ary2) return Qtrue;
+ if (!RB_TYPE_P(ary2, T_ARRAY)) return Qfalse;
+ if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return Qfalse;
+ return rb_exec_recursive_paired(recursive_eql, ary1, ary2, ary2);
+}
+
+static VALUE
+recursive_hash(VALUE ary, VALUE dummy, int recur)
{
long i;
+ st_index_t h;
+ VALUE n;
- if (ary1 == ary2) return Qtrue;
- if (TYPE(ary2) != T_ARRAY) return Qfalse;
- if (RARRAY(ary1)->len != RARRAY(ary2)->len) return Qfalse;
- for (i=0; i<RARRAY(ary1)->len; i++) {
- if (!rb_eql(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i)))
- return Qfalse;
+ h = rb_hash_start(RARRAY_LEN(ary));
+ if (recur) {
+ h = rb_hash_uint(h, NUM2LONG(rb_hash(rb_cArray)));
}
- return Qtrue;
+ else {
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ n = rb_hash(RARRAY_PTR(ary)[i]);
+ h = rb_hash_uint(h, NUM2LONG(n));
+ }
+ }
+ h = rb_hash_end(h);
+ return LONG2FIX(h);
}
/*
* call-seq:
- * array.hash -> fixnum
+ * ary.hash -> fixnum
+ *
+ * Compute a hash-code for this array.
*
- * Compute a hash-code for this array. Two arrays with the same content
- * will have the same hash code (and will compare using <code>eql?</code>).
+ * Two arrays with the same content will have the same hash code (and will
+ * compare using #eql?).
*/
static VALUE
-rb_ary_hash(ary)
- VALUE ary;
+rb_ary_hash(VALUE ary)
{
- long i, h;
- VALUE n;
-
- h = RARRAY(ary)->len;
- for (i=0; i<RARRAY(ary)->len; i++) {
- h = (h << 1) | (h<0 ? 1 : 0);
- n = rb_hash(RARRAY(ary)->ptr[i]);
- h ^= NUM2LONG(n);
- }
- return LONG2FIX(h);
+ return rb_exec_recursive_outer(recursive_hash, ary, 0);
}
/*
* call-seq:
- * array.include?(obj) -> true or false
- *
- * Returns <code>true</code> if the given object is present in
- * <i>self</i> (that is, if any object <code>==</code> <i>anObject</i>),
- * <code>false</code> otherwise.
- *
+ * ary.include?(object) -> true or false
+ *
+ * Returns +true+ if the given +object+ is present in +self+ (that is, if any
+ * object <code>==</code> +object+), otherwise returns +false+.
+ *
* a = [ "a", "b", "c" ]
* a.include?("b") #=> true
* a.include?("z") #=> false
*/
VALUE
-rb_ary_includes(ary, item)
- VALUE ary;
- VALUE item;
+rb_ary_includes(VALUE ary, VALUE item)
{
long i;
-
- for (i=0; i<RARRAY(ary)->len; i++) {
- if (rb_equal(RARRAY(ary)->ptr[i], item)) {
+
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ if (rb_equal(RARRAY_PTR(ary)[i], item)) {
return Qtrue;
}
}
@@ -2566,36 +3673,15 @@ rb_ary_includes(ary, item)
}
-/*
- * call-seq:
- * array <=> other_array -> -1, 0, +1
- *
- * Comparison---Returns an integer (-1, 0,
- * or +1) if this array is less than, equal to, or greater than
- * other_array. Each object in each array is compared
- * (using <=>). If any value isn't
- * equal, then that inequality is the return value. If all the
- * values found are equal, then the return is based on a
- * comparison of the array lengths. Thus, two arrays are
- * ``equal'' according to <code>Array#<=></code> if and only if they have
- * the same length and the value of each element is equal to the
- * value of the corresponding element in the other array.
- *
- * [ "a", "a", "c" ] <=> [ "a", "b", "c" ] #=> -1
- * [ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ] #=> +1
- *
- */
-
-VALUE
-rb_ary_cmp(ary1, ary2)
- VALUE ary1, ary2;
+static VALUE
+recursive_cmp(VALUE ary1, VALUE ary2, int recur)
{
long i, len;
- ary2 = to_ary(ary2);
- len = RARRAY(ary1)->len;
- if (len > RARRAY(ary2)->len) {
- len = RARRAY(ary2)->len;
+ if (recur) return Qundef; /* Subtle! */
+ len = RARRAY_LEN(ary1);
+ if (len > RARRAY_LEN(ary2)) {
+ len = RARRAY_LEN(ary2);
}
for (i=0; i<len; i++) {
VALUE v = rb_funcall(rb_ary_elt(ary1, i), id_cmp, 1, rb_ary_elt(ary2, i));
@@ -2603,234 +3689,388 @@ rb_ary_cmp(ary1, ary2)
return v;
}
}
- len = RARRAY(ary1)->len - RARRAY(ary2)->len;
+ return Qundef;
+}
+
+/*
+ * call-seq:
+ * ary <=> other_ary -> -1, 0, +1 or nil
+ *
+ * Comparison --- Returns an integer (+-1+, +0+, or <code>+1</code>) if this
+ * array is less than, equal to, or greater than +other_ary+.
+ *
+ * Each object in each array is compared (using the <=> operator).
+ *
+ * Arrays are compared in an "element-wise" manner; the first two elements
+ * that are not equal will determine the return value for the whole
+ * comparison.
+ *
+ * If all the values are equal, then the return is based on a comparison of
+ * the array lengths. Thus, two arrays are "equal" according to Array#<=> if,
+ * and only if, they have the same length and the value of each element is
+ * equal to the value of the corresponding element in the other array.
+ *
+ * [ "a", "a", "c" ] <=> [ "a", "b", "c" ] #=> -1
+ * [ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ] #=> +1
+ *
+ */
+
+VALUE
+rb_ary_cmp(VALUE ary1, VALUE ary2)
+{
+ long len;
+ VALUE v;
+
+ ary2 = rb_check_array_type(ary2);
+ if (NIL_P(ary2)) return Qnil;
+ if (ary1 == ary2) return INT2FIX(0);
+ v = rb_exec_recursive_paired(recursive_cmp, ary1, ary2, ary2);
+ if (v != Qundef) return v;
+ len = RARRAY_LEN(ary1) - RARRAY_LEN(ary2);
if (len == 0) return INT2FIX(0);
if (len > 0) return INT2FIX(1);
return INT2FIX(-1);
}
static VALUE
-ary_make_hash(ary1, ary2)
- VALUE ary1, ary2;
+ary_add_hash(VALUE hash, VALUE ary)
{
- VALUE hash = rb_hash_new();
long i;
- for (i=0; i<RARRAY(ary1)->len; i++) {
- rb_hash_aset(hash, RARRAY(ary1)->ptr[i], Qtrue);
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ rb_hash_aset(hash, RARRAY_PTR(ary)[i], Qtrue);
}
- if (ary2) {
- for (i=0; i<RARRAY(ary2)->len; i++) {
- rb_hash_aset(hash, RARRAY(ary2)->ptr[i], Qtrue);
+ return hash;
+}
+
+static inline VALUE
+ary_tmp_hash_new(void)
+{
+ VALUE hash = rb_hash_new();
+
+ RBASIC(hash)->klass = 0;
+ return hash;
+}
+
+static VALUE
+ary_make_hash(VALUE ary)
+{
+ VALUE hash = ary_tmp_hash_new();
+ return ary_add_hash(hash, ary);
+}
+
+static VALUE
+ary_add_hash_by(VALUE hash, VALUE ary)
+{
+ long i;
+
+ for (i = 0; i < RARRAY_LEN(ary); ++i) {
+ VALUE v = rb_ary_elt(ary, i), k = rb_yield(v);
+ if (rb_hash_lookup2(hash, k, Qundef) == Qundef) {
+ rb_hash_aset(hash, k, v);
}
}
return hash;
}
-/*
+static VALUE
+ary_make_hash_by(VALUE ary)
+{
+ VALUE hash = ary_tmp_hash_new();
+ return ary_add_hash_by(hash, ary);
+}
+
+static inline void
+ary_recycle_hash(VALUE hash)
+{
+ if (RHASH(hash)->ntbl) {
+ st_table *tbl = RHASH(hash)->ntbl;
+ RHASH(hash)->ntbl = 0;
+ st_free_table(tbl);
+ }
+}
+
+/*
* call-seq:
- * array - other_array -> an_array
+ * ary - other_ary -> new_ary
*
- * Array Difference---Returns a new array that is a copy of
- * the original array, removing any items that also appear in
- * other_array. (If you need set-like behavior, see the
- * library class Set.)
+ * Array Difference
+ *
+ * Returns a new array that is a copy of the original array, removing any
+ * items that also appear in +other_ary+.
+ *
+ * It compares elements using their hash (returned by the Object#hash method).
*
* [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ] #=> [ 3, 3, 5 ]
+ *
+ * If you need set-like behavior, see the library class Set.
*/
static VALUE
-rb_ary_diff(ary1, ary2)
- VALUE ary1, ary2;
+rb_ary_diff(VALUE ary1, VALUE ary2)
{
VALUE ary3;
volatile VALUE hash;
long i;
- hash = ary_make_hash(to_ary(ary2), 0);
+ hash = ary_make_hash(to_ary(ary2));
ary3 = rb_ary_new();
- for (i=0; i<RARRAY(ary1)->len; i++) {
- if (st_lookup(RHASH(hash)->tbl, RARRAY(ary1)->ptr[i], 0)) continue;
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
+ if (st_lookup(RHASH_TBL(hash), RARRAY_PTR(ary1)[i], 0)) continue;
rb_ary_push(ary3, rb_ary_elt(ary1, i));
}
+ ary_recycle_hash(hash);
return ary3;
}
-/*
+/*
* call-seq:
- * array & other_array
+ * ary & other_ary -> new_ary
+ *
+ * Set Intersection --- Returns a new array containing elements common to the
+ * two arrays, excluding any duplicates.
*
- * Set Intersection---Returns a new array
- * containing elements common to the two arrays, with no duplicates.
+ * [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ]
+ * [ 'a', 'b', 'b', 'z' ] & [ 'a', 'b', 'c' ] #=> [ 'a', 'b' ]
*
- * [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ]
+ * See also Array#uniq.
*/
static VALUE
-rb_ary_and(ary1, ary2)
- VALUE ary1, ary2;
+rb_ary_and(VALUE ary1, VALUE ary2)
{
- VALUE hash, ary3, v, vv;
+ VALUE hash, ary3, v;
+ st_data_t vv;
long i;
ary2 = to_ary(ary2);
- ary3 = rb_ary_new2(RARRAY(ary1)->len < RARRAY(ary2)->len ?
- RARRAY(ary1)->len : RARRAY(ary2)->len);
- hash = ary_make_hash(ary2, 0);
+ ary3 = rb_ary_new2(RARRAY_LEN(ary1) < RARRAY_LEN(ary2) ?
+ RARRAY_LEN(ary1) : RARRAY_LEN(ary2));
+ hash = ary_make_hash(ary2);
- for (i=0; i<RARRAY(ary1)->len; i++) {
- v = vv = rb_ary_elt(ary1, i);
- if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) {
+ if (RHASH_EMPTY_P(hash))
+ return ary3;
+
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
+ vv = (st_data_t)(v = rb_ary_elt(ary1, i));
+ if (st_delete(RHASH_TBL(hash), &vv, 0)) {
rb_ary_push(ary3, v);
}
}
+ ary_recycle_hash(hash);
return ary3;
}
-/*
+/*
* call-seq:
- * array | other_array -> an_array
+ * ary | other_ary -> new_ary
*
- * Set Union---Returns a new array by joining this array with
- * other_array, removing duplicates.
+ * Set Union --- Returns a new array by joining +ary+ with +other_ary+,
+ * excluding any duplicates.
*
- * [ "a", "b", "c" ] | [ "c", "d", "a" ]
- * #=> [ "a", "b", "c", "d" ]
+ * [ "a", "b", "c" ] | [ "c", "d", "a" ] #=> [ "a", "b", "c", "d" ]
+ *
+ * See also Array#uniq.
*/
static VALUE
-rb_ary_or(ary1, ary2)
- VALUE ary1, ary2;
+rb_ary_or(VALUE ary1, VALUE ary2)
{
- VALUE hash, ary3;
- VALUE v, vv;
+ VALUE hash, ary3, v;
+ st_data_t vv;
long i;
ary2 = to_ary(ary2);
- ary3 = rb_ary_new2(RARRAY(ary1)->len+RARRAY(ary2)->len);
- hash = ary_make_hash(ary1, ary2);
+ ary3 = rb_ary_new2(RARRAY_LEN(ary1)+RARRAY_LEN(ary2));
+ hash = ary_add_hash(ary_make_hash(ary1), ary2);
- for (i=0; i<RARRAY(ary1)->len; i++) {
- v = vv = rb_ary_elt(ary1, i);
- if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) {
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
+ vv = (st_data_t)(v = rb_ary_elt(ary1, i));
+ if (st_delete(RHASH_TBL(hash), &vv, 0)) {
rb_ary_push(ary3, v);
}
}
- for (i=0; i<RARRAY(ary2)->len; i++) {
- v = vv = rb_ary_elt(ary2, i);
- if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) {
+ for (i=0; i<RARRAY_LEN(ary2); i++) {
+ vv = (st_data_t)(v = rb_ary_elt(ary2, i));
+ if (st_delete(RHASH_TBL(hash), &vv, 0)) {
rb_ary_push(ary3, v);
}
}
+ ary_recycle_hash(hash);
return ary3;
}
+static int
+push_value(st_data_t key, st_data_t val, st_data_t ary)
+{
+ rb_ary_push((VALUE)ary, (VALUE)val);
+ return ST_CONTINUE;
+}
+
/*
* call-seq:
- * array.uniq! -> array or nil
- *
- * Removes duplicate elements from _self_.
- * Returns <code>nil</code> if no changes are made (that is, no
- * duplicates are found).
- *
+ * ary.uniq! -> ary or nil
+ * ary.uniq! { |item| ... } -> ary or nil
+ *
+ * Removes duplicate elements from +self+.
+ *
+ * If a block is given, it will use the return value of the block for
+ * comparison.
+ *
+ * Returns +nil+ if no changes are made (that is, no duplicates are found).
+ *
* a = [ "a", "a", "b", "b", "c" ]
- * a.uniq! #=> ["a", "b", "c"]
+ * a.uniq! # => ["a", "b", "c"]
+ *
* b = [ "a", "b", "c" ]
- * b.uniq! #=> nil
+ * b.uniq! # => nil
+ *
+ * c = [["student","sam"], ["student","george"], ["teacher","matz"]]
+ * c.uniq! { |s| s.first } # => [["student", "sam"], ["teacher", "matz"]]
+ *
*/
static VALUE
-rb_ary_uniq_bang(ary)
- VALUE ary;
+rb_ary_uniq_bang(VALUE ary)
{
- VALUE hash, v, vv;
+ VALUE hash, v;
long i, j;
- hash = ary_make_hash(ary, 0);
-
- if (RARRAY(ary)->len == RHASH(hash)->tbl->num_entries) {
- return Qnil;
+ rb_ary_modify_check(ary);
+ if (RARRAY_LEN(ary) <= 1)
+ return Qnil;
+ if (rb_block_given_p()) {
+ hash = ary_make_hash_by(ary);
+ if (RARRAY_LEN(ary) == (i = RHASH_SIZE(hash))) {
+ return Qnil;
+ }
+ ARY_SET_LEN(ary, 0);
+ if (ARY_SHARED_P(ary) && !ARY_EMBED_P(ary)) {
+ rb_ary_unshare(ary);
+ FL_SET_EMBED(ary);
+ }
+ ary_resize_capa(ary, i);
+ st_foreach(RHASH_TBL(hash), push_value, ary);
}
- for (i=j=0; i<RARRAY(ary)->len; i++) {
- v = vv = rb_ary_elt(ary, i);
- if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) {
- rb_ary_store(ary, j++, v);
+ else {
+ hash = ary_make_hash(ary);
+ if (RARRAY_LEN(ary) == (long)RHASH_SIZE(hash)) {
+ return Qnil;
+ }
+ for (i=j=0; i<RARRAY_LEN(ary); i++) {
+ st_data_t vv = (st_data_t)(v = rb_ary_elt(ary, i));
+ if (st_delete(RHASH_TBL(hash), &vv, 0)) {
+ rb_ary_store(ary, j++, v);
+ }
}
+ ARY_SET_LEN(ary, j);
}
- RARRAY(ary)->len = j;
+ ary_recycle_hash(hash);
return ary;
}
/*
* call-seq:
- * array.uniq -> an_array
- *
- * Returns a new array by removing duplicate values in <i>self</i>.
- *
+ * ary.uniq -> new_ary
+ * ary.uniq { |item| ... } -> new_ary
+ *
+ * Returns a new array by removing duplicate values in +self+.
+ *
+ * If a block is given, it will use the return value of the block for comparison.
+ *
+ * It compares elements using their hash (provided by the Object#hash method)
+ * then compares hashes with Object#eql?.
+ *
* a = [ "a", "a", "b", "b", "c" ]
- * a.uniq #=> ["a", "b", "c"]
+ * a.uniq # => ["a", "b", "c"]
+ *
+ * b = [["student","sam"], ["student","george"], ["teacher","matz"]]
+ * b.uniq { |s| s.first } # => [["student", "sam"], ["teacher", "matz"]]
+ *
*/
static VALUE
-rb_ary_uniq(ary)
- VALUE ary;
+rb_ary_uniq(VALUE ary)
{
- ary = rb_ary_dup(ary);
- rb_ary_uniq_bang(ary);
- return ary;
+ VALUE hash, uniq, v;
+ long i;
+
+ if (RARRAY_LEN(ary) <= 1)
+ return rb_ary_dup(ary);
+ if (rb_block_given_p()) {
+ hash = ary_make_hash_by(ary);
+ uniq = ary_new(rb_obj_class(ary), RHASH_SIZE(hash));
+ st_foreach(RHASH_TBL(hash), push_value, uniq);
+ }
+ else {
+ hash = ary_make_hash(ary);
+ uniq = ary_new(rb_obj_class(ary), RHASH_SIZE(hash));
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ st_data_t vv = (st_data_t)(v = rb_ary_elt(ary, i));
+ if (st_delete(RHASH_TBL(hash), &vv, 0)) {
+ rb_ary_push(uniq, v);
+ }
+ }
+ }
+ ary_recycle_hash(hash);
+
+ return uniq;
}
-/*
+/*
* call-seq:
- * array.compact! -> array or nil
+ * ary.compact! -> ary or nil
*
- * Removes +nil+ elements from array.
- * Returns +nil+ if no changes were made.
+ * Removes +nil+ elements from the array.
+ *
+ * Returns +nil+ if no changes were made, otherwise returns the array.
*
* [ "a", nil, "b", nil, "c" ].compact! #=> [ "a", "b", "c" ]
* [ "a", "b", "c" ].compact! #=> nil
*/
static VALUE
-rb_ary_compact_bang(ary)
- VALUE ary;
+rb_ary_compact_bang(VALUE ary)
{
VALUE *p, *t, *end;
+ long n;
rb_ary_modify(ary);
- p = t = RARRAY(ary)->ptr;
- end = p + RARRAY(ary)->len;
-
+ p = t = RARRAY_PTR(ary);
+ end = p + RARRAY_LEN(ary);
+
while (t < end) {
if (NIL_P(*t)) t++;
else *p++ = *t++;
}
- if (RARRAY(ary)->len == (p - RARRAY(ary)->ptr)) {
+ n = p - RARRAY_PTR(ary);
+ if (RARRAY_LEN(ary) == n) {
return Qnil;
}
- RARRAY(ary)->len = RARRAY(ary)->aux.capa = (p - RARRAY(ary)->ptr);
- REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
+ ARY_SET_LEN(ary, n);
+ if (n * 2 < ARY_CAPA(ary) && ARY_DEFAULT_SIZE * 2 < ARY_CAPA(ary)) {
+ ary_resize_capa(ary, n * 2);
+ }
return ary;
}
/*
* call-seq:
- * array.compact -> an_array
+ * ary.compact -> new_ary
*
- * Returns a copy of _self_ with all +nil+ elements removed.
+ * Returns a copy of +self+ with all +nil+ elements removed.
*
* [ "a", nil, "b", nil, "c", nil ].compact
* #=> [ "a", "b", "c" ]
*/
static VALUE
-rb_ary_compact(ary)
- VALUE ary;
+rb_ary_compact(VALUE ary)
{
ary = rb_ary_dup(ary);
rb_ary_compact_bang(ary);
@@ -2839,146 +4079,1364 @@ rb_ary_compact(ary)
/*
* call-seq:
- * array.nitems -> int
- *
- * Returns the number of non-<code>nil</code> elements in _self_.
- * May be zero.
- *
- * [ 1, nil, 3, nil, 5 ].nitems #=> 3
+ * ary.count -> int
+ * ary.count(obj) -> int
+ * ary.count { |item| block } -> int
+ *
+ * Returns the number of elements.
+ *
+ * If an argument is given, counts the number of elements which equal +obj+
+ * using <code>===</code>.
+ *
+ * If a block is given, counts the number of elements for which the block
+ * returns a true value.
+ *
+ * ary = [1, 2, 4, 2]
+ * ary.count #=> 4
+ * ary.count(2) #=> 2
+ * ary.count { |x| x%2 == 0 } #=> 3
+ *
*/
static VALUE
-rb_ary_nitems(ary)
- VALUE ary;
+rb_ary_count(int argc, VALUE *argv, VALUE ary)
{
long n = 0;
- VALUE *p, *pend;
- p = RARRAY(ary)->ptr;
- pend = p + RARRAY(ary)->len;
+ if (argc == 0) {
+ VALUE *p, *pend;
+
+ if (!rb_block_given_p())
+ return LONG2NUM(RARRAY_LEN(ary));
- while (p < pend) {
- if (!NIL_P(*p)) n++;
- p++;
+ for (p = RARRAY_PTR(ary), pend = p + RARRAY_LEN(ary); p < pend; p++) {
+ if (RTEST(rb_yield(*p))) n++;
+ }
}
+ else {
+ VALUE obj, *p, *pend;
+
+ rb_scan_args(argc, argv, "1", &obj);
+ if (rb_block_given_p()) {
+ rb_warn("given block not used");
+ }
+ for (p = RARRAY_PTR(ary), pend = p + RARRAY_LEN(ary); p < pend; p++) {
+ if (rb_equal(*p, obj)) n++;
+ }
+ }
+
return LONG2NUM(n);
}
-static long
-flatten(ary, idx, ary2, memo)
- VALUE ary;
- long idx;
- VALUE ary2, memo;
+static VALUE
+flatten(VALUE ary, int level, int *modified)
{
- VALUE id;
- long i = idx;
- long n, lim = idx + RARRAY(ary2)->len;
-
- id = rb_obj_id(ary2);
- if (rb_ary_includes(memo, id)) {
- rb_raise(rb_eArgError, "tried to flatten recursive array");
- }
- rb_ary_push(memo, id);
- rb_ary_splice(ary, idx, 1, ary2);
- while (i < lim) {
- VALUE tmp;
-
- tmp = rb_check_array_type(rb_ary_elt(ary, i));
- if (!NIL_P(tmp)) {
- n = flatten(ary, i, tmp, memo);
- i += n; lim += n;
+ long i = 0;
+ VALUE stack, result, tmp, elt;
+ st_table *memo;
+ st_data_t id;
+
+ stack = ary_new(0, ARY_DEFAULT_SIZE);
+ result = ary_new(0, RARRAY_LEN(ary));
+ memo = st_init_numtable();
+ st_insert(memo, (st_data_t)ary, (st_data_t)Qtrue);
+ *modified = 0;
+
+ while (1) {
+ while (i < RARRAY_LEN(ary)) {
+ elt = RARRAY_PTR(ary)[i++];
+ tmp = rb_check_array_type(elt);
+ if (RBASIC(result)->klass) {
+ rb_raise(rb_eRuntimeError, "flatten reentered");
+ }
+ if (NIL_P(tmp) || (level >= 0 && RARRAY_LEN(stack) / 2 >= level)) {
+ rb_ary_push(result, elt);
+ }
+ else {
+ *modified = 1;
+ id = (st_data_t)tmp;
+ if (st_lookup(memo, id, 0)) {
+ st_free_table(memo);
+ rb_raise(rb_eArgError, "tried to flatten recursive array");
+ }
+ st_insert(memo, id, (st_data_t)Qtrue);
+ rb_ary_push(stack, ary);
+ rb_ary_push(stack, LONG2NUM(i));
+ ary = tmp;
+ i = 0;
+ }
}
- i++;
+ if (RARRAY_LEN(stack) == 0) {
+ break;
+ }
+ id = (st_data_t)ary;
+ st_delete(memo, &id, 0);
+ tmp = rb_ary_pop(stack);
+ i = NUM2LONG(tmp);
+ ary = rb_ary_pop(stack);
}
- rb_ary_pop(memo);
- return lim - idx - 1; /* returns number of increased items */
+ st_free_table(memo);
+
+ RBASIC(result)->klass = rb_class_of(ary);
+ return result;
}
/*
* call-seq:
- * array.flatten! -> array or nil
- *
- * Flattens _self_ in place.
- * Returns <code>nil</code> if no modifications were made (i.e.,
- * <i>array</i> contains no subarrays.)
- *
+ * ary.flatten! -> Array or nil
+ * ary.flatten!(level) -> Array or nil
+ *
+ * Flattens +self+ in place.
+ *
+ * Returns +nil+ if no modifications were made (i.e., the array contains no
+ * subarrays.)
+ *
+ * The optional +level+ argument determines the level of recursion to flatten.
+ *
* a = [ 1, 2, [3, [4, 5] ] ]
* a.flatten! #=> [1, 2, 3, 4, 5]
* a.flatten! #=> nil
* a #=> [1, 2, 3, 4, 5]
+ * a = [ 1, 2, [3, [4, 5] ] ]
+ * a.flatten!(1) #=> [1, 2, 3, [4, 5]]
*/
static VALUE
-rb_ary_flatten_bang(ary)
- VALUE ary;
+rb_ary_flatten_bang(int argc, VALUE *argv, VALUE ary)
{
- long i = 0;
- int mod = 0;
- VALUE memo = Qnil;
+ int mod = 0, level = -1;
+ VALUE result, lv;
- while (i<RARRAY(ary)->len) {
- VALUE ary2 = RARRAY(ary)->ptr[i];
- VALUE tmp;
+ rb_scan_args(argc, argv, "01", &lv);
+ rb_ary_modify_check(ary);
+ if (!NIL_P(lv)) level = NUM2INT(lv);
+ if (level == 0) return Qnil;
- tmp = rb_check_array_type(ary2);
- if (!NIL_P(tmp)) {
- if (NIL_P(memo)) {
- memo = rb_ary_new();
- }
- i += flatten(ary, i, tmp, memo);
- mod = 1;
- }
- i++;
+ result = flatten(ary, level, &mod);
+ if (mod == 0) {
+ ary_discard(result);
+ return Qnil;
}
- if (mod == 0) return Qnil;
+ if (!(mod = ARY_EMBED_P(result))) rb_obj_freeze(result);
+ rb_ary_replace(ary, result);
+ if (mod) ARY_SET_EMBED_LEN(result, 0);
+
return ary;
}
/*
* call-seq:
- * array.flatten -> an_array
- *
- * Returns a new array that is a one-dimensional flattening of this
- * array (recursively). That is, for every element that is an array,
- * extract its elements into the new array.
- *
+ * ary.flatten -> new_ary
+ * ary.flatten(level) -> new_ary
+ *
+ * Returns a new array that is a one-dimensional flattening of +self+
+ * (recursively).
+ *
+ * That is, for every element that is an array, extract its elements into
+ * the new array.
+ *
+ * The optional +level+ argument determines the level of recursion to
+ * flatten.
+ *
* s = [ 1, 2, 3 ] #=> [1, 2, 3]
* t = [ 4, 5, 6, [7, 8] ] #=> [4, 5, 6, [7, 8]]
* a = [ s, t, 9, 10 ] #=> [[1, 2, 3], [4, 5, 6, [7, 8]], 9, 10]
- * a.flatten #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10
+ * a.flatten #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+ * a = [ 1, 2, [3, [4, 5] ] ]
+ * a.flatten(1) #=> [1, 2, 3, [4, 5]]
*/
static VALUE
-rb_ary_flatten(ary)
- VALUE ary;
+rb_ary_flatten(int argc, VALUE *argv, VALUE ary)
+{
+ int mod = 0, level = -1;
+ VALUE result, lv;
+
+ rb_scan_args(argc, argv, "01", &lv);
+ if (!NIL_P(lv)) level = NUM2INT(lv);
+ if (level == 0) return ary_make_shared_copy(ary);
+
+ result = flatten(ary, level, &mod);
+ OBJ_INFECT(result, ary);
+
+ return result;
+}
+
+#define OPTHASH_GIVEN_P(opts) \
+ (argc > 0 && !NIL_P((opts) = rb_check_hash_type(argv[argc-1])) && (--argc, 1))
+static VALUE sym_random;
+
+#define RAND_UPTO(max) (long)rb_random_ulong_limited((randgen), (max)-1)
+
+/*
+ * call-seq:
+ * ary.shuffle! -> ary
+ * ary.shuffle!(random: rng) -> ary
+ *
+ * Shuffles elements in +self+ in place.
+ *
+ * The optional +rng+ argument will be used as the random number generator.
+ */
+
+static VALUE
+rb_ary_shuffle_bang(int argc, VALUE *argv, VALUE ary)
+{
+ VALUE *ptr, opts, *snap_ptr, randgen = rb_cRandom;
+ long i, snap_len;
+
+ if (OPTHASH_GIVEN_P(opts)) {
+ randgen = rb_hash_lookup2(opts, sym_random, randgen);
+ }
+ rb_check_arity(argc, 0, 0);
+ rb_ary_modify(ary);
+ i = RARRAY_LEN(ary);
+ ptr = RARRAY_PTR(ary);
+ snap_len = i;
+ snap_ptr = ptr;
+ while (i) {
+ long j = RAND_UPTO(i);
+ VALUE tmp;
+ if (snap_len != RARRAY_LEN(ary) || snap_ptr != RARRAY_PTR(ary)) {
+ rb_raise(rb_eRuntimeError, "modified during shuffle");
+ }
+ tmp = ptr[--i];
+ ptr[i] = ptr[j];
+ ptr[j] = tmp;
+ }
+ return ary;
+}
+
+
+/*
+ * call-seq:
+ * ary.shuffle -> new_ary
+ * ary.shuffle(random: rng) -> new_ary
+ *
+ * Returns a new array with elements of +self+ shuffled.
+ *
+ * a = [ 1, 2, 3 ] #=> [1, 2, 3]
+ * a.shuffle #=> [2, 3, 1]
+ *
+ * The optional +rng+ argument will be used as the random number generator.
+ *
+ * a.shuffle(random: Random.new(1)) #=> [1, 3, 2]
+ */
+
+static VALUE
+rb_ary_shuffle(int argc, VALUE *argv, VALUE ary)
{
ary = rb_ary_dup(ary);
- rb_ary_flatten_bang(ary);
+ rb_ary_shuffle_bang(argc, argv, ary);
return ary;
}
-/* Arrays are ordered, integer-indexed collections of any object.
- * Array indexing starts at 0, as in C or Java. A negative index is
- * assumed to be relative to the end of the array---that is, an index of -1
- * indicates the last element of the array, -2 is the next to last
- * element in the array, and so on.
+/*
+ * call-seq:
+ * ary.sample -> obj
+ * ary.sample(random: rng) -> obj
+ * ary.sample(n) -> new_ary
+ * ary.sample(n, random: rng) -> new_ary
+ *
+ * Choose a random element or +n+ random elements from the array.
+ *
+ * The elements are chosen by using random and unique indices into the array
+ * in order to ensure that an element doesn't repeat itself unless the array
+ * already contained duplicate elements.
+ *
+ * If the array is empty the first form returns +nil+ and the second form
+ * returns an empty array.
+ *
+ * The optional +rng+ argument will be used as the random number generator.
+ *
+ * a = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
+ * a.sample #=> 7
+ * a.sample(4) #=> [6, 4, 2, 5]
+ */
+
+
+static VALUE
+rb_ary_sample(int argc, VALUE *argv, VALUE ary)
+{
+ VALUE nv, result, *ptr;
+ VALUE opts, randgen = rb_cRandom;
+ long n, len, i, j, k, idx[10];
+ long rnds[numberof(idx)];
+
+ if (OPTHASH_GIVEN_P(opts)) {
+ randgen = rb_hash_lookup2(opts, sym_random, randgen);
+ }
+ ptr = RARRAY_PTR(ary);
+ len = RARRAY_LEN(ary);
+ if (argc == 0) {
+ if (len == 0) return Qnil;
+ if (len == 1) {
+ i = 0;
+ }
+ else {
+ i = RAND_UPTO(len);
+ if ((len = RARRAY_LEN(ary)) <= i) return Qnil;
+ ptr = RARRAY_PTR(ary);
+ }
+ return ptr[i];
+ }
+ rb_scan_args(argc, argv, "1", &nv);
+ n = NUM2LONG(nv);
+ if (n < 0) rb_raise(rb_eArgError, "negative sample number");
+ if (n > len) n = len;
+ if (n <= numberof(idx)) {
+ for (i = 0; i < n; ++i) {
+ rnds[i] = RAND_UPTO(len - i);
+ }
+ }
+ k = len;
+ len = RARRAY_LEN(ary);
+ ptr = RARRAY_PTR(ary);
+ if (len < k) {
+ if (n <= numberof(idx)) {
+ for (i = 0; i < n; ++i) {
+ if (rnds[i] >= len) {
+ return rb_ary_new2(0);
+ }
+ }
+ }
+ }
+ if (n > len) n = len;
+ switch (n) {
+ case 0:
+ return rb_ary_new2(0);
+ case 1:
+ i = rnds[0];
+ return rb_ary_new4(1, &ptr[i]);
+ case 2:
+ i = rnds[0];
+ j = rnds[1];
+ if (j >= i) j++;
+ return rb_ary_new3(2, ptr[i], ptr[j]);
+ case 3:
+ i = rnds[0];
+ j = rnds[1];
+ k = rnds[2];
+ {
+ long l = j, g = i;
+ if (j >= i) l = i, g = ++j;
+ if (k >= l && (++k >= g)) ++k;
+ }
+ return rb_ary_new3(3, ptr[i], ptr[j], ptr[k]);
+ }
+ if (n <= numberof(idx)) {
+ VALUE *ptr_result;
+ long sorted[numberof(idx)];
+ sorted[0] = idx[0] = rnds[0];
+ for (i=1; i<n; i++) {
+ k = rnds[i];
+ for (j = 0; j < i; ++j) {
+ if (k < sorted[j]) break;
+ ++k;
+ }
+ memmove(&sorted[j+1], &sorted[j], sizeof(sorted[0])*(i-j));
+ sorted[j] = idx[i] = k;
+ }
+ result = rb_ary_new2(n);
+ ptr_result = RARRAY_PTR(result);
+ for (i=0; i<n; i++) {
+ ptr_result[i] = ptr[idx[i]];
+ }
+ }
+ else {
+ VALUE *ptr_result;
+ result = rb_ary_new4(len, ptr);
+ RBASIC(result)->klass = 0;
+ ptr_result = RARRAY_PTR(result);
+ RB_GC_GUARD(ary);
+ for (i=0; i<n; i++) {
+ j = RAND_UPTO(len-i) + i;
+ nv = ptr_result[j];
+ ptr_result[j] = ptr_result[i];
+ ptr_result[i] = nv;
+ }
+ RBASIC(result)->klass = rb_cArray;
+ }
+ ARY_SET_LEN(result, n);
+
+ return result;
+}
+
+static VALUE
+rb_ary_cycle_size(VALUE self, VALUE args)
+{
+ long mul;
+ VALUE n = Qnil;
+ if (args && (RARRAY_LEN(args) > 0)) {
+ n = RARRAY_PTR(args)[0];
+ }
+ if (RARRAY_LEN(self) == 0) return INT2FIX(0);
+ if (n == Qnil) return DBL2NUM(INFINITY);
+ mul = NUM2LONG(n);
+ if (mul <= 0) return INT2FIX(0);
+ return rb_funcall(rb_ary_length(self), '*', 1, LONG2FIX(mul));
+}
+
+/*
+ * call-seq:
+ * ary.cycle(n=nil) { |obj| block } -> nil
+ * ary.cycle(n=nil) -> Enumerator
+ *
+ * Calls the given block for each element +n+ times or forever if +nil+ is
+ * given.
+ *
+ * Does nothing if a non-positive number is given or the array is empty.
+ *
+ * Returns +nil+ if the loop has finished without getting interrupted.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * a = ["a", "b", "c"]
+ * a.cycle { |x| puts x } # print, a, b, c, a, b, c,.. forever.
+ * a.cycle(2) { |x| puts x } # print, a, b, c, a, b, c.
+ *
+ */
+
+static VALUE
+rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
+{
+ long n, i;
+ VALUE nv = Qnil;
+
+ rb_scan_args(argc, argv, "01", &nv);
+
+ RETURN_SIZED_ENUMERATOR(ary, argc, argv, rb_ary_cycle_size);
+ if (NIL_P(nv)) {
+ n = -1;
+ }
+ else {
+ n = NUM2LONG(nv);
+ if (n <= 0) return Qnil;
+ }
+
+ while (RARRAY_LEN(ary) > 0 && (n < 0 || 0 < n--)) {
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ rb_yield(RARRAY_PTR(ary)[i]);
+ }
+ }
+ return Qnil;
+}
+
+#define tmpbuf(n, size) rb_str_tmp_new((n)*(size))
+#define tmpbuf_discard(s) (rb_str_resize((s), 0L), RBASIC(s)->klass = rb_cString)
+#define tmpary(n) rb_ary_tmp_new(n)
+#define tmpary_discard(a) (ary_discard(a), RBASIC(a)->klass = rb_cArray)
+
+/*
+ * Recursively compute permutations of +r+ elements of the set
+ * <code>[0..n-1]</code>.
+ *
+ * When we have a complete permutation of array indexes, copy the values
+ * at those indexes into a new array and yield that array.
+ *
+ * n: the size of the set
+ * r: the number of elements in each permutation
+ * p: the array (of size r) that we're filling in
+ * index: what index we're filling in now
+ * used: an array of booleans: whether a given index is already used
+ * values: the Ruby array that holds the actual values to permute
+ */
+static void
+permute0(long n, long r, long *p, long index, char *used, VALUE values)
+{
+ long i,j;
+ for (i = 0; i < n; i++) {
+ if (used[i] == 0) {
+ p[index] = i;
+ if (index < r-1) { /* if not done yet */
+ used[i] = 1; /* mark index used */
+ permute0(n, r, p, index+1, /* recurse */
+ used, values);
+ used[i] = 0; /* index unused */
+ }
+ else {
+ /* We have a complete permutation of array indexes */
+ /* Build a ruby array of the corresponding values */
+ /* And yield it to the associated block */
+ VALUE result = rb_ary_new2(r);
+ VALUE *result_array = RARRAY_PTR(result);
+ const VALUE *values_array = RARRAY_PTR(values);
+
+ for (j = 0; j < r; j++) result_array[j] = values_array[p[j]];
+ ARY_SET_LEN(result, r);
+ rb_yield(result);
+ if (RBASIC(values)->klass) {
+ rb_raise(rb_eRuntimeError, "permute reentered");
+ }
+ }
+ }
+ }
+}
+
+/*
+ * Returns the product of from, from-1, ..., from - how_many + 1.
+ * http://en.wikipedia.org/wiki/Pochhammer_symbol
+ */
+static VALUE
+descending_factorial(long from, long how_many)
+{
+ VALUE cnt = LONG2FIX(how_many >= 0);
+ while (how_many-- > 0) {
+ cnt = rb_funcall(cnt, '*', 1, LONG2FIX(from--));
+ }
+ return cnt;
+}
+
+static VALUE
+binomial_coefficient(long comb, long size)
+{
+ if (comb > size-comb) {
+ comb = size-comb;
+ }
+ if (comb < 0) {
+ return LONG2FIX(0);
+ }
+ return rb_funcall(descending_factorial(size, comb), id_div, 1, descending_factorial(comb, comb));
+}
+
+static VALUE
+rb_ary_permutation_size(VALUE ary, VALUE args)
+{
+ long n = RARRAY_LEN(ary);
+ long k = (args && (RARRAY_LEN(args) > 0)) ? NUM2LONG(RARRAY_PTR(args)[0]) : n;
+
+ return descending_factorial(n, k);
+}
+
+/*
+ * call-seq:
+ * ary.permutation { |p| block } -> ary
+ * ary.permutation -> Enumerator
+ * ary.permutation(n) { |p| block } -> ary
+ * ary.permutation(n) -> Enumerator
+ *
+ * When invoked with a block, yield all permutations of length +n+ of the
+ * elements of the array, then return the array itself.
+ *
+ * If +n+ is not specified, yield all permutations of all elements.
+ *
+ * The implementation makes no guarantees about the order in which the
+ * permutations are yielded.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * Examples:
+ *
+ * a = [1, 2, 3]
+ * a.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
+ * a.permutation(1).to_a #=> [[1],[2],[3]]
+ * a.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
+ * a.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
+ * a.permutation(0).to_a #=> [[]] # one permutation of length 0
+ * a.permutation(4).to_a #=> [] # no permutations of length 4
+ */
+
+static VALUE
+rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
+{
+ VALUE num;
+ long r, n, i;
+
+ n = RARRAY_LEN(ary); /* Array length */
+ RETURN_SIZED_ENUMERATOR(ary, argc, argv, rb_ary_permutation_size); /* Return enumerator if no block */
+ rb_scan_args(argc, argv, "01", &num);
+ r = NIL_P(num) ? n : NUM2LONG(num); /* Permutation size from argument */
+
+ if (r < 0 || n < r) {
+ /* no permutations: yield nothing */
+ }
+ else if (r == 0) { /* exactly one permutation: the zero-length array */
+ rb_yield(rb_ary_new2(0));
+ }
+ else if (r == 1) { /* this is a special, easy case */
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ rb_yield(rb_ary_new3(1, RARRAY_PTR(ary)[i]));
+ }
+ }
+ else { /* this is the general case */
+ volatile VALUE t0 = tmpbuf(n,sizeof(long));
+ long *p = (long*)RSTRING_PTR(t0);
+ volatile VALUE t1 = tmpbuf(n,sizeof(char));
+ char *used = (char*)RSTRING_PTR(t1);
+ VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
+ RBASIC(ary0)->klass = 0;
+
+ MEMZERO(used, char, n); /* initialize array */
+
+ permute0(n, r, p, 0, used, ary0); /* compute and yield permutations */
+ tmpbuf_discard(t0);
+ tmpbuf_discard(t1);
+ RBASIC(ary0)->klass = rb_cArray;
+ }
+ return ary;
+}
+
+static VALUE
+rb_ary_combination_size(VALUE ary, VALUE args)
+{
+ long n = RARRAY_LEN(ary);
+ long k = NUM2LONG(RARRAY_PTR(args)[0]);
+
+ return binomial_coefficient(k, n);
+}
+
+/*
+ * call-seq:
+ * ary.combination(n) { |c| block } -> ary
+ * ary.combination(n) -> Enumerator
+ *
+ * When invoked with a block, yields all combinations of length +n+ of elements
+ * from the array and then returns the array itself.
+ *
+ * The implementation makes no guarantees about the order in which the
+ * combinations are yielded.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * Examples:
+ *
+ * a = [1, 2, 3, 4]
+ * a.combination(1).to_a #=> [[1],[2],[3],[4]]
+ * a.combination(2).to_a #=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]
+ * a.combination(3).to_a #=> [[1,2,3],[1,2,4],[1,3,4],[2,3,4]]
+ * a.combination(4).to_a #=> [[1,2,3,4]]
+ * a.combination(0).to_a #=> [[]] # one combination of length 0
+ * a.combination(5).to_a #=> [] # no combinations of length 5
+ *
+ */
+
+static VALUE
+rb_ary_combination(VALUE ary, VALUE num)
+{
+ long n, i, len;
+
+ n = NUM2LONG(num);
+ RETURN_SIZED_ENUMERATOR(ary, 1, &num, rb_ary_combination_size);
+ len = RARRAY_LEN(ary);
+ if (n < 0 || len < n) {
+ /* yield nothing */
+ }
+ else if (n == 0) {
+ rb_yield(rb_ary_new2(0));
+ }
+ else if (n == 1) {
+ for (i = 0; i < len; i++) {
+ rb_yield(rb_ary_new3(1, RARRAY_PTR(ary)[i]));
+ }
+ }
+ else {
+ volatile VALUE t0 = tmpbuf(n+1, sizeof(long));
+ long *stack = (long*)RSTRING_PTR(t0);
+ volatile VALUE cc = tmpary(n);
+ VALUE *chosen = RARRAY_PTR(cc);
+ long lev = 0;
+
+ MEMZERO(stack, long, n);
+ stack[0] = -1;
+ for (;;) {
+ chosen[lev] = RARRAY_PTR(ary)[stack[lev+1]];
+ for (lev++; lev < n; lev++) {
+ chosen[lev] = RARRAY_PTR(ary)[stack[lev+1] = stack[lev]+1];
+ }
+ rb_yield(rb_ary_new4(n, chosen));
+ if (RBASIC(t0)->klass) {
+ rb_raise(rb_eRuntimeError, "combination reentered");
+ }
+ do {
+ if (lev == 0) goto done;
+ stack[lev--]++;
+ } while (stack[lev+1]+n == len+lev+1);
+ }
+ done:
+ tmpbuf_discard(t0);
+ tmpary_discard(cc);
+ }
+ return ary;
+}
+
+/*
+ * Recursively compute repeated permutations of +r+ elements of the set
+ * <code>[0..n-1]</code>.
+ *
+ * When we have a complete repeated permutation of array indexes, copy the
+ * values at those indexes into a new array and yield that array.
+ *
+ * n: the size of the set
+ * r: the number of elements in each permutation
+ * p: the array (of size r) that we're filling in
+ * index: what index we're filling in now
+ * values: the Ruby array that holds the actual values to permute
+ */
+static void
+rpermute0(long n, long r, long *p, long index, VALUE values)
+{
+ long i, j;
+ for (i = 0; i < n; i++) {
+ p[index] = i;
+ if (index < r-1) { /* if not done yet */
+ rpermute0(n, r, p, index+1, values); /* recurse */
+ }
+ else {
+ /* We have a complete permutation of array indexes */
+ /* Build a ruby array of the corresponding values */
+ /* And yield it to the associated block */
+ VALUE result = rb_ary_new2(r);
+ VALUE *result_array = RARRAY_PTR(result);
+ const VALUE *values_array = RARRAY_PTR(values);
+
+ for (j = 0; j < r; j++) result_array[j] = values_array[p[j]];
+ ARY_SET_LEN(result, r);
+ rb_yield(result);
+ if (RBASIC(values)->klass) {
+ rb_raise(rb_eRuntimeError, "repeated permute reentered");
+ }
+ }
+ }
+}
+
+static VALUE
+rb_ary_repeated_permutation_size(VALUE ary, VALUE args)
+{
+ long n = RARRAY_LEN(ary);
+ long k = NUM2LONG(RARRAY_PTR(args)[0]);
+
+ if (k < 0) {
+ return LONG2FIX(0);
+ }
+
+ return rb_funcall(LONG2NUM(n), id_power, 1, LONG2NUM(k));
+}
+
+/*
+ * call-seq:
+ * ary.repeated_permutation(n) { |p| block } -> ary
+ * ary.repeated_permutation(n) -> Enumerator
+ *
+ * When invoked with a block, yield all repeated permutations of length +n+ of
+ * the elements of the array, then return the array itself.
+ *
+ * The implementation makes no guarantees about the order in which the repeated
+ * permutations are yielded.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * Examples:
+ *
+ * a = [1, 2]
+ * a.repeated_permutation(1).to_a #=> [[1], [2]]
+ * a.repeated_permutation(2).to_a #=> [[1,1],[1,2],[2,1],[2,2]]
+ * a.repeated_permutation(3).to_a #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
+ * # [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
+ * a.repeated_permutation(0).to_a #=> [[]] # one permutation of length 0
+ */
+
+static VALUE
+rb_ary_repeated_permutation(VALUE ary, VALUE num)
+{
+ long r, n, i;
+
+ n = RARRAY_LEN(ary); /* Array length */
+ RETURN_SIZED_ENUMERATOR(ary, 1, &num, rb_ary_repeated_permutation_size); /* Return Enumerator if no block */
+ r = NUM2LONG(num); /* Permutation size from argument */
+
+ if (r < 0) {
+ /* no permutations: yield nothing */
+ }
+ else if (r == 0) { /* exactly one permutation: the zero-length array */
+ rb_yield(rb_ary_new2(0));
+ }
+ else if (r == 1) { /* this is a special, easy case */
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ rb_yield(rb_ary_new3(1, RARRAY_PTR(ary)[i]));
+ }
+ }
+ else { /* this is the general case */
+ volatile VALUE t0 = tmpbuf(r, sizeof(long));
+ long *p = (long*)RSTRING_PTR(t0);
+ VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
+ RBASIC(ary0)->klass = 0;
+
+ rpermute0(n, r, p, 0, ary0); /* compute and yield repeated permutations */
+ tmpbuf_discard(t0);
+ RBASIC(ary0)->klass = rb_cArray;
+ }
+ return ary;
+}
+
+static void
+rcombinate0(long n, long r, long *p, long index, long rest, VALUE values)
+{
+ long j;
+ if (rest > 0) {
+ for (; index < n; ++index) {
+ p[r-rest] = index;
+ rcombinate0(n, r, p, index, rest-1, values);
+ }
+ }
+ else {
+ VALUE result = rb_ary_new2(r);
+ VALUE *result_array = RARRAY_PTR(result);
+ const VALUE *values_array = RARRAY_PTR(values);
+
+ for (j = 0; j < r; ++j) result_array[j] = values_array[p[j]];
+ ARY_SET_LEN(result, r);
+ rb_yield(result);
+ if (RBASIC(values)->klass) {
+ rb_raise(rb_eRuntimeError, "repeated combination reentered");
+ }
+ }
+}
+
+static VALUE
+rb_ary_repeated_combination_size(VALUE ary, VALUE args)
+{
+ long n = RARRAY_LEN(ary);
+ long k = NUM2LONG(RARRAY_PTR(args)[0]);
+ if (k == 0) {
+ return LONG2FIX(1);
+ }
+ return binomial_coefficient(k, n + k - 1);
+}
+
+/*
+ * call-seq:
+ * ary.repeated_combination(n) { |c| block } -> ary
+ * ary.repeated_combination(n) -> Enumerator
+ *
+ * When invoked with a block, yields all repeated combinations of length +n+ of
+ * elements from the array and then returns the array itself.
+ *
+ * The implementation makes no guarantees about the order in which the repeated
+ * combinations are yielded.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * Examples:
+ *
+ * a = [1, 2, 3]
+ * a.repeated_combination(1).to_a #=> [[1], [2], [3]]
+ * a.repeated_combination(2).to_a #=> [[1,1],[1,2],[1,3],[2,2],[2,3],[3,3]]
+ * a.repeated_combination(3).to_a #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
+ * # [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
+ * a.repeated_combination(4).to_a #=> [[1,1,1,1],[1,1,1,2],[1,1,1,3],[1,1,2,2],[1,1,2,3],
+ * # [1,1,3,3],[1,2,2,2],[1,2,2,3],[1,2,3,3],[1,3,3,3],
+ * # [2,2,2,2],[2,2,2,3],[2,2,3,3],[2,3,3,3],[3,3,3,3]]
+ * a.repeated_combination(0).to_a #=> [[]] # one combination of length 0
+ *
+ */
+
+static VALUE
+rb_ary_repeated_combination(VALUE ary, VALUE num)
+{
+ long n, i, len;
+
+ n = NUM2LONG(num); /* Combination size from argument */
+ RETURN_SIZED_ENUMERATOR(ary, 1, &num, rb_ary_repeated_combination_size); /* Return enumerator if no block */
+ len = RARRAY_LEN(ary);
+ if (n < 0) {
+ /* yield nothing */
+ }
+ else if (n == 0) {
+ rb_yield(rb_ary_new2(0));
+ }
+ else if (n == 1) {
+ for (i = 0; i < len; i++) {
+ rb_yield(rb_ary_new3(1, RARRAY_PTR(ary)[i]));
+ }
+ }
+ else if (len == 0) {
+ /* yield nothing */
+ }
+ else {
+ volatile VALUE t0 = tmpbuf(n, sizeof(long));
+ long *p = (long*)RSTRING_PTR(t0);
+ VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
+ RBASIC(ary0)->klass = 0;
+
+ rcombinate0(len, n, p, 0, n, ary0); /* compute and yield repeated combinations */
+ tmpbuf_discard(t0);
+ RBASIC(ary0)->klass = rb_cArray;
+ }
+ return ary;
+}
+
+/*
+ * call-seq:
+ * ary.product(other_ary, ...) -> new_ary
+ * ary.product(other_ary, ...) { |p| block } -> ary
+ *
+ * Returns an array of all combinations of elements from all arrays.
+ *
+ * The length of the returned array is the product of the length of +self+ and
+ * the argument arrays.
+ *
+ * If given a block, #product will yield all combinations and return +self+
+ * instead.
+ *
+ * [1,2,3].product([4,5]) #=> [[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]]
+ * [1,2].product([1,2]) #=> [[1,1],[1,2],[2,1],[2,2]]
+ * [1,2].product([3,4],[5,6]) #=> [[1,3,5],[1,3,6],[1,4,5],[1,4,6],
+ * # [2,3,5],[2,3,6],[2,4,5],[2,4,6]]
+ * [1,2].product() #=> [[1],[2]]
+ * [1,2].product([]) #=> []
+ */
+
+static VALUE
+rb_ary_product(int argc, VALUE *argv, VALUE ary)
+{
+ int n = argc+1; /* How many arrays we're operating on */
+ volatile VALUE t0 = tmpary(n);
+ volatile VALUE t1 = tmpbuf(n, sizeof(int));
+ VALUE *arrays = RARRAY_PTR(t0); /* The arrays we're computing the product of */
+ int *counters = (int*)RSTRING_PTR(t1); /* The current position in each one */
+ VALUE result = Qnil; /* The array we'll be returning, when no block given */
+ long i,j;
+ long resultlen = 1;
+
+ RBASIC(t0)->klass = 0;
+ RBASIC(t1)->klass = 0;
+
+ /* initialize the arrays of arrays */
+ ARY_SET_LEN(t0, n);
+ arrays[0] = ary;
+ for (i = 1; i < n; i++) arrays[i] = Qnil;
+ for (i = 1; i < n; i++) arrays[i] = to_ary(argv[i-1]);
+
+ /* initialize the counters for the arrays */
+ for (i = 0; i < n; i++) counters[i] = 0;
+
+ /* Otherwise, allocate and fill in an array of results */
+ if (rb_block_given_p()) {
+ /* Make defensive copies of arrays; exit if any is empty */
+ for (i = 0; i < n; i++) {
+ if (RARRAY_LEN(arrays[i]) == 0) goto done;
+ arrays[i] = ary_make_shared_copy(arrays[i]);
+ }
+ }
+ else {
+ /* Compute the length of the result array; return [] if any is empty */
+ for (i = 0; i < n; i++) {
+ long k = RARRAY_LEN(arrays[i]), l = resultlen;
+ if (k == 0) {
+ result = rb_ary_new2(0);
+ goto done;
+ }
+ resultlen *= k;
+ if (resultlen < k || resultlen < l || resultlen / k != l) {
+ rb_raise(rb_eRangeError, "too big to product");
+ }
+ }
+ result = rb_ary_new2(resultlen);
+ }
+ for (;;) {
+ int m;
+ /* fill in one subarray */
+ VALUE subarray = rb_ary_new2(n);
+ for (j = 0; j < n; j++) {
+ rb_ary_push(subarray, rb_ary_entry(arrays[j], counters[j]));
+ }
+
+ /* put it on the result array */
+ if (NIL_P(result)) {
+ FL_SET(t0, FL_USER5);
+ rb_yield(subarray);
+ if (! FL_TEST(t0, FL_USER5)) {
+ rb_raise(rb_eRuntimeError, "product reentered");
+ }
+ else {
+ FL_UNSET(t0, FL_USER5);
+ }
+ }
+ else {
+ rb_ary_push(result, subarray);
+ }
+
+ /*
+ * Increment the last counter. If it overflows, reset to 0
+ * and increment the one before it.
+ */
+ m = n-1;
+ counters[m]++;
+ while (counters[m] == RARRAY_LEN(arrays[m])) {
+ counters[m] = 0;
+ /* If the first counter overflows, we are done */
+ if (--m < 0) goto done;
+ counters[m]++;
+ }
+ }
+done:
+ tmpary_discard(t0);
+ tmpbuf_discard(t1);
+
+ return NIL_P(result) ? ary : result;
+}
+
+/*
+ * call-seq:
+ * ary.take(n) -> new_ary
+ *
+ * Returns first +n+ elements from the array.
+ *
+ * If a negative number is given, raises an ArgumentError.
+ *
+ * See also Array#drop
+ *
+ * a = [1, 2, 3, 4, 5, 0]
+ * a.take(3) #=> [1, 2, 3]
+ *
+ */
+
+static VALUE
+rb_ary_take(VALUE obj, VALUE n)
+{
+ long len = NUM2LONG(n);
+ if (len < 0) {
+ rb_raise(rb_eArgError, "attempt to take negative size");
+ }
+ return rb_ary_subseq(obj, 0, len);
+}
+
+/*
+ * call-seq:
+ * ary.take_while { |arr| block } -> new_ary
+ * ary.take_while -> Enumerator
+ *
+ * Passes elements to the block until the block returns +nil+ or +false+, then
+ * stops iterating and returns an array of all prior elements.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * See also Array#drop_while
+ *
+ * a = [1, 2, 3, 4, 5, 0]
+ * a.take_while { |i| i < 3 } #=> [1, 2]
+ *
+ */
+
+static VALUE
+rb_ary_take_while(VALUE ary)
+{
+ long i;
+
+ RETURN_ENUMERATOR(ary, 0, 0);
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ if (!RTEST(rb_yield(RARRAY_PTR(ary)[i]))) break;
+ }
+ return rb_ary_take(ary, LONG2FIX(i));
+}
+
+/*
+ * call-seq:
+ * ary.drop(n) -> new_ary
+ *
+ * Drops first +n+ elements from +ary+ and returns the rest of the elements in
+ * an array.
+ *
+ * If a negative number is given, raises an ArgumentError.
+ *
+ * See also Array#take
+ *
+ * a = [1, 2, 3, 4, 5, 0]
+ * a.drop(3) #=> [4, 5, 0]
+ *
+ */
+
+static VALUE
+rb_ary_drop(VALUE ary, VALUE n)
+{
+ VALUE result;
+ long pos = NUM2LONG(n);
+ if (pos < 0) {
+ rb_raise(rb_eArgError, "attempt to drop negative size");
+ }
+
+ result = rb_ary_subseq(ary, pos, RARRAY_LEN(ary));
+ if (result == Qnil) result = rb_ary_new();
+ return result;
+}
+
+/*
+ * call-seq:
+ * ary.drop_while { |arr| block } -> new_ary
+ * ary.drop_while -> Enumerator
+ *
+ * Drops elements up to, but not including, the first element for which the
+ * block returns +nil+ or +false+ and returns an array containing the
+ * remaining elements.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * See also Array#take_while
+ *
+ * a = [1, 2, 3, 4, 5, 0]
+ * a.drop_while {|i| i < 3 } #=> [3, 4, 5, 0]
+ *
+ */
+
+static VALUE
+rb_ary_drop_while(VALUE ary)
+{
+ long i;
+
+ RETURN_ENUMERATOR(ary, 0, 0);
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ if (!RTEST(rb_yield(RARRAY_PTR(ary)[i]))) break;
+ }
+ return rb_ary_drop(ary, LONG2FIX(i));
+}
+
+/*
+ * Arrays are ordered, integer-indexed collections of any object.
+ *
+ * Array indexing starts at 0, as in C or Java. A negative index is assumed
+ * to be relative to the end of the array---that is, an index of -1 indicates
+ * the last element of the array, -2 is the next to last element in the
+ * array, and so on.
+ *
+ * == Creating Arrays
+ *
+ * A new array can be created by using the literal constructor
+ * <code>[]</code>. Arrays can contain different types of objects. For
+ * example, the array below contains an Integer, a String and a Float:
+ *
+ * ary = [1, "two", 3.0] #=> [1, "two", 3.0]
+ *
+ * An array can also be created by explicitly calling Array.new with zero, one
+ * (the initial size of the Array) or two arguments (the initial size and a
+ * default object).
+ *
+ * ary = Array.new #=> []
+ * Array.new(3) #=> [nil, nil, nil]
+ * Array.new(3, true) #=> [0, 0, 0]
+ *
+ * Note that the second argument populates the array with references to the
+ * same object. Therefore, it is only recommended in cases when you need to
+ * instantiate arrays with natively immutable objects such as Symbols,
+ * numbers, true or false.
+ *
+ * To create an array with separate objects a block can be passed instead.
+ * This method is safe to use with mutable objects such as hashes, strings or
+ * other arrays:
+ *
+ * Array.new(4) { Hash.new } #=> [{}, {}, {}, {}]
+ *
+ * This is also a quick way to build up multi-dimensional arrays:
+ *
+ * empty_table = Array.new(3) { Array.new(3) }
+ * #=> [[nil, nil, nil], [nil, nil, nil], [nil, nil, nil]]
+ *
+ * == Example Usage
+ *
+ * In addition to the methods it mixes in through the Enumerable module, the
+ * Array class has proprietary methods for accessing, searching and otherwise
+ * manipulating arrays.
+ *
+ * Some of the more common ones are illustrated below.
+ *
+ * == Accessing Elements
+ *
+ * Elements in an array can be retrieved using the Array#[] method. It can
+ * take a single integer argument (a numeric index), a pair of arguments
+ * (start and length) or a range.
+ *
+ * arr = [1, 2, 3, 4, 5, 6]
+ * arr[2] #=> 3
+ * arr[100] #=> nil
+ * arr[-3] #=> 4
+ * arr[2, 3] #=> [3, 4, 5]
+ * arr[1..4] #=> [2, 3, 4, 5]
+ *
+ * Another way to access a particular array element is by using the #at method
+ *
+ * arr.at(0) #=> 1
+ *
+ * The #slice method works in an identical manner to Array#[].
+ *
+ * To raise an error for indices outside of the array bounds or else to
+ * provide a default value when that happens, you can use #fetch.
+ *
+ * arr = ['a', 'b', 'c', 'd', 'e', 'f']
+ * arr.fetch(100) #=> IndexError: index 100 outside of array bounds: -6...6
+ * arr.fetch(100, "oops") #=> "oops"
+ *
+ * The special methods #first and #last will return the first and last
+ * elements of an array, respectively.
+ *
+ * arr.first #=> 1
+ * arr.last #=> 6
+ *
+ * To return the first +n+ elements of an array, use #take
+ *
+ * arr.take(3) #=> [1, 2, 3]
+ *
+ * #drop does the opposite of #take, by returning the elements after +n+
+ * elements have been dropped:
+ *
+ * arr.drop(3) #=> [4, 5, 6]
+ *
+ * == Obtaining Information about an Array
+ *
+ * Arrays keep track of their own length at all times. To query an array
+ * about the number of elements it contains, use #length, #count or #size.
+ *
+ * browsers = ['Chrome', 'Firefox', 'Safari', 'Opera', 'IE']
+ * browsers.length #=> 5
+ * browsers.count #=> 5
+ *
+ * To check whether an array contains any elements at all
+ *
+ * browsers.empty? #=> false
+ *
+ * To check whether a particular item is included in the array
+ *
+ * browsers.include?('Konqueror') #=> false
+ *
+ * == Adding Items to Arrays
+ *
+ * Items can be added to the end of an array by using either #push or #<<
+ *
+ * arr = [1, 2, 3, 4]
+ * arr.push(5) #=> [1, 2, 3, 4, 5]
+ * arr << 6 #=> [1, 2, 3, 4, 5, 6]
+ *
+ * #unshift will add a new item to the beginning of an array.
+ *
+ * arr.unshift(0) #=> [0, 1, 2, 3, 4, 5, 6]
+ *
+ * With #insert you can add a new element to an array at any position.
+ *
+ * arr.insert(3, 'apple') #=> [0, 1, 2, 'apple', 3, 4, 5, 6]
+ *
+ * Using the #insert method, you can also insert multiple values at once:
+ *
+ * arr.insert(3, 'orange', 'pear', 'grapefruit')
+ * #=> [0, 1, 2, "orange", "pear", "grapefruit", "apple", 3, 4, 5, 6]
+ *
+ * == Removing Items from an Array
+ *
+ * The method #pop removes the last element in an array and returns it:
+ *
+ * arr = [1, 2, 3, 4, 5, 6]
+ * arr.pop #=> 6
+ * arr #=> [1, 2, 3, 4, 5]
+ *
+ * To retrieve and at the same time remove the first item, use #shift:
+ *
+ * arr.shift #=> 1
+ * arr #=> [2, 3, 4, 5]
+ *
+ * To delete an element at a particular index:
+ *
+ * arr.delete_at(2) #=> 4
+ * arr #=> [2, 3, 5]
+ *
+ * To delete a particular element anywhere in an array, use #delete:
+ *
+ * arr = [1, 2, 2, 3]
+ * arr.delete(2) #=> [1, 3]
+ *
+ * A useful method if you need to remove +nil+ values from an array is
+ * #compact:
+ *
+ * arr = ['foo', 0, nil, 'bar', 7, 'baz', nil]
+ * arr.compact #=> ['foo', 0, 'bar', 7, 'baz']
+ * arr #=> ['foo', 0, nil, 'bar', 7, 'baz', nil]
+ * arr.compact! #=> ['foo', 0, 'bar', 7, 'baz']
+ * arr #=> ['foo', 0, 'bar', 7, 'baz']
+ *
+ * Another common need is to remove duplicate elements from an array.
+ *
+ * It has the non-destructive #uniq, and destructive method #uniq!
+ *
+ * arr = [2, 5, 6, 556, 6, 6, 8, 9, 0, 123, 556]
+ * arr.uniq #=> [2, 5, 6, 556, 8, 9, 0, 123]
+ *
+ * == Iterating over Arrays
+ *
+ * Like all classes that include the Enumerable module, Array has an each
+ * method, which defines what elements should be iterated over and how. In
+ * case of Array's #each, all elements in the Array instance are yielded to
+ * the supplied block in sequence.
+ *
+ * Note that this operation leaves the array unchanged.
+ *
+ * arr = [1, 2, 3, 4, 5]
+ * arr.each { |a| print a -= 10, " " }
+ * # prints: -9 -8 -7 -6 -5
+ * #=> [1, 2, 3, 4, 5]
+ *
+ * Another sometimes useful iterator is #reverse_each which will iterate over
+ * the elements in the array in reverse order.
+ *
+ * words = %w[rats live on no evil star]
+ * str = ""
+ * words.reverse_each { |word| str += "#{word.reverse} " }
+ * str #=> "rats live on no evil star "
+ *
+ * The #map method can be used to create a new array based on the original
+ * array, but with the values modified by the supplied block:
+ *
+ * arr.map { |a| 2*a } #=> [2, 4, 6, 8, 10]
+ * arr #=> [1, 2, 3, 4, 5]
+ * arr.map! { |a| a**2 } #=> [1, 4, 9, 16, 25]
+ * arr #=> [1, 4, 9, 16, 25]
+ *
+ * == Selecting Items from an Array
+ *
+ * Elements can be selected from an array according to criteria defined in a
+ * block. The selection can happen in a destructive or a non-destructive
+ * manner. While the destructive operations will modify the array they were
+ * called on, the non-destructive methods usually return a new array with the
+ * selected elements, but leave the original array unchanged.
+ *
+ * === Non-destructive Selection
+ *
+ * arr = [1, 2, 3, 4, 5, 6]
+ * arr.select { |a| a > 3 } #=> [4, 5, 6]
+ * arr.reject { |a| a < 3 } #=> [4, 5, 6]
+ * arr.drop_while { |a| a < 4 } #=> [4, 5, 6]
+ * arr #=> [1, 2, 3, 4, 5, 6]
+ *
+ * === Destructive Selection
+ *
+ * #select! and #reject! are the corresponding destructive methods to #select
+ * and #reject
+ *
+ * Similar to #select vs. #reject, #delete_if and #keep_if have the exact
+ * opposite result when supplied with the same block:
+ *
+ * arr.delete_if { |a| a < 4 } #=> [4, 5, 6]
+ * arr #=> [4, 5, 6]
+ *
+ * arr = [1, 2, 3, 4, 5, 6]
+ * arr.keep_if { |a| a < 4 } #=> [1, 2, 3]
+ * arr #=> [1, 2, 3]
+ *
*/
void
-Init_Array()
+Init_Array(void)
{
+#undef rb_intern
+#define rb_intern(str) rb_intern_const(str)
+
rb_cArray = rb_define_class("Array", rb_cObject);
rb_include_module(rb_cArray, rb_mEnumerable);
- rb_define_alloc_func(rb_cArray, ary_alloc);
+ rb_define_alloc_func(rb_cArray, empty_ary_alloc);
rb_define_singleton_method(rb_cArray, "[]", rb_ary_s_create, -1);
+ rb_define_singleton_method(rb_cArray, "try_convert", rb_ary_s_try_convert, 1);
rb_define_method(rb_cArray, "initialize", rb_ary_initialize, -1);
rb_define_method(rb_cArray, "initialize_copy", rb_ary_replace, 1);
- rb_define_method(rb_cArray, "to_s", rb_ary_to_s, 0);
rb_define_method(rb_cArray, "inspect", rb_ary_inspect, 0);
+ rb_define_alias(rb_cArray, "to_s", "inspect");
rb_define_method(rb_cArray, "to_a", rb_ary_to_a, 0);
rb_define_method(rb_cArray, "to_ary", rb_ary_to_ary_m, 0);
rb_define_method(rb_cArray, "frozen?", rb_ary_frozen_p, 0);
@@ -2996,8 +5454,8 @@ Init_Array()
rb_define_method(rb_cArray, "concat", rb_ary_concat, 1);
rb_define_method(rb_cArray, "<<", rb_ary_push, 1);
rb_define_method(rb_cArray, "push", rb_ary_push_m, -1);
- rb_define_method(rb_cArray, "pop", rb_ary_pop, 0);
- rb_define_method(rb_cArray, "shift", rb_ary_shift, 0);
+ rb_define_method(rb_cArray, "pop", rb_ary_pop_m, -1);
+ rb_define_method(rb_cArray, "shift", rb_ary_shift_m, -1);
rb_define_method(rb_cArray, "unshift", rb_ary_unshift_m, -1);
rb_define_method(rb_cArray, "insert", rb_ary_insert, -1);
rb_define_method(rb_cArray, "each", rb_ary_each, 0);
@@ -3006,20 +5464,24 @@ Init_Array()
rb_define_method(rb_cArray, "length", rb_ary_length, 0);
rb_define_alias(rb_cArray, "size", "length");
rb_define_method(rb_cArray, "empty?", rb_ary_empty_p, 0);
- rb_define_method(rb_cArray, "index", rb_ary_index, 1);
- rb_define_method(rb_cArray, "rindex", rb_ary_rindex, 1);
- rb_define_method(rb_cArray, "indexes", rb_ary_indexes, -1);
- rb_define_method(rb_cArray, "indices", rb_ary_indexes, -1);
+ rb_define_method(rb_cArray, "find_index", rb_ary_index, -1);
+ rb_define_method(rb_cArray, "index", rb_ary_index, -1);
+ rb_define_method(rb_cArray, "rindex", rb_ary_rindex, -1);
rb_define_method(rb_cArray, "join", rb_ary_join_m, -1);
rb_define_method(rb_cArray, "reverse", rb_ary_reverse_m, 0);
rb_define_method(rb_cArray, "reverse!", rb_ary_reverse_bang, 0);
+ rb_define_method(rb_cArray, "rotate", rb_ary_rotate_m, -1);
+ rb_define_method(rb_cArray, "rotate!", rb_ary_rotate_bang, -1);
rb_define_method(rb_cArray, "sort", rb_ary_sort, 0);
rb_define_method(rb_cArray, "sort!", rb_ary_sort_bang, 0);
+ rb_define_method(rb_cArray, "sort_by!", rb_ary_sort_by_bang, 0);
rb_define_method(rb_cArray, "collect", rb_ary_collect, 0);
rb_define_method(rb_cArray, "collect!", rb_ary_collect_bang, 0);
rb_define_method(rb_cArray, "map", rb_ary_collect, 0);
rb_define_method(rb_cArray, "map!", rb_ary_collect_bang, 0);
rb_define_method(rb_cArray, "select", rb_ary_select, 0);
+ rb_define_method(rb_cArray, "select!", rb_ary_select_bang, 0);
+ rb_define_method(rb_cArray, "keep_if", rb_ary_keep_if, 0);
rb_define_method(rb_cArray, "values_at", rb_ary_values_at, -1);
rb_define_method(rb_cArray, "delete", rb_ary_delete, 1);
rb_define_method(rb_cArray, "delete_at", rb_ary_delete_at_m, 1);
@@ -3051,10 +5513,27 @@ Init_Array()
rb_define_method(rb_cArray, "uniq!", rb_ary_uniq_bang, 0);
rb_define_method(rb_cArray, "compact", rb_ary_compact, 0);
rb_define_method(rb_cArray, "compact!", rb_ary_compact_bang, 0);
- rb_define_method(rb_cArray, "flatten", rb_ary_flatten, 0);
- rb_define_method(rb_cArray, "flatten!", rb_ary_flatten_bang, 0);
- rb_define_method(rb_cArray, "nitems", rb_ary_nitems, 0);
+ rb_define_method(rb_cArray, "flatten", rb_ary_flatten, -1);
+ rb_define_method(rb_cArray, "flatten!", rb_ary_flatten_bang, -1);
+ rb_define_method(rb_cArray, "count", rb_ary_count, -1);
+ rb_define_method(rb_cArray, "shuffle!", rb_ary_shuffle_bang, -1);
+ rb_define_method(rb_cArray, "shuffle", rb_ary_shuffle, -1);
+ rb_define_method(rb_cArray, "sample", rb_ary_sample, -1);
+ rb_define_method(rb_cArray, "cycle", rb_ary_cycle, -1);
+ rb_define_method(rb_cArray, "permutation", rb_ary_permutation, -1);
+ rb_define_method(rb_cArray, "combination", rb_ary_combination, 1);
+ rb_define_method(rb_cArray, "repeated_permutation", rb_ary_repeated_permutation, 1);
+ rb_define_method(rb_cArray, "repeated_combination", rb_ary_repeated_combination, 1);
+ rb_define_method(rb_cArray, "product", rb_ary_product, -1);
+
+ rb_define_method(rb_cArray, "take", rb_ary_take, 1);
+ rb_define_method(rb_cArray, "take_while", rb_ary_take_while, 0);
+ rb_define_method(rb_cArray, "drop", rb_ary_drop, 1);
+ rb_define_method(rb_cArray, "drop_while", rb_ary_drop_while, 0);
+ rb_define_method(rb_cArray, "bsearch", rb_ary_bsearch, 0);
id_cmp = rb_intern("<=>");
- inspect_key = rb_intern("__inspect_key__");
+ sym_random = ID2SYM(rb_intern("random"));
+ id_div = rb_intern("div");
+ id_power = rb_intern("**");
}
diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub
index de7a2beeb8..1cd26a8643 100644
--- a/bcc32/Makefile.sub
+++ b/bcc32/Makefile.sub
@@ -3,9 +3,19 @@
SHELL = $(COMSPEC)
MKFILES = Makefile
+!ifndef MFLAGS
+MFLAGS=-
+!endif
+
#### Start of system configuration section. ####
+!ifndef OS
OS = bccwin32
-RT = $(OS)
+!endif
+!if !defined(RT)
+!error RT not defined. Retry from configure pass.
+!endif
+
+arch = $(ARCH)-$(OS)
## variables may be overridden by $(compile_dir)/Makefile
!ifndef srcdir
@@ -23,7 +33,7 @@ RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME:ruby=rubyw)
RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME)w
!endif
!ifndef RUBY_SO_NAME
-RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)
+RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY)
!endif
!ifndef icondirs
!ifdef ICONDIRS
@@ -36,7 +46,6 @@ iconinc=-I$(icondirs: = -I)
!endif
###############
-VPATH = $(srcdir):$(srcdir)/missing
.SUFFIXES: .y
!ifndef CC
@@ -49,15 +58,21 @@ CPP = cpp32
RC = brcc32
!endif
!ifndef YACC
-YACC = byacc
+YACC = bison
!endif
!ifndef AR
AR = tlib
!endif
+!ifndef BASERUBY
+BASERUBY = ruby
+!endif
PURIFY =
AUTOCONF = autoconf
+IFCHANGE = $(srcdir:/=\)\win32\ifchange.bat
RM = $(srcdir:/=\)\win32\rm.bat
+CP = copy > nul
+MV = move > nul
!if !defined(PROCESSOR_ARCHITECTURE)
PROCESSOR_ARCHITECTURE = x86
@@ -94,14 +109,11 @@ exec_prefix = $(prefix)
libdir = $(exec_prefix)/lib
!endif
!if !defined(datadir)
-datadir = /share
+datadir = $(prefix)/share
!endif
!ifndef EXTOUT
EXTOUT = .ext
!endif
-!ifndef RIDATADIR
-RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
-!endif
!ifndef TESTUI
TESTUI = console
!endif
@@ -109,13 +121,24 @@ TESTUI = console
TESTS =
!endif
!ifndef RDOCTARGET
-RDOCTARGET = install-nodoc
+RDOCTARGET = install-doc
!endif
OUTFLAG = -o
+COUTFLAG = -o
!ifndef CFLAGS
CFLAGS = -q -tWR -tWC $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) -w- -wsus -wcpt -wdup -wext -wrng -wrpt -wzdi
!endif
+!ifndef DEFS
+DEFS =
+!endif
+!ifndef CPPFLAGS
+CPPFLAGS =
+!endif
+CPPFLAGS = $(DEFS) $(CPPFLAGS)
+!ifndef CXXFLAGS
+CXXFLAGS = $(CFLAGS)
+!endif
!ifndef LDFLAGS
LDFLAGS = -S:$(STACK)
!endif
@@ -129,15 +152,15 @@ EXTLIBS =
MEMLIB =
!endif
LIBS = $(MEMLIB) cw32i.lib import32.lib ws2_32.lib $(EXTLIBS)
-MISSING = acosh.obj crypt.obj erf.obj win32.obj
+MISSING = acosh.obj cbrt.obj crypt.obj erf.obj lgamma_r.obj strlcat.obj strlcpy.obj tgamma.obj win32.obj
!ifndef STACK
STACK = 0x2000000
!endif
-XCFLAGS = -DRUBY_EXPORT -I. -I$(srcdir) -I$(srcdir)/missing
+XCFLAGS = -DRUBY_EXPORT -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) -I$(srcdir)/missing
-ARFLAGS = /a
+ARFLAGS = /a /p32
LD = ilink32 -q -Gn
LDSHARED = $(LD)
XLDFLAGS = -Tpe c0x32.obj
@@ -153,8 +176,8 @@ EXEEXT = .exe
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
WPROGRAM=$(RUBYW_INSTALL_NAME)$(EXEEXT)
RUBYDEF = $(RUBY_SO_NAME).def
-MINIRUBY = .\miniruby$(EXEEXT)
-RUNRUBY = .\ruby$(EXEEXT) "$(srcdir)/runruby.rb" --extout="$(EXTOUT)" --
+MINIRUBY = .\miniruby$(EXEEXT) -I$(srcdir)/lib $(MINIRUBYOPT)
+RUNRUBY = .\$(PROGRAM) -i"$(EXTOUT)/$(arch)" "$(srcdir)/runruby.rb" --extout="$(EXTOUT)" --
ORGLIBPATH = $(LIB)
@@ -164,30 +187,43 @@ LIBRUBY_A = $(RUBY_SO_NAME)-static.lib
LIBRUBY_SO = $(RUBY_SO_NAME).dll
LIBRUBY = $(RUBY_SO_NAME).lib
LIBRUBYARG = $(LIBRUBY)
+THREAD_MODEL = win32
PREP = miniruby$(EXEEXT)
OBJEXT = obj
+ASMEXT = asm
+
+INSTALLED_LIST= .installed.list
+
+MKMAIN_CMD = mkmain.bat
+
+SRC_FILE = $(<:\=/)
WINMAINOBJ = winmain.$(OBJEXT)
-MINIOBJS = dmydln.$(OBJEXT)
+ARCHMINIOBJS = dmydln.$(OBJEXT)
-.path.c = .;$(srcdir);$(srcdir)/win32;$(srcdir)/missing
-.path.h = .;$(srcdir);$(srcdir)/win32;$(srcdir)/missing
+arch_hdrdir = $(EXTOUT)/include/$(arch)
+hdrdir = $(srcdir)/include
+VPATH = $(arch_hdrdir)/ruby;$(hdrdir)/ruby;$(srcdir);$(srcdir)/enc;$(srcdir)/missing;$(srcdir)/win32
+
+.path.c = .;$(srcdir);$(srcdir)/enc;$(srcdir)/win32;$(srcdir)/missing
+.path.ci = $(srcdir)
+.path.inc = .;$(srcdir)
+.path.def = .;$(srcdir)
+.path.h = .;$(arch_hdrdir)/ruby;$(hdrdir)/ruby;$(srcdir);$(srcdir)/win32;$(srcdir)/missing
.path.y = $(srcdir)
.path. = $(srcdir)
.c.obj:
- $(CC) $(CFLAGS) $(XCFLAGS) -I. $(CPPFLAGS) -c $(<:/=\)
+ $(CC) $(CFLAGS) $(XCFLAGS) -I. $(CPPFLAGS) $(COUTFLAG)$@ -c $(<:/=\)
+
+.c.asm:
+ $(CC) $(CFLAGS) $(XCFLAGS) -I. $(CPPFLAGS) $(COUTFLAG)$@ -S $(<:\=/)
.rc.res:
$(RC) $(RFLAGS) -I. -I$(<D). $(iconinc) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $(<:/=\)
-.y.c:
- $(YACC) $(YFLAGS) $(<:\=/)
- sed -e "s!^ *extern char \*getenv();!/* & */!;s/^\(#.*\)y\.tab/\1parse/" y.tab.c > $(@F)
- @del y.tab.c
-
all: $(srcdir)/bcc32/Makefile.sub $(srcdir)/common.mk
ruby: $(PROGRAM)
@@ -195,32 +231,52 @@ rubyw: $(WPROGRAM)
!include $(srcdir)/common.mk
-PHONY: Makefile
+$(MKFILES): $(srcdir)/bcc32/Makefile.sub $(srcdir)/bcc32/configure.bat $(srcdir)/bcc32/setup.mak
+ $(COMSPEC) /C $(srcdir:/=\)\bcc32\configure.bat $(configure_args)
+ @echo $(MKFILES) should be updated, re-run $(MAKE).
+ @$(MAKE) > nul -q -f &&|
+PHONY: nul
+ @exit
+|
+
+PHONY: nul
+RUBY_CONFIG_H = $(arch_hdrdir)/ruby/config.h
CONFIG_H = ./.config.h.time
config: config.status
config.status: $(CONFIG_H)
+guard = INCLUDE_RUBY_CONFIG_H
+
$(CONFIG_H): $(MKFILES) $(srcdir)/bcc32/Makefile.sub
- @$(srcdir:/=\)\win32\ifchange.bat config.h &&|
+ @if not exist $(arch_hdrdir:/=\) md $(arch_hdrdir:/=\)
+ @if not exist $(arch_hdrdir:/=\)\ruby md $(arch_hdrdir:/=\)\ruby
+ @$(IFCHANGE) $(RUBY_CONFIG_H:/=\) &&|
+\#ifndef $(guard)
+\#define $(guard) 1
+\#define NO_BIG_INLINE 1
\#define HAVE_SYS_TYPES_H 1
\#define HAVE_SYS_STAT_H 1
\#define HAVE_STDLIB_H 1
\#define HAVE_STRING_H 1
\#define HAVE_MEMORY_H 1
+\#define HAVE_LONG_LONG 1
\#define HAVE_OFF_T 1
\#define SIZEOF_INT 4
\#define SIZEOF_SHORT 2
\#define SIZEOF_LONG 4
\#define SIZEOF_LONG_LONG 0
\#define SIZEOF___INT64 8
-\#define SIZEOF_OFF_T 4
+\#define SIZEOF_OFF_T 8
\#define SIZEOF_VOIDP 4
\#define SIZEOF_FLOAT 4
\#define SIZEOF_DOUBLE 8
\#define SIZEOF_TIME_T 4
+\#define SIZEOF_RLIM_T 0
+\#define SIZEOF_SIZE_T 4
+\#define SIZEOF_PTRDIFF_T 4
\#define HAVE_PROTOTYPES 1
\#define TOKEN_PASTE(x,y) x\#\#y
\#define HAVE_STDARG_PROTOTYPES 1
@@ -236,6 +292,32 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/bcc32/Makefile.sub
\#define rb_pid_t int
\#define HAVE_STRUCT_STAT_ST_RDEV 1
\#define HAVE_ST_RDEV 1
+!if $(BORLANDC) < 0x0580
+\#define int8_t signed char
+\#define uint8_t unsigned char
+\#define int16_t short
+\#define uint16_t unsigned short
+\#define int32_t int
+\#define uint32_t unsigned int
+\#define int64_t __int64
+\#define uint64_t unsigned __int64
+\#define ssize_t int
+!endif
+\#define HAVE_INT8_T 1
+\#define HAVE_UINT8_T 1
+\#define SIZEOF_INT8_T 1
+\#define HAVE_INT16_T 1
+\#define HAVE_UINT16_T 1
+\#define SIZEOF_INT32_T 2
+\#define HAVE_INT32_T 1
+\#define HAVE_UINT32_T 1
+\#define SIZEOF_INT32_T 4
+\#define HAVE_INT64_T 1
+\#define HAVE_UINT64_T 1
+\#define SIZEOF_INT64_T 8
+\#define HAVE_INTPTR_T 1
+\#define HAVE_UINTPTR_T 1
+\#define HAVE_SSIZE_T 1
\#define GETGROUPS_T int
\#define RETSIGTYPE void
\#define HAVE_ALLOCA 1
@@ -251,6 +333,8 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/bcc32/Makefile.sub
\#define HAVE_STRTOD 1
\#define HAVE_STRTOL 1
\#define HAVE_STRTOUL 1
+\#define HAVE_SNPRINTF 1
+\#define HAVE_VSNPRINTF 1
\#define HAVE_ISNAN 1
\#define HAVE_FINITE 1
\#define HAVE_HYPOT 1
@@ -258,7 +342,10 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/bcc32/Makefile.sub
\#define HAVE_WAITPID 1
\#define HAVE_FSYNC 1
\#define HAVE_GETCWD 1
-\#define HAVE_CHSIZE 1
+\#define HAVE_TRUNCATE 1
+\#define HAVE_FTRUNCATE 1
+\#define HAVE_FSEEKO 1
+\#define HAVE_FTELLO 1
\#define HAVE_TIMES 1
\#define HAVE_FCNTL 1
\#define HAVE_LINK 1
@@ -270,19 +357,20 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/bcc32/Makefile.sub
\#define RSHIFT(x,y) ((x)>>(int)y)
\#define FILE_COUNT level
\#define FILE_READPTR curp
+\#define RUBY_SETJMP(env) setjmp(env)
+\#define RUBY_LONGJMP(env,val) longjmp(env,val)
+\#define RUBY_JMP_BUF jmp_buf
\#define inline __inline
\#define NEED_IO_SEEK_BETWEEN_RW 1
\#define STACK_GROW_DIRECTION -1
\#define DEFAULT_KCODE KCODE_NONE
+\#define LOAD_RELATIVE 1
\#define DLEXT ".so"
-\#define RUBY_LIB "/lib/ruby/$(MAJOR).$(MINOR)"
-\#define RUBY_SITE_LIB "/lib/ruby/site_ruby"
-\#define RUBY_SITE_LIB2 "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)"
+\#define RUBY_LIB_PREFIX "/lib/ruby"
\#define RUBY_PLATFORM "$(ARCH)-$(OS)"
-\#define RUBY_ARCHLIB "/lib/ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
-\#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
+\#endif /* $(guard) */
|
- @exit > $@
+ @exit > $(@:/=\)
config.status: $(MKFILES) $(srcdir)/bcc32/Makefile.sub $(srcdir)/common.mk
@echo Creating $@
@@ -292,13 +380,14 @@ s,@SHELL@,$$(COMSPEC),;t t
s,@BUILD_FILE_SEPARATOR@,\,;t t
s,@PATH_SEPARATOR@,;,;t t
s,@CFLAGS@,$(CFLAGS),;t t
+s,@DEFS@,$(DEFS),;t t
s,@CPPFLAGS@,$(CPPFLAGS),;t t
s,@CXXFLAGS@,$(CXXFLAGS),;t t
s,@FFLAGS@,$(FFLAGS),;t t
s,@LDFLAGS@,,;t t
s,@LIBS@,$(LIBS),;t t
s,@exec_prefix@,$${prefix},;t t
-s,@prefix@,,;t t
+s,@prefix@,$(prefix),;t t
s,@program_transform_name@,s,,,,;t t
s,@bindir@,$${exec_prefix}/bin,;t t
s,@sbindir@,$${exec_prefix}/sbin,;t t
@@ -312,6 +401,7 @@ s,@includedir@,$${prefix}/include,;t t
s,@oldincludedir@,/usr/include,;t t
s,@infodir@,$${prefix}/info,;t t
s,@mandir@,$${prefix}/man,;t t
+s,@ridir@,$${prefix}/share/ri,;t t
s,@build@,$(CPU)-pc-$(OS),;t t
s,@build_alias@,$(CPU)-$(OS),;t t
s,@build_cpu@,$(CPU),;t t
@@ -329,17 +419,17 @@ s,@target_vendor@,pc,;t t
s,@target_os@,$(OS),;t t
s,@CC@,$(CC),;t t
s,@CPP@,cpp32,;t t
+s,@CXX@,$$(CC),;t t
+s,@LD@,$(LD),;t t
s,@YACC@,$(YACC),;t t
s,@RANLIB@,,;t t
s,@AR@,$(AR),;t t
s,@ARFLAGS@,$(ARFLAGS) ,;t t
s,@LN_S@,$(LN_S),;t t
-s,@SET_MAKE@,$(SET_MAKE),;t t
+s,@SET_MAKE@,MFLAGS = -$$(MAKEFLAGS),;t t
+s,@RM@,$$(top_srcdir:/=\)\win32\rm.bat,;t t
s,@CP@,copy > nul,;t t
-s,@INSTALL@,copy > nul,;t t
-s,@INSTALL_PROG@,$$(INSTALL),;t t
-s,@INSTALL_DATA@,$$(INSTALL),;t t
-s,@LIBOBJS@, acosh.obj crypt.obj erf.obj win32.obj,;t t
+s,@LIBOBJS@, $(MISSING),;t t
s,@ALLOCA@,$(ALLOCA),;t t
s,@DEFAULT_KCODE@,$(DEFAULT_KCODE),;t t
s,@EXEEXT@,.exe,;t t
@@ -379,23 +469,30 @@ s,@SOLIBS@,$(SOLIBS),;t t
s,@DLDLIBS@,$(DLDLIBS),;t t
s,@ENABLE_SHARED@,yes,;t t
s,@OUTFLAG@,$(OUTFLAG),;t t
+s,@COUTFLAG@,$(COUTFLAG),;t t
s,@CPPOUTFILE@,,;t t
s,@LIBPATHFLAG@, -L"%s",;t t
s,@RPATHFLAG@,,;t t
s,@LIBARG@,%s.lib,;t t
-s,@LINK_SO@,$$(LDSHARED) $$(DLDFLAGS) $$(LIBPATH) $$(OBJS), $$(@:/=\), nul, $$(LIBS) $$(LOCAL_LIBS), $$(DEFFILE), $$(RESFILE),;t t
-s,@COMPILE_C@,$$(CC) $$(INCFLAGS) $$(CFLAGS) $$(CPPFLAGS) -c $$(<:/=\),;t t
-s,@COMPILE_CXX@,$$(CXX) $$(INCFLAGS) $$(CXXFLAGS) $$(CPPFLAGS) -P -c $$(<:/=\),;t t
+s,@LINK_SO@,$$(LDSHARED) $$(DLDFLAGS) $$(LIBPATH) $$(OBJS:/=\), $$(@:/=\), nul, $$(LIBS) $$(LOCAL_LIBS), $$(DEFFILE:/=\), $$(RESFILE:/=\),;t t
+s,@COMPILE_C@,$$(CC) $$(INCFLAGS) $$(CFLAGS) $$(CPPFLAGS) $(COUTFLAG)$$(@) -c $$(<:/=\),;t t
+s,@COMPILE_CXX@,$$(CXX) $$(INCFLAGS) $$(CXXFLAGS) $$(CPPFLAGS) -P $(COUTFLAG)$$(@) -c $$(<:/=\),;t t
s,@COMPILE_RULES@,{$$(srcdir)}.%s{}.%s: {$$(topdir)}.%s{}.%s: {$$(hdrdir)}.%s{}.%s: .%s.%s:,;t t
s,@RULE_SUBST@,{.;$$(VPATH)}%s,;t t
s,@COMMON_LIBS@,m advapi32 avicap32 avifil32 cap comctl32 comdlg32 dlcapi gdi32 glu32 imagehlp imm32 inetmib1 kernel32 loadperf lsapi32 lz32 mapi32 mgmtapi mpr msacm32 msvfw32 nddeapi netapi32 ole32 oleaut32 oledlg olepro32 opengl32 pdh pkpd32 rasapi32 rasdlg rassapi rpcrt4 setupapi shell32 shfolder snmpapi sporder tapi32 url user32 vdmdbg version win32spl winmm wintrust wsock32,;t t
s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN WIN32,;t t
s,@COMMON_HEADERS@,winsock2.h windows.h,;t t
+s,@cleanlibs@,$$*.tds,;t t
+s,@cleanobjs@,$$*-$$(arch).def $$*.il? $$*.lib,;t t
s,@TRY_LINK@,$$(CC) -oconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(LIBPATH) $$(LDFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS),;t t
s,@EXPORT_PREFIX@,_,;t t
s,@arch@,$(ARCH)-$(OS),;t t
s,@sitearch@,$(ARCH)-$(OS),;t t
s,@sitedir@,$${prefix}/lib/ruby/site_ruby,;t t
+s,@vendordir@,$${prefix}/lib/ruby/vendor_ruby,;t t
+s,@rubyhdrdir@,$$(includedir)/ruby-$$(MAJOR).$$(MINOR).$$(TEENY),;t t
+s,@sitehdrdir@,$$(rubyhdrdir)/site_ruby,;t t
+s,@vendorhdrdir@,$$(rubyhdrdir)/vendor_ruby,;t t
s,@configure_args@,--enable-shared $(configure_args),;t t
s,@configure_input@,$$configure_input,;t t
s,@srcdir@,$(srcdir),;t t
@@ -404,7 +501,7 @@ s,@top_srcdir@,$(srcdir),;t t
miniruby$(EXEEXT):
@echo $(LIBS)
- $(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(MINIOBJS),$@,nul,$(LIBRUBY_A) $(LIBS)
+ $(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS:/=\) $(DMYEXT),$@,nul,$(LIBS)
$(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $(RUBY_INSTALL_NAME).res
$(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ),$@,nul,$(LIBRUBYARG) $(LIBS),,$(RUBY_INSTALL_NAME).res
@@ -421,6 +518,7 @@ $(LIBRUBY_A): $(OBJS) $(DMYEXT)
$(LIBRUBY_SO): $(LIBRUBY_A) $(DLDOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
@echo $(DLDOBJS)
+ @$(PRE_LIBRUBY_UPDATE)
$(LIBRUBY_LDSHARED) $(LIBRUBY_DLDFLAGS) $(DLDOBJS:/=\),$(LIBRUBY_SO),nul,$(LIBRUBY_A) $(LIBS),$(RUBYDEF),$(RUBY_SO_NAME).res
$(LIBRUBY): $(LIBRUBY_SO)
@@ -428,30 +526,51 @@ $(LIBRUBY): $(LIBRUBY_SO)
$(RUBYDEF): $(LIBRUBY_A) $(PREP)
$(MINIRUBY) $(srcdir)/bcc32/mkexports.rb -output=$@ -base=$(RUBY_SO_NAME) $(LIBRUBY_A)
-$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
+$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb $(srcdir)/revision.h $(srcdir)/win32/resource.rb
@$(MINIRUBY) $(srcdir)/win32/resource.rb \
-ruby_name=$(RUBY_INSTALL_NAME) \
-rubyw_name=$(RUBYW_INSTALL_NAME) \
-so_name=$(RUBY_SO_NAME) \
. $(icondirs) $(srcdir)/win32
-post-install-ext::
- $(MINIRUBY) -I$(srcdir)lib -rrbconfig -rfileutils \
- -e "FileUtils.rm_f(Dir[ARGV[0]+Config::CONFIG['archdir']+'/**/*.tds'])" "$(DESTDIR:\=/)"
+lex.c: {$(srcdir)}lex.c.blt
+ copy "$(?:/=\)" $@
+
+post-install-bin::
+ @$(NULLCMD)
+post-install-lib::
+ @$(NULLCMD)
+post-install-ext-comm::
+ @$(NULLCMD)
+post-install-ext-arch::
+ @$(NULLCMD)
+post-install-man::
+ @$(NULLCMD)
+post-install-doc::
+ @$(NULLCMD)
clean-local::
- @$(RM) ext\extinit.c ext\extinit.$(OBJEXT) *.tds *.il? $(RUBY_SO_NAME).lib
+ @$(RM) $(WINMAINOBJ) ext\extinit.c ext\extinit.$(OBJEXT) *.tds *.il? $(RUBY_SO_NAME).lib
@$(RM) $(RUBY_INSTALL_NAME).res $(RUBYW_INSTALL_NAME).res $(RUBY_SO_NAME).res
+ @$(RM) *.map *.pdb *.ilk *.exp $(RUBYDEF) ext\ripper\y.output
distclean-local::
@$(RM) ext\config.cache $(RBCONFIG:/=\)
- @$(RM) *.map *.pdb *.ilk *.exp $(RUBYDEF)
@$(RM) $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc
+clean-ext distclean-ext realclean-ext::
+ @for /R ext %I in (.) do @if exist %I\Makefile ( \
+ echo $(@:-ext=)ing %~nI & \
+ cd %I & \
+ $(MAKE) $(MFLAGS) $(@:-ext=) & \
+ cd %CD% \
+ )
+
ext/extinit.obj: ext/extinit.c $(SETUP)
- $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -o$@ -c ext/extinit.c
+ $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
main.$(OBJEXT): win32.h
+ascii.$(OBJEXT): win32.h
array.$(OBJEXT): win32.h
bignum.$(OBJEXT): win32.h
class.$(OBJEXT): win32.h
@@ -460,6 +579,7 @@ dir.$(OBJEXT): dir.h win32.h
dln.$(OBJEXT): win32.h
enum.$(OBJEXT): win32.h
error.$(OBJEXT): win32.h
+euc_jp.$(OBJEXT): win32.h
eval.$(OBJEXT): win32.h
file.$(OBJEXT): win32.h
gc.$(OBJEXT): win32.h
@@ -477,14 +597,21 @@ prec.$(OBJEXT): win32.h
random.$(OBJEXT): win32.h
range.$(OBJEXT): win32.h
re.$(OBJEXT): win32.h
-regex.$(OBJEXT): win32.h
+regcomp.$(OBJEXT): win32.h
+regenc.$(OBJEXT): win32.h
+regerror.$(OBJEXT): win32.h
+regexec.$(OBJEXT): win32.h
+reggnu.$(OBJEXT): win32.h
+regparse.$(OBJEXT): win32.h
ruby.$(OBJEXT): win32.h
signal.$(OBJEXT): win32.h
+sjis.$(OBJEXT): win32.h
sprintf.$(OBJEXT): win32.h
st.$(OBJEXT): win32.h
string.$(OBJEXT): win32.h
struct.$(OBJEXT): win32.h
time.$(OBJEXT): win32.h
+utf_8.$(OBJEXT): win32.h
util.$(OBJEXT): win32.h
variable.$(OBJEXT): win32.h
version.$(OBJEXT): win32.h
diff --git a/bcc32/README.bcc32 b/bcc32/README.bcc32
index c27a1261f1..cd33eec0a1 100644
--- a/bcc32/README.bcc32
+++ b/bcc32/README.bcc32
@@ -16,7 +16,7 @@
* ilink32
(3) If you want to build from CVS source, following commands are required.
- * byacc ((<URL:http://gnuwin32.sourceforge.net/packages/byacc.htm>))
+ * bison ((<URL:http://gnuwin32.sourceforge.net/packages/bison.htm>))
* sed ((<URL:http://gnuwin32.sourceforge.net/packages/sed.htm>))
(4) We strongly recommend to build ruby on C++Builder, to link following files.
@@ -30,7 +30,13 @@
== How to compile and install
(1) Execute bcc32\configure.bat on your build directory.
- ex. c:\ruby-1.6.7>bcc32\configure.bat
+ ex. c:\src\ruby> bcc32\configure.bat
+ You can specify the target platform as an argument.
+ For example, run `((%configure i686-bccwin32%))'
+ You can also specify the install directory.
+ For example, run `((%configure --prefix=<install_directory>%))'
+ Default of the install directory is /usr .
+ The default ((|<PLATFORM>|)) is `(({i386-bccwin32}))'.
(2) Change ((|RUBY_INSTALL_NAME|)) and ((|RUBY_SO_NAME|)) in (({Makefile}))
if you want to change the name of the executable files.
@@ -41,20 +47,7 @@
(4) Run `((%make test%))'
-(5) Run `((%make DESTDIR=<install_directory> install%))'
-
- This command will create following directories and install files onto them.
- * <install_directory>\bin
- * <install_directory>\lib
- * <install_directory>\lib\ruby
- * <install_directory>\lib\ruby\<MAJOR>.<MINOR>
- * <install_directory>\lib\ruby\<MAJOR>.<MINOR>\<PLATFORM>
- * <install_directory>\lib\ruby\site_ruby
- * <install_directory>\lib\ruby\site_ruby\<MAJOR>.<MINOR>
- * <install_directory>\lib\ruby\site_ruby\<MAJOR>.<MINOR>\<PLATFORM>
- * <install_directory>\man\man1
- If Ruby's version is `x.y.z', the ((|<MAJOR>|)) is `x' and the ((|<MINOR>|)) is `y'.
- The ((|<PLATFORM>|)) is usually `(({i586-bccwin32}))'.
+(5) Run `((%make install%))'
(6) Requires dynamic RTL (cc3250.dll on C++Builder5) and borlndmm.dll (If built with
usebormm.lib) to use installed binary. These files are ordinary in bcc32's bin
@@ -90,10 +83,10 @@ in Japanese, but you can download at least.
C:
cd \ruby
- bcc32\configure
+ bcc32\configure --prefix=/usr/local
make
make test
- make DESTDIR=/usr/local install
+ make install
* Build on the relative directory from the ruby source directory and CPU type
i386.
@@ -108,10 +101,10 @@ in Japanese, but you can download at least.
cd \ruby
mkdir bccwin32
cd bccwin32
- ..\bcc32\configure target i386-bccwin32
+ ..\bcc32\configure --prefix=/usr/local
make
make test
- make DESTDIR=/usr/local install
+ make install
* Build on the different drive.
@@ -122,10 +115,10 @@ in Japanese, but you can download at least.
D:
cd D:\build\ruby
- C:\src\ruby\bcc32\configure
+ C:\src\ruby\bcc32\configure --prefix=C:/usr/local
make
make test
- make DESTDIR=C:/usr/local install
+ make install
== Bugs
diff --git a/bcc32/configure.bat b/bcc32/configure.bat
index 123a3f23c8..8cdfc64b03 100755
--- a/bcc32/configure.bat
+++ b/bcc32/configure.bat
@@ -6,70 +6,120 @@
echo> ~tmp~.mak ####
echo>> ~tmp~.mak conf = %0
echo>> ~tmp~.mak $(conf:\=/): nul
-echo>> ~tmp~.mak @del ~tmp~.mak
+echo>> ~tmp~.mak @del ~setup~.mak
echo>> ~tmp~.mak @-$(MAKE) -l$(MAKEFLAGS) -f $(@D)setup.mak \
+if exist pathlist.tmp del pathlist.tmp
+if exist confargs.mk del confargs.mk
:loop
if "%1" == "" goto :end
if "%1" == "--prefix" goto :prefix
+if "%1" == "prefix" goto :prefix
if "%1" == "--srcdir" goto :srcdir
if "%1" == "srcdir" goto :srcdir
if "%1" == "--target" goto :target
if "%1" == "target" goto :target
if "%1" == "--with-static-linked-ext" goto :extstatic
if "%1" == "--program-suffix" goto :suffix
-if "%1" == "--program-name" goto :progname
+if "%1" == "RUBY_SUFFIX" goto :suffix
+if "%1" == "--program-name" goto :installname
+if "%1" == "--install-name" goto :installname
+if "%1" == "RUBY_INSTALL_NAME" goto :installname
+if "%1" == "--so-name" goto :soname
+if "%1" == "RUBY_SO_NAME" goto :soname
if "%1" == "--enable-install-doc" goto :enable-rdoc
if "%1" == "--disable-install-doc" goto :disable-rdoc
if "%1" == "--extout" goto :extout
+if "%1" == "EXTOUT" goto :extout
+if "%1" == "--with-baseruby" goto :baseruby
+if "%1" == "BASERUBY" goto :baseruby
+if "%1" == "--path" goto :path
if "%1" == "-h" goto :help
if "%1" == "--help" goto :help
- echo>> ~tmp~.mak "%1" \
+ echo>>confargs.tmp %1 \
shift
goto :loop
:srcdir
- echo>> ~tmp~.mak -D"srcdir=%2" \
+ echo>> ~tmp~.mak -Dsrcdir=%2 \
+ echo>>confargs.tmp --srcdir=%2 \
shift
shift
goto :loop
:prefix
- echo>> ~tmp~.mak -D"prefix=%2" \
+ echo>> ~tmp~.mak -Dprefix=%2 \
+ echo>>confargs.tmp %1=%2 \
shift
shift
goto :loop
:suffix
- echo>> ~tmp~.mak -D"RUBY_SUFFIX=%2" \
+ echo>>confargs.mk !ifndef RUBY_SUFFIX
+ echo>>confargs.mk RUBY_SUFFIX = %2
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1=%2 \
shift
shift
goto :loop
:installname
- echo>> ~tmp~.mak -D"RUBY_INSTALL_NAME=%2" \
+ echo>>confargs.mk !ifndef RUBY_INSTALL_NAME
+ echo>>confargs.mk RUBY_INSTALL_NAME = %2
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1=%2 \
shift
shift
goto :loop
:soname
- echo>> ~tmp~.mak -D"RUBY_SO_NAME=%2" \
+ echo>>confargs.mk !ifndef RUBY_SO_NAME
+ echo>>confargs.mk RUBY_SO_NAME = %2
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1=%2 \
shift
shift
goto :loop
:target
- echo>> ~tmp~.mak "%2" \
+ echo>> ~tmp~.mak %2 \
+ echo>>confargs.tmp --target=%2 \
shift
shift
goto :loop
:extstatic
- echo>> ~tmp~.mak -D"EXTSTATIC=static" \
+ echo>>confargs.mk !ifndef EXTSTATIC
+ echo>>confargs.mk EXTSTATIC = static
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1 \
shift
goto :loop
:enable-rdoc
- echo>> ~tmp~.mak -D"RDOCTARGET=install-doc" \
+ echo>>confargs.mk !ifndef RDOCTARGET
+ echo>>confargs.mk RDOCTARGET = install-doc
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1 \
shift
goto :loop
:disable-rdoc
- echo>> ~tmp~.mak -D"RDOCTARGET=install-nodoc" \
+ echo>>confargs.mk !ifndef RDOCTARGET
+ echo>>confargs.mk RDOCTARGET = install-nodoc
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1 \
shift
goto :loop
:extout
- echo>> ~tmp~.mak "EXTOUT=%2" \
+ echo>>confargs.mk !ifndef EXTOUT
+ echo>>confargs.mk EXTOUT = %2
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1=%2 \
+ shift
+ shift
+goto :loop
+:baseruby
+ echo>>confargs.mk !ifndef BASERUBY
+ echo>>confargs.mk BASERUBY = %2
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1=%2 \
+ shift
+ shift
+goto :loop
+:path
+ echo>>pathlist.tmp %2;\
+ echo>>confargs.tmp %1=%2 \
shift
shift
goto :loop
@@ -82,11 +132,32 @@ goto :loop
echo System types:
echo --target=TARGET configure for TARGET [i386-bccwin32]
echo Optional Package:
+ echo --with-baseruby=RUBY use RUBY as baseruby [ruby]
echo --with-static-linked-ext link external modules statically
echo --enable-install-doc install rdoc indexes during install
+ del *.tmp
del ~tmp~.mak
goto :exit
:end
-echo>> ~tmp~.mak bcc32dir="$(@D)"
-make -s -f ~tmp~.mak
+echo>> ~tmp~.mak -Dbcc32dir=$(@D)
+if not exist confargs.tmp goto :noconfargs
+ echo>>confargs.mk configure_args = \
+ type>>confargs.mk confargs.tmp
+ echo.>>confargs.mk
+ echo>>confargs.mk ####
+:noconfargs
+if not exist pathlist.tmp goto :nopathlist
+ echo>>confargs.mk pathlist = \
+ type>>confargs.mk pathlist.tmp
+ echo.>>confargs.mk
+ echo>>confargs.mk ####
+ echo>>confargs.mk PATH = $(pathlist:;=/bin;)$(PATH)
+ echo>>confargs.mk INCLUDE = $(pathlist:;=/include;)
+ echo>>confargs.mk LIB = $(pathlist:;=/lib;)
+:nopathlist
+if exist confargs.mk copy confargs.mk ~setup~.mak > nul
+type>>~setup~.mak ~tmp~.mak
+del *.tmp > nul
+del ~tmp~.mak > nul
+make -s -f ~setup~.mak
:exit
diff --git a/bcc32/mkexports.rb b/bcc32/mkexports.rb
index e34b441e2f..888ab2e2a6 100644..100755
--- a/bcc32/mkexports.rb
+++ b/bcc32/mkexports.rb
@@ -1,25 +1,26 @@
#!./miniruby -s
-SYM = {}
-STDIN.reopen(open("nul"))
-ARGV.each do |obj|
- IO.foreach("|tdump -q -oiPUBDEF -oiPUBD32 #{obj.tr('/', '\\')}") do |l|
- next unless /(?:PUBDEF|PUBD32)/ =~ l
- SYM[$1] = true if /'(.*?)'/ =~ l
+$:.unshift(File.expand_path("../..", __FILE__))
+require 'win32/mkexports'
+
+class Exports::Bcc < Exports
+ def forwarding(internal, export)
+ internal[/\A_?/]+export
end
-end
-exports = []
-if $name
- exports << "Name " + $name
-elsif $library
- exports << "Library " + $library
-end
-exports << "Description " + $description.dump if $description
-exports << "EXPORTS" << SYM.keys.sort
+ def each_line(objs, &block)
+ objs.each do |obj|
+ opt = /\.(?:so|dll)\z/i =~ obj ? "-ee" : "-oiPUBDEF -oiPUBD32"
+ IO.foreach("|tdump -q #{opt} #{obj.tr('/', '\\')} < nul", &block)
+ end
+ end
-if $output
- open($output, 'w') {|f| f.puts exports.join("\n")}
-else
- puts exports.join("\n")
+ def each_export(objs)
+ objdump(objs) do |l|
+ next unless /(?:PUBDEF|PUBD32|EXPORT)/ =~ l
+ yield $1 if /'(.*?)'/ =~ l
+ end
+ yield "_strcasecmp", "_stricmp"
+ yield "_strncasecmp", "_strnicmp"
+ end
end
diff --git a/bcc32/setup.mak b/bcc32/setup.mak
index b7a2539d0a..df2fd3c128 100644
--- a/bcc32/setup.mak
+++ b/bcc32/setup.mak
@@ -15,7 +15,7 @@ prefix = /usr
OS = bccwin32
RT = $(OS)
BANG = !
-APPEND = echo>>$(MAKEFILE)
+APPEND = echo.>>$(MAKEFILE)
!ifdef MAKEFILE
MAKE = $(MAKE) -f $(MAKEFILE)
!else
@@ -30,7 +30,9 @@ i586-$(OS): -prologue- -i586- -epilogue-
i686-$(OS): -prologue- -i686- -epilogue-
alpha-$(OS): -prologue- -alpha- -epilogue-
--prologue-: nul
+-prologue-: -basic-vars- -version- -system-vars-
+
+-basic-vars-: nul
@echo Creating $(MAKEFILE)
@type > $(MAKEFILE) &&|
\#\#\# Makefile for ruby $(OS) \#\#\#
@@ -40,36 +42,79 @@ $(BANG)endif
$(BANG)ifndef prefix
prefix = $(prefix:\=/)
$(BANG)endif
-$(BANG)ifndef EXTSTATIC
-EXTSTATIC = $(EXTSTATIC)
-$(BANG)endif
-!if defined(RDOCTARGET)
-$(BANG)ifndef RDOCTARGET
-RDOCTARGET = $(RDOCTARGET)
-$(BANG)endif
+$(BANG)if !defined(BASERUBY)
+!if defined(BASERUBY)
+BASERUBY = $(BASERUBY)
+!endif
+|
+!if !defined(BASERUBY)
+ @for %I in (ruby.exe) do @echo BASERUBY = "%~$$PATH:I" >> $(MAKEFILE)
!endif
-!if defined(EXTOUT)
-$(BANG)ifndef EXTOUT
-EXTOUT = $(EXTOUT)
+ @type >> $(MAKEFILE) &&|
$(BANG)endif
+|
+!if exist(confargs.mk)
+ @type confargs.mk >> $(MAKEFILE)
+ @del confargs.mk
!endif
+
+-system-vars-: -runtime- -bormm-
+
+-bormm-: nul
+ @-ilink32 -q -Gn -x usebormm.lib > nul
+ @-if exist usebormm.tds $(APPEND) MEMLIB = usebormm.lib
+ @if exist usebormm.* del usebormm.*
+
+-osname-: nul
+ @echo OS = >>$(MAKEFILE)
+
+-runtime-: nul
+ type > conftest.c &&|
+\#include <stdio.h>
+int main(){printf("");return 0;}
|
- @type > usebormm.bat &&|
-@echo off
-ilink32 -Gn -x usebormm.lib > nul
-if exist usebormm.tds echo MEMLIB = usebormm.lib
+ bcc32 conftest.c cw32i.lib > nul
+ tdump conftest.exe < nul > conftest.i
+ grep "^Imports from CC" conftest.i > conftest.c
+ cpp32 -P- -DFile=\# -DImports=RTNAME -Dfrom== conftest.c > nul
+ $(MAKE) > nul -DBANG=$(BANG) -f &&|
+-runtime-: nul
+$(BANG)include conftest.i
+RT = $$(RTNAME:.DLL=)
+OS = $$(RT:CC32=)
+-runtime-:
+ del conftest.*
+$(BANG)if "$$(OS)" == "50"
+ echo OS = bccwin32 >> $(MAKEFILE)
+$(BANG)else
+ echo OS = bccwin32_$$(OS) >> $(MAKEFILE)
+$(BANG)endif
|
- @usebormm.bat >> $(MAKEFILE)
- @del usebormm.*
+ @echo RT = $$(OS) >> $(MAKEFILE)
+-version-: nul
@cpp32 -I$(srcdir) -P- -o$(MAKEFILE) > nul &&|
+\#define RUBY_REVISION 0
\#include "version.h"
-MAJOR = RUBY_VERSION_MAJOR
-MINOR = RUBY_VERSION_MINOR
-TEENY = RUBY_VERSION_TEENY
+MAJOR = RUBY_API_VERSION_MAJOR
+MINOR = RUBY_API_VERSION_MINOR
+TEENY = RUBY_API_VERSION_TEENY
+
+BORLANDC = __BORLANDC__
|
- @type $(MAKEFILE).i >> $(MAKEFILE)
+ @$(MAKE) > nul -DBANG=$(BANG) -f &&,
+-version-: nul
+$(BANG)include $(MAKEFILE)
+$(BANG)include $(MAKEFILE).i
+-version-:
@del $(MAKEFILE).i
+ @type >> $(MAKEFILE) &&|
+MAJOR = $$(MAJOR)
+MINOR = $$(MINOR)
+TEENY = $$(TEENY)
+BORLANDC = $$(BORLANDC)
+|
+,
-generic-: nul
!if defined(PROCESSOR_ARCHITECTURE) || defined(PROCESSOR_LEVEL)
@@ -84,7 +129,6 @@ $(BANG)ifndef PROCESSOR_LEVEL
PROCESSOR_LEVEL = $(PROCESSOR_LEVEL)
$(BANG)endif
!endif
-
|
!endif
@@ -114,11 +158,14 @@ $(BANG)endif
@$(APPEND) PROCESSOR_LEVEL = 6
@$(APPEND) !endif
+-epilogue-: -encs-
+
+-encs-: nul
+ @$(MAKE) -f $(srcdir)/win32/enc-setup.mak srcdir="$(srcdir)" MAKEFILE=$(MAKEFILE)
+
-epilogue-: nul
@type >> $(MAKEFILE) &&|
-\# OS = $(OS)
-\# RT = $(RT)
\# RUBY_INSTALL_NAME = ruby
\# RUBY_SO_NAME = $$(RT)-$$(RUBY_INSTALL_NAME)$$(MAJOR)$$(MINOR)
\# CFLAGS = -q $$(DEBUGFLAGS) $$(OPTFLAGS) $$(PROCESSOR_FLAG) -w- -wsus -wcpt -wdup -wext -wrng -wrpt -wzdi
@@ -129,5 +176,4 @@ $(BANG)endif
\# EXTLIBS = cw32.lib import32.lib user32.lib kernel32.lib
$(BANG)include $$(srcdir)/bcc32/Makefile.sub
|
- @$(srcdir:/=\)\win32\rm.bat config.h config.status
@echo type "`$(MAKE)'" to make ruby for $(OS).
diff --git a/benchmark/bm_app_answer.rb b/benchmark/bm_app_answer.rb
new file mode 100644
index 0000000000..3cd8a8fd37
--- /dev/null
+++ b/benchmark/bm_app_answer.rb
@@ -0,0 +1,15 @@
+def ack(m, n)
+ if m == 0 then
+ n + 1
+ elsif n == 0 then
+ ack(m - 1, 1)
+ else
+ ack(m - 1, ack(m, n - 1))
+ end
+end
+
+def the_answer_to_life_the_universe_and_everything
+ (ack(3,7).to_s.split(//).inject(0){|s,x| s+x.to_i}.to_s + "2" ).to_i
+end
+
+answer = the_answer_to_life_the_universe_and_everything
diff --git a/benchmark/bm_app_erb.rb b/benchmark/bm_app_erb.rb
new file mode 100644
index 0000000000..77c66a7949
--- /dev/null
+++ b/benchmark/bm_app_erb.rb
@@ -0,0 +1,26 @@
+#
+# Create many HTML strings with ERB.
+#
+
+require 'erb'
+
+data = DATA.read
+max = 15_000
+title = "hello world!"
+content = "hello world!\n" * 10
+
+max.times{
+ ERB.new(data).result(binding)
+}
+
+__END__
+
+<html>
+ <head> <%= title %> </head>
+ <body>
+ <h1> <%= title %> </h1>
+ <p>
+ <%= content %>
+ </p>
+ </body>
+</html>
diff --git a/benchmark/bm_app_factorial.rb b/benchmark/bm_app_factorial.rb
new file mode 100644
index 0000000000..45f471dfdb
--- /dev/null
+++ b/benchmark/bm_app_factorial.rb
@@ -0,0 +1,11 @@
+def fact(n)
+ if(n > 1)
+ n * fact(n-1)
+ else
+ 1
+ end
+end
+
+100.times {
+ fact(5000)
+}
diff --git a/benchmark/bm_app_fib.rb b/benchmark/bm_app_fib.rb
new file mode 100644
index 0000000000..34a7b2e725
--- /dev/null
+++ b/benchmark/bm_app_fib.rb
@@ -0,0 +1,10 @@
+def fib n
+ if n < 3
+ 1
+ else
+ fib(n-1) + fib(n-2)
+ end
+end
+
+fib(34)
+
diff --git a/benchmark/bm_app_mandelbrot.rb b/benchmark/bm_app_mandelbrot.rb
new file mode 100644
index 0000000000..801b75e8e2
--- /dev/null
+++ b/benchmark/bm_app_mandelbrot.rb
@@ -0,0 +1,23 @@
+require 'complex'
+
+def mandelbrot? z
+ i = 0
+ while i<100
+ i += 1
+ z = z * z
+ return false if z.abs > 2
+ end
+ true
+end
+
+ary = []
+
+(0..1000).each{|dx|
+ (0..1000).each{|dy|
+ x = dx / 50.0
+ y = dy / 50.0
+ c = Complex(x, y)
+ ary << c if mandelbrot?(c)
+ }
+}
+
diff --git a/benchmark/bm_app_pentomino.rb b/benchmark/bm_app_pentomino.rb
new file mode 100644
index 0000000000..59c63f358e
--- /dev/null
+++ b/benchmark/bm_app_pentomino.rb
@@ -0,0 +1,259 @@
+#!/usr/local/bin/ruby
+# This program is contributed by Shin Nishiyama
+
+
+# modified by K.Sasada
+
+NP = 5
+ROW = 8 + NP
+COL = 8
+
+$p = []
+$b = []
+$no = 0
+
+def piece(n, a, nb)
+ nb.each{|x|
+ a[n] = x
+ if n == NP-1
+ $p << [a.sort]
+ else
+ nbc=nb.dup
+ [-ROW, -1, 1, ROW].each{|d|
+ if x+d > 0 and not a.include?(x+d) and not nbc.include?(x+d)
+ nbc << x+d
+ end
+ }
+ nbc.delete x
+ piece(n+1,a[0..n],nbc)
+ end
+ }
+end
+
+def kikaku(a)
+ a.collect {|x| x - a[0]}
+end
+def ud(a)
+ kikaku(a.collect {|x| ((x+NP)%ROW)-ROW*((x+NP)/ROW) }.sort)
+end
+def rl(a)
+ kikaku(a.collect {|x| ROW*((x+NP)/ROW)+ROW-((x+NP)%ROW)}.sort)
+end
+def xy(a)
+ kikaku(a.collect {|x| ROW*((x+NP)%ROW) + (x+NP)/ROW }.sort)
+end
+
+def mkpieces
+ piece(0,[],[0])
+ $p.each do |a|
+ a0 = a[0]
+ a[1] = ud(a0)
+ a[2] = rl(a0)
+ a[3] = ud(rl(a0))
+ a[4] = xy(a0)
+ a[5] = ud(xy(a0))
+ a[6] = rl(xy(a0))
+ a[7] = ud(rl(xy(a0)))
+ a.sort!
+ a.uniq!
+ end
+ $p.uniq!.sort! {|x,y| x[0] <=> y[0] }
+end
+
+def mkboard
+ (0...ROW*COL).each{|i|
+ if i % ROW >= ROW-NP
+ $b[i] = -2
+ else
+ $b[i] = -1
+ end
+ $b[3*ROW+3]=$b[3*ROW+4]=$b[4*ROW+3]=$b[4*ROW+4]=-2
+ }
+end
+
+def pboard
+ return # skip print
+ print "No. #$no\n"
+ (0...COL).each{|i|
+ print "|"
+ (0...ROW-NP).each{|j|
+ x = $b[i*ROW+j]
+ if x < 0
+ print "..|"
+ else
+ printf "%2d|",x+1
+ end
+ }
+ print "\n"
+ }
+ print "\n"
+end
+
+$pnum=[]
+def setpiece(a,pos)
+ if a.length == $p.length then
+ $no += 1
+ pboard
+ return
+ end
+ while $b[pos] != -1
+ pos += 1
+ end
+ ($pnum - a).each do |i|
+ $p[i].each do |x|
+ f = 0
+ x.each{|s|
+ if $b[pos+s] != -1
+ f=1
+ break
+ end
+ }
+ if f == 0 then
+ x.each{|s|
+ $b[pos+s] = i
+ }
+ a << i
+ setpiece(a.dup, pos)
+ a.pop
+ x.each{|s|
+ $b[pos+s] = -1
+ }
+ end
+ end
+ end
+end
+
+mkpieces
+mkboard
+$p[4] = [$p[4][0]]
+$pnum = (0...$p.length).to_a
+setpiece([],0)
+
+
+__END__
+
+# original
+
+NP = 5
+ROW = 8 + NP
+COL = 8
+
+$p = []
+$b = []
+$no = 0
+
+def piece(n,a,nb)
+ for x in nb
+ a[n] = x
+ if n == NP-1
+ $p << [a.sort]
+ else
+ nbc=nb.dup
+ for d in [-ROW, -1, 1, ROW]
+ if x+d > 0 and not a.include?(x+d) and not nbc.include?(x+d)
+ nbc << x+d
+ end
+ end
+ nbc.delete x
+ piece(n+1,a[0..n],nbc)
+ end
+ end
+end
+
+def kikaku(a)
+ a.collect {|x| x - a[0]}
+end
+def ud(a)
+ kikaku(a.collect {|x| ((x+NP)%ROW)-ROW*((x+NP)/ROW) }.sort)
+end
+def rl(a)
+ kikaku(a.collect {|x| ROW*((x+NP)/ROW)+ROW-((x+NP)%ROW)}.sort)
+end
+def xy(a)
+ kikaku(a.collect {|x| ROW*((x+NP)%ROW) + (x+NP)/ROW }.sort)
+end
+
+def mkpieces
+ piece(0,[],[0])
+ $p.each do |a|
+ a0 = a[0]
+ a[1] = ud(a0)
+ a[2] = rl(a0)
+ a[3] = ud(rl(a0))
+ a[4] = xy(a0)
+ a[5] = ud(xy(a0))
+ a[6] = rl(xy(a0))
+ a[7] = ud(rl(xy(a0)))
+ a.sort!
+ a.uniq!
+ end
+ $p.uniq!.sort! {|x,y| x[0] <=> y[0] }
+end
+
+def mkboard
+ for i in 0...ROW*COL
+ if i % ROW >= ROW-NP
+ $b[i] = -2
+ else
+ $b[i] = -1
+ end
+ $b[3*ROW+3]=$b[3*ROW+4]=$b[4*ROW+3]=$b[4*ROW+4]=-2
+ end
+end
+
+def pboard
+ print "No. #$no\n"
+ for i in 0...COL
+ print "|"
+ for j in 0...ROW-NP
+ x = $b[i*ROW+j]
+ if x < 0
+ print "..|"
+ else
+ printf "%2d|",x+1
+ end
+ end
+ print "\n"
+ end
+ print "\n"
+end
+
+$pnum=[]
+def setpiece(a,pos)
+ if a.length == $p.length then
+ $no += 1
+ pboard
+ return
+ end
+ while $b[pos] != -1
+ pos += 1
+ end
+ ($pnum - a).each do |i|
+ $p[i].each do |x|
+ f = 0
+ for s in x do
+ if $b[pos+s] != -1
+ f=1
+ break
+ end
+ end
+ if f == 0 then
+ for s in x do
+ $b[pos+s] = i
+ end
+ a << i
+ setpiece(a.dup, pos)
+ a.pop
+ for s in x do
+ $b[pos+s] = -1
+ end
+ end
+ end
+ end
+end
+
+mkpieces
+mkboard
+$p[4] = [$p[4][0]]
+$pnum = (0...$p.length).to_a
+setpiece([],0)
diff --git a/benchmark/bm_app_raise.rb b/benchmark/bm_app_raise.rb
new file mode 100644
index 0000000000..5db8f95d50
--- /dev/null
+++ b/benchmark/bm_app_raise.rb
@@ -0,0 +1,8 @@
+i = 0
+while i<300000
+ i += 1
+ begin
+ raise
+ rescue
+ end
+end
diff --git a/benchmark/bm_app_strconcat.rb b/benchmark/bm_app_strconcat.rb
new file mode 100644
index 0000000000..7eed7c1aed
--- /dev/null
+++ b/benchmark/bm_app_strconcat.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<2_000_000
+ "#{1+1} #{1+1} #{1+1}"
+ i += 1
+end
diff --git a/benchmark/bm_app_tak.rb b/benchmark/bm_app_tak.rb
new file mode 100644
index 0000000000..efe5380f4e
--- /dev/null
+++ b/benchmark/bm_app_tak.rb
@@ -0,0 +1,13 @@
+
+def tak x, y, z
+ unless y < x
+ z
+ else
+ tak( tak(x-1, y, z),
+ tak(y-1, z, x),
+ tak(z-1, x, y))
+ end
+end
+
+tak(18, 9, 0)
+
diff --git a/benchmark/bm_app_tarai.rb b/benchmark/bm_app_tarai.rb
new file mode 100644
index 0000000000..4c146f5ccf
--- /dev/null
+++ b/benchmark/bm_app_tarai.rb
@@ -0,0 +1,10 @@
+def tarai( x, y, z )
+ if x <= y
+ then y
+ else tarai(tarai(x-1, y, z),
+ tarai(y-1, z, x),
+ tarai(z-1, x, y))
+ end
+end
+
+tarai(12, 6, 0)
diff --git a/benchmark/bm_app_uri.rb b/benchmark/bm_app_uri.rb
new file mode 100644
index 0000000000..586edfd5dc
--- /dev/null
+++ b/benchmark/bm_app_uri.rb
@@ -0,0 +1,8 @@
+require 'uri'
+
+100_000.times{
+ uri = URI.parse('http://www.ruby-lang.org')
+ uri.scheme
+ uri.host
+ uri.port
+}
diff --git a/benchmark/bm_io_file_create.rb b/benchmark/bm_io_file_create.rb
new file mode 100644
index 0000000000..2f205c1333
--- /dev/null
+++ b/benchmark/bm_io_file_create.rb
@@ -0,0 +1,13 @@
+#
+# Create files
+#
+
+max = 200_000
+file = './tmpfile_of_bm_io_file_create'
+
+max.times{
+ f = open(file, 'w')
+ f.close#(true)
+}
+File.unlink(file)
+
diff --git a/benchmark/bm_io_file_read.rb b/benchmark/bm_io_file_read.rb
new file mode 100644
index 0000000000..b9e796ed30
--- /dev/null
+++ b/benchmark/bm_io_file_read.rb
@@ -0,0 +1,15 @@
+#
+# Seek and Read file.
+#
+
+require 'tempfile'
+
+max = 200_000
+str = "Hello world! " * 1000
+f = Tempfile.new('yarv-benchmark')
+f.write str
+
+max.times{
+ f.seek 0
+ f.read
+}
diff --git a/benchmark/bm_io_file_write.rb b/benchmark/bm_io_file_write.rb
new file mode 100644
index 0000000000..aa1be0e5fe
--- /dev/null
+++ b/benchmark/bm_io_file_write.rb
@@ -0,0 +1,14 @@
+#
+# Seek and Write file.
+#
+
+require 'tempfile'
+
+max = 200_000
+str = "Hello world! " * 1000
+f = Tempfile.new('yarv-benchmark')
+
+max.times{
+ f.seek 0
+ f.write str
+}
diff --git a/benchmark/bm_io_select.rb b/benchmark/bm_io_select.rb
new file mode 100644
index 0000000000..19248daeb1
--- /dev/null
+++ b/benchmark/bm_io_select.rb
@@ -0,0 +1,9 @@
+# IO.select performance
+
+w = [ IO.pipe[1] ];
+
+nr = 1000000
+nr.times {
+ IO.select nil, w
+}
+
diff --git a/benchmark/bm_io_select2.rb b/benchmark/bm_io_select2.rb
new file mode 100644
index 0000000000..10e37d71b2
--- /dev/null
+++ b/benchmark/bm_io_select2.rb
@@ -0,0 +1,22 @@
+# IO.select performance. worst case of single fd.
+
+ios = []
+nr = 1000000
+if defined?(Process::RLIMIT_NOFILE)
+ max = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
+else
+ max = 64
+end
+puts "max fd: #{max} (results not apparent with <= 1024 max fd)"
+
+((max / 2) - 10).times do
+ ios.concat IO.pipe
+end
+
+last = [ ios[-1] ]
+puts "last IO: #{last[0].inspect}"
+
+nr.times do
+ IO.select nil, last
+end
+
diff --git a/benchmark/bm_io_select3.rb b/benchmark/bm_io_select3.rb
new file mode 100644
index 0000000000..7d0ba1f092
--- /dev/null
+++ b/benchmark/bm_io_select3.rb
@@ -0,0 +1,21 @@
+# IO.select performance. a lot of fd
+
+ios = []
+nr = 100
+if defined?(Process::RLIMIT_NOFILE)
+ max = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
+else
+ max = 64
+end
+puts "max fd: #{max} (results not apparent with <= 1024 max fd)"
+
+(max - 10).times do
+ r, w = IO.pipe
+ r.close
+ ios.push w
+end
+
+nr.times do
+ IO.select nil, ios
+end
+
diff --git a/benchmark/bm_loop_for.rb b/benchmark/bm_loop_for.rb
new file mode 100644
index 0000000000..0fc4cc1511
--- /dev/null
+++ b/benchmark/bm_loop_for.rb
@@ -0,0 +1,3 @@
+for i in 1..30_000_000
+ #
+end
diff --git a/benchmark/bm_loop_generator.rb b/benchmark/bm_loop_generator.rb
new file mode 100644
index 0000000000..d3375c744c
--- /dev/null
+++ b/benchmark/bm_loop_generator.rb
@@ -0,0 +1,14 @@
+max = 600000
+
+if defined? Fiber
+ gen = (1..max).each
+ loop do
+ gen.next
+ end
+else
+ require 'generator'
+ gen = Generator.new((0..max))
+ while gen.next?
+ gen.next
+ end
+end
diff --git a/benchmark/bm_loop_times.rb b/benchmark/bm_loop_times.rb
new file mode 100644
index 0000000000..521f72ad1a
--- /dev/null
+++ b/benchmark/bm_loop_times.rb
@@ -0,0 +1 @@
+30_000_000.times{|e|}
diff --git a/benchmark/bm_loop_whileloop.rb b/benchmark/bm_loop_whileloop.rb
new file mode 100644
index 0000000000..0072822c06
--- /dev/null
+++ b/benchmark/bm_loop_whileloop.rb
@@ -0,0 +1,4 @@
+i = 0
+while i<30_000_000 # benchmark loop 1
+ i += 1
+end
diff --git a/benchmark/bm_loop_whileloop2.rb b/benchmark/bm_loop_whileloop2.rb
new file mode 100644
index 0000000000..47d02dffc4
--- /dev/null
+++ b/benchmark/bm_loop_whileloop2.rb
@@ -0,0 +1,4 @@
+i = 0
+while i< 6_000_000 # benchmark loop 2
+ i += 1
+end
diff --git a/benchmark/bm_so_ackermann.rb b/benchmark/bm_so_ackermann.rb
new file mode 100644
index 0000000000..7db5be9050
--- /dev/null
+++ b/benchmark/bm_so_ackermann.rb
@@ -0,0 +1,19 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: ackermann-ruby.code,v 1.4 2004/11/13 07:40:41 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+
+def ack(m, n)
+ if m == 0 then
+ n + 1
+ elsif n == 0 then
+ ack(m - 1, 1)
+ else
+ ack(m - 1, ack(m, n - 1))
+ end
+end
+
+NUM = 9
+ack(3, NUM)
+
+
diff --git a/benchmark/bm_so_array.rb b/benchmark/bm_so_array.rb
new file mode 100644
index 0000000000..2b8fce8f99
--- /dev/null
+++ b/benchmark/bm_so_array.rb
@@ -0,0 +1,23 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: ary-ruby.code,v 1.4 2004/11/13 07:41:27 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# with help from Paul Brannan and Mark Hubbart
+
+n = 9000 # Integer(ARGV.shift || 1)
+
+x = Array.new(n)
+y = Array.new(n, 0)
+
+n.times{|bi|
+ x[bi] = bi + 1
+}
+
+(0 .. 999).each do |e|
+ (n-1).step(0,-1) do |bi|
+ y[bi] += x.at(bi)
+ end
+end
+# puts "#{y.first} #{y.last}"
+
+
diff --git a/benchmark/bm_so_binary_trees.rb b/benchmark/bm_so_binary_trees.rb
new file mode 100644
index 0000000000..6a26465578
--- /dev/null
+++ b/benchmark/bm_so_binary_trees.rb
@@ -0,0 +1,57 @@
+# The Computer Language Shootout Benchmarks
+# http://shootout.alioth.debian.org
+#
+# contributed by Jesse Millikan
+
+# disable output
+def STDOUT.write_ *args
+end
+
+def item_check(tree)
+ if tree[0] == nil
+ tree[1]
+ else
+ tree[1] + item_check(tree[0]) - item_check(tree[2])
+ end
+end
+
+def bottom_up_tree(item, depth)
+ if depth > 0
+ item_item = 2 * item
+ depth -= 1
+ [bottom_up_tree(item_item - 1, depth), item, bottom_up_tree(item_item, depth)]
+ else
+ [nil, item, nil]
+ end
+end
+
+max_depth = 12 # 16 # ARGV[0].to_i
+min_depth = 4
+
+max_depth = min_depth + 2 if min_depth + 2 > max_depth
+
+stretch_depth = max_depth + 1
+stretch_tree = bottom_up_tree(0, stretch_depth)
+
+puts "stretch tree of depth #{stretch_depth}\t check: #{item_check(stretch_tree)}"
+stretch_tree = nil
+
+long_lived_tree = bottom_up_tree(0, max_depth)
+
+min_depth.step(max_depth + 1, 2) do |depth|
+ iterations = 2**(max_depth - depth + min_depth)
+
+ check = 0
+
+ for i in 1..iterations
+ temp_tree = bottom_up_tree(i, depth)
+ check += item_check(temp_tree)
+
+ temp_tree = bottom_up_tree(-i, depth)
+ check += item_check(temp_tree)
+ end
+
+ puts "#{iterations * 2}\t trees of depth #{depth}\t check: #{check}"
+end
+
+puts "long lived tree of depth #{max_depth}\t check: #{item_check(long_lived_tree)}"
diff --git a/benchmark/bm_so_concatenate.rb b/benchmark/bm_so_concatenate.rb
new file mode 100644
index 0000000000..873214de7c
--- /dev/null
+++ b/benchmark/bm_so_concatenate.rb
@@ -0,0 +1,18 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: strcat-ruby.code,v 1.4 2004/11/13 07:43:28 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# based on code from Aristarkh A Zagorodnikov and Dat Nguyen
+
+STUFF = "hello\n"
+i = 0
+while i<10
+ i += 1
+ hello = ''
+ 4_000_000.times do |e|
+ hello << STUFF
+ end
+end
+# puts hello.length
+
+
diff --git a/benchmark/bm_so_count_words.rb b/benchmark/bm_so_count_words.rb
new file mode 100644
index 0000000000..65f6337a4a
--- /dev/null
+++ b/benchmark/bm_so_count_words.rb
@@ -0,0 +1,19 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: wc-ruby.code,v 1.4 2004/11/13 07:43:32 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# with help from Paul Brannan
+
+input = open(File.join(File.dirname($0), 'wc.input'), 'rb')
+
+nl = nw = nc = 0
+while true
+ tmp = input.read(4096) or break
+ data = tmp << (input.gets || "")
+ nc += data.length
+ nl += data.count("\n")
+ ((data.strip! || data).tr!("\n", " ") || data).squeeze!
+ nw += data.count(" ") + 1
+end
+# STDERR.puts "#{nl} #{nw} #{nc}"
+
diff --git a/benchmark/bm_so_exception.rb b/benchmark/bm_so_exception.rb
new file mode 100644
index 0000000000..deb003a594
--- /dev/null
+++ b/benchmark/bm_so_exception.rb
@@ -0,0 +1,61 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: except-ruby.code,v 1.4 2004/11/13 07:41:33 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+
+$HI = 0
+$LO = 0
+NUM = 250000 # Integer(ARGV[0] || 1)
+
+
+class Lo_Exception < Exception
+ def initialize(num)
+ @value = num
+ end
+end
+
+class Hi_Exception < Exception
+ def initialize(num)
+ @value = num
+ end
+end
+
+def some_function(num)
+ begin
+ hi_function(num)
+ rescue
+ print "We shouldn't get here, exception is: #{$!.type}\n"
+ end
+end
+
+def hi_function(num)
+ begin
+ lo_function(num)
+ rescue Hi_Exception
+ $HI = $HI + 1
+ end
+end
+
+def lo_function(num)
+ begin
+ blowup(num)
+ rescue Lo_Exception
+ $LO = $LO + 1
+ end
+end
+
+def blowup(num)
+ if num % 2 == 0
+ raise Lo_Exception.new(num)
+ else
+ raise Hi_Exception.new(num)
+ end
+end
+
+
+i = 1
+max = NUM+1
+while i < max
+ i += 1
+ some_function(i+1)
+end
diff --git a/benchmark/bm_so_fannkuch.rb b/benchmark/bm_so_fannkuch.rb
new file mode 100644
index 0000000000..bac5ecd44c
--- /dev/null
+++ b/benchmark/bm_so_fannkuch.rb
@@ -0,0 +1,45 @@
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org/
+# Contributed by Sokolov Yura
+# Modified by Ryan Williams
+
+def fannkuch(n)
+ maxFlips, m, r, check = 0, n-1, n, 0
+ count = (1..n).to_a
+ perm = (1..n).to_a
+
+ while true
+ if check < 30
+ puts "#{perm}"
+ check += 1
+ end
+
+ while r != 1
+ count[r-1] = r
+ r -= 1
+ end
+
+ if perm[0] != 1 and perm[m] != n
+ perml = perm.clone #.dup
+ flips = 0
+ while (k = perml.first ) != 1
+ perml = perml.slice!(0, k).reverse + perml
+ flips += 1
+ end
+ maxFlips = flips if flips > maxFlips
+ end
+ while true
+ if r==n then return maxFlips end
+ perm.insert r,perm.shift
+ break if (count[r] -= 1) > 0
+ r += 1
+ end
+ end
+end
+
+def puts *args
+end
+
+N = 9 # (ARGV[0] || 1).to_i
+puts "Pfannkuchen(#{N}) = #{fannkuch(N)}"
+
diff --git a/benchmark/bm_so_fasta.rb b/benchmark/bm_so_fasta.rb
new file mode 100644
index 0000000000..3f759ba7ae
--- /dev/null
+++ b/benchmark/bm_so_fasta.rb
@@ -0,0 +1,81 @@
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org/
+# Contributed by Sokolov Yura
+
+$last = 42.0
+def gen_random (max,im=139968,ia=3877,ic=29573)
+ (max * ($last = ($last * ia + ic) % im)) / im
+end
+
+alu =
+ "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG"+
+ "GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA"+
+ "CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT"+
+ "ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA"+
+ "GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG"+
+ "AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC"+
+ "AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA"
+
+iub = [
+ ["a", 0.27],
+ ["c", 0.12],
+ ["g", 0.12],
+ ["t", 0.27],
+
+ ["B", 0.02],
+ ["D", 0.02],
+ ["H", 0.02],
+ ["K", 0.02],
+ ["M", 0.02],
+ ["N", 0.02],
+ ["R", 0.02],
+ ["S", 0.02],
+ ["V", 0.02],
+ ["W", 0.02],
+ ["Y", 0.02],
+]
+homosapiens = [
+ ["a", 0.3029549426680],
+ ["c", 0.1979883004921],
+ ["g", 0.1975473066391],
+ ["t", 0.3015094502008],
+]
+
+def make_repeat_fasta(id, desc, src, n)
+ puts ">#{id} #{desc}"
+ v = nil
+ width = 60
+ l = src.length
+ s = src * ((n / l) + 1)
+ s.slice!(n, l)
+ puts(s.scan(/.{1,#{width}}/).join("\n"))
+end
+
+def make_random_fasta(id, desc, table, n)
+ puts ">#{id} #{desc}"
+ rand, v = nil,nil
+ width = 60
+ chunk = 1 * width
+ prob = 0.0
+ table.each{|v| v[1]= (prob += v[1])}
+ for i in 1..(n/width)
+ puts((1..width).collect{
+ rand = gen_random(1.0)
+ table.find{|v| v[1]>rand}[0]
+ }.join)
+ end
+ if n%width != 0
+ puts((1..(n%width)).collect{
+ rand = gen_random(1.0)
+ table.find{|v| v[1]>rand}[0]
+ }.join)
+ end
+end
+
+
+n = (ARGV[0] or 250_000).to_i
+
+make_repeat_fasta('ONE', 'Homo sapiens alu', alu, n*2)
+make_random_fasta('TWO', 'IUB ambiguity codes', iub, n*3)
+make_random_fasta('THREE', 'Homo sapiens frequency', homosapiens, n*5)
+
diff --git a/benchmark/bm_so_k_nucleotide.rb b/benchmark/bm_so_k_nucleotide.rb
new file mode 100644
index 0000000000..dadab3e79c
--- /dev/null
+++ b/benchmark/bm_so_k_nucleotide.rb
@@ -0,0 +1,48 @@
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org
+#
+# contributed by jose fco. gonzalez
+# modified by Sokolov Yura
+
+seq = String.new
+
+def frecuency( seq,length )
+ n, table = seq.length - length + 1, Hash.new(0)
+ f, i = nil, nil
+ (0 ... length).each do |f|
+ (f ... n).step(length) do |i|
+ table[seq[i,length]] += 1
+ end
+ end
+ [n,table]
+
+end
+
+def sort_by_freq( seq,length )
+ n,table = frecuency( seq,length )
+ a, b, v = nil, nil, nil
+ table.sort{|a,b| b[1] <=> a[1]}.each do |v|
+ puts "%s %.3f" % [v[0].upcase,((v[1]*100).to_f/n)]
+ end
+ puts
+end
+
+def find_seq( seq,s )
+ n,table = frecuency( seq,s.length )
+ puts "#{table[s].to_s}\t#{s.upcase}"
+end
+
+input = open(File.join(File.dirname($0), 'fasta.output.100000'), 'rb')
+
+line = input.gets while line !~ /^>THREE/
+line = input.gets
+
+while (line !~ /^>/) & line do
+ seq << line.chomp
+ line = input.gets
+end
+
+[1,2].each {|i| sort_by_freq( seq,i ) }
+
+%w(ggt ggta ggtatt ggtattttaatt ggtattttaatttatagt).each{|s| find_seq( seq,s) }
+
diff --git a/benchmark/bm_so_lists.rb b/benchmark/bm_so_lists.rb
new file mode 100644
index 0000000000..e8f4a2a5f7
--- /dev/null
+++ b/benchmark/bm_so_lists.rb
@@ -0,0 +1,47 @@
+#from http://www.bagley.org/~doug/shootout/bench/lists/lists.ruby
+
+NUM = 300
+SIZE = 10000
+
+def test_lists()
+ # create a list of integers (Li1) from 1 to SIZE
+ li1 = (1..SIZE).to_a
+ # copy the list to li2 (not by individual items)
+ li2 = li1.dup
+ # remove each individual item from left side of li2 and
+ # append to right side of li3 (preserving order)
+ li3 = Array.new
+ while (not li2.empty?)
+ li3.push(li2.shift)
+ end
+ # li2 must now be empty
+ # remove each individual item from right side of li3 and
+ # append to right side of li2 (reversing list)
+ while (not li3.empty?)
+ li2.push(li3.pop)
+ end
+ # li3 must now be empty
+ # reverse li1 in place
+ li1.reverse!
+ # check that first item is now SIZE
+ if li1[0] != SIZE then
+ p "not SIZE"
+ 0
+ else
+ # compare li1 and li2 for equality
+ if li1 != li2 then
+ return(0)
+ else
+ # return the length of the list
+ li1.length
+ end
+ end
+end
+
+i = 0
+while i<NUM
+ i += 1
+ result = test_lists()
+end
+
+result
diff --git a/benchmark/bm_so_mandelbrot.rb b/benchmark/bm_so_mandelbrot.rb
new file mode 100644
index 0000000000..76331c64b8
--- /dev/null
+++ b/benchmark/bm_so_mandelbrot.rb
@@ -0,0 +1,57 @@
+# The Computer Language Benchmarks Game
+# http://shootout.alioth.debian.org/
+#
+# contributed by Karl von Laudermann
+# modified by Jeremy Echols
+
+size = 600 # ARGV[0].to_i
+
+puts "P4\n#{size} #{size}"
+
+ITER = 49 # Iterations - 1 for easy for..in looping
+LIMIT_SQUARED = 4.0 # Presquared limit
+
+byte_acc = 0
+bit_num = 0
+
+count_size = size - 1 # Precomputed size for easy for..in looping
+
+# For..in loops are faster than .upto, .downto, .times, etc.
+for y in 0..count_size
+ for x in 0..count_size
+ zr = 0.0
+ zi = 0.0
+ cr = (2.0*x/size)-1.5
+ ci = (2.0*y/size)-1.0
+ escape = false
+
+ # To make use of the for..in code, we use a dummy variable,
+ # like one would in C
+ for dummy in 0..ITER
+ tr = zr*zr - zi*zi + cr
+ ti = 2*zr*zi + ci
+ zr, zi = tr, ti
+
+ if (zr*zr+zi*zi) > LIMIT_SQUARED
+ escape = true
+ break
+ end
+ end
+
+ byte_acc = (byte_acc << 1) | (escape ? 0b0 : 0b1)
+ bit_num += 1
+
+ # Code is very similar for these cases, but using separate blocks
+ # ensures we skip the shifting when it's unnecessary, which is most cases.
+ if (bit_num == 8)
+ print byte_acc.chr
+ byte_acc = 0
+ bit_num = 0
+ elsif (x == count_size)
+ byte_acc <<= (8 - bit_num)
+ print byte_acc.chr
+ byte_acc = 0
+ bit_num = 0
+ end
+ end
+end
diff --git a/benchmark/bm_so_matrix.rb b/benchmark/bm_so_matrix.rb
new file mode 100644
index 0000000000..e2c5c8e559
--- /dev/null
+++ b/benchmark/bm_so_matrix.rb
@@ -0,0 +1,48 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: matrix-ruby.code,v 1.4 2004/11/13 07:42:14 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+
+n = 60 #Integer(ARGV.shift || 1)
+
+size = 40
+
+def mkmatrix(rows, cols)
+ count = 1
+ mx = Array.new(rows)
+ (0 .. (rows - 1)).each do |bi|
+ row = Array.new(cols, 0)
+ (0 .. (cols - 1)).each do |j|
+ row[j] = count
+ count += 1
+ end
+ mx[bi] = row
+ end
+ mx
+end
+
+def mmult(rows, cols, m1, m2)
+ m3 = Array.new(rows)
+ (0 .. (rows - 1)).each do |bi|
+ row = Array.new(cols, 0)
+ (0 .. (cols - 1)).each do |j|
+ val = 0
+ (0 .. (cols - 1)).each do |k|
+ val += m1.at(bi).at(k) * m2.at(k).at(j)
+ end
+ row[j] = val
+ end
+ m3[bi] = row
+ end
+ m3
+end
+
+m1 = mkmatrix(size, size)
+m2 = mkmatrix(size, size)
+mm = Array.new
+n.times do
+ mm = mmult(size, size, m1, m2)
+end
+# puts "#{mm[0][0]} #{mm[2][3]} #{mm[3][2]} #{mm[4][4]}"
+
+
diff --git a/benchmark/bm_so_meteor_contest.rb b/benchmark/bm_so_meteor_contest.rb
new file mode 100644
index 0000000000..99cf6a91cc
--- /dev/null
+++ b/benchmark/bm_so_meteor_contest.rb
@@ -0,0 +1,564 @@
+#!/usr/bin/env ruby
+#
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org
+# contributed by Kevin Barnes (Ruby novice)
+
+# PROGRAM: the main body is at the bottom.
+# 1) read about the problem here: http://www-128.ibm.com/developerworks/java/library/j-javaopt/
+# 2) see how I represent a board as a bitmask by reading the blank_board comments
+# 3) read as your mental paths take you
+
+def print *args
+end
+
+# class to represent all information about a particular rotation of a particular piece
+class Rotation
+ # an array (by location) containing a bit mask for how the piece maps at the given location.
+ # if the rotation is invalid at that location the mask will contain false
+ attr_reader :start_masks
+
+ # maps a direction to a relative location. these differ depending on whether it is an even or
+ # odd row being mapped from
+ @@rotation_even_adder = { :west => -1, :east => 1, :nw => -7, :ne => -6, :sw => 5, :se => 6 }
+ @@rotation_odd_adder = { :west => -1, :east => 1, :nw => -6, :ne => -5, :sw => 6, :se => 7 }
+
+ def initialize( directions )
+ @even_offsets, @odd_offsets = normalize_offsets( get_values( directions ))
+
+ @even_mask = mask_for_offsets( @even_offsets)
+ @odd_mask = mask_for_offsets( @odd_offsets)
+
+ @start_masks = Array.new(60)
+
+ # create the rotational masks by placing the base mask at the location and seeing if
+ # 1) it overlaps the boundries and 2) it produces a prunable board. if either of these
+ # is true the piece cannot be placed
+ 0.upto(59) do | offset |
+ mask = is_even(offset) ? (@even_mask << offset) : (@odd_mask << offset)
+ if (blank_board & mask == 0 && !prunable(blank_board | mask, 0, true)) then
+ imask = compute_required( mask, offset)
+ @start_masks[offset] = [ mask, imask, imask | mask ]
+ else
+ @start_masks[offset] = false
+ end
+ end
+ end
+
+ def compute_required( mask, offset )
+ board = blank_board
+ 0.upto(offset) { | i | board |= 1 << i }
+ board |= mask
+ return 0 if (!prunable(board | mask, offset))
+ board = flood_fill(board,58)
+ count = 0
+ imask = 0
+ 0.upto(59) do | i |
+ if (board[i] == 0) then
+ imask |= (1 << i)
+ count += 1
+ end
+ end
+ (count > 0 && count < 5) ? imask : 0
+ end
+
+ def flood_fill( board, location)
+ return board if (board[location] == 1)
+ board |= 1 << location
+ row, col = location.divmod(6)
+ board = flood_fill( board, location - 1) if (col > 0)
+ board = flood_fill( board, location + 1) if (col < 4)
+ if (row % 2 == 0) then
+ board = flood_fill( board, location - 7) if (col > 0 && row > 0)
+ board = flood_fill( board, location - 6) if (row > 0)
+ board = flood_fill( board, location + 6) if (row < 9)
+ board = flood_fill( board, location + 5) if (col > 0 && row < 9)
+ else
+ board = flood_fill( board, location - 5) if (col < 4 && row > 0)
+ board = flood_fill( board, location - 6) if (row > 0)
+ board = flood_fill( board, location + 6) if (row < 9)
+ board = flood_fill( board, location + 7) if (col < 4 && row < 9)
+ end
+ board
+ end
+
+ # given a location, produces a list of relative locations covered by the piece at this rotation
+ def offsets( location)
+ if is_even( location) then
+ @even_offsets.collect { | value | value + location }
+ else
+ @odd_offsets.collect { | value | value + location }
+ end
+ end
+
+ # returns a set of offsets relative to the top-left most piece of the rotation (by even or odd rows)
+ # this is hard to explain. imagine we have this partial board:
+ # 0 0 0 0 0 x [positions 0-5]
+ # 0 0 1 1 0 x [positions 6-11]
+ # 0 0 1 0 0 x [positions 12-17]
+ # 0 1 0 0 0 x [positions 18-23]
+ # 0 1 0 0 0 x [positions 24-29]
+ # 0 0 0 0 0 x [positions 30-35]
+ # ...
+ # The top-left of the piece is at position 8, the
+ # board would be passed as a set of positions (values array) containing [8,9,14,19,25] not necessarily in that
+ # sorted order. Since that array starts on an odd row, the offsets for an odd row are: [0,1,6,11,17] obtained
+ # by subtracting 8 from everything. Now imagine the piece shifted up and to the right so it's on an even row:
+ # 0 0 0 1 1 x [positions 0-5]
+ # 0 0 1 0 0 x [positions 6-11]
+ # 0 0 1 0 0 x [positions 12-17]
+ # 0 1 0 0 0 x [positions 18-23]
+ # 0 0 0 0 0 x [positions 24-29]
+ # 0 0 0 0 0 x [positions 30-35]
+ # ...
+ # Now the positions are [3,4,8,14,19] which after subtracting the lowest value (3) gives [0,1,5,11,16] thus, the
+ # offsets for this particular piece are (in even, odd order) [0,1,5,11,16],[0,1,6,11,17] which is what
+ # this function would return
+ def normalize_offsets( values)
+ min = values.min
+ even_min = is_even(min)
+ other_min = even_min ? min + 6 : min + 7
+ other_values = values.collect do | value |
+ if is_even(value) then
+ value + 6 - other_min
+ else
+ value + 7 - other_min
+ end
+ end
+ values.collect! { | value | value - min }
+
+ if even_min then
+ [values, other_values]
+ else
+ [other_values, values]
+ end
+ end
+
+ # produce a bitmask representation of an array of offset locations
+ def mask_for_offsets( offsets )
+ mask = 0
+ offsets.each { | value | mask = mask + ( 1 << value ) }
+ mask
+ end
+
+ # finds a "safe" position that a position as described by a list of directions can be placed
+ # without falling off any edge of the board. the values returned a location to place the first piece
+ # at so it will fit after making the described moves
+ def start_adjust( directions )
+ south = east = 0;
+ directions.each do | direction |
+ east += 1 if ( direction == :sw || direction == :nw || direction == :west )
+ south += 1 if ( direction == :nw || direction == :ne )
+ end
+ south * 6 + east
+ end
+
+ # given a set of directions places the piece (as defined by a set of directions) on the board at
+ # a location that will not take it off the edge
+ def get_values ( directions )
+ start = start_adjust(directions)
+ values = [ start ]
+ directions.each do | direction |
+ if (start % 12 >= 6) then
+ start += @@rotation_odd_adder[direction]
+ else
+ start += @@rotation_even_adder[direction]
+ end
+ values += [ start ]
+ end
+
+ # some moves take you back to an existing location, we'll strip duplicates
+ values.uniq
+ end
+end
+
+# describes a piece and caches information about its rotations to as to be efficient for iteration
+# ATTRIBUTES:
+# rotations -- all the rotations of the piece
+# type -- a numeic "name" of the piece
+# masks -- an array by location of all legal rotational masks (a n inner array) for that location
+# placed -- the mask that this piece was last placed at (not a location, but the actual mask used)
+class Piece
+ attr_reader :rotations, :type, :masks
+ attr_accessor :placed
+
+ # transform hashes that change one direction into another when you either flip or rotate a set of directions
+ @@flip_converter = { :west => :west, :east => :east, :nw => :sw, :ne => :se, :sw => :nw, :se => :ne }
+ @@rotate_converter = { :west => :nw, :east => :se, :nw => :ne, :ne => :east, :sw => :west, :se => :sw }
+
+ def initialize( directions, type )
+ @type = type
+ @rotations = Array.new();
+ @map = {}
+
+ generate_rotations( directions )
+ directions.collect! { | value | @@flip_converter[value] }
+ generate_rotations( directions )
+
+ # creates the masks AND a map that returns [location, rotation] for any given mask
+ # this is used when a board is found and we want to draw it, otherwise the map is unused
+ @masks = Array.new();
+ 0.upto(59) do | i |
+ even = true
+ @masks[i] = @rotations.collect do | rotation |
+ mask = rotation.start_masks[i]
+ @map[mask[0]] = [ i, rotation ] if (mask)
+ mask || nil
+ end
+ @masks[i].compact!
+ end
+ end
+
+ # rotates a set of directions through all six angles and adds a Rotation to the list for each one
+ def generate_rotations( directions )
+ 6.times do
+ rotations.push( Rotation.new(directions))
+ directions.collect! { | value | @@rotate_converter[value] }
+ end
+ end
+
+ # given a board string, adds this piece to the board at whatever location/rotation
+ # important: the outbound board string is 5 wide, the normal location notation is six wide (padded)
+ def fill_string( board_string)
+ location, rotation = @map[@placed]
+ rotation.offsets(location).each do | offset |
+ row, col = offset.divmod(6)
+ board_string[ row*5 + col, 1 ] = @type.to_s
+ end
+ end
+end
+
+# a blank bit board having this form:
+#
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 1 1 1 1 1 1
+#
+# where left lest significant bit is the top left and the most significant is the lower right
+# the actual board only consists of the 0 places, the 1 places are blockers to keep things from running
+# off the edges or bottom
+def blank_board
+ 0b111111100000100000100000100000100000100000100000100000100000100000
+end
+
+def full_board
+ 0b111111111111111111111111111111111111111111111111111111111111111111
+end
+
+# determines if a location (bit position) is in an even row
+def is_even( location)
+ (location % 12) < 6
+end
+
+# support function that create three utility maps:
+# $converter -- for each row an array that maps a five bit row (via array mapping)
+# to the a a five bit representation of the bits below it
+# $bit_count -- maps a five bit row (via array mapping) to the number of 1s in the row
+# @@new_regions -- maps a five bit row (via array mapping) to an array of "region" arrays
+# a region array has three values the first is a mask of bits in the region,
+# the second is the count of those bits and the third is identical to the first
+# examples:
+# 0b10010 => [ 0b01100, 2, 0b01100 ], [ 0b00001, 1, 0b00001]
+# 0b01010 => [ 0b10000, 1, 0b10000 ], [ 0b00100, 1, 0b00100 ], [ 0b00001, 1, 0b00001]
+# 0b10001 => [ 0b01110, 3, 0b01110 ]
+def create_collector_support
+ odd_map = [0b11, 0b110, 0b1100, 0b11000, 0b10000]
+ even_map = [0b1, 0b11, 0b110, 0b1100, 0b11000]
+
+ all_odds = Array.new(0b100000)
+ all_evens = Array.new(0b100000)
+ bit_counts = Array.new(0b100000)
+ new_regions = Array.new(0b100000)
+ 0.upto(0b11111) do | i |
+ bit_count = odd = even = 0
+ 0.upto(4) do | bit |
+ if (i[bit] == 1) then
+ bit_count += 1
+ odd |= odd_map[bit]
+ even |= even_map[bit]
+ end
+ end
+ all_odds[i] = odd
+ all_evens[i] = even
+ bit_counts[i] = bit_count
+ new_regions[i] = create_regions( i)
+ end
+
+ $converter = []
+ 10.times { | row | $converter.push((row % 2 == 0) ? all_evens : all_odds) }
+ $bit_counts = bit_counts
+ $regions = new_regions.collect { | set | set.collect { | value | [ value, bit_counts[value], value] } }
+end
+
+# determines if a board is punable, meaning that there is no possibility that it
+# can be filled up with pieces. A board is prunable if there is a grouping of unfilled spaces
+# that are not a multiple of five. The following board is an example of a prunable board:
+# 0 0 1 0 0
+# 0 1 0 0 0
+# 1 1 0 0 0
+# 0 1 0 0 0
+# 0 0 0 0 0
+# ...
+#
+# This board is prunable because the top left corner is only 3 bits in area, no piece will ever fit it
+# parameters:
+# board -- an initial bit board (6 bit padded rows, see blank_board for format)
+# location -- starting location, everything above and to the left is already full
+# slotting -- set to true only when testing initial pieces, when filling normally
+# additional assumptions are possible
+#
+# Algorithm:
+# The algorithm starts at the top row (as determined by location) and iterates a row at a time
+# maintainng counts of active open areas (kept in the collector array) each collector contains
+# three values at the start of an iteration:
+# 0: mask of bits that would be adjacent to the collector in this row
+# 1: the number of bits collected so far
+# 2: a scratch space starting as zero, but used during the computation to represent
+# the empty bits in the new row that are adjacent (position 0)
+# The exact procedure is described in-code
+def prunable( board, location, slotting = false)
+ collectors = []
+ # loop accross the rows
+ (location / 6).to_i.upto(9) do | row_on |
+ # obtain a set of regions representing the bits of the curent row.
+ regions = $regions[(board >> (row_on * 6)) & 0b11111]
+ converter = $converter[row_on]
+
+ # track the number of collectors at the start of the cycle so that
+ # we don't compute against newly created collectors, only existing collectors
+ initial_collector_count = collectors.length
+
+ # loop against the regions. For each region of the row
+ # we will see if it connects to one or more existing collectors.
+ # if it connects to 1 collector, the bits from the region are added to the
+ # bits of the collector and the mask is placed in collector[2]
+ # If the region overlaps more than one collector then all the collectors
+ # it overlaps with are merged into the first one (the others are set to nil in the array)
+ # if NO collectors are found then the region is copied as a new collector
+ regions.each do | region |
+ collector_found = nil
+ region_mask = region[2]
+ initial_collector_count.times do | collector_num |
+ collector = collectors[collector_num]
+ if (collector) then
+ collector_mask = collector[0]
+ if (collector_mask & region_mask != 0) then
+ if (collector_found) then
+ collector_found[0] |= collector_mask
+ collector_found[1] += collector[1]
+ collector_found[2] |= collector[2]
+ collectors[collector_num] = nil
+ else
+ collector_found = collector
+ collector[1] += region[1]
+ collector[2] |= region_mask
+ end
+ end
+ end
+ end
+ if (collector_found == nil) then
+ collectors.push(Array.new(region))
+ end
+ end
+
+ # check the existing collectors, if any collector overlapped no bits in the region its [2] value will
+ # be zero. The size of any such reaason is tested if it is not a muliple of five true is returned since
+ # the board is prunable. if it is a multiple of five it is removed.
+ # Collector that are still active have a new adjacent value [0] set based n the matched bits
+ # and have [2] cleared out for the next cycle.
+ collectors.length.times do | collector_num |
+ collector = collectors[collector_num]
+ if (collector) then
+ if (collector[2] == 0) then
+ return true if (collector[1] % 5 != 0)
+ collectors[collector_num] = nil
+ else
+ # if a collector matches all bits in the row then we can return unprunable early for the
+ # follwing reasons:
+ # 1) there can be no more unavailable bits bince we fill from the top left downward
+ # 2) all previous regions have been closed or joined so only this region can fail
+ # 3) this region must be good since there can never be only 1 region that is nuot
+ # a multiple of five
+ # this rule only applies when filling normally, so we ignore the rule if we are "slotting"
+ # in pieces to see what configurations work for them (the only other time this algorithm is used).
+ return false if (collector[2] == 0b11111 && !slotting)
+ collector[0] = converter[collector[2]]
+ collector[2] = 0
+ end
+ end
+ end
+
+ # get rid of all the empty converters for the next round
+ collectors.compact!
+ end
+ return false if (collectors.length <= 1) # 1 collector or less and the region is fine
+ collectors.any? { | collector | (collector[1] % 5) != 0 } # more than 1 and we test them all for bad size
+end
+
+# creates a region given a row mask. see prunable for what a "region" is
+def create_regions( value )
+ regions = []
+ cur_region = 0
+ 5.times do | bit |
+ if (value[bit] == 0) then
+ cur_region |= 1 << bit
+ else
+ if (cur_region != 0 ) then
+ regions.push( cur_region)
+ cur_region = 0;
+ end
+ end
+ end
+ regions.push(cur_region) if (cur_region != 0)
+ regions
+end
+
+# find up to the counted number of solutions (or all solutions) and prints the final result
+def find_all
+ find_top( 1)
+ find_top( 0)
+ print_results
+end
+
+# show the board
+def print_results
+ print "#{@boards_found} solutions found\n\n"
+ print_full_board( @min_board)
+ print "\n"
+ print_full_board( @max_board)
+ print "\n"
+end
+
+# finds solutions. This special version of the main function is only used for the top level
+# the reason for it is basically to force a particular ordering on how the rotations are tested for
+# the first piece. It is called twice, first looking for placements of the odd rotations and then
+# looking for placements of the even locations.
+#
+# WHY?
+# Since any found solution has an inverse we want to maximize finding solutions that are not already found
+# as an inverse. The inverse will ALWAYS be 3 one of the piece configurations that is exactly 3 rotations away
+# (an odd number). Checking even vs odd then produces a higher probability of finding more pieces earlier
+# in the cycle. We still need to keep checking all the permutations, but our probability of finding one will
+# diminsh over time. Since we are TOLD how many to search for this lets us exit before checking all pieces
+# this bennifit is very great when seeking small numbers of solutions and is 0 when looking for more than the
+# maximum number
+def find_top( rotation_skip)
+ board = blank_board
+ (@pieces.length-1).times do
+ piece = @pieces.shift
+ piece.masks[0].each do | mask, imask, cmask |
+ if ((rotation_skip += 1) % 2 == 0) then
+ piece.placed = mask
+ find( 1, 1, board | mask)
+ end
+ end
+ @pieces.push(piece)
+ end
+ piece = @pieces.shift
+ @pieces.push(piece)
+end
+
+# the normail find routine, iterates through the available pieces, checks all rotations at the current location
+# and adds any boards found. depth is acheived via recursion. the overall approach is described
+# here: http://www-128.ibm.com/developerworks/java/library/j-javaopt/
+# parameters:
+# start_location -- where to start looking for place for the next piece at
+# placed -- number of pieces placed
+# board -- current state of the board
+#
+# see in-code comments
+def find( start_location, placed, board)
+ # find the next location to place a piece by looking for an empty bit
+ while board[start_location] == 1
+ start_location += 1
+ end
+
+ @pieces.length.times do
+ piece = @pieces.shift
+ piece.masks[start_location].each do | mask, imask, cmask |
+ if ( board & cmask == imask) then
+ piece.placed = mask
+ if (placed == 9) then
+ add_board
+ else
+ find( start_location + 1, placed + 1, board | mask)
+ end
+ end
+ end
+ @pieces.push(piece)
+ end
+end
+
+# print the board
+def print_full_board( board_string)
+ 10.times do | row |
+ print " " if (row % 2 == 1)
+ 5.times do | col |
+ print "#{board_string[row*5 + col,1]} "
+ end
+ print "\n"
+ end
+end
+
+# when a board is found we "draw it" into a string and then flip that string, adding both to
+# the list (hash) of solutions if they are unique.
+def add_board
+ board_string = "99999999999999999999999999999999999999999999999999"
+ @all_pieces.each { | piece | piece.fill_string( board_string ) }
+ save( board_string)
+ save( board_string.reverse)
+end
+
+# adds a board string to the list (if new) and updates the current best/worst board
+def save( board_string)
+ if (@all_boards[board_string] == nil) then
+ @min_board = board_string if (board_string < @min_board)
+ @max_board = board_string if (board_string > @max_board)
+ @all_boards.store(board_string,true)
+ @boards_found += 1
+
+ # the exit motif is a time saver. Ideally the function should return, but those tests
+ # take noticable time (performance).
+ if (@boards_found == @stop_count) then
+ print_results
+ exit(0)
+ end
+ end
+end
+
+
+##
+## MAIN BODY :)
+##
+create_collector_support
+@pieces = [
+ Piece.new( [ :nw, :ne, :east, :east ], 2),
+ Piece.new( [ :ne, :se, :east, :ne ], 7),
+ Piece.new( [ :ne, :east, :ne, :nw ], 1),
+ Piece.new( [ :east, :sw, :sw, :se ], 6),
+ Piece.new( [ :east, :ne, :se, :ne ], 5),
+ Piece.new( [ :east, :east, :east, :se ], 0),
+ Piece.new( [ :ne, :nw, :se, :east, :se ], 4),
+ Piece.new( [ :se, :se, :se, :west ], 9),
+ Piece.new( [ :se, :se, :east, :se ], 8),
+ Piece.new( [ :east, :east, :sw, :se ], 3)
+ ];
+
+@all_pieces = Array.new( @pieces)
+
+@min_board = "99999999999999999999999999999999999999999999999999"
+@max_board = "00000000000000000000000000000000000000000000000000"
+@stop_count = ARGV[0].to_i || 2089
+@all_boards = {}
+@boards_found = 0
+
+find_all ######## DO IT!!!
+
diff --git a/benchmark/bm_so_nbody.rb b/benchmark/bm_so_nbody.rb
new file mode 100644
index 0000000000..d6c5bb9e61
--- /dev/null
+++ b/benchmark/bm_so_nbody.rb
@@ -0,0 +1,148 @@
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org
+#
+# Optimized for Ruby by Jesse Millikan
+# From version ported by Michael Neumann from the C gcc version,
+# which was written by Christoph Bauer.
+
+SOLAR_MASS = 4 * Math::PI**2
+DAYS_PER_YEAR = 365.24
+
+def _puts *args
+end
+
+class Planet
+ attr_accessor :x, :y, :z, :vx, :vy, :vz, :mass
+
+ def initialize(x, y, z, vx, vy, vz, mass)
+ @x, @y, @z = x, y, z
+ @vx, @vy, @vz = vx * DAYS_PER_YEAR, vy * DAYS_PER_YEAR, vz * DAYS_PER_YEAR
+ @mass = mass * SOLAR_MASS
+ end
+
+ def move_from_i(bodies, nbodies, dt, i)
+ while i < nbodies
+ b2 = bodies[i]
+ dx = @x - b2.x
+ dy = @y - b2.y
+ dz = @z - b2.z
+
+ distance = Math.sqrt(dx * dx + dy * dy + dz * dz)
+ mag = dt / (distance * distance * distance)
+ b_mass_mag, b2_mass_mag = @mass * mag, b2.mass * mag
+
+ @vx -= dx * b2_mass_mag
+ @vy -= dy * b2_mass_mag
+ @vz -= dz * b2_mass_mag
+ b2.vx += dx * b_mass_mag
+ b2.vy += dy * b_mass_mag
+ b2.vz += dz * b_mass_mag
+ i += 1
+ end
+
+ @x += dt * @vx
+ @y += dt * @vy
+ @z += dt * @vz
+ end
+end
+
+def energy(bodies)
+ e = 0.0
+ nbodies = bodies.size
+
+ for i in 0 ... nbodies
+ b = bodies[i]
+ e += 0.5 * b.mass * (b.vx * b.vx + b.vy * b.vy + b.vz * b.vz)
+ for j in (i + 1) ... nbodies
+ b2 = bodies[j]
+ dx = b.x - b2.x
+ dy = b.y - b2.y
+ dz = b.z - b2.z
+ distance = Math.sqrt(dx * dx + dy * dy + dz * dz)
+ e -= (b.mass * b2.mass) / distance
+ end
+ end
+ e
+end
+
+def offset_momentum(bodies)
+ px, py, pz = 0.0, 0.0, 0.0
+
+ for b in bodies
+ m = b.mass
+ px += b.vx * m
+ py += b.vy * m
+ pz += b.vz * m
+ end
+
+ b = bodies[0]
+ b.vx = - px / SOLAR_MASS
+ b.vy = - py / SOLAR_MASS
+ b.vz = - pz / SOLAR_MASS
+end
+
+BODIES = [
+ # sun
+ Planet.new(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0),
+
+ # jupiter
+ Planet.new(
+ 4.84143144246472090e+00,
+ -1.16032004402742839e+00,
+ -1.03622044471123109e-01,
+ 1.66007664274403694e-03,
+ 7.69901118419740425e-03,
+ -6.90460016972063023e-05,
+ 9.54791938424326609e-04),
+
+ # saturn
+ Planet.new(
+ 8.34336671824457987e+00,
+ 4.12479856412430479e+00,
+ -4.03523417114321381e-01,
+ -2.76742510726862411e-03,
+ 4.99852801234917238e-03,
+ 2.30417297573763929e-05,
+ 2.85885980666130812e-04),
+
+ # uranus
+ Planet.new(
+ 1.28943695621391310e+01,
+ -1.51111514016986312e+01,
+ -2.23307578892655734e-01,
+ 2.96460137564761618e-03,
+ 2.37847173959480950e-03,
+ -2.96589568540237556e-05,
+ 4.36624404335156298e-05),
+
+ # neptune
+ Planet.new(
+ 1.53796971148509165e+01,
+ -2.59193146099879641e+01,
+ 1.79258772950371181e-01,
+ 2.68067772490389322e-03,
+ 1.62824170038242295e-03,
+ -9.51592254519715870e-05,
+ 5.15138902046611451e-05)
+]
+
+init = 200_000 # ARGV[0]
+n = Integer(init)
+
+offset_momentum(BODIES)
+
+puts "%.9f" % energy(BODIES)
+
+nbodies = BODIES.size
+dt = 0.01
+
+n.times do
+ i = 0
+ while i < nbodies
+ b = BODIES[i]
+ b.move_from_i(BODIES, nbodies, dt, i + 1)
+ i += 1
+ end
+end
+
+puts "%.9f" % energy(BODIES)
diff --git a/benchmark/bm_so_nested_loop.rb b/benchmark/bm_so_nested_loop.rb
new file mode 100644
index 0000000000..a0513f8c47
--- /dev/null
+++ b/benchmark/bm_so_nested_loop.rb
@@ -0,0 +1,24 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: nestedloop-ruby.code,v 1.4 2004/11/13 07:42:22 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# from Avi Bryant
+
+n = 16 # Integer(ARGV.shift || 1)
+x = 0
+n.times do
+ n.times do
+ n.times do
+ n.times do
+ n.times do
+ n.times do
+ x += 1
+ end
+ end
+ end
+ end
+ end
+end
+# puts x
+
+
diff --git a/benchmark/bm_so_nsieve.rb b/benchmark/bm_so_nsieve.rb
new file mode 100644
index 0000000000..a65cc78233
--- /dev/null
+++ b/benchmark/bm_so_nsieve.rb
@@ -0,0 +1,35 @@
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org/
+#
+# contributed by Glenn Parker, March 2005
+# modified by Evan Phoenix, Sept 2006
+
+def sieve(m)
+ flags = Flags.dup[0,m]
+ count = 0
+ pmax = m - 1
+ p = 2
+ while p <= pmax
+ unless flags[p].zero?
+ count += 1
+ mult = p
+ while mult <= pmax
+ flags[mult] = 0
+ mult += p
+ end
+ end
+ p += 1
+ end
+ count
+end
+
+n = 9 # (ARGV[0] || 2).to_i
+Flags = ("\x1" * ( 2 ** n * 10_000)).unpack("c*")
+
+n.downto(n-2) do |exponent|
+ break if exponent < 0
+ m = (1 << exponent) * 10_000
+ # m = (2 ** exponent) * 10_000
+ count = sieve(m)
+ printf "Primes up to %8d %8d\n", m, count
+end
diff --git a/benchmark/bm_so_nsieve_bits.rb b/benchmark/bm_so_nsieve_bits.rb
new file mode 100644
index 0000000000..6f958ee44e
--- /dev/null
+++ b/benchmark/bm_so_nsieve_bits.rb
@@ -0,0 +1,43 @@
+#!/usr/bin/ruby
+#coding: us-ascii
+#
+# The Great Computer Language Shootout
+# http://shootout.alioth.debian.org/
+#
+# nsieve-bits in Ruby
+# Contributed by Glenn Parker, March 2005
+
+CharExponent = 3
+BitsPerChar = 1 << CharExponent
+LowMask = BitsPerChar - 1
+
+def sieve(m)
+ items = "\xFF" * ((m / BitsPerChar) + 1)
+ masks = ""
+ BitsPerChar.times do |b|
+ masks << (1 << b).chr
+ end
+
+ count = 0
+ pmax = m - 1
+ 2.step(pmax, 1) do |p|
+ if items[p >> CharExponent][p & LowMask] == 1
+ count += 1
+ p.step(pmax, p) do |mult|
+ a = mult >> CharExponent
+ b = mult & LowMask
+ items[a] -= masks[b] if items[a][b] != 0
+ end
+ end
+ end
+ count
+end
+
+n = 9 # (ARGV[0] || 2).to_i
+n.step(n - 2, -1) do |exponent|
+ break if exponent < 0
+ m = 2 ** exponent * 10_000
+ count = sieve(m)
+ printf "Primes up to %8d %8d\n", m, count
+end
+
diff --git a/benchmark/bm_so_object.rb b/benchmark/bm_so_object.rb
new file mode 100644
index 0000000000..e8607c7199
--- /dev/null
+++ b/benchmark/bm_so_object.rb
@@ -0,0 +1,56 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: objinst-ruby.code,v 1.4 2004/11/13 07:42:25 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# with help from Aristarkh Zagorodnikov
+
+class Toggle
+ def initialize(start_state)
+ @bool = start_state
+ end
+
+ def value
+ @bool
+ end
+
+ def activate
+ @bool = !@bool
+ self
+ end
+end
+
+class NthToggle < Toggle
+ def initialize(start_state, max_counter)
+ super start_state
+ @count_max = max_counter
+ @counter = 0
+ end
+
+ def activate
+ @counter += 1
+ if @counter >= @count_max
+ @bool = !@bool
+ @counter = 0
+ end
+ self
+ end
+end
+
+n = 1500000 # (ARGV.shift || 1).to_i
+
+toggle = Toggle.new 1
+5.times do
+ toggle.activate.value ? 'true' : 'false'
+end
+n.times do
+ toggle = Toggle.new 1
+end
+
+ntoggle = NthToggle.new 1, 3
+8.times do
+ ntoggle.activate.value ? 'true' : 'false'
+end
+n.times do
+ ntoggle = NthToggle.new 1, 3
+end
+
diff --git a/benchmark/bm_so_partial_sums.rb b/benchmark/bm_so_partial_sums.rb
new file mode 100644
index 0000000000..630b45cb8d
--- /dev/null
+++ b/benchmark/bm_so_partial_sums.rb
@@ -0,0 +1,31 @@
+n = 2_500_000 # (ARGV.shift || 1).to_i
+
+alt = 1.0 ; s0 = s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = 0.0
+
+1.upto(n) do |d|
+ d = d.to_f ; d2 = d * d ; d3 = d2 * d ; ds = Math.sin(d) ; dc = Math.cos(d)
+
+ s0 += (2.0 / 3.0) ** (d - 1.0)
+ s1 += 1.0 / Math.sqrt(d)
+ s2 += 1.0 / (d * (d + 1.0))
+ s3 += 1.0 / (d3 * ds * ds)
+ s4 += 1.0 / (d3 * dc * dc)
+ s5 += 1.0 / d
+ s6 += 1.0 / d2
+ s7 += alt / d
+ s8 += alt / (2.0 * d - 1.0)
+
+ alt = -alt
+end
+
+if false
+ printf("%.9f\t(2/3)^k\n", s0)
+ printf("%.9f\tk^-0.5\n", s1)
+ printf("%.9f\t1/k(k+1)\n", s2)
+ printf("%.9f\tFlint Hills\n", s3)
+ printf("%.9f\tCookson Hills\n", s4)
+ printf("%.9f\tHarmonic\n", s5)
+ printf("%.9f\tRiemann Zeta\n", s6)
+ printf("%.9f\tAlternating Harmonic\n", s7)
+ printf("%.9f\tGregory\n", s8)
+end
diff --git a/benchmark/bm_so_pidigits.rb b/benchmark/bm_so_pidigits.rb
new file mode 100644
index 0000000000..c7d6fbfb4d
--- /dev/null
+++ b/benchmark/bm_so_pidigits.rb
@@ -0,0 +1,92 @@
+# The Great Computer Language Shootout
+# http://shootout.alioth.debian.org/
+#
+# contributed by Gabriele Renzi
+
+class PiDigitSpigot
+
+ def initialize()
+ @z = Transformation.new 1,0,0,1
+ @x = Transformation.new 0,0,0,0
+ @inverse = Transformation.new 0,0,0,0
+ end
+
+ def next!
+ @y = @z.extract(3)
+ if safe? @y
+ @z = produce(@y)
+ @y
+ else
+ @z = consume @x.next!()
+ next!()
+ end
+ end
+
+ def safe?(digit)
+ digit == @z.extract(4)
+ end
+
+ def produce(i)
+ @inverse.qrst(10,-10*i,0,1).compose(@z)
+ end
+
+ def consume(a)
+ @z.compose(a)
+ end
+end
+
+
+class Transformation
+ attr_reader :q, :r, :s, :t
+ def initialize (q, r, s, t)
+ @q,@r,@s,@t,@k = q,r,s,t,0
+ end
+
+ def next!()
+ @q = @k = @k + 1
+ @r = 4 * @k + 2
+ @s = 0
+ @t = 2 * @k + 1
+ self
+ end
+
+ def extract(j)
+ (@q * j + @r) / (@s * j + @t)
+ end
+
+ def compose(a)
+ self.class.new( @q * a.q,
+ @q * a.r + r * a.t,
+ @s * a.q + t * a.s,
+ @s * a.r + t * a.t
+ )
+ end
+
+ def qrst *args
+ initialize *args
+ self
+ end
+
+
+end
+
+
+WIDTH = 10
+n = 2_500 # Integer(ARGV[0])
+j = 0
+
+digits = PiDigitSpigot.new
+
+while n > 0
+ if n >= WIDTH
+ WIDTH.times {print digits.next!}
+ j += WIDTH
+ else
+ n.times {print digits.next!}
+ (WIDTH-n).times {print " "}
+ j += n
+ end
+ puts "\t:"+j.to_s
+ n -= WIDTH
+end
+
diff --git a/benchmark/bm_so_random.rb b/benchmark/bm_so_random.rb
new file mode 100644
index 0000000000..a66b9e8e63
--- /dev/null
+++ b/benchmark/bm_so_random.rb
@@ -0,0 +1,20 @@
+# from http://www.bagley.org/~doug/shootout/bench/random/random.ruby
+
+IM = 139968.0
+IA = 3877.0
+IC = 29573.0
+
+$last = 42.0
+
+def gen_random(max)
+ (max * ($last = ($last * IA + IC) % IM)) / IM
+end
+
+N = 3_000_000
+
+i = 0
+while i<N
+ i +=1
+ gen_random(100.0)
+end
+# "%.9f" % gen_random(100.0)
diff --git a/benchmark/bm_so_reverse_complement.rb b/benchmark/bm_so_reverse_complement.rb
new file mode 100644
index 0000000000..82ea666994
--- /dev/null
+++ b/benchmark/bm_so_reverse_complement.rb
@@ -0,0 +1,30 @@
+#!/usr/bin/ruby
+# The Great Computer Language Shootout
+# http://shootout.alioth.debian.org/
+#
+# Contributed by Peter Bjarke Olsen
+# Modified by Doug King
+
+seq=Array.new
+
+def revcomp(seq)
+ seq.reverse!.tr!('wsatugcyrkmbdhvnATUGCYRKMBDHVN','WSTAACGRYMKVHDBNTAACGRYMKVHDBN')
+ stringlen=seq.length
+ 0.step(stringlen-1,60) {|x| print seq.slice(x,60) , "\n"}
+end
+
+input = open(File.join(File.dirname($0), 'fasta.output.2500000'), 'rb')
+
+while input.gets
+ if $_ =~ />/
+ if seq.length != 0
+ revcomp(seq.join)
+ seq=Array.new
+ end
+ puts $_
+ else
+ $_.sub(/\n/,'')
+ seq.push $_
+ end
+end
+revcomp(seq.join)
diff --git a/benchmark/bm_so_sieve.rb b/benchmark/bm_so_sieve.rb
new file mode 100644
index 0000000000..43dc302648
--- /dev/null
+++ b/benchmark/bm_so_sieve.rb
@@ -0,0 +1,24 @@
+# from http://www.bagley.org/~doug/shootout/bench/sieve/sieve.ruby
+num = 500
+count = i = j = 0
+flags0 = Array.new(8192,1)
+k = 0
+while k < num
+ k += 1
+ count = 0
+ flags = flags0.dup
+ i = 2
+ while i<8192
+ i += 1
+ if flags[i]
+ # remove all multiples of prime: i
+ j = i*i
+ while j < 8192
+ j += i
+ flags[j] = nil
+ end
+ count += 1
+ end
+ end
+end
+count
diff --git a/benchmark/bm_so_spectralnorm.rb b/benchmark/bm_so_spectralnorm.rb
new file mode 100644
index 0000000000..6b97206689
--- /dev/null
+++ b/benchmark/bm_so_spectralnorm.rb
@@ -0,0 +1,50 @@
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org/
+# Contributed by Sokolov Yura
+
+def eval_A(i,j)
+ return 1.0/((i+j)*(i+j+1)/2+i+1)
+end
+
+def eval_A_times_u(u)
+ v, i = nil, nil
+ (0..u.length-1).collect { |i|
+ v = 0
+ for j in 0..u.length-1
+ v += eval_A(i,j)*u[j]
+ end
+ v
+ }
+end
+
+def eval_At_times_u(u)
+ v, i = nil, nil
+ (0..u.length-1).collect{|i|
+ v = 0
+ for j in 0..u.length-1
+ v += eval_A(j,i)*u[j]
+ end
+ v
+ }
+end
+
+def eval_AtA_times_u(u)
+ return eval_At_times_u(eval_A_times_u(u))
+end
+
+n = 500 # ARGV[0].to_i
+
+u=[1]*n
+for i in 1..10
+ v=eval_AtA_times_u(u)
+ u=eval_AtA_times_u(v)
+end
+vBv=0
+vv=0
+for i in 0..n-1
+ vBv += u[i]*v[i]
+ vv += v[i]*v[i]
+end
+
+str = "%0.9f" % (Math.sqrt(vBv/vv)), "\n"
+# print str
diff --git a/benchmark/bm_vm1_attr_ivar.rb b/benchmark/bm_vm1_attr_ivar.rb
new file mode 100644
index 0000000000..16906f3605
--- /dev/null
+++ b/benchmark/bm_vm1_attr_ivar.rb
@@ -0,0 +1,14 @@
+class C
+ attr_reader :a, :b
+ def initialize
+ @a = nil
+ @b = nil
+ end
+end
+obj = C.new
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ j = obj.a
+ k = obj.b
+end
diff --git a/benchmark/bm_vm1_attr_ivar_set.rb b/benchmark/bm_vm1_attr_ivar_set.rb
new file mode 100644
index 0000000000..7e7a6b48c0
--- /dev/null
+++ b/benchmark/bm_vm1_attr_ivar_set.rb
@@ -0,0 +1,14 @@
+class C
+ attr_accessor :a, :b
+ def initialize
+ @a = nil
+ @b = nil
+ end
+end
+obj = C.new
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ obj.a = 1
+ obj.b = 2
+end
diff --git a/benchmark/bm_vm1_block.rb b/benchmark/bm_vm1_block.rb
new file mode 100644
index 0000000000..a9f56b15ea
--- /dev/null
+++ b/benchmark/bm_vm1_block.rb
@@ -0,0 +1,10 @@
+def m
+ yield
+end
+
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ m{
+ }
+end
diff --git a/benchmark/bm_vm1_const.rb b/benchmark/bm_vm1_const.rb
new file mode 100644
index 0000000000..ac59ebccf1
--- /dev/null
+++ b/benchmark/bm_vm1_const.rb
@@ -0,0 +1,8 @@
+Const = 1
+
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ j = Const
+ k = Const
+end
diff --git a/benchmark/bm_vm1_ensure.rb b/benchmark/bm_vm1_ensure.rb
new file mode 100644
index 0000000000..a1596145f2
--- /dev/null
+++ b/benchmark/bm_vm1_ensure.rb
@@ -0,0 +1,11 @@
+i = 0
+while i<30_000_000 # benchmark loop 1
+ i += 1
+ begin
+ begin
+ ensure
+ end
+ ensure
+ end
+end
+
diff --git a/benchmark/bm_vm1_float_simple.rb b/benchmark/bm_vm1_float_simple.rb
new file mode 100644
index 0000000000..d4581439ff
--- /dev/null
+++ b/benchmark/bm_vm1_float_simple.rb
@@ -0,0 +1,7 @@
+i = 0.0; f = 0.0
+while i<30_000_000
+ i += 1
+ f += 0.1; f -= 0.1
+ f += 0.1; f -= 0.1
+ f += 0.1; f -= 0.1
+end
diff --git a/benchmark/bm_vm1_ivar.rb b/benchmark/bm_vm1_ivar.rb
new file mode 100644
index 0000000000..68a73cf92f
--- /dev/null
+++ b/benchmark/bm_vm1_ivar.rb
@@ -0,0 +1,8 @@
+@a = 1
+
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ j = @a
+ k = @a
+end
diff --git a/benchmark/bm_vm1_ivar_set.rb b/benchmark/bm_vm1_ivar_set.rb
new file mode 100644
index 0000000000..bd81b06c34
--- /dev/null
+++ b/benchmark/bm_vm1_ivar_set.rb
@@ -0,0 +1,6 @@
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ @a = 1
+ @b = 2
+end
diff --git a/benchmark/bm_vm1_length.rb b/benchmark/bm_vm1_length.rb
new file mode 100644
index 0000000000..353de3ab0e
--- /dev/null
+++ b/benchmark/bm_vm1_length.rb
@@ -0,0 +1,9 @@
+a = 'abc'
+b = [1, 2, 3]
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ a.length
+ b.length
+end
+
diff --git a/benchmark/bm_vm1_lvar_init.rb b/benchmark/bm_vm1_lvar_init.rb
new file mode 100644
index 0000000000..36f2068811
--- /dev/null
+++ b/benchmark/bm_vm1_lvar_init.rb
@@ -0,0 +1,18 @@
+def m v
+ unless v
+ # unreachable code
+ v1 = v2 = v3 = v4 = v5 = v6 = v7 = v8 = v9 = v10 =
+ v11 = v12 = v13 = v14 = v15 = v16 = v17 = v18 = v19 = v20 =
+ v21 = v22 = v23 = v24 = v25 = v26 = v27 = v28 = v29 = v30 =
+ v31 = v32 = v33 = v34 = v35 = v36 = v37 = v38 = v39 = v40 =
+ v41 = v42 = v43 = v44 = v45 = v46 = v47 = v48 = v49 = v50 = 1
+ end
+end
+
+i = 0
+
+while i<30_000_000 # while loop 1
+ i += 1
+ m i
+end
+
diff --git a/benchmark/bm_vm1_lvar_set.rb b/benchmark/bm_vm1_lvar_set.rb
new file mode 100644
index 0000000000..222e864134
--- /dev/null
+++ b/benchmark/bm_vm1_lvar_set.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ a = b = c = d = e = f = g = h = j = k = l = m = n = o = p = q = r = 1
+end
diff --git a/benchmark/bm_vm1_neq.rb b/benchmark/bm_vm1_neq.rb
new file mode 100644
index 0000000000..bbb4ae07a4
--- /dev/null
+++ b/benchmark/bm_vm1_neq.rb
@@ -0,0 +1,8 @@
+i = 0
+obj1 = Object.new
+obj2 = Object.new
+
+while i<30_000_000 # while loop 1
+ i += 1
+ obj1 != obj2
+end
diff --git a/benchmark/bm_vm1_not.rb b/benchmark/bm_vm1_not.rb
new file mode 100644
index 0000000000..b09ecdcc21
--- /dev/null
+++ b/benchmark/bm_vm1_not.rb
@@ -0,0 +1,7 @@
+i = 0
+obj = Object.new
+
+while i<30_000_000 # while loop 1
+ i += 1
+ !obj
+end
diff --git a/benchmark/bm_vm1_rescue.rb b/benchmark/bm_vm1_rescue.rb
new file mode 100644
index 0000000000..b0d3e2bdfa
--- /dev/null
+++ b/benchmark/bm_vm1_rescue.rb
@@ -0,0 +1,7 @@
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ begin
+ rescue
+ end
+end
diff --git a/benchmark/bm_vm1_simplereturn.rb b/benchmark/bm_vm1_simplereturn.rb
new file mode 100644
index 0000000000..63f9f21675
--- /dev/null
+++ b/benchmark/bm_vm1_simplereturn.rb
@@ -0,0 +1,9 @@
+def m
+ return 1
+end
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ m
+end
+
diff --git a/benchmark/bm_vm1_swap.rb b/benchmark/bm_vm1_swap.rb
new file mode 100644
index 0000000000..918f8b2112
--- /dev/null
+++ b/benchmark/bm_vm1_swap.rb
@@ -0,0 +1,8 @@
+a = 1
+b = 2
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ a, b = b, a
+end
+
diff --git a/benchmark/bm_vm1_yield.rb b/benchmark/bm_vm1_yield.rb
new file mode 100644
index 0000000000..775597cea6
--- /dev/null
+++ b/benchmark/bm_vm1_yield.rb
@@ -0,0 +1,10 @@
+def m
+ i = 0
+ while i<30_000_000 # while loop 1
+ i += 1
+ yield
+ end
+end
+
+m{}
+
diff --git a/benchmark/bm_vm2_array.rb b/benchmark/bm_vm2_array.rb
new file mode 100644
index 0000000000..df9037c83c
--- /dev/null
+++ b/benchmark/bm_vm2_array.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ a = [1,2,3,4,5,6,7,8,9,10]
+end
diff --git a/benchmark/bm_vm2_bigarray.rb b/benchmark/bm_vm2_bigarray.rb
new file mode 100644
index 0000000000..b02509d6a2
--- /dev/null
+++ b/benchmark/bm_vm2_bigarray.rb
@@ -0,0 +1,106 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ a = [
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ ]
+end
diff --git a/benchmark/bm_vm2_bighash.rb b/benchmark/bm_vm2_bighash.rb
new file mode 100644
index 0000000000..5e3f437bb8
--- /dev/null
+++ b/benchmark/bm_vm2_bighash.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<60_000 # benchmark loop 2
+ i += 1
+ a = {0=>0, 1=>1, 2=>2, 3=>3, 4=>4, 5=>5, 6=>6, 7=>7, 8=>8, 9=>9, 10=>10, 11=>11, 12=>12, 13=>13, 14=>14, 15=>15, 16=>16, 17=>17, 18=>18, 19=>19, 20=>20, 21=>21, 22=>22, 23=>23, 24=>24, 25=>25, 26=>26, 27=>27, 28=>28, 29=>29, 30=>30, 31=>31, 32=>32, 33=>33, 34=>34, 35=>35, 36=>36, 37=>37, 38=>38, 39=>39, 40=>40, 41=>41, 42=>42, 43=>43, 44=>44, 45=>45, 46=>46, 47=>47, 48=>48, 49=>49, 50=>50, 51=>51, 52=>52, 53=>53, 54=>54, 55=>55, 56=>56, 57=>57, 58=>58, 59=>59, 60=>60, 61=>61, 62=>62, 63=>63, 64=>64, 65=>65, 66=>66, 67=>67, 68=>68, 69=>69, 70=>70, 71=>71, 72=>72, 73=>73, 74=>74, 75=>75, 76=>76, 77=>77, 78=>78, 79=>79, 80=>80, 81=>81, 82=>82, 83=>83, 84=>84, 85=>85, 86=>86, 87=>87, 88=>88, 89=>89, 90=>90, 91=>91, 92=>92, 93=>93, 94=>94, 95=>95, 96=>96, 97=>97, 98=>98, 99=>99, 100=>100, 101=>101, 102=>102, 103=>103, 104=>104, 105=>105, 106=>106, 107=>107, 108=>108, 109=>109, 110=>110, 111=>111, 112=>112, 113=>113, 114=>114, 115=>115, 116=>116, 117=>117, 118=>118, 119=>119, 120=>120, 121=>121, 122=>122, 123=>123, 124=>124, 125=>125, 126=>126, 127=>127, 128=>128, 129=>129, 130=>130, 131=>131, 132=>132, 133=>133, 134=>134, 135=>135, 136=>136, 137=>137, 138=>138, 139=>139, 140=>140, 141=>141, 142=>142, 143=>143, 144=>144, 145=>145, 146=>146, 147=>147, 148=>148, 149=>149, 150=>150, 151=>151, 152=>152, 153=>153, 154=>154, 155=>155, 156=>156, 157=>157, 158=>158, 159=>159, 160=>160, 161=>161, 162=>162, 163=>163, 164=>164, 165=>165, 166=>166, 167=>167, 168=>168, 169=>169, 170=>170, 171=>171, 172=>172, 173=>173, 174=>174, 175=>175, 176=>176, 177=>177, 178=>178, 179=>179, 180=>180, 181=>181, 182=>182, 183=>183, 184=>184, 185=>185, 186=>186, 187=>187, 188=>188, 189=>189, 190=>190, 191=>191, 192=>192, 193=>193, 194=>194, 195=>195, 196=>196, 197=>197, 198=>198, 199=>199, 200=>200, 201=>201, 202=>202, 203=>203, 204=>204, 205=>205, 206=>206, 207=>207, 208=>208, 209=>209, 210=>210, 211=>211, 212=>212, 213=>213, 214=>214, 215=>215, 216=>216, 217=>217, 218=>218, 219=>219, 220=>220, 221=>221, 222=>222, 223=>223, 224=>224, 225=>225, 226=>226, 227=>227, 228=>228, 229=>229, 230=>230, 231=>231, 232=>232, 233=>233, 234=>234, 235=>235, 236=>236, 237=>237, 238=>238, 239=>239, 240=>240, 241=>241, 242=>242, 243=>243, 244=>244, 245=>245, 246=>246, 247=>247, 248=>248, 249=>249, 250=>250, 251=>251, 252=>252, 253=>253, 254=>254, 255=>255, 256=>256, 257=>257, 258=>258, 259=>259, 260=>260, 261=>261, 262=>262, 263=>263, 264=>264, 265=>265, 266=>266, 267=>267, 268=>268, 269=>269, 270=>270, 271=>271, 272=>272, 273=>273, 274=>274, 275=>275, 276=>276, 277=>277, 278=>278, 279=>279, 280=>280, 281=>281, 282=>282, 283=>283, 284=>284, 285=>285, 286=>286, 287=>287, 288=>288, 289=>289, 290=>290, 291=>291, 292=>292, 293=>293, 294=>294, 295=>295, 296=>296, 297=>297, 298=>298, 299=>299, 300=>300, 301=>301, 302=>302, 303=>303, 304=>304, 305=>305, 306=>306, 307=>307, 308=>308, 309=>309, 310=>310, 311=>311, 312=>312, 313=>313, 314=>314, 315=>315, 316=>316, 317=>317, 318=>318, 319=>319, 320=>320, 321=>321, 322=>322, 323=>323, 324=>324, 325=>325, 326=>326, 327=>327, 328=>328, 329=>329, 330=>330, 331=>331, 332=>332, 333=>333, 334=>334, 335=>335, 336=>336, 337=>337, 338=>338, 339=>339, 340=>340, 341=>341, 342=>342, 343=>343, 344=>344, 345=>345, 346=>346, 347=>347, 348=>348, 349=>349, 350=>350, 351=>351, 352=>352, 353=>353, 354=>354, 355=>355, 356=>356, 357=>357, 358=>358, 359=>359, 360=>360, 361=>361, 362=>362, 363=>363, 364=>364, 365=>365, 366=>366, 367=>367, 368=>368, 369=>369, 370=>370, 371=>371, 372=>372, 373=>373, 374=>374, 375=>375, 376=>376, 377=>377, 378=>378, 379=>379, 380=>380, 381=>381, 382=>382, 383=>383, 384=>384, 385=>385, 386=>386, 387=>387, 388=>388, 389=>389, 390=>390, 391=>391, 392=>392, 393=>393, 394=>394, 395=>395, 396=>396, 397=>397, 398=>398, 399=>399, 400=>400, 401=>401, 402=>402, 403=>403, 404=>404, 405=>405, 406=>406, 407=>407, 408=>408, 409=>409, 410=>410, 411=>411, 412=>412, 413=>413, 414=>414, 415=>415, 416=>416, 417=>417, 418=>418, 419=>419, 420=>420, 421=>421, 422=>422, 423=>423, 424=>424, 425=>425, 426=>426, 427=>427, 428=>428, 429=>429, 430=>430, 431=>431, 432=>432, 433=>433, 434=>434, 435=>435, 436=>436, 437=>437, 438=>438, 439=>439, 440=>440, 441=>441, 442=>442, 443=>443, 444=>444, 445=>445, 446=>446, 447=>447, 448=>448, 449=>449, 450=>450, 451=>451, 452=>452, 453=>453, 454=>454, 455=>455, 456=>456, 457=>457, 458=>458, 459=>459, 460=>460, 461=>461, 462=>462, 463=>463, 464=>464, 465=>465, 466=>466, 467=>467, 468=>468, 469=>469, 470=>470, 471=>471, 472=>472, 473=>473, 474=>474, 475=>475, 476=>476, 477=>477, 478=>478, 479=>479, 480=>480, 481=>481, 482=>482, 483=>483, 484=>484, 485=>485, 486=>486, 487=>487, 488=>488, 489=>489, 490=>490, 491=>491, 492=>492, 493=>493, 494=>494, 495=>495, 496=>496, 497=>497, 498=>498, 499=>499, 500=>500,}
+end
diff --git a/benchmark/bm_vm2_case.rb b/benchmark/bm_vm2_case.rb
new file mode 100644
index 0000000000..adc6e4df0a
--- /dev/null
+++ b/benchmark/bm_vm2_case.rb
@@ -0,0 +1,14 @@
+i = 0
+while i<6_000_000 # while loop 2
+ case :foo
+ when :bar
+ raise
+ when :baz
+ raise
+ when :boo
+ raise
+ when :foo
+ i += 1
+ end
+end
+
diff --git a/benchmark/bm_vm2_defined_method.rb b/benchmark/bm_vm2_defined_method.rb
new file mode 100644
index 0000000000..053ed6c912
--- /dev/null
+++ b/benchmark/bm_vm2_defined_method.rb
@@ -0,0 +1,9 @@
+class Object
+ define_method(:m){}
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m; m; m; m; m; m; m; m;
+end
diff --git a/benchmark/bm_vm2_dstr.rb b/benchmark/bm_vm2_dstr.rb
new file mode 100644
index 0000000000..58c0f7bbc3
--- /dev/null
+++ b/benchmark/bm_vm2_dstr.rb
@@ -0,0 +1,6 @@
+i = 0
+x = y = 'z'
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ str = "foo#{x}bar#{y}baz"
+end
diff --git a/benchmark/bm_vm2_eval.rb b/benchmark/bm_vm2_eval.rb
new file mode 100644
index 0000000000..307cfc28ef
--- /dev/null
+++ b/benchmark/bm_vm2_eval.rb
@@ -0,0 +1,6 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ eval("1")
+end
+
diff --git a/benchmark/bm_vm2_method.rb b/benchmark/bm_vm2_method.rb
new file mode 100644
index 0000000000..a8ccff7138
--- /dev/null
+++ b/benchmark/bm_vm2_method.rb
@@ -0,0 +1,9 @@
+def m
+ nil
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m; m; m; m; m; m; m; m;
+end
diff --git a/benchmark/bm_vm2_method_missing.rb b/benchmark/bm_vm2_method_missing.rb
new file mode 100644
index 0000000000..2badc73101
--- /dev/null
+++ b/benchmark/bm_vm2_method_missing.rb
@@ -0,0 +1,12 @@
+class C
+ def method_missing mid
+ end
+end
+
+obj = C.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m;
+end
diff --git a/benchmark/bm_vm2_method_with_block.rb b/benchmark/bm_vm2_method_with_block.rb
new file mode 100644
index 0000000000..b4efb4f520
--- /dev/null
+++ b/benchmark/bm_vm2_method_with_block.rb
@@ -0,0 +1,9 @@
+def m
+ nil
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m{}; m{}; m{}; m{}; m{}; m{}; m{}; m{};
+end
diff --git a/benchmark/bm_vm2_mutex.rb b/benchmark/bm_vm2_mutex.rb
new file mode 100644
index 0000000000..7362f738c5
--- /dev/null
+++ b/benchmark/bm_vm2_mutex.rb
@@ -0,0 +1,9 @@
+require 'thread'
+
+m = Mutex.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m.synchronize{}
+end
diff --git a/benchmark/bm_vm2_poly_method.rb b/benchmark/bm_vm2_poly_method.rb
new file mode 100644
index 0000000000..c82c0e4bce
--- /dev/null
+++ b/benchmark/bm_vm2_poly_method.rb
@@ -0,0 +1,20 @@
+class C1
+ def m
+ 1
+ end
+end
+class C2
+ def m
+ 2
+ end
+end
+
+o1 = C1.new
+o2 = C2.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ o = (i % 2 == 0) ? o1 : o2
+ o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m
+ i += 1
+end
diff --git a/benchmark/bm_vm2_poly_method_ov.rb b/benchmark/bm_vm2_poly_method_ov.rb
new file mode 100644
index 0000000000..aa5fd1dd38
--- /dev/null
+++ b/benchmark/bm_vm2_poly_method_ov.rb
@@ -0,0 +1,20 @@
+class C1
+ def m
+ 1
+ end
+end
+class C2
+ def m
+ 2
+ end
+end
+
+o1 = C1.new
+o2 = C2.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ o = (i % 2 == 0) ? o1 : o2
+# o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m
+ i += 1
+end
diff --git a/benchmark/bm_vm2_proc.rb b/benchmark/bm_vm2_proc.rb
new file mode 100644
index 0000000000..65e5217371
--- /dev/null
+++ b/benchmark/bm_vm2_proc.rb
@@ -0,0 +1,14 @@
+def m &b
+ b
+end
+
+pr = m{
+ a = 1
+}
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ pr.call
+end
+
diff --git a/benchmark/bm_vm2_raise1.rb b/benchmark/bm_vm2_raise1.rb
new file mode 100644
index 0000000000..aa5387987f
--- /dev/null
+++ b/benchmark/bm_vm2_raise1.rb
@@ -0,0 +1,18 @@
+def rec n
+ if n > 0
+ rec n-1
+ else
+ raise
+ end
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+
+ begin
+ rec 1
+ rescue
+ # ignore
+ end
+end
diff --git a/benchmark/bm_vm2_raise2.rb b/benchmark/bm_vm2_raise2.rb
new file mode 100644
index 0000000000..1f61c63157
--- /dev/null
+++ b/benchmark/bm_vm2_raise2.rb
@@ -0,0 +1,18 @@
+def rec n
+ if n > 0
+ rec n-1
+ else
+ raise
+ end
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+
+ begin
+ rec 10
+ rescue
+ # ignore
+ end
+end
diff --git a/benchmark/bm_vm2_regexp.rb b/benchmark/bm_vm2_regexp.rb
new file mode 100644
index 0000000000..55f9e957a3
--- /dev/null
+++ b/benchmark/bm_vm2_regexp.rb
@@ -0,0 +1,6 @@
+i = 0
+str = 'xxxhogexxx'
+while i<6_000_000 # benchmark loop 2
+ /hoge/ =~ str
+ i += 1
+end
diff --git a/benchmark/bm_vm2_send.rb b/benchmark/bm_vm2_send.rb
new file mode 100644
index 0000000000..6a3ab6fdab
--- /dev/null
+++ b/benchmark/bm_vm2_send.rb
@@ -0,0 +1,12 @@
+class C
+ def m
+ end
+end
+
+o = C.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ o.__send__ :m
+end
diff --git a/benchmark/bm_vm2_super.rb b/benchmark/bm_vm2_super.rb
new file mode 100644
index 0000000000..afd8579e7b
--- /dev/null
+++ b/benchmark/bm_vm2_super.rb
@@ -0,0 +1,20 @@
+
+class C
+ def m
+ 1
+ end
+end
+
+class CC < C
+ def m
+ super()
+ end
+end
+
+obj = CC.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ obj.m
+ i += 1
+end
diff --git a/benchmark/bm_vm2_unif1.rb b/benchmark/bm_vm2_unif1.rb
new file mode 100644
index 0000000000..1774625942
--- /dev/null
+++ b/benchmark/bm_vm2_unif1.rb
@@ -0,0 +1,8 @@
+i = 0
+def m a, b
+end
+
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m 100, 200
+end
diff --git a/benchmark/bm_vm2_zsuper.rb b/benchmark/bm_vm2_zsuper.rb
new file mode 100644
index 0000000000..2a43e62217
--- /dev/null
+++ b/benchmark/bm_vm2_zsuper.rb
@@ -0,0 +1,20 @@
+i = 0
+
+class C
+ def m a
+ 1
+ end
+end
+
+class CC < C
+ def m a
+ super
+ end
+end
+
+obj = CC.new
+
+while i<6_000_000 # benchmark loop 2
+ obj.m 10
+ i += 1
+end
diff --git a/benchmark/bm_vm3_backtrace.rb b/benchmark/bm_vm3_backtrace.rb
new file mode 100644
index 0000000000..0fbf73e1ca
--- /dev/null
+++ b/benchmark/bm_vm3_backtrace.rb
@@ -0,0 +1,22 @@
+# get last backtrace
+
+begin
+ caller(0, 0)
+rescue ArgumentError
+ alias caller_orig caller
+ def caller lev, n
+ caller_orig(lev)[0..n]
+ end
+end
+
+def rec n
+ if n < 0
+ 100_000.times{
+ caller(0, 1)
+ }
+ else
+ rec(n-1)
+ end
+end
+
+rec 50
diff --git a/benchmark/bm_vm3_clearmethodcache.rb b/benchmark/bm_vm3_clearmethodcache.rb
new file mode 100644
index 0000000000..9661323cd2
--- /dev/null
+++ b/benchmark/bm_vm3_clearmethodcache.rb
@@ -0,0 +1,8 @@
+i = 0
+while i<200_000
+ i += 1
+
+ Class.new{
+ def m; end
+ }
+end
diff --git a/benchmark/bm_vm3_gc.rb b/benchmark/bm_vm3_gc.rb
new file mode 100755
index 0000000000..7db9829d44
--- /dev/null
+++ b/benchmark/bm_vm3_gc.rb
@@ -0,0 +1,7 @@
+#! /usr/bin/ruby
+5000.times do
+ 100.times do
+ {"xxxx"=>"yyyy"}
+ end
+ GC.start
+end
diff --git a/benchmark/bm_vm_thread_alive_check1.rb b/benchmark/bm_vm_thread_alive_check1.rb
new file mode 100644
index 0000000000..c993accdda
--- /dev/null
+++ b/benchmark/bm_vm_thread_alive_check1.rb
@@ -0,0 +1,6 @@
+5_000.times{
+ t = Thread.new{}
+ while t.alive?
+ Thread.pass
+ end
+}
diff --git a/benchmark/bm_vm_thread_create_join.rb b/benchmark/bm_vm_thread_create_join.rb
new file mode 100644
index 0000000000..393cd45df9
--- /dev/null
+++ b/benchmark/bm_vm_thread_create_join.rb
@@ -0,0 +1,6 @@
+i = 0
+while i<100_000 # benchmark loop 3
+ i += 1
+ Thread.new{
+ }.join
+end
diff --git a/benchmark/bm_vm_thread_mutex1.rb b/benchmark/bm_vm_thread_mutex1.rb
new file mode 100644
index 0000000000..5c9f85dfb7
--- /dev/null
+++ b/benchmark/bm_vm_thread_mutex1.rb
@@ -0,0 +1,21 @@
+# one thread, one mutex (no contention)
+
+require 'thread'
+m = Mutex.new
+r = 0
+max = 2000
+lmax = max * max
+(1..1).map{
+ Thread.new{
+ i = 0
+ while i<lmax
+ i += 1
+ m.synchronize{
+ r += 1
+ }
+ end
+ }
+}.each{|e|
+ e.join
+}
+raise r.to_s if r != max * max
diff --git a/benchmark/bm_vm_thread_mutex2.rb b/benchmark/bm_vm_thread_mutex2.rb
new file mode 100644
index 0000000000..10de59054f
--- /dev/null
+++ b/benchmark/bm_vm_thread_mutex2.rb
@@ -0,0 +1,21 @@
+# two threads, one mutex
+
+require 'thread'
+m = Mutex.new
+r = 0
+max = 2000
+lmax = (max * max)/2
+(1..2).map{
+ Thread.new{
+ i = 0
+ while i<lmax
+ i += 1
+ m.synchronize{
+ r += 1
+ }
+ end
+ }
+}.each{|e|
+ e.join
+}
+raise r.to_s if r != max * max
diff --git a/benchmark/bm_vm_thread_mutex3.rb b/benchmark/bm_vm_thread_mutex3.rb
new file mode 100644
index 0000000000..7f9a44b39d
--- /dev/null
+++ b/benchmark/bm_vm_thread_mutex3.rb
@@ -0,0 +1,20 @@
+# 1000 threads, one mutex
+
+require 'thread'
+m = Mutex.new
+r = 0
+max = 2000
+(1..max).map{
+ Thread.new{
+ i = 0
+ while i<max
+ i += 1
+ m.synchronize{
+ r += 1
+ }
+ end
+ }
+}.each{|e|
+ e.join
+}
+raise r.to_s if r != max * max
diff --git a/benchmark/bm_vm_thread_pass.rb b/benchmark/bm_vm_thread_pass.rb
new file mode 100644
index 0000000000..b5b3c0bc85
--- /dev/null
+++ b/benchmark/bm_vm_thread_pass.rb
@@ -0,0 +1,15 @@
+# Plenty Thtread.pass
+# A performance may depend on GVL implementation.
+
+tmax = (ARGV.shift || 2).to_i
+lmax = 200_000 / tmax
+
+(1..tmax).map{
+ Thread.new{
+ lmax.times{
+ Thread.pass
+ }
+ }
+}.each{|t| t.join}
+
+
diff --git a/benchmark/bm_vm_thread_pass_flood.rb b/benchmark/bm_vm_thread_pass_flood.rb
new file mode 100644
index 0000000000..27157d1a6f
--- /dev/null
+++ b/benchmark/bm_vm_thread_pass_flood.rb
@@ -0,0 +1,8 @@
+1000.times{
+ Thread.new{loop{Thread.pass}}
+}
+
+i = 0
+while i<10000
+ i += 1
+end
diff --git a/benchmark/bm_vm_thread_pipe.rb b/benchmark/bm_vm_thread_pipe.rb
new file mode 100644
index 0000000000..272d231eba
--- /dev/null
+++ b/benchmark/bm_vm_thread_pipe.rb
@@ -0,0 +1,17 @@
+# Mesure small and plenty pipe read/write.
+# A performance may depend on GVL implementation.
+
+lmax = 100_000
+r, w = IO.pipe
+[Thread.new{
+ lmax.times{
+ w.write('a')
+ }
+ p "w:exit"
+}, Thread.new{
+ lmax.times{
+ r.read(1)
+ }
+ p "r:exit"
+}].each{|t| t.join}
+
diff --git a/benchmark/driver.rb b/benchmark/driver.rb
new file mode 100644
index 0000000000..695dc41aff
--- /dev/null
+++ b/benchmark/driver.rb
@@ -0,0 +1,301 @@
+#
+# Ruby Benchmark driver
+#
+
+first = true
+
+begin
+ require 'optparse'
+rescue LoadError
+ if first
+ first = false
+ $:.unshift File.join(File.dirname(__FILE__), '../lib')
+ retry
+ else
+ raise
+ end
+end
+
+require 'benchmark'
+require 'pp'
+
+class BenchmarkDriver
+ def self.benchmark(opt)
+ driver = self.new(opt[:execs], opt[:dir], opt)
+ begin
+ driver.run
+ ensure
+ driver.show_results
+ end
+ end
+
+ def output *args
+ puts(*args)
+ @output and @output.puts(*args)
+ end
+
+ def message *args
+ output(*args) if @verbose
+ end
+
+ def message_print *args
+ if @verbose
+ print(*args)
+ STDOUT.flush
+ @output and @output.print(*args)
+ end
+ end
+
+ def progress_message *args
+ unless STDOUT.tty?
+ STDERR.print(*args)
+ STDERR.flush
+ end
+ end
+
+ def initialize execs, dir, opt = {}
+ @execs = execs.map{|e|
+ e.strip!
+ next if e.empty?
+
+ if /(.+)::(.+)/ =~ e
+ # ex) ruby-a::/path/to/ruby-a
+ label = $1.strip
+ path = $2
+ version = `#{path} -v`.chomp
+ else
+ path = e
+ version = label = `#{path} -v`.chomp
+ end
+ [path, label, version]
+ }.compact
+
+ @dir = dir
+ @repeat = opt[:repeat] || 1
+ @repeat = 1 if @repeat < 1
+ @pattern = opt[:pattern] || nil
+ @exclude = opt[:exclude] || nil
+ @verbose = opt[:quiet] ? false : (opt[:verbose] || false)
+ @output = opt[:output] ? open(opt[:output], 'w') : nil
+ @loop_wl1 = @loop_wl2 = nil
+ @ruby_arg = opt[:ruby_arg] || nil
+ @opt = opt
+
+ # [[name, [[r-1-1, r-1-2, ...], [r-2-1, r-2-2, ...]]], ...]
+ @results = []
+
+ if @verbose
+ @start_time = Time.now
+ message @start_time
+ @execs.each_with_index{|(path, label, version), i|
+ message "target #{i}: " + (label == version ? "#{label}" : "#{label} (#{version})") + " at \"#{path}\""
+ }
+ end
+ end
+
+ def adjusted_results name, results
+ s = nil
+ results.each_with_index{|e, i|
+ r = e.min
+ case name
+ when /^vm1_/
+ if @loop_wl1
+ r -= @loop_wl1[i]
+ r = 0 if r < 0
+ s = '*'
+ end
+ when /^vm2_/
+ if @loop_wl2
+ r -= @loop_wl2[i]
+ r = 0 if r < 0
+ s = '*'
+ end
+ end
+ yield r
+ }
+ s
+ end
+
+ def show_results
+ output
+
+ if @verbose
+ message '-----------------------------------------------------------'
+ message 'raw data:'
+ message
+ message PP.pp(@results, "", 79)
+ message
+ message "Elapsed time: #{Time.now - @start_time} (sec)"
+ end
+
+ output '-----------------------------------------------------------'
+ output 'benchmark results:'
+
+ if @verbose and @repeat > 1
+ output "minimum results in each #{@repeat} measurements."
+ end
+
+ output "Execution time (sec)"
+ output "name\t#{@execs.map{|(_, v)| v}.join("\t")}"
+ @results.each{|v, result|
+ rets = []
+ s = adjusted_results(v, result){|r|
+ rets << sprintf("%.3f", r)
+ }
+ output "#{v}#{s}\t#{rets.join("\t")}"
+ }
+
+ if @execs.size > 1
+ output
+ output "Speedup ratio: compare with the result of `#{@execs[0][1]}' (greater is better)"
+ output "name\t#{@execs[1..-1].map{|(_, v)| v}.join("\t")}"
+ @results.each{|v, result|
+ rets = []
+ first_value = nil
+ s = adjusted_results(v, result){|r|
+ if first_value
+ if r == 0
+ rets << "Error"
+ else
+ rets << sprintf("%.3f", first_value/r)
+ end
+ else
+ first_value = r
+ end
+ }
+ output "#{v}#{s}\t#{rets.join("\t")}"
+ }
+ end
+
+ if @opt[:output]
+ output
+ output "Log file: #{@opt[:output]}"
+ end
+ end
+
+ def files
+ flag = {}
+ @files = Dir.glob(File.join(@dir, 'bm*.rb')).map{|file|
+ next if @pattern && /#{@pattern}/ !~ File.basename(file)
+ next if @exclude && /#{@exclude}/ =~ File.basename(file)
+ case file
+ when /bm_(vm[12])_/, /bm_loop_(whileloop2?).rb/
+ flag[$1] = true
+ end
+ file
+ }.compact
+
+ if flag['vm1'] && !flag['whileloop']
+ @files << File.join(@dir, 'bm_loop_whileloop.rb')
+ elsif flag['vm2'] && !flag['whileloop2']
+ @files << File.join(@dir, 'bm_loop_whileloop2.rb')
+ end
+
+ @files.sort!
+ progress_message "total: #{@files.size * @repeat} trial(s) (#{@repeat} trial(s) for #{@files.size} benchmark(s))\n"
+ @files
+ end
+
+ def run
+ files.each_with_index{|file, i|
+ @i = i
+ r = measure_file(file)
+
+ if /bm_loop_whileloop.rb/ =~ file
+ @loop_wl1 = r[1].map{|e| e.min}
+ elsif /bm_loop_whileloop2.rb/ =~ file
+ @loop_wl2 = r[1].map{|e| e.min}
+ end
+ }
+ end
+
+ def measure_file file
+ name = File.basename(file, '.rb').sub(/^bm_/, '')
+ prepare_file = File.join(File.dirname(file), "prepare_#{name}.rb")
+ load prepare_file if FileTest.exist?(prepare_file)
+
+ if @verbose
+ output
+ output '-----------------------------------------------------------'
+ output name
+ output
+ output File.read(file)
+ output
+ end
+
+ result = [name]
+ result << @execs.map{|(e, v)|
+ (0...@repeat).map{
+ message_print "#{v}\t"
+ progress_message '.'
+
+ m = measure(e, file)
+ message "#{m}"
+ m
+ }
+ }
+ @results << result
+ result
+ end
+
+ def measure executable, file
+ cmd = "#{executable} #{@ruby_arg} #{file}"
+
+ m = Benchmark.measure{
+ `#{cmd}`
+ }
+
+ if $? != 0
+ output "\`#{cmd}\' exited with abnormal status (#{$?})"
+ 0
+ else
+ m.real
+ end
+ end
+end
+
+if __FILE__ == $0
+ opt = {
+ :execs => [],
+ :dir => File.dirname(__FILE__),
+ :repeat => 1,
+ :output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
+ }
+
+ parser = OptionParser.new{|o|
+ o.on('-e', '--executables [EXECS]',
+ "Specify benchmark one or more targets (e1::path1; e2::path2; e3::path3;...)"){|e|
+ e.split(/;/).each{|path|
+ opt[:execs] << path
+ }
+ }
+ o.on('-d', '--directory [DIRECTORY]', "Benchmark suites directory"){|d|
+ opt[:dir] = d
+ }
+ o.on('-p', '--pattern [PATTERN]', "Benchmark name pattern"){|p|
+ opt[:pattern] = p
+ }
+ o.on('-x', '--exclude [PATTERN]', "Benchmark exclude pattern"){|e|
+ opt[:exclude] = e
+ }
+ o.on('-r', '--repeat-count [NUM]', "Repeat count"){|n|
+ opt[:repeat] = n.to_i
+ }
+ o.on('-o', '--output-file [FILE]', "Output file"){|f|
+ opt[:output] = f
+ }
+ o.on('--ruby-arg [ARG]', "Optional argument for ruby"){|a|
+ opt[:ruby_arg] = a
+ }
+ o.on('-q', '--quiet', "Run without notify information except result table."){|q|
+ opt[:quiet] = q
+ }
+ o.on('-v', '--verbose'){|v|
+ opt[:verbose] = v
+ }
+ }
+
+ parser.parse!(ARGV)
+ BenchmarkDriver.benchmark(opt)
+end
+
diff --git a/benchmark/make_fasta_output.rb b/benchmark/make_fasta_output.rb
new file mode 100644
index 0000000000..b6d787ae27
--- /dev/null
+++ b/benchmark/make_fasta_output.rb
@@ -0,0 +1,19 @@
+# prepare 'fasta.output'
+
+def prepare_fasta_output n
+ filebase = File.join(File.dirname($0), 'fasta.output')
+ script = File.join(File.dirname($0), 'bm_so_fasta.rb')
+ file = "#{filebase}.#{n}"
+
+ unless FileTest.exist?(file)
+ STDERR.puts "preparing #{file}"
+
+ open(file, 'w'){|f|
+ ARGV[0] = n
+ $stdout = f
+ load script
+ $stdout = STDOUT
+ }
+ end
+end
+
diff --git a/benchmark/other-lang/ack.pl b/benchmark/other-lang/ack.pl
new file mode 100644
index 0000000000..201e22ddfa
--- /dev/null
+++ b/benchmark/other-lang/ack.pl
@@ -0,0 +1,11 @@
+use integer;
+
+sub Ack {
+ return $_[0] ? ($_[1] ? Ack($_[0]-1, Ack($_[0], $_[1]-1))
+ : Ack($_[0]-1, 1))
+ : $_[1]+1;
+}
+
+my $NUM = 9;
+$NUM = 1 if ($NUM < 1);
+my $ack = Ack(3, $NUM);
diff --git a/benchmark/other-lang/ack.py b/benchmark/other-lang/ack.py
new file mode 100644
index 0000000000..9968e7cfcf
--- /dev/null
+++ b/benchmark/other-lang/ack.py
@@ -0,0 +1,16 @@
+import sys
+sys.setrecursionlimit(5000000)
+
+def Ack(M, N):
+ if (not M):
+ return( N + 1 )
+ if (not N):
+ return( Ack(M-1, 1) )
+ return( Ack(M-1, Ack(M, N-1)) )
+
+def main():
+ NUM = 9
+ sys.setrecursionlimit(10000)
+ Ack(3, NUM)
+
+main()
diff --git a/benchmark/other-lang/ack.rb b/benchmark/other-lang/ack.rb
new file mode 100644
index 0000000000..7451bed6c4
--- /dev/null
+++ b/benchmark/other-lang/ack.rb
@@ -0,0 +1,12 @@
+def ack(m, n)
+ if m == 0 then
+ n + 1
+ elsif n == 0 then
+ ack(m - 1, 1)
+ else
+ ack(m - 1, ack(m, n - 1))
+ end
+end
+
+NUM = 9
+ack(3, NUM)
diff --git a/benchmark/other-lang/ack.scm b/benchmark/other-lang/ack.scm
new file mode 100644
index 0000000000..a80b73ba55
--- /dev/null
+++ b/benchmark/other-lang/ack.scm
@@ -0,0 +1,7 @@
+(define (ack m n)
+ (cond ((zero? m) (+ n 1))
+ ((zero? n) (ack (- m 1) 1))
+ (else (ack (- m 1) (ack m (- n 1))))))
+
+(ack 3 9)
+
diff --git a/benchmark/other-lang/eval.rb b/benchmark/other-lang/eval.rb
new file mode 100644
index 0000000000..48a2cea019
--- /dev/null
+++ b/benchmark/other-lang/eval.rb
@@ -0,0 +1,66 @@
+
+Bench = %w(
+ loop
+ ack
+ fib
+ tak
+ fact
+)
+
+Lang = <<EOP.map{|l| l.strip}
+ ruby-cyg
+ ../../../test6/miniruby
+ perl
+ python
+ gosh
+EOP
+
+Bench.replace ['loop2']
+Lang.replace ['ruby-cyg']
+
+Ext = %w(
+ .rb
+ .rb
+ .pl
+ .py
+ .scm
+)
+
+p Bench
+p Lang
+
+require 'benchmark'
+
+def bench cmd
+ m = Benchmark.measure{
+ #p cmd
+ system(cmd)
+ }
+ [m.utime, m.real]
+end
+
+Result = []
+Bench.each{|b|
+ r = []
+ Lang.each_with_index{|l, idx|
+ cmd = "#{l} #{b}#{Ext[idx]}"
+ r << bench(cmd)
+ }
+ Result << r
+}
+
+require 'pp'
+# utime
+puts Lang.join("\t")
+Bench.each_with_index{|b, bi|
+ print b, "\t"
+ puts Result[bi].map{|e| e[0]}.join("\t")
+}
+
+# rtime
+puts Lang.join("\t")
+Bench.each_with_index{|b, bi|
+ print b, "\t"
+ puts Result[bi].map{|e| e[1]}.join("\t")
+}
+
diff --git a/benchmark/other-lang/fact.pl b/benchmark/other-lang/fact.pl
new file mode 100644
index 0000000000..a9b0b69cdf
--- /dev/null
+++ b/benchmark/other-lang/fact.pl
@@ -0,0 +1,13 @@
+sub fact{
+ my $n = @_[0];
+ if($n < 2){
+ return 1;
+ }
+ else{
+ return $n * fact($n-1);
+ }
+}
+
+for($i=0; $i<10000; $i++){
+ &fact(100);
+}
diff --git a/benchmark/other-lang/fact.py b/benchmark/other-lang/fact.py
new file mode 100644
index 0000000000..01593965d9
--- /dev/null
+++ b/benchmark/other-lang/fact.py
@@ -0,0 +1,18 @@
+#import sys
+#sys.setrecursionlimit(1000)
+
+def factL(n):
+ r = 1
+ for x in range(2, n):
+ r *= x
+ return r
+
+def factR(n):
+ if n < 2:
+ return 1
+ else:
+ return n * factR(n-1)
+
+for i in range(10000):
+ factR(100)
+
diff --git a/benchmark/other-lang/fact.rb b/benchmark/other-lang/fact.rb
new file mode 100644
index 0000000000..6cedc752cd
--- /dev/null
+++ b/benchmark/other-lang/fact.rb
@@ -0,0 +1,13 @@
+def fact(n)
+ if n < 2
+ 1
+ else
+ n * fact(n-1)
+ end
+end
+
+i = 0
+while i<10000
+ i += 1
+ fact(100)
+end
diff --git a/benchmark/other-lang/fact.scm b/benchmark/other-lang/fact.scm
new file mode 100644
index 0000000000..c98a7fedd3
--- /dev/null
+++ b/benchmark/other-lang/fact.scm
@@ -0,0 +1,8 @@
+(define (fact n)
+ (if (< n 2)
+ 1
+ (* n (fact (- n 1)))))
+
+(dotimes (i 10000)
+ (fact 100))
+
diff --git a/benchmark/other-lang/fib.pl b/benchmark/other-lang/fib.pl
new file mode 100644
index 0000000000..a46f666d1e
--- /dev/null
+++ b/benchmark/other-lang/fib.pl
@@ -0,0 +1,11 @@
+sub fib{
+ my $n = $_[0];
+ if($n < 3){
+ return 1;
+ }
+ else{
+ return fib($n-1) + fib($n-2);
+ }
+};
+
+&fib(34);
diff --git a/benchmark/other-lang/fib.py b/benchmark/other-lang/fib.py
new file mode 100644
index 0000000000..45f2bceb8d
--- /dev/null
+++ b/benchmark/other-lang/fib.py
@@ -0,0 +1,7 @@
+def fib(n):
+ if n < 3:
+ return 1
+ else:
+ return fib(n-1) + fib(n-2)
+
+fib(34)
diff --git a/benchmark/other-lang/fib.rb b/benchmark/other-lang/fib.rb
new file mode 100644
index 0000000000..ec587eabe0
--- /dev/null
+++ b/benchmark/other-lang/fib.rb
@@ -0,0 +1,9 @@
+def fib n
+ if n < 3
+ 1
+ else
+ fib(n-1) + fib(n-2)
+ end
+end
+
+fib(34)
diff --git a/benchmark/other-lang/fib.scm b/benchmark/other-lang/fib.scm
new file mode 100644
index 0000000000..2fc4e225bd
--- /dev/null
+++ b/benchmark/other-lang/fib.scm
@@ -0,0 +1,7 @@
+(define (fib n)
+ (if (< n 3)
+ 1
+ (+ (fib (- n 1)) (fib (- n 2)))))
+
+(fib 34)
+
diff --git a/benchmark/other-lang/loop.pl b/benchmark/other-lang/loop.pl
new file mode 100644
index 0000000000..2777490aaa
--- /dev/null
+++ b/benchmark/other-lang/loop.pl
@@ -0,0 +1,3 @@
+for($i=0; $i<30000000; $i++){
+}
+
diff --git a/benchmark/other-lang/loop.py b/benchmark/other-lang/loop.py
new file mode 100644
index 0000000000..003749bf3a
--- /dev/null
+++ b/benchmark/other-lang/loop.py
@@ -0,0 +1,2 @@
+for i in xrange(30000000):
+ pass
diff --git a/benchmark/other-lang/loop.rb b/benchmark/other-lang/loop.rb
new file mode 100644
index 0000000000..b367b9dbf3
--- /dev/null
+++ b/benchmark/other-lang/loop.rb
@@ -0,0 +1,4 @@
+i = 0
+while i<30000000
+ i += 1
+end
diff --git a/benchmark/other-lang/loop.scm b/benchmark/other-lang/loop.scm
new file mode 100644
index 0000000000..3364f7e679
--- /dev/null
+++ b/benchmark/other-lang/loop.scm
@@ -0,0 +1 @@
+(dotimes (x 30000000))
diff --git a/benchmark/other-lang/loop2.rb b/benchmark/other-lang/loop2.rb
new file mode 100644
index 0000000000..df8fffc1ff
--- /dev/null
+++ b/benchmark/other-lang/loop2.rb
@@ -0,0 +1 @@
+30000000.times{}
diff --git a/benchmark/other-lang/tak.pl b/benchmark/other-lang/tak.pl
new file mode 100644
index 0000000000..7e748a67c6
--- /dev/null
+++ b/benchmark/other-lang/tak.pl
@@ -0,0 +1,11 @@
+sub tak {
+ local($x, $y, $z) = @_;
+ if (!($y < $x)) {
+ return $z;
+ } else {
+ return &tak(&tak($x - 1, $y, $z),
+ &tak($y - 1, $z, $x),
+ &tak($z - 1, $x, $y));
+ }
+}
+&tak(18, 9, 0);
diff --git a/benchmark/other-lang/tak.py b/benchmark/other-lang/tak.py
new file mode 100644
index 0000000000..04f3f6829c
--- /dev/null
+++ b/benchmark/other-lang/tak.py
@@ -0,0 +1,8 @@
+def tak(x, y, z):
+ if not(y<x):
+ return z
+ else:
+ return tak(tak(x-1, y, z),
+ tak(y-1, z, x),
+ tak(z-1, x, y))
+tak(18, 9, 0)
diff --git a/benchmark/other-lang/tak.rb b/benchmark/other-lang/tak.rb
new file mode 100644
index 0000000000..efe5380f4e
--- /dev/null
+++ b/benchmark/other-lang/tak.rb
@@ -0,0 +1,13 @@
+
+def tak x, y, z
+ unless y < x
+ z
+ else
+ tak( tak(x-1, y, z),
+ tak(y-1, z, x),
+ tak(z-1, x, y))
+ end
+end
+
+tak(18, 9, 0)
+
diff --git a/benchmark/other-lang/tak.scm b/benchmark/other-lang/tak.scm
new file mode 100644
index 0000000000..52a7629ee5
--- /dev/null
+++ b/benchmark/other-lang/tak.scm
@@ -0,0 +1,10 @@
+(define (tak x y z)
+ (if (not (< y x))
+ z
+ (tak (tak (- x 1) y z)
+ (tak (- y 1) z x)
+ (tak (- z 1) x y))))
+
+(tak 18 9 0)
+
+
diff --git a/benchmark/prepare_so_count_words.rb b/benchmark/prepare_so_count_words.rb
new file mode 100644
index 0000000000..ee2138cdb2
--- /dev/null
+++ b/benchmark/prepare_so_count_words.rb
@@ -0,0 +1,15 @@
+# prepare 'wc.input'
+
+def prepare_wc_input
+ wcinput = File.join(File.dirname($0), 'wc.input')
+ wcbase = File.join(File.dirname($0), 'wc.input.base')
+ unless FileTest.exist?(wcinput)
+ data = File.read(wcbase)
+ 13.times{
+ data << data
+ }
+ open(wcinput, 'w'){|f| f.write data}
+ end
+end
+
+prepare_wc_input
diff --git a/benchmark/prepare_so_k_nucleotide.rb b/benchmark/prepare_so_k_nucleotide.rb
new file mode 100644
index 0000000000..f28f4460a1
--- /dev/null
+++ b/benchmark/prepare_so_k_nucleotide.rb
@@ -0,0 +1,2 @@
+require File.join(File.dirname(__FILE__), 'make_fasta_output')
+prepare_fasta_output(100_000)
diff --git a/benchmark/prepare_so_reverse_complement.rb b/benchmark/prepare_so_reverse_complement.rb
new file mode 100644
index 0000000000..7f089109de
--- /dev/null
+++ b/benchmark/prepare_so_reverse_complement.rb
@@ -0,0 +1,2 @@
+require File.join(File.dirname(__FILE__), 'make_fasta_output')
+prepare_fasta_output(2_500_000)
diff --git a/benchmark/report.rb b/benchmark/report.rb
new file mode 100644
index 0000000000..d2dc56b1e1
--- /dev/null
+++ b/benchmark/report.rb
@@ -0,0 +1,79 @@
+#
+# YARV benchmark driver
+#
+
+require 'yarvutil'
+require 'benchmark'
+require 'rbconfig'
+
+def exec_command type, file, w
+ <<-EOP
+ $DRIVER_PATH = '#{File.dirname($0)}'
+ $LOAD_PATH.replace $LOAD_PATH | #{$LOAD_PATH.inspect}
+ require 'benchmark'
+ require 'yarvutil'
+# print '#{type}'
+ begin
+ puts Benchmark.measure{
+ #{w}('#{file}')
+ }.utime
+ rescue Exception => exec_command_error_variable
+ puts "\t" + exec_command_error_variable.message
+ end
+ EOP
+end
+
+def benchmark cmd
+ rubybin = ENV['RUBY'] || RbConfig.ruby
+
+ IO.popen(rubybin, 'r+'){|io|
+ io.write cmd
+ io.close_write
+ return io.gets
+ }
+end
+
+def ruby_exec file
+ prog = exec_command 'ruby', file, 'load'
+ benchmark prog
+end
+
+def yarv_exec file
+ prog = exec_command 'yarv', file, 'YARVUtil.load_bm'
+ benchmark prog
+end
+
+$wr = $wy = nil
+
+def measure bench
+ file = File.dirname($0) + "/bm_#{bench}.rb"
+ r = ruby_exec(file).to_f
+ y = yarv_exec(file).to_f
+ puts "#{bench}\t#{r}\t#{y}"
+end
+
+def measure2
+ r = ruby_exec.to_f
+ y = yarv_exec.to_f
+ puts r/y
+end
+
+if $0 == __FILE__
+ %w{
+ whileloop
+ whileloop2
+ times
+ const
+ method
+ poly_method
+ block
+ rescue
+ rescue2
+ }.each{|bench|
+ measure bench
+ }
+end
+
+
+
+
diff --git a/benchmark/run.rb b/benchmark/run.rb
new file mode 100644
index 0000000000..0cd2363849
--- /dev/null
+++ b/benchmark/run.rb
@@ -0,0 +1,127 @@
+#
+# Ruby benchmark driver
+#
+
+require 'benchmark'
+require 'rbconfig'
+
+$matzrubyonly = false
+$rubyonly = false
+
+$results = []
+
+# prepare 'wc.input'
+def prepare_wc_input
+ wcinput = File.join(File.dirname($0), 'wc.input')
+ wcbase = File.join(File.dirname($0), 'wc.input.base')
+ unless FileTest.exist?(wcinput)
+ data = File.read(wcbase)
+ 13.times{
+ data << data
+ }
+ open(wcinput, 'w'){|f| f.write data}
+ end
+end
+
+prepare_wc_input
+
+def bm file
+ prog = File.readlines(file).map{|e| e.rstrip}.join("\n")
+ return if prog.empty?
+
+ /[a-z]+_(.+)\.rb/ =~ file
+ bm_name = $1
+ puts '-----------------------------------------------------------' unless $rubyonly || $matzrubyonly
+ puts "#{bm_name}: "
+
+
+puts <<EOS unless $matzrubyonly || $rubyonly
+#{prog}
+--
+EOS
+ begin
+ result = [bm_name]
+ result << matzruby_exec(file) unless $rubyonly
+ result << ruby_exec(file) unless $matzrubyonly
+ $results << result
+
+ rescue Exception => e
+ puts
+ puts "** benchmark failure: #{e}"
+ puts e.backtrace
+ end
+end
+
+def benchmark file, bin
+ m = Benchmark.measure{
+ `#{bin} #{$opts} #{file}`
+ }
+ sec = '%.3f' % m.real
+ puts " #{sec}"
+ sec
+end
+
+def ruby_exec file
+ print 'ruby'
+ benchmark file, $ruby_program
+end
+
+def matzruby_exec file
+ print 'matz'
+ rubylib = ENV['RUBYLIB']
+ ENV['RUBYLIB'] = ''
+ r = benchmark file, $matzruby_program
+ ENV['RUBYLIB'] = rubylib
+ r
+end
+
+if $0 == __FILE__
+ ARGV.each{|arg|
+ case arg
+ when /\A--ruby=(.+)/
+ $ruby_program = $1
+ when /\A--matzruby=(.+)/
+ $matzruby_program = $1
+ when /\A--opts=(.+)/
+ $opts = $1
+ when /\A(-r|--only-ruby)\z/
+ $rubyonly = true
+ when /\A(-m|--only-matzruby)\z/
+ $matzrubyonly = true
+ end
+ }
+ ARGV.delete_if{|arg|
+ /\A-/ =~ arg
+ }
+
+ puts "MatzRuby:"
+ system("#{$matzruby_program} -v")
+ puts "Ruby:"
+ system("#{$ruby_program} -v")
+ puts
+
+ if ARGV.empty?
+ Dir.glob(File.dirname(__FILE__) + '/bm_*.rb').sort.each{|file|
+ bm file
+ }
+ else
+ ARGV.each{|file|
+ Dir.glob(File.join(File.dirname(__FILE__), file + '*')){|ef|
+ # file = "#{File.dirname(__FILE__)}/#{file}.rb"
+ bm ef
+ }
+ }
+ end
+
+ puts
+ puts "-- benchmark summary ---------------------------"
+ $results.each{|res|
+ print res.shift, "\t"
+ (res||[]).each{|result|
+ /([\d\.]+)/ =~ result
+ print $1 + "\t" if $1
+ }
+ puts
+ }
+end
+
diff --git a/benchmark/runc.rb b/benchmark/runc.rb
new file mode 100644
index 0000000000..97c5cef045
--- /dev/null
+++ b/benchmark/runc.rb
@@ -0,0 +1,27 @@
+#
+#
+#
+
+require 'benchmark'
+require 'rbconfig'
+
+$rubybin = ENV['RUBY'] || RbConfig.ruby
+
+def runfile file
+ puts file
+ file = File.join(File.dirname($0), 'contrib', file)
+ Benchmark.bm{|x|
+ x.report('ruby'){
+ system("#{$rubybin} #{file}")
+ }
+ x.report('yarv'){
+ system("#{$rubybin} -rite -I.. #{file}")
+ }
+ }
+end
+
+ARGV.each{|file|
+ runfile file
+}
+
+
diff --git a/benchmark/wc.input.base b/benchmark/wc.input.base
new file mode 100644
index 0000000000..41143fbac0
--- /dev/null
+++ b/benchmark/wc.input.base
@@ -0,0 +1,25 @@
+Subject: Re: Who was Izchak Miller?
+From: "Jane D. Anonymous" <nobody@yale.edu>
+Date: 1996/04/28
+Message-Id: <4lv7bc$oh@news.ycc.yale.edu>
+References: <317C405E.5DFA@panix.com> <4lk6vl$gde@ns.oar.net>
+To: 75176.2330@compuserve.com
+Content-Type: text/plain; charset=us-ascii
+Organization: Yale University
+X-Url: news:4lk6vl$gde@ns.oar.net
+Mime-Version: 1.0
+Newsgroups: rec.games.roguelike.nethack
+X-Mailer: Mozilla 1.1N (Macintosh; I; 68K)
+
+Hello there, Izchak Miller was my father. When I was younger I spent
+many a night, hunched over the keyboard with a cup of tea, playing
+nethack with him and my brother. my dad was a philosopher with a strong
+weakness for fantasy/sci fi. I remember when he started to get involved
+with the Nethack team- my brother's Dungeons and Dragons monster book
+found a regular place beside my dad's desk. it's nice to see him living
+on in the game he loved so much :-).
+ Tamar Miller
+
+The following is a really long word of 5000 characters:
+
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
diff --git a/bignum.c b/bignum.c
index cf7649c47e..8601d80342 100644
--- a/bignum.c
+++ b/bignum.c
@@ -2,75 +2,207 @@
bignum.c -
- $Author: shyouhei $
- $Date: 2006/12/06 10:14:12 $
+ $Author$
created at: Fri Jun 10 00:48:55 JST 1994
- Copyright (C) 1993-2003 Yukihiro Matsumoto
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
+#include "ruby/thread.h"
+#include "ruby/util.h"
+#include "internal.h"
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
#include <math.h>
+#include <float.h>
#include <ctype.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
+#include <assert.h>
VALUE rb_cBignum;
+static VALUE big_three = Qnil;
+
#if defined __MINGW32__
#define USHORT _USHORT
#endif
-#define BDIGITS(x) ((BDIGIT*)RBIGNUM(x)->digits)
+#define BDIGITS(x) (RBIGNUM_DIGITS(x))
#define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT)
#define BIGRAD ((BDIGIT_DBL)1 << BITSPERDIG)
-#define DIGSPERLONG ((unsigned int)(SIZEOF_LONG/SIZEOF_BDIGITS))
+#define BIGRAD_HALF ((BDIGIT)(BIGRAD >> 1))
+#define DIGSPERLONG (SIZEOF_LONG/SIZEOF_BDIGITS)
#if HAVE_LONG_LONG
-# define DIGSPERLL ((unsigned int)(SIZEOF_LONG_LONG/SIZEOF_BDIGITS))
+# define DIGSPERLL (SIZEOF_LONG_LONG/SIZEOF_BDIGITS)
#endif
#define BIGUP(x) ((BDIGIT_DBL)(x) << BITSPERDIG)
-#define BIGDN(x) RSHIFT(x,BITSPERDIG)
+#define BIGDN(x) RSHIFT((x),BITSPERDIG)
#define BIGLO(x) ((BDIGIT)((x) & (BIGRAD-1)))
#define BDIGMAX ((BDIGIT)-1)
-#define BIGZEROP(x) (RBIGNUM(x)->len == 0 || (RBIGNUM(x)->len == 1 && BDIGITS(x)[0] == 0))
+#define BIGZEROP(x) (RBIGNUM_LEN(x) == 0 || \
+ (BDIGITS(x)[0] == 0 && \
+ (RBIGNUM_LEN(x) == 1 || bigzero_p(x))))
+
+#define BIGNUM_DEBUG 0
+#if BIGNUM_DEBUG
+#define ON_DEBUG(x) do { x; } while (0)
+static void
+dump_bignum(VALUE x)
+{
+ long i;
+ printf("%c0x0", RBIGNUM_SIGN(x) ? '+' : '-');
+ for (i = RBIGNUM_LEN(x); i--; ) {
+ printf("_%08"PRIxBDIGIT, BDIGITS(x)[i]);
+ }
+ printf(", len=%lu", RBIGNUM_LEN(x));
+ puts("");
+}
static VALUE
-bignew_1(klass, len, sign)
- VALUE klass;
- long len;
- int sign;
+rb_big_dump(VALUE x)
+{
+ dump_bignum(x);
+ return x;
+}
+#else
+#define ON_DEBUG(x)
+#endif
+
+static int
+bigzero_p(VALUE x)
+{
+ long i;
+ BDIGIT *ds = BDIGITS(x);
+
+ for (i = RBIGNUM_LEN(x) - 1; 0 <= i; i--) {
+ if (ds[i]) return 0;
+ }
+ return 1;
+}
+
+int
+rb_bigzero_p(VALUE x)
+{
+ return BIGZEROP(x);
+}
+
+int
+rb_cmpint(VALUE val, VALUE a, VALUE b)
+{
+ if (NIL_P(val)) {
+ rb_cmperr(a, b);
+ }
+ if (FIXNUM_P(val)) {
+ long l = FIX2LONG(val);
+ if (l > 0) return 1;
+ if (l < 0) return -1;
+ return 0;
+ }
+ if (RB_TYPE_P(val, T_BIGNUM)) {
+ if (BIGZEROP(val)) return 0;
+ if (RBIGNUM_SIGN(val)) return 1;
+ return -1;
+ }
+ if (RTEST(rb_funcall(val, '>', 1, INT2FIX(0)))) return 1;
+ if (RTEST(rb_funcall(val, '<', 1, INT2FIX(0)))) return -1;
+ return 0;
+}
+
+#define RBIGNUM_SET_LEN(b,l) \
+ ((RBASIC(b)->flags & RBIGNUM_EMBED_FLAG) ? \
+ (void)(RBASIC(b)->flags = \
+ (RBASIC(b)->flags & ~RBIGNUM_EMBED_LEN_MASK) | \
+ ((l) << RBIGNUM_EMBED_LEN_SHIFT)) : \
+ (void)(RBIGNUM(b)->as.heap.len = (l)))
+
+static void
+rb_big_realloc(VALUE big, long len)
{
- NEWOBJ(big, struct RBignum);
- OBJSETUP(big, klass, T_BIGNUM);
- big->sign = sign?1:0;
- big->len = len;
- big->digits = ALLOC_N(BDIGIT, len);
+ BDIGIT *ds;
+ if (RBASIC(big)->flags & RBIGNUM_EMBED_FLAG) {
+ if (RBIGNUM_EMBED_LEN_MAX < len) {
+ ds = ALLOC_N(BDIGIT, len);
+ MEMCPY(ds, RBIGNUM(big)->as.ary, BDIGIT, RBIGNUM_EMBED_LEN_MAX);
+ RBIGNUM(big)->as.heap.len = RBIGNUM_LEN(big);
+ RBIGNUM(big)->as.heap.digits = ds;
+ RBASIC(big)->flags &= ~RBIGNUM_EMBED_FLAG;
+ }
+ }
+ else {
+ if (len <= RBIGNUM_EMBED_LEN_MAX) {
+ ds = RBIGNUM(big)->as.heap.digits;
+ RBASIC(big)->flags |= RBIGNUM_EMBED_FLAG;
+ RBIGNUM_SET_LEN(big, len);
+ if (ds) {
+ MEMCPY(RBIGNUM(big)->as.ary, ds, BDIGIT, len);
+ xfree(ds);
+ }
+ }
+ else {
+ if (RBIGNUM_LEN(big) == 0) {
+ RBIGNUM(big)->as.heap.digits = ALLOC_N(BDIGIT, len);
+ }
+ else {
+ REALLOC_N(RBIGNUM(big)->as.heap.digits, BDIGIT, len);
+ }
+ }
+ }
+}
+void
+rb_big_resize(VALUE big, long len)
+{
+ rb_big_realloc(big, len);
+ RBIGNUM_SET_LEN(big, len);
+}
+
+static VALUE
+bignew_1(VALUE klass, long len, int sign)
+{
+ NEWOBJ_OF(big, struct RBignum, klass, T_BIGNUM);
+ RBIGNUM_SET_SIGN(big, sign?1:0);
+ if (len <= RBIGNUM_EMBED_LEN_MAX) {
+ RBASIC(big)->flags |= RBIGNUM_EMBED_FLAG;
+ RBIGNUM_SET_LEN(big, len);
+ }
+ else {
+ RBIGNUM(big)->as.heap.digits = ALLOC_N(BDIGIT, len);
+ RBIGNUM(big)->as.heap.len = len;
+ }
+ OBJ_FREEZE(big);
return (VALUE)big;
}
-#define bignew(len,sign) bignew_1(rb_cBignum,len,sign)
+#define bignew(len,sign) bignew_1(rb_cBignum,(len),(sign))
VALUE
-rb_big_clone(x)
- VALUE x;
+rb_big_new(long len, int sign)
{
- VALUE z = bignew_1(CLASS_OF(x), RBIGNUM(x)->len, RBIGNUM(x)->sign);
+ return bignew(len, sign != 0);
+}
- MEMCPY(BDIGITS(z), BDIGITS(x), BDIGIT, RBIGNUM(x)->len);
+VALUE
+rb_big_clone(VALUE x)
+{
+ long len = RBIGNUM_LEN(x);
+ VALUE z = bignew_1(CLASS_OF(x), len, RBIGNUM_SIGN(x));
+
+ MEMCPY(BDIGITS(z), BDIGITS(x), BDIGIT, len);
return z;
}
/* modify a bignum by 2's complement */
static void
-get2comp(x)
- VALUE x;
+get2comp(VALUE x)
{
- long i = RBIGNUM(x)->len;
+ long i = RBIGNUM_LEN(x);
BDIGIT *ds = BDIGITS(x);
BDIGIT_DBL num;
@@ -81,61 +213,79 @@ get2comp(x)
num += ds[i];
ds[i++] = BIGLO(num);
num = BIGDN(num);
- } while (i < RBIGNUM(x)->len);
+ } while (i < RBIGNUM_LEN(x));
if (num != 0) {
- REALLOC_N(RBIGNUM(x)->digits, BDIGIT, ++RBIGNUM(x)->len);
+ rb_big_resize(x, RBIGNUM_LEN(x)+1);
ds = BDIGITS(x);
- ds[RBIGNUM(x)->len-1] = RBIGNUM(x)->sign ? ~0 : 1;
+ ds[RBIGNUM_LEN(x)-1] = 1;
}
}
void
-rb_big_2comp(x) /* get 2's complement */
- VALUE x;
+rb_big_2comp(VALUE x) /* get 2's complement */
{
get2comp(x);
}
-static VALUE
-bignorm(x)
- VALUE x;
+static inline VALUE
+bigtrunc(VALUE x)
{
- if (FIXNUM_P(x)) {
- return x;
+ long len = RBIGNUM_LEN(x);
+ BDIGIT *ds = BDIGITS(x);
+
+ if (len == 0) return x;
+ while (--len && !ds[len]);
+ if (RBIGNUM_LEN(x) > len+1) {
+ rb_big_resize(x, len+1);
}
- else if (TYPE(x) == T_BIGNUM) {
- long len = RBIGNUM(x)->len;
- BDIGIT *ds = BDIGITS(x);
+ return x;
+}
- while (--len && !ds[len]) ;
- RBIGNUM(x)->len = ++len;
+static inline VALUE
+bigfixize(VALUE x)
+{
+ long len = RBIGNUM_LEN(x);
+ BDIGIT *ds = BDIGITS(x);
- if (len*SIZEOF_BDIGITS <= sizeof(VALUE)) {
- long num = 0;
- while (len--) {
- num = BIGUP(num) + ds[len];
+ if (len == 0) return INT2FIX(0);
+ if ((size_t)(len*SIZEOF_BDIGITS) <= sizeof(long)) {
+ long num = 0;
+#if 2*SIZEOF_BDIGITS > SIZEOF_LONG
+ num = (long)ds[0];
+#else
+ while (len--) {
+ num = (long)(BIGUP(num) + ds[len]);
+ }
+#endif
+ if (num >= 0) {
+ if (RBIGNUM_SIGN(x)) {
+ if (POSFIXABLE(num)) return LONG2FIX(num);
}
- if (num >= 0) {
- if (RBIGNUM(x)->sign) {
- if (POSFIXABLE(num)) return LONG2FIX(num);
- }
- else if (NEGFIXABLE(-(long)num)) return LONG2FIX(-(long)num);
+ else {
+ if (NEGFIXABLE(-num)) return LONG2FIX(-num);
}
}
}
return x;
}
+static VALUE
+bignorm(VALUE x)
+{
+ if (RB_TYPE_P(x, T_BIGNUM)) {
+ x = bigfixize(bigtrunc(x));
+ }
+ return x;
+}
+
VALUE
-rb_big_norm(x)
- VALUE x;
+rb_big_norm(VALUE x)
{
return bignorm(x);
}
VALUE
-rb_uint2big(n)
- unsigned long n;
+rb_uint2big(VALUE n)
{
BDIGIT_DBL num = n;
long i = 0;
@@ -151,13 +301,12 @@ rb_uint2big(n)
i = DIGSPERLONG;
while (--i && !digits[i]) ;
- RBIGNUM(big)->len = i+1;
+ RBIGNUM_SET_LEN(big, i+1);
return big;
}
VALUE
-rb_int2big(n)
- long n;
+rb_int2big(SIGNED_VALUE n)
{
long neg = 0;
VALUE big;
@@ -168,33 +317,140 @@ rb_int2big(n)
}
big = rb_uint2big(n);
if (neg) {
- RBIGNUM(big)->sign = 0;
+ RBIGNUM_SET_SIGN(big, 0);
}
return big;
}
VALUE
-rb_uint2inum(n)
- unsigned long n;
+rb_uint2inum(VALUE n)
{
if (POSFIXABLE(n)) return LONG2FIX(n);
return rb_uint2big(n);
}
VALUE
-rb_int2inum(n)
- long n;
+rb_int2inum(SIGNED_VALUE n)
{
if (FIXABLE(n)) return LONG2FIX(n);
return rb_int2big(n);
}
-#ifdef HAVE_LONG_LONG
+#if SIZEOF_LONG % SIZEOF_BDIGITS != 0
+# error unexpected SIZEOF_LONG : SIZEOF_BDIGITS ratio
+#endif
+
+/*
+ * buf is an array of long integers.
+ * buf is ordered from least significant word to most significant word.
+ * buf[0] is the least significant word and
+ * buf[num_longs-1] is the most significant word.
+ * This means words in buf is little endian.
+ * However each word in buf is native endian.
+ * (buf[i]&1) is the least significant bit and
+ * (buf[i]&(1<<(SIZEOF_LONG*CHAR_BIT-1))) is the most significant bit
+ * for each 0 <= i < num_longs.
+ * So buf is little endian at whole on a little endian machine.
+ * But buf is mixed endian on a big endian machine.
+ *
+ * The buf represents negative integers as two's complement.
+ * So, the most significant bit of the most significant word,
+ * (buf[num_longs-1]>>(SIZEOF_LONG*CHAR_BIT-1)),
+ * is the sign bit: 1 means negative and 0 means zero or positive.
+ *
+ * If given size of buf (num_longs) is not enough to represent val,
+ * higier words (including a sign bit) are ignored.
+ */
+void
+rb_big_pack(VALUE val, unsigned long *buf, long num_longs)
+{
+ val = rb_to_int(val);
+ if (num_longs == 0)
+ return;
+ if (FIXNUM_P(val)) {
+ long i;
+ long tmp = FIX2LONG(val);
+ buf[0] = (unsigned long)tmp;
+ tmp = tmp < 0 ? ~0L : 0;
+ for (i = 1; i < num_longs; i++)
+ buf[i] = (unsigned long)tmp;
+ return;
+ }
+ else {
+ long len = RBIGNUM_LEN(val);
+ BDIGIT *ds = BDIGITS(val), *dend = ds + len;
+ long i, j;
+ for (i = 0; i < num_longs && ds < dend; i++) {
+ unsigned long l = 0;
+ for (j = 0; j < DIGSPERLONG && ds < dend; j++, ds++) {
+ l |= ((unsigned long)*ds << (j * BITSPERDIG));
+ }
+ buf[i] = l;
+ }
+ for (; i < num_longs; i++)
+ buf[i] = 0;
+ if (RBIGNUM_NEGATIVE_P(val)) {
+ for (i = 0; i < num_longs; i++) {
+ buf[i] = ~buf[i];
+ }
+ for (i = 0; i < num_longs; i++) {
+ buf[i]++;
+ if (buf[i] != 0)
+ return;
+ }
+ }
+ }
+}
+
+/* See rb_big_pack comment for endianness and sign of buf. */
+VALUE
+rb_big_unpack(unsigned long *buf, long num_longs)
+{
+ while (2 <= num_longs) {
+ if (buf[num_longs-1] == 0 && (long)buf[num_longs-2] >= 0)
+ num_longs--;
+ else if (buf[num_longs-1] == ~0UL && (long)buf[num_longs-2] < 0)
+ num_longs--;
+ else
+ break;
+ }
+ if (num_longs == 0)
+ return INT2FIX(0);
+ else if (num_longs == 1)
+ return LONG2NUM((long)buf[0]);
+ else {
+ VALUE big;
+ BDIGIT *ds;
+ long len = num_longs * DIGSPERLONG;
+ long i;
+ big = bignew(len, 1);
+ ds = BDIGITS(big);
+ for (i = 0; i < num_longs; i++) {
+ unsigned long d = buf[i];
+#if SIZEOF_LONG == SIZEOF_BDIGITS
+ *ds++ = d;
+#else
+ int j;
+ for (j = 0; j < DIGSPERLONG; j++) {
+ *ds++ = BIGLO(d);
+ d = BIGDN(d);
+ }
+#endif
+ }
+ if ((long)buf[num_longs-1] < 0) {
+ get2comp(big);
+ RBIGNUM_SET_SIGN(big, 0);
+ }
+ return bignorm(big);
+ }
+}
+
+#define QUAD_SIZE 8
+
+#if SIZEOF_LONG_LONG == QUAD_SIZE && SIZEOF_BDIGITS*2 == SIZEOF_LONG_LONG
void
-rb_quad_pack(buf, val)
- char *buf;
- VALUE val;
+rb_quad_pack(char *buf, VALUE val)
{
LONG_LONG q;
@@ -203,26 +459,25 @@ rb_quad_pack(buf, val)
q = FIX2LONG(val);
}
else {
- long len = RBIGNUM(val)->len;
+ long len = RBIGNUM_LEN(val);
BDIGIT *ds;
- if (len > SIZEOF_LONG_LONG/SIZEOF_BDIGITS)
- rb_raise(rb_eRangeError, "bignum too big to convert into `quad int'");
+ if (len > SIZEOF_LONG_LONG/SIZEOF_BDIGITS) {
+ len = SIZEOF_LONG_LONG/SIZEOF_BDIGITS;
+ }
ds = BDIGITS(val);
q = 0;
while (len--) {
q = BIGUP(q);
q += ds[len];
}
- if (!RBIGNUM(val)->sign) q = -q;
+ if (!RBIGNUM_SIGN(val)) q = -q;
}
memcpy(buf, (char*)&q, SIZEOF_LONG_LONG);
}
VALUE
-rb_quad_unpack(buf, sign)
- const char *buf;
- int sign;
+rb_quad_unpack(const char *buf, int sign)
{
unsigned LONG_LONG q;
long neg = 0;
@@ -252,22 +507,32 @@ rb_quad_unpack(buf, sign)
i = DIGSPERLL;
while (i-- && !digits[i]) ;
- RBIGNUM(big)->len = i+1;
+ RBIGNUM_SET_LEN(big, i+1);
if (neg) {
- RBIGNUM(big)->sign = 0;
+ RBIGNUM_SET_SIGN(big, 0);
}
return bignorm(big);
}
#else
-#define QUAD_SIZE 8
+static int
+quad_buf_complement(char *buf, size_t len)
+{
+ size_t i;
+ for (i = 0; i < len; i++)
+ buf[i] = ~buf[i];
+ for (i = 0; i < len; i++) {
+ buf[i]++;
+ if (buf[i] != 0)
+ return 0;
+ }
+ return 1;
+}
void
-rb_quad_pack(buf, val)
- char *buf;
- VALUE val;
+rb_quad_pack(char *buf, VALUE val)
{
long len;
@@ -276,39 +541,29 @@ rb_quad_pack(buf, val)
if (FIXNUM_P(val)) {
val = rb_int2big(FIX2LONG(val));
}
- len = RBIGNUM(val)->len * SIZEOF_BDIGITS;
+ len = RBIGNUM_LEN(val) * SIZEOF_BDIGITS;
if (len > QUAD_SIZE) {
- rb_raise(rb_eRangeError, "bignum too big to convert into `quad int'");
+ len = QUAD_SIZE;
}
memcpy(buf, (char*)BDIGITS(val), len);
- if (!RBIGNUM(val)->sign) {
- len = QUAD_SIZE;
- while (len--) {
- *buf = ~*buf;
- buf++;
- }
+ if (RBIGNUM_NEGATIVE_P(val)) {
+ quad_buf_complement(buf, QUAD_SIZE);
}
}
-#define BNEG(b) (RSHIFT(((BDIGIT*)b)[QUAD_SIZE/SIZEOF_BDIGITS-1],BITSPERDIG-1) != 0)
+#define BNEG(b) (RSHIFT(((BDIGIT*)(b))[QUAD_SIZE/SIZEOF_BDIGITS-1],BITSPERDIG-1) != 0)
VALUE
-rb_quad_unpack(buf, sign)
- const char *buf;
- int sign;
+rb_quad_unpack(const char *buf, int sign)
{
VALUE big = bignew(QUAD_SIZE/SIZEOF_BDIGITS, 1);
memcpy((char*)BDIGITS(big), buf, QUAD_SIZE);
if (sign && BNEG(buf)) {
- long len = QUAD_SIZE;
char *tmp = (char*)BDIGITS(big);
- RBIGNUM(big)->sign = 0;
- while (len--) {
- *tmp = ~*tmp;
- tmp++;
- }
+ RBIGNUM_SET_SIGN(big, 0);
+ quad_buf_complement(tmp, QUAD_SIZE);
}
return bignorm(big);
@@ -317,10 +572,7 @@ rb_quad_unpack(buf, sign)
#endif
VALUE
-rb_cstr_to_inum(str, base, badcheck)
- const char *str;
- int base;
- int badcheck;
+rb_cstr_to_inum(const char *str, int base, int badcheck)
{
const char *s = str;
char *end;
@@ -332,23 +584,20 @@ rb_cstr_to_inum(str, base, badcheck)
VALUE z;
BDIGIT *zds;
+#undef ISDIGIT
+#define ISDIGIT(c) ('0' <= (c) && (c) <= '9')
#define conv_digit(c) \
(!ISASCII(c) ? -1 : \
- isdigit(c) ? ((c) - '0') : \
- islower(c) ? ((c) - 'a' + 10) : \
- isupper(c) ? ((c) - 'A' + 10) : \
+ ISDIGIT(c) ? ((c) - '0') : \
+ ISLOWER(c) ? ((c) - 'a' + 10) : \
+ ISUPPER(c) ? ((c) - 'A' + 10) : \
-1)
if (!str) {
if (badcheck) goto bad;
return INT2FIX(0);
}
- if (badcheck) {
- while (ISSPACE(*str)) str++;
- }
- else {
- while (ISSPACE(*str) || *str == '_') str++;
- }
+ while (ISSPACE(*str)) str++;
if (str[0] == '+') {
str++;
@@ -419,7 +668,7 @@ rb_cstr_to_inum(str, base, badcheck)
break;
default:
if (base < 2 || 36 < base) {
- rb_raise(rb_eArgError, "illegal radix %d", base);
+ rb_raise(rb_eArgError, "invalid radix %d", base);
}
if (base <= 32) {
len = 5;
@@ -429,8 +678,15 @@ rb_cstr_to_inum(str, base, badcheck)
}
break;
}
- if (*str == '0') { /* squeeze preceeding 0s */
- while (*++str == '0');
+ if (*str == '0') { /* squeeze preceding 0s */
+ int us = 0;
+ while ((c = *++str) == '0' || c == '_') {
+ if (c == '_') {
+ if (++us >= 2)
+ break;
+ } else
+ us = 0;
+ }
if (!(c = *str) || ISSPACE(c)) --str;
}
c = *str;
@@ -441,10 +697,10 @@ rb_cstr_to_inum(str, base, badcheck)
}
len *= strlen(str)*sizeof(char);
- if (len <= (sizeof(VALUE)*CHAR_BIT)) {
- unsigned long val = strtoul((char*)str, &end, base);
+ if ((size_t)len <= (sizeof(long)*CHAR_BIT)) {
+ unsigned long val = STRTOUL(str, &end, base);
- if (*end == '_') goto bigparse;
+ if (str < end && *end == '_') goto bigparse;
if (badcheck) {
if (end == str) goto bad; /* no number */
while (*end && ISSPACE(*end)) end++;
@@ -460,7 +716,7 @@ rb_cstr_to_inum(str, base, badcheck)
}
else {
VALUE big = rb_uint2big(val);
- RBIGNUM(big)->sign = sign;
+ RBIGNUM_SET_SIGN(big, sign);
return bignorm(big);
}
}
@@ -473,10 +729,11 @@ rb_cstr_to_inum(str, base, badcheck)
for (i=len;i--;) zds[i]=0;
while ((c = *str++) != 0) {
if (c == '_') {
- if (badcheck) {
- if (nondigit) goto bad;
- nondigit = c;
+ if (nondigit) {
+ if (badcheck) goto bad;
+ break;
}
+ nondigit = (char) c;
continue;
}
else if ((c = conv_digit(c)) < 0) {
@@ -505,7 +762,7 @@ rb_cstr_to_inum(str, base, badcheck)
while (*str && ISSPACE(*str)) str++;
if (*str) {
bad:
- rb_invalid_str(s, "Integer");
+ rb_invalid_str(s, "Integer()");
}
}
@@ -513,39 +770,41 @@ rb_cstr_to_inum(str, base, badcheck)
}
VALUE
-rb_str_to_inum(str, base, badcheck)
- VALUE str;
- int base;
- int badcheck;
+rb_str_to_inum(VALUE str, int base, int badcheck)
{
char *s;
long len;
+ VALUE v = 0;
+ VALUE ret;
StringValue(str);
+ rb_must_asciicompat(str);
if (badcheck) {
s = StringValueCStr(str);
}
else {
- s = RSTRING(str)->ptr;
+ s = RSTRING_PTR(str);
}
if (s) {
- len = RSTRING(str)->len;
+ len = RSTRING_LEN(str);
if (s[len]) { /* no sentinel somehow */
- char *p = ALLOCA_N(char, len+1);
+ char *p = ALLOCV(v, len+1);
MEMCPY(p, s, char, len);
p[len] = '\0';
s = p;
}
}
- return rb_cstr_to_inum(s, base, badcheck);
+ ret = rb_cstr_to_inum(s, base, badcheck);
+ if (v)
+ ALLOCV_END(v);
+ return ret;
}
#if HAVE_LONG_LONG
-VALUE
-rb_ull2big(n)
- unsigned LONG_LONG n;
+static VALUE
+rb_ull2big(unsigned LONG_LONG n)
{
BDIGIT_DBL num = n;
long i = 0;
@@ -561,13 +820,12 @@ rb_ull2big(n)
i = DIGSPERLL;
while (i-- && !digits[i]) ;
- RBIGNUM(big)->len = i+1;
+ RBIGNUM_SET_LEN(big, i+1);
return big;
}
-VALUE
-rb_ll2big(n)
- LONG_LONG n;
+static VALUE
+rb_ll2big(LONG_LONG n)
{
long neg = 0;
VALUE big;
@@ -578,137 +836,334 @@ rb_ll2big(n)
}
big = rb_ull2big(n);
if (neg) {
- RBIGNUM(big)->sign = 0;
+ RBIGNUM_SET_SIGN(big, 0);
}
return big;
}
VALUE
-rb_ull2inum(n)
- unsigned LONG_LONG n;
+rb_ull2inum(unsigned LONG_LONG n)
{
if (POSFIXABLE(n)) return LONG2FIX(n);
return rb_ull2big(n);
}
VALUE
-rb_ll2inum(n)
- LONG_LONG n;
+rb_ll2inum(LONG_LONG n)
{
if (FIXABLE(n)) return LONG2FIX(n);
return rb_ll2big(n);
}
#endif /* HAVE_LONG_LONG */
-
+
VALUE
-rb_cstr2inum(str, base)
- const char *str;
- int base;
+rb_cstr2inum(const char *str, int base)
{
return rb_cstr_to_inum(str, base, base==0);
}
VALUE
-rb_str2inum(str, base)
- VALUE str;
- int base;
+rb_str2inum(VALUE str, int base)
{
return rb_str_to_inum(str, base, base==0);
}
const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
-VALUE
-rb_big2str(x, base)
- VALUE x;
- int base;
+
+static VALUE bigsqr(VALUE x);
+static void bigdivmod(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp);
+
+#define POW2_P(x) (((x)&((x)-1))==0)
+
+static inline int
+ones(register unsigned long x)
{
- volatile VALUE t;
- BDIGIT *ds;
- long i, j, hbase;
- VALUE ss;
- char *s, c;
+#if SIZEOF_LONG == 8
+# define MASK_55 0x5555555555555555UL
+# define MASK_33 0x3333333333333333UL
+# define MASK_0f 0x0f0f0f0f0f0f0f0fUL
+#else
+# define MASK_55 0x55555555UL
+# define MASK_33 0x33333333UL
+# define MASK_0f 0x0f0f0f0fUL
+#endif
+ x -= (x >> 1) & MASK_55;
+ x = ((x >> 2) & MASK_33) + (x & MASK_33);
+ x = ((x >> 4) + x) & MASK_0f;
+ x += (x >> 8);
+ x += (x >> 16);
+#if SIZEOF_LONG == 8
+ x += (x >> 32);
+#endif
+ return (int)(x & 0x7f);
+#undef MASK_0f
+#undef MASK_33
+#undef MASK_55
+}
+
+static inline unsigned long
+next_pow2(register unsigned long x)
+{
+ x |= x >> 1;
+ x |= x >> 2;
+ x |= x >> 4;
+ x |= x >> 8;
+ x |= x >> 16;
+#if SIZEOF_LONG == 8
+ x |= x >> 32;
+#endif
+ return x + 1;
+}
+
+static inline int
+floor_log2(register unsigned long x)
+{
+ x |= x >> 1;
+ x |= x >> 2;
+ x |= x >> 4;
+ x |= x >> 8;
+ x |= x >> 16;
+#if SIZEOF_LONG == 8
+ x |= x >> 32;
+#endif
+ return (int)ones(x) - 1;
+}
+
+static inline int
+ceil_log2(register unsigned long x)
+{
+ return floor_log2(x) + !POW2_P(x);
+}
+
+#define LOG2_KARATSUBA_DIGITS 7
+#define KARATSUBA_DIGITS (1L<<LOG2_KARATSUBA_DIGITS)
+#define MAX_BIG2STR_TABLE_ENTRIES 64
+
+static VALUE big2str_power_cache[35][MAX_BIG2STR_TABLE_ENTRIES];
+
+static void
+power_cache_init(void)
+{
+ int i, j;
+ for (i = 0; i < 35; ++i) {
+ for (j = 0; j < MAX_BIG2STR_TABLE_ENTRIES; ++j) {
+ big2str_power_cache[i][j] = Qnil;
+ }
+ }
+}
+
+static inline VALUE
+power_cache_get_power0(int base, int i)
+{
+ if (NIL_P(big2str_power_cache[base - 2][i])) {
+ big2str_power_cache[base - 2][i] =
+ i == 0 ? rb_big_pow(rb_int2big(base), INT2FIX(KARATSUBA_DIGITS))
+ : bigsqr(power_cache_get_power0(base, i - 1));
+ rb_gc_register_mark_object(big2str_power_cache[base - 2][i]);
+ }
+ return big2str_power_cache[base - 2][i];
+}
+
+static VALUE
+power_cache_get_power(int base, long n1, long* m1)
+{
+ int i, m;
+ long j;
+ VALUE t;
+
+ if (n1 <= KARATSUBA_DIGITS)
+ rb_bug("n1 > KARATSUBA_DIGITS");
+
+ m = ceil_log2(n1);
+ if (m1) *m1 = 1 << m;
+ i = m - LOG2_KARATSUBA_DIGITS;
+ if (i >= MAX_BIG2STR_TABLE_ENTRIES)
+ i = MAX_BIG2STR_TABLE_ENTRIES - 1;
+ t = power_cache_get_power0(base, i);
+
+ j = KARATSUBA_DIGITS*(1 << i);
+ while (n1 > j) {
+ t = bigsqr(t);
+ j *= 2;
+ }
+ return t;
+}
+
+/* big2str_muraken_find_n1
+ *
+ * Let a natural number x is given by:
+ * x = 2^0 * x_0 + 2^1 * x_1 + ... + 2^(B*n_0 - 1) * x_{B*n_0 - 1},
+ * where B is BITSPERDIG (i.e. BDIGITS*CHAR_BIT) and n_0 is
+ * RBIGNUM_LEN(x).
+ *
+ * Now, we assume n_1 = min_n \{ n | 2^(B*n_0/2) <= b_1^(n_1) \}, so
+ * it is realized that 2^(B*n_0) <= {b_1}^{2*n_1}, where b_1 is a
+ * given radix number. And then, we have n_1 <= (B*n_0) /
+ * (2*log_2(b_1)), therefore n_1 is given by ceil((B*n_0) /
+ * (2*log_2(b_1))).
+ */
+static long
+big2str_find_n1(VALUE x, int base)
+{
+ static const double log_2[] = {
+ 1.0, 1.58496250072116, 2.0,
+ 2.32192809488736, 2.58496250072116, 2.8073549220576,
+ 3.0, 3.16992500144231, 3.32192809488736,
+ 3.4594316186373, 3.58496250072116, 3.70043971814109,
+ 3.8073549220576, 3.90689059560852, 4.0,
+ 4.08746284125034, 4.16992500144231, 4.24792751344359,
+ 4.32192809488736, 4.39231742277876, 4.4594316186373,
+ 4.52356195605701, 4.58496250072116, 4.64385618977472,
+ 4.70043971814109, 4.75488750216347, 4.8073549220576,
+ 4.85798099512757, 4.90689059560852, 4.95419631038688,
+ 5.0, 5.04439411935845, 5.08746284125034,
+ 5.12928301694497, 5.16992500144231
+ };
+ long bits;
+
+ if (base < 2 || 36 < base)
+ rb_bug("invalid radix %d", base);
if (FIXNUM_P(x)) {
- return rb_fix2str(x, base);
+ bits = (SIZEOF_LONG*CHAR_BIT - 1)/2 + 1;
}
- i = RBIGNUM(x)->len;
- if (BIGZEROP(x)) {
- return rb_str_new2("0");
+ else if (BIGZEROP(x)) {
+ return 0;
}
- j = SIZEOF_BDIGITS*CHAR_BIT*i;
- switch (base) {
- case 2: break;
- case 3:
- j = j * 647L / 1024;
- break;
- case 4: case 5: case 6: case 7:
- j /= 2;
- break;
- case 8: case 9:
- j /= 3;
- break;
- case 10: case 11: case 12: case 13: case 14: case 15:
- j = j * 241L / 800;
- break;
- case 16: case 17: case 18: case 19: case 20: case 21:
- case 22: case 23: case 24: case 25: case 26: case 27:
- case 28: case 29: case 30: case 31:
- j /= 4;
- break;
- case 32: case 33: case 34: case 35: case 36:
- j /= 5;
- break;
- default:
- rb_raise(rb_eArgError, "illegal radix %d", base);
- break;
+ else if (RBIGNUM_LEN(x) >= LONG_MAX/BITSPERDIG) {
+ rb_raise(rb_eRangeError, "bignum too big to convert into `string'");
+ }
+ else {
+ bits = BITSPERDIG*RBIGNUM_LEN(x);
}
- j += 2;
- hbase = base * base;
-#if SIZEOF_BDIGITS > 2
- hbase *= hbase;
-#endif
+ /* @shyouhei note: vvvvvvvvvvvvv this cast is suspicious. But I believe it is OK, because if that cast loses data, this x value is too big, and should have raised RangeError. */
+ return (long)ceil(((double)bits)/log_2[base - 2]);
+}
- t = rb_big_clone(x);
- ds = BDIGITS(t);
- ss = rb_str_new(0, j);
- s = RSTRING(ss)->ptr;
+static long
+big2str_orig(VALUE x, int base, char* ptr, long len, long hbase, int trim)
+{
+ long i = RBIGNUM_LEN(x), j = len;
+ BDIGIT* ds = BDIGITS(x);
- s[0] = RBIGNUM(x)->sign ? '+' : '-';
- while (i && j) {
+ while (i && j > 0) {
long k = i;
BDIGIT_DBL num = 0;
- while (k--) {
+ while (k--) { /* x / hbase */
num = BIGUP(num) + ds[k];
ds[k] = (BDIGIT)(num / hbase);
num %= hbase;
}
- if (ds[i-1] == 0) i--;
+ if (trim && ds[i-1] == 0) i--;
k = SIZEOF_BDIGITS;
while (k--) {
- c = (char)(num % base);
- s[--j] = ruby_digitmap[(int)c];
+ ptr[--j] = ruby_digitmap[num % base];
num /= base;
- if (i == 0 && num == 0) break;
+ if (j <= 0) break;
+ if (trim && i == 0 && num == 0) break;
+ }
+ }
+ if (trim) {
+ while (j < len && ptr[j] == '0') j++;
+ MEMMOVE(ptr, ptr + j, char, len - j);
+ len -= j;
+ }
+ return len;
+}
+
+static long
+big2str_karatsuba(VALUE x, int base, char* ptr,
+ long n1, long len, long hbase, int trim)
+{
+ long lh, ll, m1;
+ VALUE b, q, r;
+
+ if (BIGZEROP(x)) {
+ if (trim) return 0;
+ else {
+ memset(ptr, '0', len);
+ return len;
}
}
- while (s[j] == '0') j++;
- RSTRING(ss)->len -= RBIGNUM(x)->sign?j:j-1;
- memmove(RBIGNUM(x)->sign?s:s+1, s+j, RSTRING(ss)->len);
- s[RSTRING(ss)->len] = '\0';
+
+ if (n1 <= KARATSUBA_DIGITS) {
+ return big2str_orig(x, base, ptr, len, hbase, trim);
+ }
+
+ b = power_cache_get_power(base, n1, &m1);
+ bigdivmod(x, b, &q, &r);
+ lh = big2str_karatsuba(q, base, ptr, (len - m1)/2,
+ len - m1, hbase, trim);
+ rb_big_resize(q, 0);
+ ll = big2str_karatsuba(r, base, ptr + lh, m1/2,
+ m1, hbase, !lh && trim);
+ rb_big_resize(r, 0);
+
+ return lh + ll;
+}
+
+VALUE
+rb_big2str0(VALUE x, int base, int trim)
+{
+ int off;
+ VALUE ss, xx;
+ long n1, n2, len, hbase;
+ char* ptr;
+
+ if (FIXNUM_P(x)) {
+ return rb_fix2str(x, base);
+ }
+ if (BIGZEROP(x)) {
+ return rb_usascii_str_new2("0");
+ }
+
+ if (base < 2 || 36 < base)
+ rb_raise(rb_eArgError, "invalid radix %d", base);
+
+ n2 = big2str_find_n1(x, base);
+ n1 = (n2 + 1) / 2;
+ ss = rb_usascii_str_new(0, n2 + 1); /* plus one for sign */
+ ptr = RSTRING_PTR(ss);
+ ptr[0] = RBIGNUM_SIGN(x) ? '+' : '-';
+
+ hbase = base*base;
+#if SIZEOF_BDIGITS > 2
+ hbase *= hbase;
+#endif
+ off = !(trim && RBIGNUM_SIGN(x)); /* erase plus sign if trim */
+ xx = rb_big_clone(x);
+ RBIGNUM_SET_SIGN(xx, 1);
+ if (n1 <= KARATSUBA_DIGITS) {
+ len = off + big2str_orig(xx, base, ptr + off, n2, hbase, trim);
+ }
+ else {
+ len = off + big2str_karatsuba(xx, base, ptr + off, n1,
+ n2, hbase, trim);
+ }
+ rb_big_resize(xx, 0);
+
+ ptr[len] = '\0';
+ rb_str_resize(ss, len);
return ss;
}
+VALUE
+rb_big2str(VALUE x, int base)
+{
+ return rb_big2str0(x, base, 1);
+}
+
/*
* call-seq:
- * big.to_s(base=10) => string
- *
+ * big.to_s(base=10) -> string
+ *
* Returns a string containing the representation of <i>big</i> radix
* <i>base</i> (2 through 36).
- *
+ *
* 12345654321.to_s #=> "12345654321"
* 12345654321.to_s(2) #=> "1011011111110110111011110000110001"
* 12345654321.to_s(8) #=> "133766736061"
@@ -717,87 +1172,85 @@ rb_big2str(x, base)
*/
static VALUE
-rb_big_to_s(argc, argv, x)
- int argc;
- VALUE *argv;
- VALUE x;
+rb_big_to_s(int argc, VALUE *argv, VALUE x)
{
- VALUE b;
int base;
- rb_scan_args(argc, argv, "01", &b);
if (argc == 0) base = 10;
- else base = NUM2INT(b);
+ else {
+ VALUE b;
+
+ rb_scan_args(argc, argv, "01", &b);
+ base = NUM2INT(b);
+ }
return rb_big2str(x, base);
}
-static unsigned long
-big2ulong(x, type)
- VALUE x;
- char *type;
+static VALUE
+big2ulong(VALUE x, const char *type, int check)
{
- long len = RBIGNUM(x)->len;
+ long len = RBIGNUM_LEN(x);
BDIGIT_DBL num;
BDIGIT *ds;
- if (len > SIZEOF_LONG/SIZEOF_BDIGITS)
- rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type);
+ if (len > DIGSPERLONG) {
+ if (check)
+ rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type);
+ len = DIGSPERLONG;
+ }
ds = BDIGITS(x);
num = 0;
while (len--) {
num = BIGUP(num);
num += ds[len];
}
- return num;
+ return (VALUE)num;
}
-unsigned long
-rb_big2ulong_pack(x)
- VALUE x;
-{
- unsigned long num = big2ulong(x, "unsigned long");
- if (!RBIGNUM(x)->sign) {
- return -num;
+VALUE
+rb_big2ulong_pack(VALUE x)
+{
+ VALUE num = big2ulong(x, "unsigned long", FALSE);
+ if (!RBIGNUM_SIGN(x)) {
+ return (VALUE)(-(SIGNED_VALUE)num);
}
return num;
-}
+}
-unsigned long
-rb_big2ulong(x)
- VALUE x;
+VALUE
+rb_big2ulong(VALUE x)
{
- unsigned long num = big2ulong(x, "unsigned long");
+ VALUE num = big2ulong(x, "unsigned long", TRUE);
- if (!RBIGNUM(x)->sign) {
- if ((long)num < 0) {
+ if (!RBIGNUM_SIGN(x)) {
+ unsigned long v = (unsigned long)(-(long)num);
+
+ if (v <= LONG_MAX)
rb_raise(rb_eRangeError, "bignum out of range of unsigned long");
- }
- return -num;
+ return (VALUE)v;
}
return num;
}
-long
-rb_big2long(x)
- VALUE x;
+SIGNED_VALUE
+rb_big2long(VALUE x)
{
- unsigned long num = big2ulong(x, "long");
+ VALUE num = big2ulong(x, "long", TRUE);
- if ((long)num < 0 && (RBIGNUM(x)->sign || (long)num != LONG_MIN)) {
+ if ((long)num < 0 &&
+ (RBIGNUM_SIGN(x) || (long)num != LONG_MIN)) {
rb_raise(rb_eRangeError, "bignum too big to convert into `long'");
}
- if (!RBIGNUM(x)->sign) return -(long)num;
+ if (!RBIGNUM_SIGN(x)) return -(SIGNED_VALUE)num;
return num;
}
#if HAVE_LONG_LONG
static unsigned LONG_LONG
-big2ull(x, type)
- VALUE x;
- char *type;
+big2ull(VALUE x, const char *type)
{
- long len = RBIGNUM(x)->len;
+ long len = RBIGNUM_LEN(x);
BDIGIT_DBL num;
BDIGIT *ds;
@@ -813,34 +1266,38 @@ big2ull(x, type)
}
unsigned LONG_LONG
-rb_big2ull(x)
- VALUE x;
+rb_big2ull(VALUE x)
{
unsigned LONG_LONG num = big2ull(x, "unsigned long long");
- if (!RBIGNUM(x)->sign) return -num;
+ if (!RBIGNUM_SIGN(x)) {
+ LONG_LONG v = -(LONG_LONG)num;
+
+ /* FIXNUM_MIN-1 .. LLONG_MIN mapped into 0xbfffffffffffffff .. LONG_MAX+1 */
+ if ((unsigned LONG_LONG)v <= LLONG_MAX)
+ rb_raise(rb_eRangeError, "bignum out of range of unsigned long long");
+ return v;
+ }
return num;
}
LONG_LONG
-rb_big2ll(x)
- VALUE x;
+rb_big2ll(VALUE x)
{
unsigned LONG_LONG num = big2ull(x, "long long");
- if ((LONG_LONG)num < 0 && (RBIGNUM(x)->sign
+ if ((LONG_LONG)num < 0 && (RBIGNUM_SIGN(x)
|| (LONG_LONG)num != LLONG_MIN)) {
rb_raise(rb_eRangeError, "bignum too big to convert into `long long'");
}
- if (!RBIGNUM(x)->sign) return -(LONG_LONG)num;
+ if (!RBIGNUM_SIGN(x)) return -(LONG_LONG)num;
return num;
}
#endif /* HAVE_LONG_LONG */
static VALUE
-dbl2big(d)
- double d;
+dbl2big(double d)
{
long i = 0;
BDIGIT c;
@@ -872,62 +1329,208 @@ dbl2big(d)
}
VALUE
-rb_dbl2big(d)
- double d;
+rb_dbl2big(double d)
{
return bignorm(dbl2big(d));
}
-double
-rb_big2dbl(x)
- VALUE x;
+static int
+nlz(BDIGIT x)
+{
+ BDIGIT y;
+ int n = BITSPERDIG;
+#if BITSPERDIG > 64
+ y = x >> 64; if (y) {n -= 64; x = y;}
+#endif
+#if BITSPERDIG > 32
+ y = x >> 32; if (y) {n -= 32; x = y;}
+#endif
+#if BITSPERDIG > 16
+ y = x >> 16; if (y) {n -= 16; x = y;}
+#endif
+ y = x >> 8; if (y) {n -= 8; x = y;}
+ y = x >> 4; if (y) {n -= 4; x = y;}
+ y = x >> 2; if (y) {n -= 2; x = y;}
+ y = x >> 1; if (y) {return n - 2;}
+ return n - x;
+}
+
+static double
+big2dbl(VALUE x)
{
double d = 0.0;
- long i = RBIGNUM(x)->len;
- BDIGIT *ds = BDIGITS(x);
+ long i = (bigtrunc(x), RBIGNUM_LEN(x)), lo = 0, bits;
+ BDIGIT *ds = BDIGITS(x), dl;
- while (i--) {
- d = ds[i] + BIGRAD*d;
+ if (i) {
+ bits = i * BITSPERDIG - nlz(ds[i-1]);
+ if (bits > DBL_MANT_DIG+DBL_MAX_EXP) {
+ d = HUGE_VAL;
+ }
+ else {
+ if (bits > DBL_MANT_DIG+1)
+ lo = (bits -= DBL_MANT_DIG+1) / BITSPERDIG;
+ else
+ bits = 0;
+ while (--i > lo) {
+ d = ds[i] + BIGRAD*d;
+ }
+ dl = ds[i];
+ if (bits && (dl & (1UL << (bits %= BITSPERDIG)))) {
+ int carry = dl & ~(~(BDIGIT)0 << bits);
+ if (!carry) {
+ while (i-- > 0) {
+ if ((carry = ds[i]) != 0) break;
+ }
+ }
+ if (carry) {
+ dl &= (BDIGIT)~0 << bits;
+ dl += (BDIGIT)1 << bits;
+ if (!dl) d += 1;
+ }
+ }
+ d = dl + BIGRAD*d;
+ if (lo) {
+ if (lo > INT_MAX / BITSPERDIG)
+ d = HUGE_VAL;
+ else if (lo < INT_MIN / BITSPERDIG)
+ d = 0.0;
+ else
+ d = ldexp(d, (int)(lo * BITSPERDIG));
+ }
+ }
}
+ if (!RBIGNUM_SIGN(x)) d = -d;
+ return d;
+}
+
+double
+rb_big2dbl(VALUE x)
+{
+ double d = big2dbl(x);
+
if (isinf(d)) {
- rb_warn("Bignum out of Float range");
- d = HUGE_VAL;
+ rb_warning("Bignum out of Float range");
+ if (d < 0.0)
+ d = -HUGE_VAL;
+ else
+ d = HUGE_VAL;
}
- if (!RBIGNUM(x)->sign) d = -d;
return d;
}
/*
* call-seq:
* big.to_f -> float
- *
+ *
* Converts <i>big</i> to a <code>Float</code>. If <i>big</i> doesn't
* fit in a <code>Float</code>, the result is infinity.
- *
+ *
*/
static VALUE
-rb_big_to_f(x)
- VALUE x;
+rb_big_to_f(VALUE x)
+{
+ return DBL2NUM(rb_big2dbl(x));
+}
+
+VALUE
+rb_integer_float_cmp(VALUE x, VALUE y)
+{
+ double yd = RFLOAT_VALUE(y);
+ double yi, yf;
+ VALUE rel;
+
+ if (isnan(yd))
+ return Qnil;
+ if (isinf(yd)) {
+ if (yd > 0.0) return INT2FIX(-1);
+ else return INT2FIX(1);
+ }
+ yf = modf(yd, &yi);
+ if (FIXNUM_P(x)) {
+#if SIZEOF_LONG * CHAR_BIT < DBL_MANT_DIG /* assume FLT_RADIX == 2 */
+ double xd = (double)FIX2LONG(x);
+ if (xd < yd)
+ return INT2FIX(-1);
+ if (xd > yd)
+ return INT2FIX(1);
+ return INT2FIX(0);
+#else
+ long xl, yl;
+ if (yi < FIXNUM_MIN)
+ return INT2FIX(1);
+ if (FIXNUM_MAX+1 <= yi)
+ return INT2FIX(-1);
+ xl = FIX2LONG(x);
+ yl = (long)yi;
+ if (xl < yl)
+ return INT2FIX(-1);
+ if (xl > yl)
+ return INT2FIX(1);
+ if (yf < 0.0)
+ return INT2FIX(1);
+ if (0.0 < yf)
+ return INT2FIX(-1);
+ return INT2FIX(0);
+#endif
+ }
+ y = rb_dbl2big(yi);
+ rel = rb_big_cmp(x, y);
+ if (yf == 0.0 || rel != INT2FIX(0))
+ return rel;
+ if (yf < 0.0)
+ return INT2FIX(1);
+ return INT2FIX(-1);
+}
+
+VALUE
+rb_integer_float_eq(VALUE x, VALUE y)
{
- return rb_float_new(rb_big2dbl(x));
+ double yd = RFLOAT_VALUE(y);
+ double yi, yf;
+
+ if (isnan(yd) || isinf(yd))
+ return Qfalse;
+ yf = modf(yd, &yi);
+ if (yf != 0)
+ return Qfalse;
+ if (FIXNUM_P(x)) {
+#if SIZEOF_LONG * CHAR_BIT < DBL_MANT_DIG /* assume FLT_RADIX == 2 */
+ double xd = (double)FIX2LONG(x);
+ if (xd != yd)
+ return Qfalse;
+ return Qtrue;
+#else
+ long xl, yl;
+ if (yi < LONG_MIN || LONG_MAX < yi)
+ return Qfalse;
+ xl = FIX2LONG(x);
+ yl = (long)yi;
+ if (xl != yl)
+ return Qfalse;
+ return Qtrue;
+#endif
+ }
+ y = rb_dbl2big(yi);
+ return rb_big_eq(x, y);
}
/*
* call-seq:
- * big <=> numeric => -1, 0, +1
- *
+ * big <=> numeric -> -1, 0, +1 or nil
+ *
* Comparison---Returns -1, 0, or +1 depending on whether <i>big</i> is
* less than, equal to, or greater than <i>numeric</i>. This is the
* basis for the tests in <code>Comparable</code>.
- *
+ *
*/
-static VALUE
-rb_big_cmp(x, y)
- VALUE x, y;
+VALUE
+rb_big_cmp(VALUE x, VALUE y)
{
- long xlen = RBIGNUM(x)->len;
+ long xlen = RBIGNUM_LEN(x);
+ BDIGIT *xds, *yds;
switch (TYPE(y)) {
case T_FIXNUM:
@@ -938,40 +1541,146 @@ rb_big_cmp(x, y)
break;
case T_FLOAT:
- return rb_dbl_cmp(rb_big2dbl(x), RFLOAT(y)->value);
+ return rb_integer_float_cmp(x, y);
default:
- return rb_num_coerce_cmp(x, y);
+ return rb_num_coerce_cmp(x, y, rb_intern("<=>"));
}
- if (RBIGNUM(x)->sign > RBIGNUM(y)->sign) return INT2FIX(1);
- if (RBIGNUM(x)->sign < RBIGNUM(y)->sign) return INT2FIX(-1);
- if (xlen < RBIGNUM(y)->len)
- return (RBIGNUM(x)->sign) ? INT2FIX(-1) : INT2FIX(1);
- if (xlen > RBIGNUM(y)->len)
- return (RBIGNUM(x)->sign) ? INT2FIX(1) : INT2FIX(-1);
+ if (RBIGNUM_SIGN(x) > RBIGNUM_SIGN(y)) return INT2FIX(1);
+ if (RBIGNUM_SIGN(x) < RBIGNUM_SIGN(y)) return INT2FIX(-1);
+ if (xlen < RBIGNUM_LEN(y))
+ return (RBIGNUM_SIGN(x)) ? INT2FIX(-1) : INT2FIX(1);
+ if (xlen > RBIGNUM_LEN(y))
+ return (RBIGNUM_SIGN(x)) ? INT2FIX(1) : INT2FIX(-1);
+
+ xds = BDIGITS(x);
+ yds = BDIGITS(y);
- while(xlen-- && (BDIGITS(x)[xlen]==BDIGITS(y)[xlen]));
+ while (xlen-- && (xds[xlen]==yds[xlen]));
if (-1 == xlen) return INT2FIX(0);
- return (BDIGITS(x)[xlen] > BDIGITS(y)[xlen]) ?
- (RBIGNUM(x)->sign ? INT2FIX(1) : INT2FIX(-1)) :
- (RBIGNUM(x)->sign ? INT2FIX(-1) : INT2FIX(1));
+ return (xds[xlen] > yds[xlen]) ?
+ (RBIGNUM_SIGN(x) ? INT2FIX(1) : INT2FIX(-1)) :
+ (RBIGNUM_SIGN(x) ? INT2FIX(-1) : INT2FIX(1));
+}
+
+enum big_op_t {
+ big_op_gt,
+ big_op_ge,
+ big_op_lt,
+ big_op_le
+};
+
+static VALUE
+big_op(VALUE x, VALUE y, enum big_op_t op)
+{
+ VALUE rel;
+ int n;
+
+ switch (TYPE(y)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ rel = rb_big_cmp(x, y);
+ break;
+
+ case T_FLOAT:
+ rel = rb_integer_float_cmp(x, y);
+ break;
+
+ default:
+ {
+ ID id = 0;
+ switch (op) {
+ case big_op_gt: id = '>'; break;
+ case big_op_ge: id = rb_intern(">="); break;
+ case big_op_lt: id = '<'; break;
+ case big_op_le: id = rb_intern("<="); break;
+ }
+ return rb_num_coerce_relop(x, y, id);
+ }
+ }
+
+ if (NIL_P(rel)) return Qfalse;
+ n = FIX2INT(rel);
+
+ switch (op) {
+ case big_op_gt: return n > 0 ? Qtrue : Qfalse;
+ case big_op_ge: return n >= 0 ? Qtrue : Qfalse;
+ case big_op_lt: return n < 0 ? Qtrue : Qfalse;
+ case big_op_le: return n <= 0 ? Qtrue : Qfalse;
+ }
+ return Qundef;
+}
+
+/*
+ * call-seq:
+ * big > real -> true or false
+ *
+ * Returns <code>true</code> if the value of <code>big</code> is
+ * greater than that of <code>real</code>.
+ */
+
+static VALUE
+big_gt(VALUE x, VALUE y)
+{
+ return big_op(x, y, big_op_gt);
+}
+
+/*
+ * call-seq:
+ * big >= real -> true or false
+ *
+ * Returns <code>true</code> if the value of <code>big</code> is
+ * greater than or equal to that of <code>real</code>.
+ */
+
+static VALUE
+big_ge(VALUE x, VALUE y)
+{
+ return big_op(x, y, big_op_ge);
+}
+
+/*
+ * call-seq:
+ * big < real -> true or false
+ *
+ * Returns <code>true</code> if the value of <code>big</code> is
+ * less than that of <code>real</code>.
+ */
+
+static VALUE
+big_lt(VALUE x, VALUE y)
+{
+ return big_op(x, y, big_op_lt);
+}
+
+/*
+ * call-seq:
+ * big <= real -> true or false
+ *
+ * Returns <code>true</code> if the value of <code>big</code> is
+ * less than or equal to that of <code>real</code>.
+ */
+
+static VALUE
+big_le(VALUE x, VALUE y)
+{
+ return big_op(x, y, big_op_le);
}
/*
* call-seq:
- * big == obj => true or false
- *
+ * big == obj -> true or false
+ *
* Returns <code>true</code> only if <i>obj</i> has the same value
* as <i>big</i>. Contrast this with <code>Bignum#eql?</code>, which
* requires <i>obj</i> to be a <code>Bignum</code>.
- *
+ *
* 68719476736 == 68719476736.0 #=> true
*/
-static VALUE
-rb_big_eq(x, y)
- VALUE x, y;
+VALUE
+rb_big_eq(VALUE x, VALUE y)
{
switch (TYPE(y)) {
case T_FIXNUM:
@@ -980,255 +1689,953 @@ rb_big_eq(x, y)
case T_BIGNUM:
break;
case T_FLOAT:
- {
- volatile double a, b;
-
- a = RFLOAT(y)->value;
- if (isnan(a)) return Qfalse;
- b = rb_big2dbl(x);
- return (a == b)?Qtrue:Qfalse;
- }
+ return rb_integer_float_eq(x, y);
default:
return rb_equal(y, x);
}
- if (RBIGNUM(x)->sign != RBIGNUM(y)->sign) return Qfalse;
- if (RBIGNUM(x)->len != RBIGNUM(y)->len) return Qfalse;
- if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM(y)->len) != 0) return Qfalse;
+ if (RBIGNUM_SIGN(x) != RBIGNUM_SIGN(y)) return Qfalse;
+ if (RBIGNUM_LEN(x) != RBIGNUM_LEN(y)) return Qfalse;
+ if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM_LEN(y)) != 0) return Qfalse;
return Qtrue;
}
/*
* call-seq:
- * big.eql?(obj) => true or false
- *
+ * big.eql?(obj) -> true or false
+ *
* Returns <code>true</code> only if <i>obj</i> is a
* <code>Bignum</code> with the same value as <i>big</i>. Contrast this
* with <code>Bignum#==</code>, which performs type conversions.
- *
+ *
* 68719476736.eql?(68719476736.0) #=> false
*/
-static VALUE
-rb_big_eql(x, y)
- VALUE x, y;
+VALUE
+rb_big_eql(VALUE x, VALUE y)
{
- if (TYPE(y) != T_BIGNUM) return Qfalse;
- if (RBIGNUM(x)->sign != RBIGNUM(y)->sign) return Qfalse;
- if (RBIGNUM(x)->len != RBIGNUM(y)->len) return Qfalse;
- if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM(y)->len) != 0) return Qfalse;
+ if (!RB_TYPE_P(y, T_BIGNUM)) return Qfalse;
+ if (RBIGNUM_SIGN(x) != RBIGNUM_SIGN(y)) return Qfalse;
+ if (RBIGNUM_LEN(x) != RBIGNUM_LEN(y)) return Qfalse;
+ if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM_LEN(y)) != 0) return Qfalse;
return Qtrue;
}
/*
* call-seq:
- * -big => other_big
+ * -big -> integer
*
- * Unary minus (returns a new Bignum whose value is 0-big)
+ * Unary minus (returns an integer whose value is 0-big)
*/
-static VALUE
-rb_big_uminus(x)
- VALUE x;
+VALUE
+rb_big_uminus(VALUE x)
{
VALUE z = rb_big_clone(x);
- RBIGNUM(z)->sign = !RBIGNUM(x)->sign;
+ RBIGNUM_SET_SIGN(z, !RBIGNUM_SIGN(x));
return bignorm(z);
}
/*
* call-seq:
- * ~big => integer
+ * ~big -> integer
*
* Inverts the bits in big. As Bignums are conceptually infinite
* length, the result acts as if it had an infinite number of one
* bits to the left. In hex representations, this is displayed
* as two periods to the left of the digits.
- *
+ *
* sprintf("%X", ~0x1122334455) #=> "..FEEDDCCBBAA"
*/
static VALUE
-rb_big_neg(x)
- VALUE x;
+rb_big_neg(VALUE x)
{
VALUE z = rb_big_clone(x);
- long i;
BDIGIT *ds;
+ long i;
- if (!RBIGNUM(x)->sign) get2comp(z);
+ if (!RBIGNUM_SIGN(x)) get2comp(z);
ds = BDIGITS(z);
- i = RBIGNUM(x)->len;
- if (!i) return INT2FIX(~0);
- while (i--) ds[i] = ~ds[i];
- RBIGNUM(z)->sign = !RBIGNUM(z)->sign;
- if (RBIGNUM(x)->sign) get2comp(z);
+ i = RBIGNUM_LEN(x);
+ if (!i) return INT2FIX(~(SIGNED_VALUE)0);
+ while (i--) {
+ ds[i] = ~ds[i];
+ }
+ RBIGNUM_SET_SIGN(z, !RBIGNUM_SIGN(z));
+ if (RBIGNUM_SIGN(x)) get2comp(z);
return bignorm(z);
}
+static void
+bigsub_core(BDIGIT *xds, long xn, BDIGIT *yds, long yn, BDIGIT *zds, long zn)
+{
+ BDIGIT_DBL_SIGNED num;
+ long i;
+
+ for (i = 0, num = 0; i < yn; i++) {
+ num += (BDIGIT_DBL_SIGNED)xds[i] - yds[i];
+ zds[i] = BIGLO(num);
+ num = BIGDN(num);
+ }
+ while (num && i < xn) {
+ num += xds[i];
+ zds[i++] = BIGLO(num);
+ num = BIGDN(num);
+ }
+ while (i < xn) {
+ zds[i] = xds[i];
+ i++;
+ }
+ assert(i <= zn);
+ while (i < zn) {
+ zds[i++] = 0;
+ }
+}
+
static VALUE
-bigsub(x, y)
- VALUE x, y;
+bigsub(VALUE x, VALUE y)
{
VALUE z = 0;
- BDIGIT *zds;
- BDIGIT_DBL_SIGNED num;
- long i = RBIGNUM(x)->len;
-
- /* if x is larger than y, swap */
- if (RBIGNUM(x)->len < RBIGNUM(y)->len) {
+ long i = RBIGNUM_LEN(x);
+ BDIGIT *xds, *yds;
+
+ /* if x is smaller than y, swap */
+ if (RBIGNUM_LEN(x) < RBIGNUM_LEN(y)) {
z = x; x = y; y = z; /* swap x y */
}
- else if (RBIGNUM(x)->len == RBIGNUM(y)->len) {
+ else if (RBIGNUM_LEN(x) == RBIGNUM_LEN(y)) {
+ xds = BDIGITS(x);
+ yds = BDIGITS(y);
while (i > 0) {
i--;
- if (BDIGITS(x)[i] > BDIGITS(y)[i]) {
+ if (xds[i] > yds[i]) {
break;
}
- if (BDIGITS(x)[i] < BDIGITS(y)[i]) {
+ if (xds[i] < yds[i]) {
z = x; x = y; y = z; /* swap x y */
break;
}
}
}
- z = bignew(RBIGNUM(x)->len, z==0);
+ z = bignew(RBIGNUM_LEN(x), z==0);
+ bigsub_core(BDIGITS(x), RBIGNUM_LEN(x),
+ BDIGITS(y), RBIGNUM_LEN(y),
+ BDIGITS(z), RBIGNUM_LEN(z));
+
+ return z;
+}
+
+static VALUE bigadd_int(VALUE x, long y);
+
+static VALUE
+bigsub_int(VALUE x, long y0)
+{
+ VALUE z;
+ BDIGIT *xds, *zds;
+ long xn;
+ BDIGIT_DBL_SIGNED num;
+ long i, y;
+
+ y = y0;
+ xds = BDIGITS(x);
+ xn = RBIGNUM_LEN(x);
+
+ z = bignew(xn, RBIGNUM_SIGN(x));
zds = BDIGITS(z);
- for (i = 0, num = 0; i < RBIGNUM(y)->len; i++) {
- num += (BDIGIT_DBL_SIGNED)BDIGITS(x)[i] - BDIGITS(y)[i];
+#if SIZEOF_BDIGITS == SIZEOF_LONG
+ num = (BDIGIT_DBL_SIGNED)xds[0] - y;
+ if (xn == 1 && num < 0) {
+ RBIGNUM_SET_SIGN(z, !RBIGNUM_SIGN(x));
+ zds[0] = (BDIGIT)-num;
+ RB_GC_GUARD(x);
+ return bignorm(z);
+ }
+ zds[0] = BIGLO(num);
+ num = BIGDN(num);
+ i = 1;
+#else
+ num = 0;
+ for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
+ num += (BDIGIT_DBL_SIGNED)xds[i] - BIGLO(y);
zds[i] = BIGLO(num);
num = BIGDN(num);
- }
- while (num && i < RBIGNUM(x)->len) {
- num += BDIGITS(x)[i];
+ y = BIGDN(y);
+ }
+#endif
+ while (num && i < xn) {
+ num += xds[i];
zds[i++] = BIGLO(num);
num = BIGDN(num);
}
- while (i < RBIGNUM(x)->len) {
- zds[i] = BDIGITS(x)[i];
+ while (i < xn) {
+ zds[i] = xds[i];
i++;
}
-
- return z;
+ if (num < 0) {
+ z = bigsub(x, rb_int2big(y0));
+ }
+ RB_GC_GUARD(x);
+ return bignorm(z);
}
static VALUE
-bigadd(x, y, sign)
- VALUE x, y;
- int sign;
+bigadd_int(VALUE x, long y)
{
VALUE z;
+ BDIGIT *xds, *zds;
+ long xn, zn;
BDIGIT_DBL num;
- long i, len;
+ long i;
- sign = (sign == RBIGNUM(y)->sign);
- if (RBIGNUM(x)->sign != sign) {
- if (sign) return bigsub(y, x);
- return bigsub(x, y);
- }
+ xds = BDIGITS(x);
+ xn = RBIGNUM_LEN(x);
- if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
- len = RBIGNUM(x)->len + 1;
- z = x; x = y; y = z;
+ if (xn < 2) {
+ zn = 3;
}
else {
- len = RBIGNUM(y)->len + 1;
+ zn = xn + 1;
}
- z = bignew(len, sign);
+ z = bignew(zn, RBIGNUM_SIGN(x));
+ zds = BDIGITS(z);
- len = RBIGNUM(x)->len;
- for (i = 0, num = 0; i < len; i++) {
- num += (BDIGIT_DBL)BDIGITS(x)[i] + BDIGITS(y)[i];
- BDIGITS(z)[i] = BIGLO(num);
+#if SIZEOF_BDIGITS == SIZEOF_LONG
+ num = (BDIGIT_DBL)xds[0] + y;
+ zds[0] = BIGLO(num);
+ num = BIGDN(num);
+ i = 1;
+#else
+ num = 0;
+ for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
+ num += (BDIGIT_DBL)xds[i] + BIGLO(y);
+ zds[i] = BIGLO(num);
num = BIGDN(num);
+ y = BIGDN(y);
}
- len = RBIGNUM(y)->len;
- while (num && i < len) {
- num += BDIGITS(y)[i];
- BDIGITS(z)[i++] = BIGLO(num);
+#endif
+ while (num && i < xn) {
+ num += xds[i];
+ zds[i++] = BIGLO(num);
num = BIGDN(num);
}
- while (i < len) {
- BDIGITS(z)[i] = BDIGITS(y)[i];
+ if (num) zds[i++] = (BDIGIT)num;
+ else while (i < xn) {
+ zds[i] = xds[i];
i++;
}
- BDIGITS(z)[i] = (BDIGIT)num;
+ assert(i <= zn);
+ while (i < zn) {
+ zds[i++] = 0;
+ }
+ RB_GC_GUARD(x);
+ return bignorm(z);
+}
+
+static void
+bigadd_core(BDIGIT *xds, long xn, BDIGIT *yds, long yn, BDIGIT *zds, long zn)
+{
+ BDIGIT_DBL num = 0;
+ long i;
+
+ if (xn > yn) {
+ BDIGIT *tds;
+ tds = xds; xds = yds; yds = tds;
+ i = xn; xn = yn; yn = i;
+ }
+
+ i = 0;
+ while (i < xn) {
+ num += (BDIGIT_DBL)xds[i] + yds[i];
+ zds[i++] = BIGLO(num);
+ num = BIGDN(num);
+ }
+ while (num && i < yn) {
+ num += yds[i];
+ zds[i++] = BIGLO(num);
+ num = BIGDN(num);
+ }
+ while (i < yn) {
+ zds[i] = yds[i];
+ i++;
+ }
+ if (num) zds[i++] = (BDIGIT)num;
+ assert(i <= zn);
+ while (i < zn) {
+ zds[i++] = 0;
+ }
+}
+
+static VALUE
+bigadd(VALUE x, VALUE y, int sign)
+{
+ VALUE z;
+ long len;
+
+ sign = (sign == RBIGNUM_SIGN(y));
+ if (RBIGNUM_SIGN(x) != sign) {
+ if (sign) return bigsub(y, x);
+ return bigsub(x, y);
+ }
+
+ if (RBIGNUM_LEN(x) > RBIGNUM_LEN(y)) {
+ len = RBIGNUM_LEN(x) + 1;
+ }
+ else {
+ len = RBIGNUM_LEN(y) + 1;
+ }
+ z = bignew(len, sign);
+
+ bigadd_core(BDIGITS(x), RBIGNUM_LEN(x),
+ BDIGITS(y), RBIGNUM_LEN(y),
+ BDIGITS(z), RBIGNUM_LEN(z));
return z;
}
/*
* call-seq:
- * big + other => Numeric
+ * big + other -> Numeric
*
* Adds big and other, returning the result.
*/
VALUE
-rb_big_plus(x, y)
- VALUE x, y;
+rb_big_plus(VALUE x, VALUE y)
{
+ long n;
+
switch (TYPE(y)) {
case T_FIXNUM:
- y = rb_int2big(FIX2LONG(y));
- /* fall through */
+ n = FIX2LONG(y);
+ if ((n > 0) != RBIGNUM_SIGN(x)) {
+ if (n < 0) {
+ n = -n;
+ }
+ return bigsub_int(x, n);
+ }
+ if (n < 0) {
+ n = -n;
+ }
+ return bigadd_int(x, n);
+
case T_BIGNUM:
return bignorm(bigadd(x, y, 1));
case T_FLOAT:
- return rb_float_new(rb_big2dbl(x) + RFLOAT(y)->value);
+ return DBL2NUM(rb_big2dbl(x) + RFLOAT_VALUE(y));
default:
- return rb_num_coerce_bin(x, y);
+ return rb_num_coerce_bin(x, y, '+');
}
}
/*
* call-seq:
- * big - other => Numeric
+ * big - other -> Numeric
*
* Subtracts other from big, returning the result.
*/
VALUE
-rb_big_minus(x, y)
- VALUE x, y;
+rb_big_minus(VALUE x, VALUE y)
{
+ long n;
+
switch (TYPE(y)) {
case T_FIXNUM:
- y = rb_int2big(FIX2LONG(y));
- /* fall through */
+ n = FIX2LONG(y);
+ if ((n > 0) != RBIGNUM_SIGN(x)) {
+ if (n < 0) {
+ n = -n;
+ }
+ return bigadd_int(x, n);
+ }
+ if (n < 0) {
+ n = -n;
+ }
+ return bigsub_int(x, n);
+
case T_BIGNUM:
return bignorm(bigadd(x, y, 0));
case T_FLOAT:
- return rb_float_new(rb_big2dbl(x) - RFLOAT(y)->value);
+ return DBL2NUM(rb_big2dbl(x) - RFLOAT_VALUE(y));
default:
- return rb_num_coerce_bin(x, y);
+ return rb_num_coerce_bin(x, y, '-');
+ }
+}
+
+static long
+big_real_len(VALUE x)
+{
+ long i = RBIGNUM_LEN(x);
+ BDIGIT *xds = BDIGITS(x);
+ while (--i && !xds[i]);
+ return i + 1;
+}
+
+static VALUE
+bigmul1_single(VALUE x, VALUE y)
+{
+ BDIGIT_DBL n;
+ VALUE z = bignew(2, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ BDIGIT *xds, *yds, *zds;
+
+ xds = BDIGITS(x);
+ yds = BDIGITS(y);
+ zds = BDIGITS(z);
+
+ n = (BDIGIT_DBL)xds[0] * yds[0];
+ zds[0] = BIGLO(n);
+ zds[1] = (BDIGIT)BIGDN(n);
+
+ return z;
+}
+
+static VALUE
+bigmul1_normal(VALUE x, VALUE y)
+{
+ long xl = RBIGNUM_LEN(x), yl = RBIGNUM_LEN(y), i, j = xl + yl + 1;
+ BDIGIT_DBL n = 0;
+ VALUE z = bignew(j, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ BDIGIT *xds, *yds, *zds;
+
+ xds = BDIGITS(x);
+ yds = BDIGITS(y);
+ zds = BDIGITS(z);
+ while (j--) zds[j] = 0;
+ for (i = 0; i < xl; i++) {
+ BDIGIT_DBL dd;
+ dd = xds[i];
+ if (dd == 0) continue;
+ n = 0;
+ for (j = 0; j < yl; j++) {
+ BDIGIT_DBL ee = n + (BDIGIT_DBL)dd * yds[j];
+ n = zds[i + j] + ee;
+ if (ee) zds[i + j] = BIGLO(n);
+ n = BIGDN(n);
+ }
+ if (n) {
+ zds[i + j] = (BDIGIT)n;
+ }
+ }
+ rb_thread_check_ints();
+ return z;
+}
+
+static VALUE bigmul0(VALUE x, VALUE y);
+
+/* balancing multiplication by slicing larger argument */
+static VALUE
+bigmul1_balance(VALUE x, VALUE y)
+{
+ VALUE z, t1, t2;
+ long i, xn, yn, r, n;
+ BDIGIT *yds, *zds, *t1ds;
+
+ xn = RBIGNUM_LEN(x);
+ yn = RBIGNUM_LEN(y);
+ assert(2 * xn <= yn || 3 * xn <= 2*(yn+2));
+
+ z = bignew(xn + yn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ t1 = bignew(xn, 1);
+
+ yds = BDIGITS(y);
+ zds = BDIGITS(z);
+ t1ds = BDIGITS(t1);
+
+ for (i = 0; i < xn + yn; i++) zds[i] = 0;
+
+ n = 0;
+ while (yn > 0) {
+ r = xn > yn ? yn : xn;
+ MEMCPY(t1ds, yds + n, BDIGIT, r);
+ RBIGNUM_SET_LEN(t1, r);
+ t2 = bigmul0(x, t1);
+ bigadd_core(zds + n, RBIGNUM_LEN(z) - n,
+ BDIGITS(t2), big_real_len(t2),
+ zds + n, RBIGNUM_LEN(z) - n);
+ yn -= r;
+ n += r;
+ }
+
+ return z;
+}
+
+/* split a bignum into high and low bignums */
+static void
+big_split(VALUE v, long n, volatile VALUE *ph, volatile VALUE *pl)
+{
+ long hn = 0, ln = RBIGNUM_LEN(v);
+ VALUE h, l;
+ BDIGIT *vds = BDIGITS(v);
+
+ if (ln > n) {
+ hn = ln - n;
+ ln = n;
+ }
+
+ if (!hn) {
+ h = rb_uint2big(0);
+ }
+ else {
+ while (--hn && !vds[hn + ln]);
+ h = bignew(hn += 2, 1);
+ MEMCPY(BDIGITS(h), vds + ln, BDIGIT, hn - 1);
+ BDIGITS(h)[hn - 1] = 0; /* margin for carry */
+ }
+
+ while (--ln && !vds[ln]);
+ l = bignew(ln += 2, 1);
+ MEMCPY(BDIGITS(l), vds, BDIGIT, ln - 1);
+ BDIGITS(l)[ln - 1] = 0; /* margin for carry */
+
+ *pl = l;
+ *ph = h;
+}
+
+/* multiplication by karatsuba method */
+static VALUE
+bigmul1_karatsuba(VALUE x, VALUE y)
+{
+ long i, n, xn, yn, t1n, t2n;
+ VALUE xh, xl, yh, yl, z, t1, t2, t3;
+ BDIGIT *zds;
+
+ xn = RBIGNUM_LEN(x);
+ yn = RBIGNUM_LEN(y);
+ n = yn / 2;
+ big_split(x, n, &xh, &xl);
+ if (x == y) {
+ yh = xh; yl = xl;
+ }
+ else big_split(y, n, &yh, &yl);
+
+ /* x = xh * b + xl
+ * y = yh * b + yl
+ *
+ * Karatsuba method:
+ * x * y = z2 * b^2 + z1 * b + z0
+ * where
+ * z2 = xh * yh
+ * z0 = xl * yl
+ * z1 = (xh + xl) * (yh + yl) - z2 - z0
+ *
+ * ref: http://en.wikipedia.org/wiki/Karatsuba_algorithm
+ */
+
+ /* allocate a result bignum */
+ z = bignew(xn + yn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ zds = BDIGITS(z);
+
+ /* t1 <- xh * yh */
+ t1 = bigmul0(xh, yh);
+ t1n = big_real_len(t1);
+
+ /* copy t1 into high bytes of the result (z2) */
+ MEMCPY(zds + 2 * n, BDIGITS(t1), BDIGIT, t1n);
+ for (i = 2 * n + t1n; i < xn + yn; i++) zds[i] = 0;
+
+ if (!BIGZEROP(xl) && !BIGZEROP(yl)) {
+ /* t2 <- xl * yl */
+ t2 = bigmul0(xl, yl);
+ t2n = big_real_len(t2);
+
+ /* copy t2 into low bytes of the result (z0) */
+ MEMCPY(zds, BDIGITS(t2), BDIGIT, t2n);
+ for (i = t2n; i < 2 * n; i++) zds[i] = 0;
+ }
+ else {
+ t2 = Qundef;
+ t2n = 0;
+
+ /* copy 0 into low bytes of the result (z0) */
+ for (i = 0; i < 2 * n; i++) zds[i] = 0;
+ }
+
+ /* xh <- xh + xl */
+ if (RBIGNUM_LEN(xl) > RBIGNUM_LEN(xh)) {
+ t3 = xl; xl = xh; xh = t3;
+ }
+ /* xh has a margin for carry */
+ bigadd_core(BDIGITS(xh), RBIGNUM_LEN(xh),
+ BDIGITS(xl), RBIGNUM_LEN(xl),
+ BDIGITS(xh), RBIGNUM_LEN(xh));
+
+ /* yh <- yh + yl */
+ if (x != y) {
+ if (RBIGNUM_LEN(yl) > RBIGNUM_LEN(yh)) {
+ t3 = yl; yl = yh; yh = t3;
+ }
+ /* yh has a margin for carry */
+ bigadd_core(BDIGITS(yh), RBIGNUM_LEN(yh),
+ BDIGITS(yl), RBIGNUM_LEN(yl),
+ BDIGITS(yh), RBIGNUM_LEN(yh));
+ }
+ else yh = xh;
+
+ /* t3 <- xh * yh */
+ t3 = bigmul0(xh, yh);
+
+ i = xn + yn - n;
+ /* subtract t1 from t3 */
+ bigsub_core(BDIGITS(t3), big_real_len(t3), BDIGITS(t1), t1n, BDIGITS(t3), big_real_len(t3));
+
+ /* subtract t2 from t3; t3 is now the middle term of the product */
+ if (t2 != Qundef) bigsub_core(BDIGITS(t3), big_real_len(t3), BDIGITS(t2), t2n, BDIGITS(t3), big_real_len(t3));
+
+ /* add t3 to middle bytes of the result (z1) */
+ bigadd_core(zds + n, i, BDIGITS(t3), big_real_len(t3), zds + n, i);
+
+ return z;
+}
+
+static void
+biglsh_bang(BDIGIT *xds, long xn, unsigned long shift)
+{
+ long const s1 = shift/BITSPERDIG;
+ int const s2 = (int)(shift%BITSPERDIG);
+ int const s3 = BITSPERDIG-s2;
+ BDIGIT* zds;
+ BDIGIT num;
+ long i;
+ if (s1 >= xn) {
+ MEMZERO(xds, BDIGIT, xn);
+ return;
+ }
+ zds = xds + xn - 1;
+ xn -= s1 + 1;
+ num = xds[xn]<<s2;
+ do {
+ *zds-- = num | xds[--xn]>>s3;
+ num = xds[xn]<<s2;
}
+ while (xn > 0);
+ *zds = num;
+ for (i = s1; i > 0; --i)
+ *zds-- = 0;
+}
+
+static void
+bigrsh_bang(BDIGIT* xds, long xn, unsigned long shift)
+{
+ long s1 = shift/BITSPERDIG;
+ int s2 = (int)(shift%BITSPERDIG);
+ int s3 = BITSPERDIG - s2;
+ int i;
+ BDIGIT num;
+ BDIGIT* zds;
+ if (s1 >= xn) {
+ MEMZERO(xds, BDIGIT, xn);
+ return;
+ }
+
+ i = 0;
+ zds = xds + s1;
+ num = *zds++>>s2;
+ do {
+ xds[i++] = (BDIGIT)(*zds<<s3) | num;
+ num = *zds++>>s2;
+ }
+ while (i < xn - s1 - 1);
+ xds[i] = num;
+ MEMZERO(xds + xn - s1, BDIGIT, s1);
+}
+
+static void
+big_split3(VALUE v, long n, volatile VALUE* p0, volatile VALUE* p1, volatile VALUE* p2)
+{
+ VALUE v0, v12, v1, v2;
+
+ big_split(v, n, &v12, &v0);
+ big_split(v12, n, &v2, &v1);
+
+ *p0 = bigtrunc(v0);
+ *p1 = bigtrunc(v1);
+ *p2 = bigtrunc(v2);
+}
+
+static VALUE big_lshift(VALUE, unsigned long);
+static VALUE big_rshift(VALUE, unsigned long);
+static VALUE bigdivrem(VALUE, VALUE, volatile VALUE*, volatile VALUE*);
+
+static VALUE
+bigmul1_toom3(VALUE x, VALUE y)
+{
+ long n, xn, yn, zn;
+ VALUE x0, x1, x2, y0, y1, y2;
+ VALUE u0, u1, u2, u3, u4, v1, v2, v3;
+ VALUE z0, z1, z2, z3, z4, z, t;
+ BDIGIT* zds;
+
+ xn = RBIGNUM_LEN(x);
+ yn = RBIGNUM_LEN(y);
+ assert(xn <= yn); /* assume y >= x */
+
+ n = (yn + 2) / 3;
+ big_split3(x, n, &x0, &x1, &x2);
+ if (x == y) {
+ y0 = x0; y1 = x1; y2 = x2;
+ }
+ else big_split3(y, n, &y0, &y1, &y2);
+
+ /*
+ * ref. http://en.wikipedia.org/wiki/Toom%E2%80%93Cook_multiplication
+ *
+ * x(b) = x0 * b^0 + x1 * b^1 + x2 * b^2
+ * y(b) = y0 * b^0 + y1 * b^1 + y2 * b^2
+ *
+ * z(b) = x(b) * y(b)
+ * z(b) = z0 * b^0 + z1 * b^1 + z2 * b^2 + z3 * b^3 + z4 * b^4
+ * where:
+ * z0 = x0 * y0
+ * z1 = x0 * y1 + x1 * y0
+ * z2 = x0 * y2 + x1 * y1 + x2 * y0
+ * z3 = x1 * y2 + x2 * y1
+ * z4 = x2 * y2
+ *
+ * Toom3 method (a.k.a. Toom-Cook method):
+ * (Step1) calculating 5 points z(b0), z(b1), z(b2), z(b3), z(b4),
+ * where:
+ * b0 = 0, b1 = 1, b2 = -1, b3 = -2, b4 = inf,
+ * z(0) = x(0) * y(0) = x0 * y0
+ * z(1) = x(1) * y(1) = (x0 + x1 + x2) * (y0 + y1 + y2)
+ * z(-1) = x(-1) * y(-1) = (x0 - x1 + x2) * (y0 - y1 + y2)
+ * z(-2) = x(-2) * y(-2) = (x0 - 2 * (x1 - 2 * x2)) * (y0 - 2 * (y1 - 2 * y2))
+ * z(inf) = x(inf) * y(inf) = x2 * y2
+ *
+ * (Step2) interpolating z0, z1, z2, z3, z4, and z5.
+ *
+ * (Step3) Substituting base value into b of the polynomial z(b),
+ */
+
+ /*
+ * [Step1] calculating 5 points z(b0), z(b1), z(b2), z(b3), z(b4)
+ */
+
+ /* u1 <- x0 + x2 */
+ u1 = bigtrunc(bigadd(x0, x2, 1));
+
+ /* x(-1) : u2 <- u1 - x1 = x0 - x1 + x2 */
+ u2 = bigtrunc(bigsub(u1, x1));
+
+ /* x(1) : u1 <- u1 + x1 = x0 + x1 + x2 */
+ u1 = bigtrunc(bigadd(u1, x1, 1));
+
+ /* x(-2) : u3 <- 2 * (u2 + x2) - x0 = x0 - 2 * (x1 - 2 * x2) */
+ u3 = bigadd(u2, x2, 1);
+ if (BDIGITS(u3)[RBIGNUM_LEN(u3)-1] & BIGRAD_HALF) {
+ rb_big_resize(u3, RBIGNUM_LEN(u3) + 1);
+ BDIGITS(u3)[RBIGNUM_LEN(u3)-1] = 0;
+ }
+ biglsh_bang(BDIGITS(u3), RBIGNUM_LEN(u3), 1);
+ u3 = bigtrunc(bigadd(bigtrunc(u3), x0, 0));
+
+ if (x == y) {
+ v1 = u1; v2 = u2; v3 = u3;
+ }
+ else {
+ /* v1 <- y0 + y2 */
+ v1 = bigtrunc(bigadd(y0, y2, 1));
+
+ /* y(-1) : v2 <- v1 - y1 = y0 - y1 + y2 */
+ v2 = bigtrunc(bigsub(v1, y1));
+
+ /* y(1) : v1 <- v1 + y1 = y0 + y1 + y2 */
+ v1 = bigtrunc(bigadd(v1, y1, 1));
+
+ /* y(-2) : v3 <- 2 * (v2 + y2) - y0 = y0 - 2 * (y1 - 2 * y2) */
+ v3 = bigadd(v2, y2, 1);
+ if (BDIGITS(v3)[RBIGNUM_LEN(v3)-1] & BIGRAD_HALF) {
+ rb_big_resize(v3, RBIGNUM_LEN(v3) + 1);
+ BDIGITS(v3)[RBIGNUM_LEN(v3)-1] = 0;
+ }
+ biglsh_bang(BDIGITS(v3), RBIGNUM_LEN(v3), 1);
+ v3 = bigtrunc(bigadd(bigtrunc(v3), y0, 0));
+ }
+
+ /* z(0) : u0 <- x0 * y0 */
+ u0 = bigtrunc(bigmul0(x0, y0));
+
+ /* z(1) : u1 <- u1 * v1 */
+ u1 = bigtrunc(bigmul0(u1, v1));
+
+ /* z(-1) : u2 <- u2 * v2 */
+ u2 = bigtrunc(bigmul0(u2, v2));
+
+ /* z(-2) : u3 <- u3 * v3 */
+ u3 = bigtrunc(bigmul0(u3, v3));
+
+ /* z(inf) : u4 <- x2 * y2 */
+ u4 = bigtrunc(bigmul0(x2, y2));
+
+ /* for GC */
+ v1 = v2 = v3 = Qnil;
+
+ /*
+ * [Step2] interpolating z0, z1, z2, z3, z4, and z5.
+ */
+
+ /* z0 <- z(0) == u0 */
+ z0 = u0;
+
+ /* z4 <- z(inf) == u4 */
+ z4 = u4;
+
+ /* z3 <- (z(-2) - z(1)) / 3 == (u3 - u1) / 3 */
+ z3 = bigadd(u3, u1, 0);
+ bigdivrem(z3, big_three, &z3, NULL); /* TODO: optimize */
+ bigtrunc(z3);
+
+ /* z1 <- (z(1) - z(-1)) / 2 == (u1 - u2) / 2 */
+ z1 = bigtrunc(bigadd(u1, u2, 0));
+ bigrsh_bang(BDIGITS(z1), RBIGNUM_LEN(z1), 1);
+
+ /* z2 <- z(-1) - z(0) == u2 - u0 */
+ z2 = bigtrunc(bigadd(u2, u0, 0));
+
+ /* z3 <- (z2 - z3) / 2 + 2 * z(inf) == (z2 - z3) / 2 + 2 * u4 */
+ z3 = bigtrunc(bigadd(z2, z3, 0));
+ bigrsh_bang(BDIGITS(z3), RBIGNUM_LEN(z3), 1);
+ t = big_lshift(u4, 1); /* TODO: combining with next addition */
+ z3 = bigtrunc(bigadd(z3, t, 1));
+
+ /* z2 <- z2 + z1 - z(inf) == z2 + z1 - u4 */
+ z2 = bigtrunc(bigadd(z2, z1, 1));
+ z2 = bigtrunc(bigadd(z2, u4, 0));
+
+ /* z1 <- z1 - z3 */
+ z1 = bigtrunc(bigadd(z1, z3, 0));
+
+ /*
+ * [Step3] Substituting base value into b of the polynomial z(b),
+ */
+
+ zn = 6*n + 1;
+ z = bignew(zn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ zds = BDIGITS(z);
+ MEMCPY(zds, BDIGITS(z0), BDIGIT, RBIGNUM_LEN(z0));
+ MEMZERO(zds + RBIGNUM_LEN(z0), BDIGIT, zn - RBIGNUM_LEN(z0));
+ bigadd_core(zds + n, zn - n, BDIGITS(z1), big_real_len(z1), zds + n, zn - n);
+ bigadd_core(zds + 2*n, zn - 2*n, BDIGITS(z2), big_real_len(z2), zds + 2*n, zn - 2*n);
+ bigadd_core(zds + 3*n, zn - 3*n, BDIGITS(z3), big_real_len(z3), zds + 3*n, zn - 3*n);
+ bigadd_core(zds + 4*n, zn - 4*n, BDIGITS(z4), big_real_len(z4), zds + 4*n, zn - 4*n);
+ z = bignorm(z);
+
+ return bignorm(z);
+}
+
+/* efficient squaring (2 times faster than normal multiplication)
+ * ref: Handbook of Applied Cryptography, Algorithm 14.16
+ * http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf
+ */
+static VALUE
+bigsqr_fast(VALUE x)
+{
+ long len = RBIGNUM_LEN(x), i, j;
+ VALUE z = bignew(2 * len + 1, 1);
+ BDIGIT *xds = BDIGITS(x), *zds = BDIGITS(z);
+ BDIGIT_DBL c, v, w;
+
+ for (i = 2 * len + 1; i--; ) zds[i] = 0;
+ for (i = 0; i < len; i++) {
+ v = (BDIGIT_DBL)xds[i];
+ if (!v) continue;
+ c = (BDIGIT_DBL)zds[i + i] + v * v;
+ zds[i + i] = BIGLO(c);
+ c = BIGDN(c);
+ v *= 2;
+ for (j = i + 1; j < len; j++) {
+ w = (BDIGIT_DBL)xds[j];
+ c += (BDIGIT_DBL)zds[i + j] + BIGLO(v) * w;
+ zds[i + j] = BIGLO(c);
+ c = BIGDN(c);
+ if (BIGDN(v)) c += w;
+ }
+ if (c) {
+ c += (BDIGIT_DBL)zds[i + len];
+ zds[i + len] = BIGLO(c);
+ c = BIGDN(c);
+ }
+ if (c) zds[i + len + 1] += (BDIGIT)c;
+ }
+ return z;
+}
+
+#define KARATSUBA_MUL_DIGITS 70
+#define TOOM3_MUL_DIGITS 150
+
+
+/* determine whether a bignum is sparse or not by random sampling */
+static inline VALUE
+big_sparse_p(VALUE x)
+{
+ long c = 0, n = RBIGNUM_LEN(x);
+
+ if ( BDIGITS(x)[rb_genrand_ulong_limited(n / 2) + n / 4]) c++;
+ if (c <= 1 && BDIGITS(x)[rb_genrand_ulong_limited(n / 2) + n / 4]) c++;
+ if (c <= 1 && BDIGITS(x)[rb_genrand_ulong_limited(n / 2) + n / 4]) c++;
+
+ return (c <= 1) ? Qtrue : Qfalse;
+}
+
+static VALUE
+bigmul0(VALUE x, VALUE y)
+{
+ long xn, yn;
+
+ xn = RBIGNUM_LEN(x);
+ yn = RBIGNUM_LEN(y);
+
+ /* make sure that y is longer than x */
+ if (xn > yn) {
+ VALUE t;
+ long tn;
+ t = x; x = y; y = t;
+ tn = xn; xn = yn; yn = tn;
+ }
+ assert(xn <= yn);
+
+ /* normal multiplication when x is small */
+ if (xn < KARATSUBA_MUL_DIGITS) {
+ normal:
+ if (x == y) return bigsqr_fast(x);
+ if (xn == 1 && yn == 1) return bigmul1_single(x, y);
+ return bigmul1_normal(x, y);
+ }
+
+ /* normal multiplication when x or y is a sparse bignum */
+ if (big_sparse_p(x)) goto normal;
+ if (big_sparse_p(y)) return bigmul1_normal(y, x);
+
+ /* balance multiplication by slicing y when x is much smaller than y */
+ if (2 * xn <= yn) return bigmul1_balance(x, y);
+
+ if (xn < TOOM3_MUL_DIGITS) {
+ /* multiplication by karatsuba method */
+ return bigmul1_karatsuba(x, y);
+ }
+ else if (3*xn <= 2*(yn + 2))
+ return bigmul1_balance(x, y);
+ return bigmul1_toom3(x, y);
}
/*
* call-seq:
- * big * other => Numeric
+ * big * other -> Numeric
*
* Multiplies big and other, returning the result.
*/
VALUE
-rb_big_mul(x, y)
- VALUE x, y;
+rb_big_mul(VALUE x, VALUE y)
{
- long i, j;
- BDIGIT_DBL n = 0;
- VALUE z;
- BDIGIT *zds;
-
- if (FIXNUM_P(x)) x = rb_int2big(FIX2LONG(x));
switch (TYPE(y)) {
case T_FIXNUM:
y = rb_int2big(FIX2LONG(y));
@@ -1238,55 +2645,94 @@ rb_big_mul(x, y)
break;
case T_FLOAT:
- return rb_float_new(rb_big2dbl(x) * RFLOAT(y)->value);
+ return DBL2NUM(rb_big2dbl(x) * RFLOAT_VALUE(y));
default:
- return rb_num_coerce_bin(x, y);
+ return rb_num_coerce_bin(x, y, '*');
}
- j = RBIGNUM(x)->len + RBIGNUM(y)->len + 1;
- z = bignew(j, RBIGNUM(x)->sign==RBIGNUM(y)->sign);
- zds = BDIGITS(z);
- while (j--) zds[j] = 0;
- for (i = 0; i < RBIGNUM(x)->len; i++) {
- BDIGIT_DBL dd = BDIGITS(x)[i];
- if (dd == 0) continue;
- n = 0;
- for (j = 0; j < RBIGNUM(y)->len; j++) {
- BDIGIT_DBL ee = n + (BDIGIT_DBL)dd * BDIGITS(y)[j];
- n = zds[i + j] + ee;
- if (ee) zds[i + j] = BIGLO(n);
- n = BIGDN(n);
- }
- if (n) {
- zds[i + j] = n;
- }
- }
+ return bignorm(bigmul0(x, y));
+}
- return bignorm(z);
+struct big_div_struct {
+ long nx, ny, j, nyzero;
+ BDIGIT *yds, *zds;
+ volatile VALUE stop;
+};
+
+static void *
+bigdivrem1(void *ptr)
+{
+ struct big_div_struct *bds = (struct big_div_struct*)ptr;
+ long ny = bds->ny;
+ long i, j;
+ BDIGIT *yds = bds->yds, *zds = bds->zds;
+ BDIGIT_DBL t2;
+ BDIGIT_DBL_SIGNED num;
+ BDIGIT q;
+
+ j = bds->j;
+ do {
+ if (bds->stop) {
+ bds->j = j;
+ return 0;
+ }
+ if (zds[j] == yds[ny-1]) q = (BDIGIT)BIGRAD-1;
+ else q = (BDIGIT)((BIGUP(zds[j]) + zds[j-1])/yds[ny-1]);
+ if (q) {
+ i = bds->nyzero; num = 0; t2 = 0;
+ do { /* multiply and subtract */
+ BDIGIT_DBL ee;
+ t2 += (BDIGIT_DBL)yds[i] * q;
+ ee = num - BIGLO(t2);
+ num = (BDIGIT_DBL)zds[j - ny + i] + ee;
+ if (ee) zds[j - ny + i] = BIGLO(num);
+ num = BIGDN(num);
+ t2 = BIGDN(t2);
+ } while (++i < ny);
+ num += zds[j - ny + i] - t2;/* borrow from high digit; don't update */
+ while (num) { /* "add back" required */
+ i = 0; num = 0; q--;
+ do {
+ BDIGIT_DBL ee = num + yds[i];
+ num = (BDIGIT_DBL)zds[j - ny + i] + ee;
+ if (ee) zds[j - ny + i] = BIGLO(num);
+ num = BIGDN(num);
+ } while (++i < ny);
+ num--;
+ }
+ }
+ zds[j] = q;
+ } while (--j >= ny);
+ return 0;
}
static void
-bigdivrem(x, y, divp, modp)
- VALUE x, y;
- VALUE *divp, *modp;
+rb_big_stop(void *ptr)
+{
+ struct big_div_struct *bds = ptr;
+ bds->stop = Qtrue;
+}
+
+static VALUE
+bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
{
- long nx = RBIGNUM(x)->len, ny = RBIGNUM(y)->len;
+ struct big_div_struct bds;
+ long nx = RBIGNUM_LEN(x), ny = RBIGNUM_LEN(y);
long i, j;
- VALUE yy, z;
+ VALUE z, yy, zz;
BDIGIT *xds, *yds, *zds, *tds;
BDIGIT_DBL t2;
- BDIGIT_DBL_SIGNED num;
BDIGIT dd, q;
if (BIGZEROP(y)) rb_num_zerodiv();
+ xds = BDIGITS(x);
yds = BDIGITS(y);
- if (nx < ny || (nx == ny && BDIGITS(x)[nx - 1] < BDIGITS(y)[ny - 1])) {
+ if (nx < ny || (nx == ny && xds[nx - 1] < yds[ny - 1])) {
if (divp) *divp = rb_int2big(0);
if (modp) *modp = x;
- return;
+ return Qnil;
}
- xds = BDIGITS(x);
if (ny == 1) {
dd = yds[0];
z = rb_big_clone(x);
@@ -1297,23 +2743,24 @@ bigdivrem(x, y, divp, modp)
zds[i] = (BDIGIT)(t2 / dd);
t2 %= dd;
}
- RBIGNUM(z)->sign = RBIGNUM(x)->sign==RBIGNUM(y)->sign;
+ RBIGNUM_SET_SIGN(z, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
if (modp) {
- *modp = rb_uint2big((unsigned long)t2);
- RBIGNUM(*modp)->sign = RBIGNUM(x)->sign;
+ *modp = rb_uint2big((VALUE)t2);
+ RBIGNUM_SET_SIGN(*modp, RBIGNUM_SIGN(x));
}
if (divp) *divp = z;
- return;
+ return Qnil;
}
- z = bignew(nx==ny?nx+2:nx+1, RBIGNUM(x)->sign==RBIGNUM(y)->sign);
+
+ z = bignew(nx==ny?nx+2:nx+1, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
zds = BDIGITS(z);
if (nx==ny) zds[nx+1] = 0;
while (!yds[ny-1]) ny--;
dd = 0;
q = yds[ny-1];
- while ((q & (1<<(BITSPERDIG-1))) == 0) {
- q <<= 1;
+ while ((q & (BDIGIT)(1UL<<(BITSPERDIG-1))) == 0) {
+ q <<= 1UL;
dd++;
}
if (dd) {
@@ -1327,6 +2774,7 @@ bigdivrem(x, y, divp, modp)
t2 = BIGDN(t2);
}
yds = tds;
+ RB_GC_GUARD(y) = yy;
j = 0;
t2 = 0;
while (j<nx) {
@@ -1342,89 +2790,73 @@ bigdivrem(x, y, divp, modp)
while (j--) zds[j] = xds[j];
}
- j = nx==ny?nx+1:nx;
- do {
- if (zds[j] == yds[ny-1]) q = BIGRAD-1;
- else q = (BDIGIT)((BIGUP(zds[j]) + zds[j-1])/yds[ny-1]);
- if (q) {
- i = 0; num = 0; t2 = 0;
- do { /* multiply and subtract */
- BDIGIT_DBL ee;
- t2 += (BDIGIT_DBL)yds[i] * q;
- ee = num - BIGLO(t2);
- num = (BDIGIT_DBL)zds[j - ny + i] + ee;
- if (ee) zds[j - ny + i] = BIGLO(num);
- num = BIGDN(num);
- t2 = BIGDN(t2);
- } while (++i < ny);
- num += zds[j - ny + i] - t2;/* borrow from high digit; don't update */
- while (num) { /* "add back" required */
- i = 0; num = 0; q--;
- do {
- BDIGIT_DBL ee = num + yds[i];
- num = (BDIGIT_DBL)zds[j - ny + i] + ee;
- if (ee) zds[j - ny + i] = BIGLO(num);
- num = BIGDN(num);
- } while (++i < ny);
- num--;
- }
+ bds.nx = nx;
+ bds.ny = ny;
+ bds.zds = zds;
+ bds.yds = yds;
+ bds.stop = Qfalse;
+ bds.j = nx==ny?nx+1:nx;
+ for (bds.nyzero = 0; !yds[bds.nyzero]; bds.nyzero++);
+ if (nx > 10000 || ny > 10000) {
+ retry:
+ bds.stop = Qfalse;
+ rb_thread_call_without_gvl(bigdivrem1, &bds, rb_big_stop, &bds);
+
+ if (bds.stop == Qtrue) {
+ /* execute trap handler, but exception was not raised. */
+ goto retry;
}
- zds[j] = q;
- } while (--j >= ny);
+ }
+ else {
+ bigdivrem1(&bds);
+ }
+
if (divp) { /* move quotient down in z */
- *divp = rb_big_clone(z);
- zds = BDIGITS(*divp);
+ *divp = zz = rb_big_clone(z);
+ zds = BDIGITS(zz);
j = (nx==ny ? nx+2 : nx+1) - ny;
for (i = 0;i < j;i++) zds[i] = zds[i+ny];
- RBIGNUM(*divp)->len = i;
+ if (!zds[i-1]) i--;
+ RBIGNUM_SET_LEN(zz, i);
}
if (modp) { /* normalize remainder */
- *modp = rb_big_clone(z);
- zds = BDIGITS(*modp);
- while (--ny && !zds[ny]); ++ny;
+ *modp = zz = rb_big_clone(z);
+ zds = BDIGITS(zz);
+ while (ny > 1 && !zds[ny-1]) --ny;
if (dd) {
t2 = 0; i = ny;
- while(i--) {
+ while (i--) {
t2 = (t2 | zds[i]) >> dd;
q = zds[i];
zds[i] = BIGLO(t2);
t2 = BIGUP(q);
}
}
- RBIGNUM(*modp)->len = ny;
- RBIGNUM(*modp)->sign = RBIGNUM(x)->sign;
+ if (!zds[ny-1]) ny--;
+ RBIGNUM_SET_LEN(zz, ny);
+ RBIGNUM_SET_SIGN(zz, RBIGNUM_SIGN(x));
}
+ return z;
}
static void
-bigdivmod(x, y, divp, modp)
- VALUE x, y;
- VALUE *divp, *modp;
+bigdivmod(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
{
VALUE mod;
bigdivrem(x, y, divp, &mod);
- if (RBIGNUM(x)->sign != RBIGNUM(y)->sign && !BIGZEROP(mod)) {
+ if (RBIGNUM_SIGN(x) != RBIGNUM_SIGN(y) && !BIGZEROP(mod)) {
if (divp) *divp = bigadd(*divp, rb_int2big(1), 0);
if (modp) *modp = bigadd(mod, y, 1);
}
- else {
- if (divp) *divp = *divp;
- if (modp) *modp = mod;
+ else if (modp) {
+ *modp = mod;
}
}
-/*
- * call-seq:
- * big / other => Numeric
- * big.div(other) => Numeric
- *
- * Divides big by other, returning the result.
- */
static VALUE
-rb_big_div(x, y)
- VALUE x, y;
+rb_big_divide(VALUE x, VALUE y, ID op)
{
VALUE z;
@@ -1437,10 +2869,19 @@ rb_big_div(x, y)
break;
case T_FLOAT:
- return rb_float_new(rb_big2dbl(x) / RFLOAT(y)->value);
+ {
+ if (op == '/') {
+ return DBL2NUM(rb_big2dbl(x) / RFLOAT_VALUE(y));
+ }
+ else {
+ double dy = RFLOAT_VALUE(y);
+ if (dy == 0.0) rb_num_zerodiv();
+ return rb_dbl2big(rb_big2dbl(x) / dy);
+ }
+ }
default:
- return rb_num_coerce_bin(x, y);
+ return rb_num_coerce_bin(x, y, op);
}
bigdivmod(x, y, &z, 0);
@@ -1449,16 +2890,43 @@ rb_big_div(x, y)
/*
* call-seq:
- * big % other => Numeric
- * big.modulo(other) => Numeric
+ * big / other -> Numeric
+ *
+ * Performs division: the class of the resulting object depends on
+ * the class of <code>numeric</code> and on the magnitude of the
+ * result.
+ */
+
+VALUE
+rb_big_div(VALUE x, VALUE y)
+{
+ return rb_big_divide(x, y, '/');
+}
+
+/*
+ * call-seq:
+ * big.div(other) -> integer
+ *
+ * Performs integer division: returns integer value.
+ */
+
+VALUE
+rb_big_idiv(VALUE x, VALUE y)
+{
+ return rb_big_divide(x, y, rb_intern("div"));
+}
+
+/*
+ * call-seq:
+ * big % other -> Numeric
+ * big.modulo(other) -> Numeric
*
* Returns big modulo other. See Numeric.divmod for more
* information.
*/
-static VALUE
-rb_big_modulo(x, y)
- VALUE x, y;
+VALUE
+rb_big_modulo(VALUE x, VALUE y)
{
VALUE z;
@@ -1471,7 +2939,7 @@ rb_big_modulo(x, y)
break;
default:
- return rb_num_coerce_bin(x, y);
+ return rb_num_coerce_bin(x, y, '%');
}
bigdivmod(x, y, 0, &z);
@@ -1480,16 +2948,15 @@ rb_big_modulo(x, y)
/*
* call-seq:
- * big.remainder(numeric) => number
- *
+ * big.remainder(numeric) -> number
+ *
* Returns the remainder after dividing <i>big</i> by <i>numeric</i>.
- *
+ *
* -1234567890987654321.remainder(13731) #=> -6966
* -1234567890987654321.remainder(13731.24) #=> -9906.22531493148
*/
static VALUE
-rb_big_remainder(x, y)
- VALUE x, y;
+rb_big_remainder(VALUE x, VALUE y)
{
VALUE z;
@@ -1502,37 +2969,22 @@ rb_big_remainder(x, y)
break;
default:
- return rb_num_coerce_bin(x, y);
+ return rb_num_coerce_bin(x, y, rb_intern("remainder"));
}
bigdivrem(x, y, 0, &z);
return bignorm(z);
}
-static VALUE big_lshift _((VALUE, unsigned long));
-static VALUE big_rshift _((VALUE, unsigned long));
-
-static VALUE big_shift(x, n)
- VALUE x;
- int n;
-{
- if (n < 0)
- return big_lshift(x, (unsigned int)n);
- else if (n > 0)
- return big_rshift(x, (unsigned int)n);
- return x;
-}
-
/*
* call-seq:
- * big.divmod(numeric) => array
- *
+ * big.divmod(numeric) -> array
+ *
* See <code>Numeric#divmod</code>.
- *
+ *
*/
VALUE
-rb_big_divmod(x, y)
- VALUE x, y;
+rb_big_divmod(VALUE x, VALUE y)
{
VALUE div, mod;
@@ -1545,54 +2997,147 @@ rb_big_divmod(x, y)
break;
default:
- return rb_num_coerce_bin(x, y);
+ return rb_num_coerce_bin(x, y, rb_intern("divmod"));
}
bigdivmod(x, y, &div, &mod);
return rb_assoc_new(bignorm(div), bignorm(mod));
}
+static int
+bdigbitsize(BDIGIT x)
+{
+ int size = 1;
+ int nb = BITSPERDIG / 2;
+ BDIGIT bits = (~0 << nb);
+
+ if (!x) return 0;
+ while (x > 1) {
+ if (x & bits) {
+ size += nb;
+ x >>= nb;
+ }
+ x &= ~bits;
+ nb /= 2;
+ bits >>= nb;
+ }
+
+ return size;
+}
+
+static VALUE big_lshift(VALUE, unsigned long);
+static VALUE big_rshift(VALUE, unsigned long);
+
+static VALUE
+big_shift(VALUE x, long n)
+{
+ if (n < 0)
+ return big_lshift(x, (unsigned long)-n);
+ else if (n > 0)
+ return big_rshift(x, (unsigned long)n);
+ return x;
+}
+
+static VALUE
+big_fdiv(VALUE x, VALUE y)
+{
+#define DBL_BIGDIG ((DBL_MANT_DIG + BITSPERDIG) / BITSPERDIG)
+ VALUE z;
+ long l, ex, ey;
+ int i;
+
+ bigtrunc(x);
+ l = RBIGNUM_LEN(x) - 1;
+ ex = l * BITSPERDIG;
+ ex += bdigbitsize(BDIGITS(x)[l]);
+ ex -= 2 * DBL_BIGDIG * BITSPERDIG;
+ if (ex) x = big_shift(x, ex);
+
+ switch (TYPE(y)) {
+ case T_FIXNUM:
+ y = rb_int2big(FIX2LONG(y));
+ case T_BIGNUM:
+ bigtrunc(y);
+ l = RBIGNUM_LEN(y) - 1;
+ ey = l * BITSPERDIG;
+ ey += bdigbitsize(BDIGITS(y)[l]);
+ ey -= DBL_BIGDIG * BITSPERDIG;
+ if (ey) y = big_shift(y, ey);
+ break;
+ case T_FLOAT:
+ y = dbl2big(ldexp(frexp(RFLOAT_VALUE(y), &i), DBL_MANT_DIG));
+ ey = i - DBL_MANT_DIG;
+ break;
+ default:
+ rb_bug("big_fdiv");
+ }
+ bigdivrem(x, y, &z, 0);
+ l = ex - ey;
+#if SIZEOF_LONG > SIZEOF_INT
+ {
+ /* Visual C++ can't be here */
+ if (l > INT_MAX) return DBL2NUM(INFINITY);
+ if (l < INT_MIN) return DBL2NUM(0.0);
+ }
+#endif
+ return DBL2NUM(ldexp(big2dbl(z), (int)l));
+}
+
/*
* call-seq:
- * big.quo(numeric) -> float
- *
+ * big.fdiv(numeric) -> float
+ *
* Returns the floating point result of dividing <i>big</i> by
* <i>numeric</i>.
- *
- * -1234567890987654321.quo(13731) #=> -89910996357705.5
- * -1234567890987654321.quo(13731.24) #=> -89909424858035.7
- *
+ *
+ * -1234567890987654321.fdiv(13731) #=> -89910996357705.5
+ * -1234567890987654321.fdiv(13731.24) #=> -89909424858035.7
+ *
*/
-static VALUE
-rb_big_quo(x, y)
- VALUE x, y;
+
+VALUE
+rb_big_fdiv(VALUE x, VALUE y)
{
- double dx = rb_big2dbl(x);
- double dy;
+ double dx, dy;
+ dx = big2dbl(x);
switch (TYPE(y)) {
case T_FIXNUM:
dy = (double)FIX2LONG(y);
+ if (isinf(dx))
+ return big_fdiv(x, y);
break;
case T_BIGNUM:
dy = rb_big2dbl(y);
+ if (isinf(dx) || isinf(dy))
+ return big_fdiv(x, y);
break;
case T_FLOAT:
- dy = RFLOAT(y)->value;
+ dy = RFLOAT_VALUE(y);
+ if (isnan(dy))
+ return y;
+ if (isinf(dx))
+ return big_fdiv(x, y);
break;
default:
- return rb_num_coerce_bin(x, y);
+ return rb_num_coerce_bin(x, y, rb_intern("fdiv"));
}
- return rb_float_new(dx / dy);
+ return DBL2NUM(dx / dy);
+}
+
+static VALUE
+bigsqr(VALUE x)
+{
+ return bigtrunc(bigmul0(x, x));
}
/*
* call-seq:
- * big ** exponent #=> numeric
+ * big ** exponent -> numeric
*
* Raises _big_ to the _exponent_ power (which may be an integer, float,
* or anything that will coerce to a number). The result may be
@@ -1604,16 +3149,17 @@ rb_big_quo(x, y)
*/
VALUE
-rb_big_pow(x, y)
- VALUE x, y;
+rb_big_pow(VALUE x, VALUE y)
{
double d;
- long yy;
-
+ SIGNED_VALUE yy;
+
if (y == INT2FIX(0)) return INT2FIX(1);
switch (TYPE(y)) {
case T_FLOAT:
- d = RFLOAT(y)->value;
+ d = RFLOAT_VALUE(y);
+ if ((!RBIGNUM_SIGN(x) && !BIGZEROP(x)) && d != round(d))
+ return rb_funcall(rb_complex_raw1(x), rb_intern("**"), 1, y);
break;
case T_BIGNUM:
@@ -1623,80 +3169,130 @@ rb_big_pow(x, y)
case T_FIXNUM:
yy = FIX2LONG(y);
- if (yy > 0) {
- VALUE z = x;
- const long BIGLEN_LIMIT = 1024*1024 / SIZEOF_BDIGITS;
- if ((RBIGNUM(x)->len > BIGLEN_LIMIT) ||
- (RBIGNUM(x)->len > BIGLEN_LIMIT / yy)) {
+ if (yy < 0)
+ return rb_funcall(rb_rational_raw1(x), rb_intern("**"), 1, y);
+ else {
+ VALUE z = 0;
+ SIGNED_VALUE mask;
+ const long xlen = RBIGNUM_LEN(x) - 1;
+ const long xbits = ffs(RBIGNUM_DIGITS(x)[xlen]) + SIZEOF_BDIGITS*BITSPERDIG*xlen;
+ const long BIGLEN_LIMIT = BITSPERDIG*1024*1024;
+
+ if ((xbits > BIGLEN_LIMIT) || (xbits * yy > BIGLEN_LIMIT)) {
rb_warn("in a**b, b may be too big");
d = (double)yy;
break;
}
- for (;;) {
- yy -= 1;
- if (yy == 0) break;
- while (yy % 2 == 0) {
- yy /= 2;
- x = rb_big_mul(x, x);
+ for (mask = FIXNUM_MAX + 1; mask; mask >>= 1) {
+ if (z) z = bigsqr(z);
+ if (yy & mask) {
+ z = z ? bigtrunc(bigmul0(z, x)) : x;
}
- z = rb_big_mul(z, x);
}
return bignorm(z);
}
- d = (double)yy;
+ /* NOTREACHED */
break;
default:
- return rb_num_coerce_bin(x, y);
+ return rb_num_coerce_bin(x, y, rb_intern("**"));
+ }
+ return DBL2NUM(pow(rb_big2dbl(x), d));
+}
+
+static VALUE
+bigand_int(VALUE x, long y)
+{
+ VALUE z;
+ BDIGIT *xds, *zds;
+ long xn, zn;
+ long i;
+ char sign;
+
+ if (y == 0) return INT2FIX(0);
+ sign = (y > 0);
+ xds = BDIGITS(x);
+ zn = xn = RBIGNUM_LEN(x);
+#if SIZEOF_BDIGITS == SIZEOF_LONG
+ if (sign) {
+ y &= xds[0];
+ return LONG2NUM(y);
+ }
+#endif
+
+ z = bignew(zn, RBIGNUM_SIGN(x) || sign);
+ zds = BDIGITS(z);
+
+#if SIZEOF_BDIGITS == SIZEOF_LONG
+ i = 1;
+ zds[0] = xds[0] & y;
+#else
+ {
+ BDIGIT_DBL num = y;
+
+ for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
+ zds[i] = xds[i] & BIGLO(num);
+ num = BIGDN(num);
+ }
+ }
+#endif
+ while (i < xn) {
+ zds[i] = sign?0:xds[i];
+ i++;
}
- return rb_float_new(pow(rb_big2dbl(x), d));
+ if (!RBIGNUM_SIGN(z)) get2comp(z);
+ return bignorm(z);
}
/*
* call-seq:
- * big & numeric => integer
+ * big & numeric -> integer
*
* Performs bitwise +and+ between _big_ and _numeric_.
*/
VALUE
-rb_big_and(xx, yy)
- VALUE xx, yy;
+rb_big_and(VALUE xx, VALUE yy)
{
volatile VALUE x, y, z;
BDIGIT *ds1, *ds2, *zds;
long i, l1, l2;
char sign;
+ if (!FIXNUM_P(yy) && !RB_TYPE_P(yy, T_BIGNUM)) {
+ return rb_num_coerce_bit(xx, yy, '&');
+ }
+
x = xx;
- y = rb_to_int(yy);
+ y = yy;
+
+ if (!RBIGNUM_SIGN(x)) {
+ x = rb_big_clone(x);
+ get2comp(x);
+ }
if (FIXNUM_P(y)) {
- y = rb_int2big(FIX2LONG(y));
+ return bigand_int(x, FIX2LONG(y));
}
- if (!RBIGNUM(y)->sign) {
+ if (!RBIGNUM_SIGN(y)) {
y = rb_big_clone(y);
get2comp(y);
}
- if (!RBIGNUM(x)->sign) {
- x = rb_big_clone(x);
- get2comp(x);
- }
- if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
- l1 = RBIGNUM(y)->len;
- l2 = RBIGNUM(x)->len;
+ if (RBIGNUM_LEN(x) > RBIGNUM_LEN(y)) {
+ l1 = RBIGNUM_LEN(y);
+ l2 = RBIGNUM_LEN(x);
ds1 = BDIGITS(y);
ds2 = BDIGITS(x);
- sign = RBIGNUM(y)->sign;
+ sign = RBIGNUM_SIGN(y);
}
else {
- l1 = RBIGNUM(x)->len;
- l2 = RBIGNUM(y)->len;
+ l1 = RBIGNUM_LEN(x);
+ l2 = RBIGNUM_LEN(y);
ds1 = BDIGITS(x);
ds2 = BDIGITS(y);
- sign = RBIGNUM(x)->sign;
+ sign = RBIGNUM_SIGN(x);
}
- z = bignew(l2, RBIGNUM(x)->sign || RBIGNUM(y)->sign);
+ z = bignew(l2, RBIGNUM_SIGN(x) || RBIGNUM_SIGN(y));
zds = BDIGITS(z);
for (i=0; i<l1; i++) {
@@ -1705,77 +3301,150 @@ rb_big_and(xx, yy)
for (; i<l2; i++) {
zds[i] = sign?0:ds2[i];
}
- if (!RBIGNUM(z)->sign) get2comp(z);
+ if (!RBIGNUM_SIGN(z)) get2comp(z);
+ return bignorm(z);
+}
+
+static VALUE
+bigor_int(VALUE x, long y)
+{
+ VALUE z;
+ BDIGIT *xds, *zds;
+ long xn, zn;
+ long i;
+ char sign;
+
+ sign = (y >= 0);
+ xds = BDIGITS(x);
+ zn = xn = RBIGNUM_LEN(x);
+ z = bignew(zn, RBIGNUM_SIGN(x) && sign);
+ zds = BDIGITS(z);
+
+#if SIZEOF_BDIGITS == SIZEOF_LONG
+ i = 1;
+ zds[0] = xds[0] | y;
+#else
+ {
+ BDIGIT_DBL num = y;
+
+ for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
+ zds[i] = xds[i] | BIGLO(num);
+ num = BIGDN(num);
+ }
+ }
+#endif
+ while (i < xn) {
+ zds[i] = sign?xds[i]:(BDIGIT)(BIGRAD-1);
+ i++;
+ }
+ if (!RBIGNUM_SIGN(z)) get2comp(z);
return bignorm(z);
}
/*
* call-seq:
- * big | numeric => integer
+ * big | numeric -> integer
*
* Performs bitwise +or+ between _big_ and _numeric_.
*/
VALUE
-rb_big_or(xx, yy)
- VALUE xx, yy;
+rb_big_or(VALUE xx, VALUE yy)
{
volatile VALUE x, y, z;
BDIGIT *ds1, *ds2, *zds;
long i, l1, l2;
char sign;
+ if (!FIXNUM_P(yy) && !RB_TYPE_P(yy, T_BIGNUM)) {
+ return rb_num_coerce_bit(xx, yy, '|');
+ }
+
x = xx;
- y = rb_to_int(yy);
+ y = yy;
+
+ if (!RBIGNUM_SIGN(x)) {
+ x = rb_big_clone(x);
+ get2comp(x);
+ }
if (FIXNUM_P(y)) {
- y = rb_int2big(FIX2LONG(y));
+ return bigor_int(x, FIX2LONG(y));
}
- if (!RBIGNUM(y)->sign) {
+ if (!RBIGNUM_SIGN(y)) {
y = rb_big_clone(y);
get2comp(y);
}
- if (!RBIGNUM(x)->sign) {
- x = rb_big_clone(x);
- get2comp(x);
- }
- if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
- l1 = RBIGNUM(y)->len;
- l2 = RBIGNUM(x)->len;
+ if (RBIGNUM_LEN(x) > RBIGNUM_LEN(y)) {
+ l1 = RBIGNUM_LEN(y);
+ l2 = RBIGNUM_LEN(x);
ds1 = BDIGITS(y);
ds2 = BDIGITS(x);
- sign = RBIGNUM(y)->sign;
+ sign = RBIGNUM_SIGN(y);
}
else {
- l1 = RBIGNUM(x)->len;
- l2 = RBIGNUM(y)->len;
+ l1 = RBIGNUM_LEN(x);
+ l2 = RBIGNUM_LEN(y);
ds1 = BDIGITS(x);
ds2 = BDIGITS(y);
- sign = RBIGNUM(x)->sign;
+ sign = RBIGNUM_SIGN(x);
}
- z = bignew(l2, RBIGNUM(x)->sign && RBIGNUM(y)->sign);
+ z = bignew(l2, RBIGNUM_SIGN(x) && RBIGNUM_SIGN(y));
zds = BDIGITS(z);
for (i=0; i<l1; i++) {
zds[i] = ds1[i] | ds2[i];
}
for (; i<l2; i++) {
- zds[i] = sign?ds2[i]:(BIGRAD-1);
+ zds[i] = sign?ds2[i]:(BDIGIT)(BIGRAD-1);
}
- if (!RBIGNUM(z)->sign) get2comp(z);
-
+ if (!RBIGNUM_SIGN(z)) get2comp(z);
return bignorm(z);
}
+static VALUE
+bigxor_int(VALUE x, long y)
+{
+ VALUE z;
+ BDIGIT *xds, *zds;
+ long xn, zn;
+ long i;
+ char sign;
+
+ sign = (y >= 0) ? 1 : 0;
+ xds = BDIGITS(x);
+ zn = xn = RBIGNUM_LEN(x);
+ z = bignew(zn, !(RBIGNUM_SIGN(x) ^ sign));
+ zds = BDIGITS(z);
+
+#if SIZEOF_BDIGITS == SIZEOF_LONG
+ i = 1;
+ zds[0] = xds[0] ^ y;
+#else
+ {
+ BDIGIT_DBL num = y;
+
+ for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
+ zds[i] = xds[i] ^ BIGLO(num);
+ num = BIGDN(num);
+ }
+ }
+#endif
+ while (i < xn) {
+ zds[i] = sign?xds[i]:~xds[i];
+ i++;
+ }
+ if (!RBIGNUM_SIGN(z)) get2comp(z);
+ return bignorm(z);
+}
/*
* call-seq:
- * big ^ numeric => integer
+ * big ^ numeric -> integer
*
* Performs bitwise +exclusive or+ between _big_ and _numeric_.
*/
VALUE
-rb_big_xor(xx, yy)
- VALUE xx, yy;
+rb_big_xor(VALUE xx, VALUE yy)
{
volatile VALUE x, y;
VALUE z;
@@ -1783,36 +3452,41 @@ rb_big_xor(xx, yy)
long i, l1, l2;
char sign;
+ if (!FIXNUM_P(yy) && !RB_TYPE_P(yy, T_BIGNUM)) {
+ return rb_num_coerce_bit(xx, yy, '^');
+ }
+
x = xx;
- y = rb_to_int(yy);
+ y = yy;
+
+ if (!RBIGNUM_SIGN(x)) {
+ x = rb_big_clone(x);
+ get2comp(x);
+ }
if (FIXNUM_P(y)) {
- y = rb_int2big(FIX2LONG(y));
+ return bigxor_int(x, FIX2LONG(y));
}
- if (!RBIGNUM(y)->sign) {
+ if (!RBIGNUM_SIGN(y)) {
y = rb_big_clone(y);
get2comp(y);
}
- if (!RBIGNUM(x)->sign) {
- x = rb_big_clone(x);
- get2comp(x);
- }
- if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
- l1 = RBIGNUM(y)->len;
- l2 = RBIGNUM(x)->len;
+ if (RBIGNUM_LEN(x) > RBIGNUM_LEN(y)) {
+ l1 = RBIGNUM_LEN(y);
+ l2 = RBIGNUM_LEN(x);
ds1 = BDIGITS(y);
ds2 = BDIGITS(x);
- sign = RBIGNUM(y)->sign;
+ sign = RBIGNUM_SIGN(y);
}
else {
- l1 = RBIGNUM(x)->len;
- l2 = RBIGNUM(y)->len;
+ l1 = RBIGNUM_LEN(x);
+ l2 = RBIGNUM_LEN(y);
ds1 = BDIGITS(x);
ds2 = BDIGITS(y);
- sign = RBIGNUM(x)->sign;
+ sign = RBIGNUM_SIGN(x);
}
- RBIGNUM(x)->sign = RBIGNUM(x)->sign?1:0;
- RBIGNUM(y)->sign = RBIGNUM(y)->sign?1:0;
- z = bignew(l2, !(RBIGNUM(x)->sign ^ RBIGNUM(y)->sign));
+ RBIGNUM_SET_SIGN(x, RBIGNUM_SIGN(x)?1:0);
+ RBIGNUM_SET_SIGN(y, RBIGNUM_SIGN(y)?1:0);
+ z = bignew(l2, !(RBIGNUM_SIGN(x) ^ RBIGNUM_SIGN(y)));
zds = BDIGITS(z);
for (i=0; i<l1; i++) {
@@ -1821,7 +3495,7 @@ rb_big_xor(xx, yy)
for (; i<l2; i++) {
zds[i] = sign?ds2[i]:~ds2[i];
}
- if (!RBIGNUM(z)->sign) get2comp(z);
+ if (!RBIGNUM_SIGN(z)) get2comp(z);
return bignorm(z);
}
@@ -1829,23 +3503,22 @@ rb_big_xor(xx, yy)
static VALUE
check_shiftdown(VALUE y, VALUE x)
{
- if (!RBIGNUM(x)->len) return INT2FIX(0);
- if (RBIGNUM(y)->len > SIZEOF_LONG / SIZEOF_BDIGITS) {
- return RBIGNUM(x)->sign ? INT2FIX(0) : INT2FIX(-1);
+ if (!RBIGNUM_LEN(x)) return INT2FIX(0);
+ if (RBIGNUM_LEN(y) > SIZEOF_LONG / SIZEOF_BDIGITS) {
+ return RBIGNUM_SIGN(x) ? INT2FIX(0) : INT2FIX(-1);
}
return Qnil;
}
/*
* call-seq:
- * big << numeric => integer
+ * big << numeric -> integer
*
* Shifts big left _numeric_ positions (right if _numeric_ is negative).
*/
VALUE
-rb_big_lshift(x, y)
- VALUE x, y;
+rb_big_lshift(VALUE x, VALUE y)
{
long shift;
int neg = 0;
@@ -1859,36 +3532,34 @@ rb_big_lshift(x, y)
}
break;
}
- else if (TYPE(y) == T_BIGNUM) {
- if (!RBIGNUM(y)->sign) {
+ else if (RB_TYPE_P(y, T_BIGNUM)) {
+ if (!RBIGNUM_SIGN(y)) {
VALUE t = check_shiftdown(y, x);
if (!NIL_P(t)) return t;
neg = 1;
}
- shift = big2ulong(y, "long", Qtrue);
+ shift = big2ulong(y, "long", TRUE);
break;
}
y = rb_to_int(y);
}
- if (neg) return big_rshift(x, shift);
- return big_lshift(x, shift);
+ x = neg ? big_rshift(x, shift) : big_lshift(x, shift);
+ return bignorm(x);
}
static VALUE
-big_lshift(x, shift)
- VALUE x;
- unsigned long shift;
+big_lshift(VALUE x, unsigned long shift)
{
BDIGIT *xds, *zds;
long s1 = shift/BITSPERDIG;
- int s2 = shift%BITSPERDIG;
+ int s2 = (int)(shift%BITSPERDIG);
VALUE z;
BDIGIT_DBL num = 0;
long len, i;
- len = RBIGNUM(x)->len;
- z = bignew(len+s1+1, RBIGNUM(x)->sign);
+ len = RBIGNUM_LEN(x);
+ z = bignew(len+s1+1, RBIGNUM_SIGN(x));
zds = BDIGITS(z);
for (i=0; i<s1; i++) {
*zds++ = 0;
@@ -1900,19 +3571,18 @@ big_lshift(x, shift)
num = BIGDN(num);
}
*zds = BIGLO(num);
- return bignorm(z);
+ return z;
}
/*
* call-seq:
- * big >> numeric => integer
+ * big >> numeric -> integer
*
* Shifts big right _numeric_ positions (left if _numeric_ is negative).
*/
VALUE
-rb_big_rshift(x, y)
- VALUE x, y;
+rb_big_rshift(VALUE x, VALUE y)
{
long shift;
int neg = 0;
@@ -1926,51 +3596,54 @@ rb_big_rshift(x, y)
}
break;
}
- else if (TYPE(y) == T_BIGNUM) {
- if (RBIGNUM(y)->sign) {
+ else if (RB_TYPE_P(y, T_BIGNUM)) {
+ if (RBIGNUM_SIGN(y)) {
VALUE t = check_shiftdown(y, x);
if (!NIL_P(t)) return t;
}
else {
neg = 1;
}
- shift = big2ulong(y, "long", Qtrue);
+ shift = big2ulong(y, "long", TRUE);
break;
}
y = rb_to_int(y);
}
- if (neg) return big_lshift(x, shift);
- return big_rshift(x, shift);
+ x = neg ? big_lshift(x, shift) : big_rshift(x, shift);
+ return bignorm(x);
}
static VALUE
-big_rshift(x, shift)
- VALUE x;
- unsigned long shift;
+big_rshift(VALUE x, unsigned long shift)
{
BDIGIT *xds, *zds;
long s1 = shift/BITSPERDIG;
- int s2 = shift%BITSPERDIG;
+ int s2 = (int)(shift%BITSPERDIG);
VALUE z;
BDIGIT_DBL num = 0;
long i, j;
volatile VALUE save_x;
- if (s1 > RBIGNUM(x)->len) {
- if (RBIGNUM(x)->sign)
+ if (s1 > RBIGNUM_LEN(x)) {
+ if (RBIGNUM_SIGN(x))
return INT2FIX(0);
else
return INT2FIX(-1);
}
- if (!RBIGNUM(x)->sign) {
- save_x = x = rb_big_clone(x);
+ if (!RBIGNUM_SIGN(x)) {
+ x = rb_big_clone(x);
get2comp(x);
}
+ save_x = x;
xds = BDIGITS(x);
- i = RBIGNUM(x)->len; j = i - s1;
- z = bignew(j, RBIGNUM(x)->sign);
- if (!RBIGNUM(x)->sign) {
+ i = RBIGNUM_LEN(x); j = i - s1;
+ if (j == 0) {
+ if (RBIGNUM_SIGN(x)) return INT2FIX(0);
+ else return INT2FIX(-1);
+ }
+ z = bignew(j, RBIGNUM_SIGN(x));
+ if (!RBIGNUM_SIGN(x)) {
num = ((BDIGIT_DBL)~0) << BITSPERDIG;
}
zds = BDIGITS(z);
@@ -1979,82 +3652,88 @@ big_rshift(x, shift)
zds[j] = BIGLO(num);
num = BIGUP(xds[i]);
}
- if (!RBIGNUM(x)->sign) {
+ if (!RBIGNUM_SIGN(x)) {
get2comp(z);
}
- return bignorm(z);
+ RB_GC_GUARD(save_x);
+ return z;
}
/*
* call-seq:
* big[n] -> 0, 1
- *
+ *
* Bit Reference---Returns the <em>n</em>th bit in the (assumed) binary
* representation of <i>big</i>, where <i>big</i>[0] is the least
* significant bit.
- *
+ *
* a = 9**15
* 50.downto(0) do |n|
* print a[n]
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* 000101110110100000111000011110010100111100010111001
- *
+ *
*/
static VALUE
-rb_big_aref(x, y)
- VALUE x, y;
+rb_big_aref(VALUE x, VALUE y)
{
BDIGIT *xds;
- int shift;
- long s1, s2;
+ BDIGIT_DBL num;
+ VALUE shift;
+ long i, s1, s2;
- if (TYPE(y) == T_BIGNUM) {
- if (!RBIGNUM(y)->sign || RBIGNUM(x)->sign)
+ if (RB_TYPE_P(y, T_BIGNUM)) {
+ if (!RBIGNUM_SIGN(y))
return INT2FIX(0);
- return INT2FIX(1);
+ bigtrunc(y);
+ if (RBIGNUM_LEN(y) > DIGSPERLONG) {
+ out_of_range:
+ return RBIGNUM_SIGN(x) ? INT2FIX(0) : INT2FIX(1);
+ }
+ shift = big2ulong(y, "long", FALSE);
+ }
+ else {
+ i = NUM2LONG(y);
+ if (i < 0) return INT2FIX(0);
+ shift = (VALUE)i;
}
- shift = NUM2INT(y);
- if (shift < 0) return INT2FIX(0);
s1 = shift/BITSPERDIG;
s2 = shift%BITSPERDIG;
- if (!RBIGNUM(x)->sign) {
- if (s1 >= RBIGNUM(x)->len) return INT2FIX(1);
- x = rb_big_clone(x);
- get2comp(x);
+ if (s1 >= RBIGNUM_LEN(x)) goto out_of_range;
+ if (!RBIGNUM_SIGN(x)) {
+ xds = BDIGITS(x);
+ i = 0; num = 1;
+ while (num += ~xds[i], ++i <= s1) {
+ num = BIGDN(num);
+ }
}
else {
- if (s1 >= RBIGNUM(x)->len) return INT2FIX(0);
+ num = BDIGITS(x)[s1];
}
- xds = BDIGITS(x);
- if (xds[s1] & (1<<s2))
+ if (num & ((BDIGIT_DBL)1<<s2))
return INT2FIX(1);
return INT2FIX(0);
}
/*
* call-seq:
- * big.hash => fixnum
+ * big.hash -> fixnum
*
* Compute a hash based on the value of _big_.
*/
static VALUE
-rb_big_hash(x)
- VALUE x;
+rb_big_hash(VALUE x)
{
- long i, len, key;
- BDIGIT *digits;
+ st_index_t hash;
- key = 0; digits = BDIGITS(x); len = RBIGNUM(x)->len;
- for (i=0; i<len; i++) {
- key ^= *digits++;
- }
- return LONG2FIX(key);
+ hash = rb_memhash(BDIGITS(x), sizeof(BDIGIT)*RBIGNUM_LEN(x)) ^ RBIGNUM_SIGN(x);
+ return INT2FIX(hash);
}
/*
@@ -2062,81 +3741,85 @@ rb_big_hash(x)
*/
static VALUE
-rb_big_coerce(x, y)
- VALUE x, y;
+rb_big_coerce(VALUE x, VALUE y)
{
if (FIXNUM_P(y)) {
- return rb_assoc_new(rb_int2big(FIX2LONG(y)), x);
- }
- else if (TYPE(y) == T_BIGNUM) {
- return rb_assoc_new(y, x);
+ y = rb_int2big(FIX2LONG(y));
}
- else {
+ else if (!RB_TYPE_P(y, T_BIGNUM)) {
rb_raise(rb_eTypeError, "can't coerce %s to Bignum",
rb_obj_classname(y));
}
- /* not reached */
- return Qnil;
+ return rb_assoc_new(y, x);
}
/*
* call-seq:
* big.abs -> aBignum
- *
+ *
* Returns the absolute value of <i>big</i>.
- *
+ *
* -1234567890987654321.abs #=> 1234567890987654321
*/
static VALUE
-rb_big_abs(x)
- VALUE x;
+rb_big_abs(VALUE x)
{
- if (!RBIGNUM(x)->sign) {
+ if (!RBIGNUM_SIGN(x)) {
x = rb_big_clone(x);
- RBIGNUM(x)->sign = 1;
+ RBIGNUM_SET_SIGN(x, 1);
}
return x;
}
-VALUE
-rb_big_rand(max, rand_buf)
- VALUE max;
- double *rand_buf;
-{
- VALUE v;
- long len = RBIGNUM(max)->len;
-
- if (BIGZEROP(max)) {
- return rb_float_new(rand_buf[0]);
- }
- v = bignew(len,1);
- len--;
- BDIGITS(v)[len] = BDIGITS(max)[len] * rand_buf[len];
- while (len--) {
- BDIGITS(v)[len] = ((BDIGIT)~0) * rand_buf[len];
- }
-
- return v;
-}
-
/*
* call-seq:
* big.size -> integer
- *
+ *
* Returns the number of bytes in the machine representation of
* <i>big</i>.
- *
+ *
* (256**10 - 1).size #=> 12
* (256**20 - 1).size #=> 20
* (256**40 - 1).size #=> 40
*/
static VALUE
-rb_big_size(big)
- VALUE big;
+rb_big_size(VALUE big)
+{
+ return LONG2FIX(RBIGNUM_LEN(big)*SIZEOF_BDIGITS);
+}
+
+/*
+ * call-seq:
+ * big.odd? -> true or false
+ *
+ * Returns <code>true</code> if <i>big</i> is an odd number.
+ */
+
+static VALUE
+rb_big_odd_p(VALUE num)
+{
+ if (BDIGITS(num)[0] & 1) {
+ return Qtrue;
+ }
+ return Qfalse;
+}
+
+/*
+ * call-seq:
+ * big.even? -> true or false
+ *
+ * Returns <code>true</code> if <i>big</i> is an even number.
+ */
+
+static VALUE
+rb_big_even_p(VALUE num)
{
- return LONG2FIX(RBIGNUM(big)->len*SIZEOF_BDIGITS);
+ if (BDIGITS(num)[0] & 1) {
+ return Qfalse;
+ }
+ return Qtrue;
}
/*
@@ -2146,23 +3829,24 @@ rb_big_size(big)
* Fixnum. When a calculation involving
* Bignum objects returns a result that will fit in a
* Fixnum, the result is automatically converted.
- *
+ *
* For the purposes of the bitwise operations and <code>[]</code>, a
* Bignum is treated as if it were an infinite-length
* bitstring with 2's complement representation.
- *
+ *
* While Fixnum values are immediate, Bignum
* objects are not---assignment and parameter passing work with
* references to objects, not the objects themselves.
- *
+ *
*/
void
-Init_Bignum()
+Init_Bignum(void)
{
rb_cBignum = rb_define_class("Bignum", rb_cInteger);
rb_define_method(rb_cBignum, "to_s", rb_big_to_s, -1);
+ rb_define_alias(rb_cBignum, "inspect", "to_s");
rb_define_method(rb_cBignum, "coerce", rb_big_coerce, 1);
rb_define_method(rb_cBignum, "-@", rb_big_uminus, 0);
rb_define_method(rb_cBignum, "+", rb_big_plus, 1);
@@ -2170,11 +3854,11 @@ Init_Bignum()
rb_define_method(rb_cBignum, "*", rb_big_mul, 1);
rb_define_method(rb_cBignum, "/", rb_big_div, 1);
rb_define_method(rb_cBignum, "%", rb_big_modulo, 1);
- rb_define_method(rb_cBignum, "div", rb_big_div, 1);
+ rb_define_method(rb_cBignum, "div", rb_big_idiv, 1);
rb_define_method(rb_cBignum, "divmod", rb_big_divmod, 1);
rb_define_method(rb_cBignum, "modulo", rb_big_modulo, 1);
rb_define_method(rb_cBignum, "remainder", rb_big_remainder, 1);
- rb_define_method(rb_cBignum, "quo", rb_big_quo, 1);
+ rb_define_method(rb_cBignum, "fdiv", rb_big_fdiv, 1);
rb_define_method(rb_cBignum, "**", rb_big_pow, 1);
rb_define_method(rb_cBignum, "&", rb_big_and, 1);
rb_define_method(rb_cBignum, "|", rb_big_or, 1);
@@ -2186,9 +3870,22 @@ Init_Bignum()
rb_define_method(rb_cBignum, "<=>", rb_big_cmp, 1);
rb_define_method(rb_cBignum, "==", rb_big_eq, 1);
+ rb_define_method(rb_cBignum, ">", big_gt, 1);
+ rb_define_method(rb_cBignum, ">=", big_ge, 1);
+ rb_define_method(rb_cBignum, "<", big_lt, 1);
+ rb_define_method(rb_cBignum, "<=", big_le, 1);
+ rb_define_method(rb_cBignum, "===", rb_big_eq, 1);
rb_define_method(rb_cBignum, "eql?", rb_big_eql, 1);
rb_define_method(rb_cBignum, "hash", rb_big_hash, 0);
rb_define_method(rb_cBignum, "to_f", rb_big_to_f, 0);
rb_define_method(rb_cBignum, "abs", rb_big_abs, 0);
+ rb_define_method(rb_cBignum, "magnitude", rb_big_abs, 0);
rb_define_method(rb_cBignum, "size", rb_big_size, 0);
+ rb_define_method(rb_cBignum, "odd?", rb_big_odd_p, 0);
+ rb_define_method(rb_cBignum, "even?", rb_big_even_p, 0);
+
+ power_cache_init();
+
+ big_three = rb_uint2big(3);
+ rb_gc_register_mark_object(big_three);
}
diff --git a/bin/erb b/bin/erb
index a6fcd5370c..6b92ac2284 100755
--- a/bin/erb
+++ b/bin/erb
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
# Tiny eRuby --- ERB2
-# Copyright (c) 1999-2000,2002 Masatoshi SEKI
+# Copyright (c) 1999-2000,2002 Masatoshi SEKI
# You can redistribute it and/or modify it under the same terms as Ruby.
require 'erb'
@@ -12,18 +12,28 @@ class ERB
arg = self.shift
return nil if arg == '--'
if arg =~ /^-(.)(.*)/
- return arg if $1 == '-'
- raise 'unknown switch "-"' if $2.index('-')
- self.unshift "-#{$2}" if $2.size > 0
+ if $1 == '-'
+ arg, @maybe_arg = arg.split(/=/, 2)
+ return arg
+ end
+ raise 'unknown switch "-"' if $2[0] == ?- and $1 != 'T'
+ if $2.size > 0
+ self.unshift "-#{$2}"
+ @maybe_arg = $2
+ else
+ @maybe_arg = nil
+ end
"-#{$1}"
else
self.unshift arg
nil
end
end
-
+
def ARGV.req_arg
- self.shift || raise('missing argument')
+ (@maybe_arg || self.shift || raise('missing argument')).tap {
+ @maybe_arg = nil
+ }
end
def trim_mode_opt(trim_mode, disable_percent)
@@ -67,25 +77,16 @@ class ERB
when '-T' # trim mode
arg = ARGV.req_arg
if arg == '-'
- trim_mode = arg
+ trim_mode = arg
next
end
raise "invalid trim mode #{arg.dump}" unless arg =~ /^[0-2]$/
trim_mode = arg.to_i
- when '-K' # KCODE
+ when '-E', '--encoding'
arg = ARGV.req_arg
- case arg.downcase
- when 'e', '-e', 'euc'
- $KCODE = 'EUC'
- when 's', '-s', 'sjis'
- $KCODE = 'SJIS'
- when 'u', '-u', 'utf8'
- $KCODE = 'UTF8'
- when 'n', '-n', 'none'
- $KCODE = 'NONE'
- else
- raise "invalid KCODE #{arg.dump}"
- end
+ set_encoding(*arg.split(/:/, 2))
+ when '-U'
+ set_encoding(Encoding::UTF_8, Encoding::UTF_8)
when '-P'
disable_percent = true
when '--help'
@@ -96,22 +97,24 @@ class ERB
end
rescue # usage
STDERR.puts $!.to_s
- STDERR.puts File.basename($0) +
+ STDERR.puts File.basename($0) +
" [switches] [inputfile]"
STDERR.puts <<EOU
-x print ruby script
-n print ruby script with line number
-v enable verbose mode
-d set $DEBUG to true
- -r [library] load a library
- -K [kcode] specify KANJI code-set
- -S [safe_level] set $SAFE (0..4)
- -T [trim_mode] specify trim_mode (0..2, -)
+ -r library load a library
+ -S safe_level set $SAFE (0..4)
+ -E ex[:in] set default external/internal encodings
+ -U set default encoding to UTF-8.
+ -T trim_mode specify trim_mode (0..2, -)
-P ignore lines which start with "%"
EOU
exit 1
end
+ $<.set_encoding(Encoding::ASCII_8BIT, nil)
src = $<.read
filename = $FILENAME
exit 2 unless src
@@ -120,10 +123,8 @@ EOU
erb.filename = filename
if output
if number
- l = 1
- for line in erb.src
- puts "%3d %s"%[l, line]
- l += 1
+ erb.src.each_line.with_index do |line, l|
+ puts "%3d %s"%[l+1, line]
end
else
puts erb.src
@@ -133,6 +134,19 @@ EOU
end
end
module_function :run
+
+ def set_encoding(extern, intern = nil)
+ verbose, $VERBOSE = $VERBOSE, nil
+ Encoding.default_external = extern unless extern.nil? || extern.empty?
+ Encoding.default_internal = intern unless intern.nil? || intern.empty?
+ [$stdin, $stdout, $stderr].each do |io|
+ io.set_encoding(extern, intern)
+ end
+ ensure
+ $VERBOSE = verbose
+ end
+ module_function :set_encoding
+ class << self; private :set_encoding; end
end
end
diff --git a/bin/gem b/bin/gem
new file mode 100755
index 0000000000..a4ec754abb
--- /dev/null
+++ b/bin/gem
@@ -0,0 +1,25 @@
+#!/usr/bin/env ruby
+#--
+# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
+# All rights reserved.
+# See LICENSE.txt for permissions.
+#++
+
+require 'rubygems'
+require 'rubygems/gem_runner'
+require 'rubygems/exceptions'
+
+required_version = Gem::Requirement.new ">= 1.8.7"
+
+unless required_version.satisfied_by? Gem.ruby_version then
+ abort "Expected Ruby Version #{required_version}, is #{Gem.ruby_version}"
+end
+
+args = ARGV.clone
+
+begin
+ Gem::GemRunner.new.run args
+rescue Gem::SystemExitException => e
+ exit e.exit_code
+end
+
diff --git a/bin/irb b/bin/irb
index 13474a932b..6c8465c802 100644..100755
--- a/bin/irb
+++ b/bin/irb
@@ -1,9 +1,8 @@
#!/usr/bin/env ruby
#
-# irb.rb - intaractive ruby
-# $Release Version: 0.9.5 $
-# $Revision: 1.2.2.1 $
-# $Date: 2005/04/19 19:24:56 $
+# irb.rb - interactive ruby
+# $Release Version: 0.9.6 $
+# $Revision$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
diff --git a/bin/rake b/bin/rake
new file mode 100755
index 0000000000..6aad2f0df3
--- /dev/null
+++ b/bin/rake
@@ -0,0 +1,37 @@
+#!/usr/bin/env ruby
+
+#--
+# Copyright (c) 2003, 2004, 2005, 2006, 2007 Jim Weirich
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#++
+
+begin
+ require 'rubygems'
+ gem 'rake'
+rescue LoadError
+end
+
+module Rake
+ REDUCE_COMPAT = true if ARGV.include?("--reduce-compat")
+end
+
+require 'rake'
+
+Rake.application.run
diff --git a/bin/rdoc b/bin/rdoc
index d08ce838f6..aaa23292df 100644..100755
--- a/bin/rdoc
+++ b/bin/rdoc
@@ -5,63 +5,40 @@
#
# Copyright (c) 2003 Dave Thomas
# Released under the same terms as Ruby
-#
-# $Revision: 1.1 $
-
-## Transitional Hack ####
-#
-# RDoc was initially distributed independently, and installed
-# itself into <prefix>/lib/ruby/site_ruby/<ver>/rdoc...
-#
-# Now that RDoc is part of the distribution, it's installed into
-# <prefix>/lib/ruby/<ver>, which unfortunately appears later in the
-# search path. This means that if you have previously installed RDoc,
-# and then install from ruby-lang, you'll pick up the old one by
-# default. This hack checks for the condition, and readjusts the
-# search path if necessary.
-
-def adjust_for_existing_rdoc(path)
-
- $stderr.puts %{
- It seems as if you have a previously-installed RDoc in
- the directory #{path}.
-
- Because this is now out-of-date, you might want to consider
- removing the directories:
-
- #{File.join(path, "rdoc")}
-
- and
-
- #{File.join(path, "markup")}
-
- }
- # Move all the site_ruby directories to the end
- p $:
- $:.replace($:.partition {|path| /site_ruby/ !~ path}.flatten)
- p $:
-end
-
-$:.each do |path|
- if /site_ruby/ =~ path
- rdoc_path = File.join(path, 'rdoc', 'rdoc.rb')
- if File.exists?(rdoc_path)
- adjust_for_existing_rdoc(path)
- break
- end
- end
+begin
+ gem 'rdoc'
+rescue NameError => e # --disable-gems
+ raise unless e.name == :gem
+rescue Gem::LoadError
end
-## End of Transitional Hack ##
-
-
require 'rdoc/rdoc'
begin
r = RDoc::RDoc.new
- r.document(ARGV)
-rescue RDoc::RDocError => e
- $stderr.puts e.message
- exit(1)
+ r.document ARGV
+rescue Errno::ENOSPC
+ $stderr.puts 'Ran out of space creating documentation'
+ $stderr.puts
+ $stderr.puts 'Please free up some space and try again'
+rescue SystemExit
+ raise
+rescue Exception => e
+ if $DEBUG_RDOC then
+ $stderr.puts e.message
+ $stderr.puts "#{e.backtrace.join "\n\t"}"
+ $stderr.puts
+ elsif Interrupt === e then
+ $stderr.puts
+ $stderr.puts 'Interrupted'
+ else
+ $stderr.puts "uh-oh! RDoc had a problem:"
+ $stderr.puts e.message
+ $stderr.puts
+ $stderr.puts "run with --debug for full backtrace"
+ end
+
+ exit 1
end
+
diff --git a/bin/ri b/bin/ri
index fb3e00eda3..7fbed0c099 100755
--- a/bin/ri
+++ b/bin/ri
@@ -1,49 +1,12 @@
#!/usr/bin/env ruby
-# usage:
-#
-# ri name...
-#
-# where name can be
-#
-# Class | Class::method | Class#method | Class.method | method
-#
-# All names may be abbreviated to their minimum unbiguous form. If a name
-# _is_ ambiguous, all valid options will be listed.
-#
-# The form '.' method matches either class or instance methods, while
-# #method matches only instance and ::method matches only class methods.
-#
-#
-# == Installing Documentation
-#
-# 'ri' uses a database of documentation built by the RDoc utility.
-#
-# So, how do you install this documentation on your system?
-# It depends on how you installed Ruby.
-#
-# <em>If you installed Ruby from source files</em> (that is, if it some point
-# you typed 'make' during the process :), you can install the RDoc
-# documentation yourself. Just go back to the place where you have
-# your Ruby source and type
-#
-# make install-doc
-#
-# You'll probably need to do this as a superuser, as the documentation
-# is installed in the Ruby target tree (normally somewhere under
-# <tt>/usr/local</tt>.
-#
-# <em>If you installed Ruby from a binary distribution</em> (perhaps
-# using a one-click installer, or using some other packaging system),
-# then the team that produced the package probably forgot to package
-# the documentation as well. Contact them, and see if they can add
-# it to the next release.
-#
+begin
+ gem 'rdoc'
+rescue NameError => e # --disable-gems
+ raise unless e.name == :gem
+rescue Gem::LoadError
+end
-require 'rdoc/ri/ri_driver'
-
-######################################################################
-
-ri = RiDriver.new
-ri.process_args
+require 'rdoc/ri/driver'
+RDoc::RI::Driver.run ARGV
diff --git a/bin/testrb b/bin/testrb
index ff49cb5466..23a00b439f 100755
--- a/bin/testrb
+++ b/bin/testrb
@@ -1,5 +1,3 @@
#!/usr/bin/env ruby
require 'test/unit'
-(r = Test::Unit::AutoRunner.new(true)).process_args(ARGV) or
- abort r.options.banner + " tests..."
-exit r.run
+exit Test::Unit::AutoRunner.run(true)
diff --git a/bootstraptest/pending.rb b/bootstraptest/pending.rb
new file mode 100644
index 0000000000..744c0adac1
--- /dev/null
+++ b/bootstraptest/pending.rb
@@ -0,0 +1,39 @@
+assert_equal 'A', %q{
+ class A
+ @@a = 'A'
+ def a=(x)
+ @@a = x
+ end
+ def a
+ @@a
+ end
+ end
+
+ B = A.dup
+ B.new.a = 'B'
+ A.new.a
+}, '[ruby-core:17019]'
+
+assert_equal 'ok', %q{
+ def m
+ lambda{
+ proc{
+ return :ng1
+ }
+ }.call.call
+ :ng2
+ end
+
+ begin
+ m()
+ rescue LocalJumpError
+ :ok
+ end
+}
+
+assert_normal_exit %q{
+ r = Range.allocate
+ def r.<=>(o) true end
+ r.instance_eval { initialize r, r }
+ r.inspect
+}
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
new file mode 100755
index 0000000000..08c335ae42
--- /dev/null
+++ b/bootstraptest/runner.rb
@@ -0,0 +1,480 @@
+"exec" "${RUBY-ruby}" "-x" "$0" "$@" || true # -*- mode: ruby; coding: utf-8 -*-
+#!./ruby
+# $Id$
+
+# NOTE:
+# Never use optparse in this file.
+# Never use test/unit in this file.
+# Never use Ruby extensions in this file.
+
+begin
+ require 'fileutils'
+ require 'tmpdir'
+rescue LoadError
+ $:.unshift File.join(File.dirname(__FILE__), '../lib')
+ retry
+end
+
+if !Dir.respond_to?(:mktmpdir)
+ # copied from lib/tmpdir.rb
+ def Dir.mktmpdir(prefix_suffix=nil, tmpdir=nil)
+ case prefix_suffix
+ when nil
+ prefix = "d"
+ suffix = ""
+ when String
+ prefix = prefix_suffix
+ suffix = ""
+ when Array
+ prefix = prefix_suffix[0]
+ suffix = prefix_suffix[1]
+ else
+ raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}"
+ end
+ tmpdir ||= Dir.tmpdir
+ t = Time.now.strftime("%Y%m%d")
+ n = nil
+ begin
+ path = "#{tmpdir}/#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
+ path << "-#{n}" if n
+ path << suffix
+ Dir.mkdir(path, 0700)
+ rescue Errno::EEXIST
+ n ||= 0
+ n += 1
+ retry
+ end
+
+ if block_given?
+ begin
+ yield path
+ ensure
+ FileUtils.remove_entry_secure path
+ end
+ else
+ path
+ end
+ end
+end
+
+def main
+ @ruby = File.expand_path('miniruby')
+ @verbose = false
+ $stress = false
+ @color = nil
+ @quiet = false
+ dir = nil
+ quiet = false
+ tests = nil
+ ARGV.delete_if {|arg|
+ case arg
+ when /\A--ruby=(.*)/
+ @ruby = $1
+ @ruby.gsub!(/^([^ ]*)/){File.expand_path($1)}
+ @ruby.gsub!(/(\s+-I\s*)((?!(?:\.\/)*-(?:\s|\z))\S+)/){$1+File.expand_path($2)}
+ @ruby.gsub!(/(\s+-r\s*)(\.\.?\/\S+)/){$1+File.expand_path($2)}
+ true
+ when /\A--sets=(.*)/
+ tests = Dir.glob("#{File.dirname($0)}/test_{#{$1}}*.rb").sort
+ puts tests.map {|path| File.basename(path) }.inspect
+ true
+ when /\A--dir=(.*)/
+ dir = $1
+ true
+ when /\A(--stress|-s)/
+ $stress = true
+ when /\A--color(?:=(?:always|(auto)|(never)|(.*)))?\z/
+ warn "unknown --color argument: #$3" if $3
+ @color = $1 ? nil : !$2
+ true
+ when /\A(-q|--q(uiet))\z/
+ quiet = true
+ @quiet = true
+ true
+ when /\A(-v|--v(erbose))\z/
+ @verbose = true
+ when /\A(-h|--h(elp)?)\z/
+ puts(<<-End)
+Usage: #{File.basename($0, '.*')} --ruby=PATH [--sets=NAME,NAME,...]
+ --sets=NAME,NAME,... Name of test sets.
+ --dir=DIRECTORY Working directory.
+ default: /tmp/bootstraptestXXXXX.tmpwd
+ --color[=WHEN] Colorize the output. WHEN defaults to 'always'
+ or can be 'never' or 'auto'.
+ -s, --stress stress test.
+ -v, --verbose Output test name before exec.
+ -q, --quiet Don\'t print header message.
+ -h, --help Print this message and quit.
+End
+ exit true
+ when /\A-j/
+ true
+ else
+ false
+ end
+ }
+ if tests and not ARGV.empty?
+ $stderr.puts "--tests and arguments are exclusive"
+ exit false
+ end
+ tests ||= ARGV
+ tests = Dir.glob("#{File.dirname($0)}/test_*.rb").sort if tests.empty?
+ pathes = tests.map {|path| File.expand_path(path) }
+
+ @progress = %w[- \\ | /]
+ @progress_bs = "\b" * @progress[0].size
+ @tty = $stderr.tty?
+ case @color
+ when nil
+ @color = @tty && /dumb/ !~ ENV["TERM"]
+ end
+ @tty &&= !@verbose
+ if @color
+ # dircolors-like style
+ colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:]*)/)] : {}
+ @passed = "\e[#{colors["pass"] || "32"}m"
+ @failed = "\e[#{colors["fail"] || "31"}m"
+ @reset = "\e[m"
+ @erase = "\r\e[2K\r"
+ else
+ @passed = @failed = @reset = @erase = ""
+ end
+ unless quiet
+ puts Time.now
+ if defined?(RUBY_DESCRIPTION)
+ puts "Driver is #{RUBY_DESCRIPTION}"
+ elsif defined?(RUBY_PATCHLEVEL)
+ puts "Driver is ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}#{RUBY_PLATFORM}) [#{RUBY_PLATFORM}]"
+ else
+ puts "Driver is ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
+ end
+ puts "Target is #{`#{@ruby} -v`.chomp}"
+ puts
+ $stdout.flush
+ end
+
+ in_temporary_working_directory(dir) {
+ exec_test pathes
+ }
+end
+
+def exec_test(pathes)
+ @count = 0
+ @error = 0
+ @errbuf = []
+ @location = nil
+ pathes.each do |path|
+ @basename = File.basename(path)
+ $stderr.print @basename, " "
+ $stderr.puts if @verbose
+ count = @count
+ error = @error
+ load File.expand_path(path)
+ if @tty
+ if @error == error
+ $stderr.print "#{@progress_bs}#{@passed}PASS #{@count-count}#{@reset}"
+ $stderr.print @erase if @quiet
+ else
+ $stderr.print "#{@progress_bs}#{@failed}FAIL #{@error-error}/#{@count-count}#{@reset}"
+ end
+ end
+ $stderr.puts unless @quiet
+ end
+ if @error == 0
+ if @count == 0
+ $stderr.puts "No tests, no problem"
+ else
+ $stderr.puts "PASS all #{@count} tests"
+ end
+ exit true
+ else
+ @errbuf.each do |msg|
+ $stderr.puts msg
+ end
+ $stderr.puts "FAIL #{@error}/#{@count} tests failed"
+ exit false
+ end
+end
+
+def show_progress(message = '')
+ if @verbose
+ $stderr.print "\##{@count} #{@location} "
+ elsif @tty
+ $stderr.print "#{@progress_bs}#{@progress[@count % @progress.size]}"
+ end
+ faildesc, errout = with_stderr {yield}
+ if !faildesc
+ if @tty
+ $stderr.print "#{@progress_bs}#{@progress[@count % @progress.size]}"
+ else
+ $stderr.print '.'
+ end
+ $stderr.puts if @verbose
+ else
+ $stderr.print "#{@failed}F#{@reset}"
+ $stderr.puts if @verbose
+ error faildesc, message
+ unless errout.empty?
+ $stderr.print "#{@failed}stderr output is not empty#{@reset}\n", adjust_indent(errout)
+ end
+ if @tty and !@verbose
+ $stderr.print @basename, " ", @progress[@count % @progress.size]
+ end
+ end
+rescue Interrupt
+ raise Interrupt
+rescue Exception => err
+ $stderr.print 'E'
+ $stderr.puts if @verbose
+ error err.message, message
+end
+
+# NativeClient is special. The binary is cross-compiled. But runs on the build environment.
+# So RUBY_PLATFORM in this process is not useful to detect it.
+def nacl?
+ @ruby and File.basename(@ruby.split(/\s/).first)['sel_ldr']
+end
+
+def assert_check(testsrc, message = '', opt = '')
+ show_progress(message) {
+ result = get_result_string(testsrc, opt)
+ check_coredump
+ yield(result)
+ }
+end
+
+def assert_equal(expected, testsrc, message = '')
+ newtest
+ assert_check(testsrc, message) {|result|
+ if expected == result
+ nil
+ else
+ desc = "#{result.inspect} (expected #{expected.inspect})"
+ pretty(testsrc, desc, result)
+ end
+ }
+end
+
+def assert_match(expected_pattern, testsrc, message = '')
+ newtest
+ assert_check(testsrc, message) {|result|
+ if expected_pattern =~ result
+ nil
+ else
+ desc = "#{expected_pattern.inspect} expected to be =~\n#{result.inspect}"
+ pretty(testsrc, desc, result)
+ end
+ }
+end
+
+def assert_not_match(unexpected_pattern, testsrc, message = '')
+ newtest
+ assert_check(testsrc, message) {|result|
+ if unexpected_pattern !~ result
+ nil
+ else
+ desc = "#{unexpected_pattern.inspect} expected to be !~\n#{result.inspect}"
+ pretty(testsrc, desc, result)
+ end
+ }
+end
+
+def assert_valid_syntax(testsrc, message = '')
+ newtest
+ assert_check(testsrc, message, '-c') {|result|
+ result if /Syntax OK/ !~ result
+ }
+end
+
+def assert_normal_exit(testsrc, *rest)
+ newtest
+ opt = {}
+ opt = rest.pop if Hash === rest.last
+ message, ignore_signals = rest
+ message ||= ''
+ timeout = opt[:timeout]
+ show_progress(message) {
+ faildesc = nil
+ filename = make_srcfile(testsrc)
+ old_stderr = $stderr.dup
+ timeout_signaled = false
+ begin
+ $stderr.reopen("assert_normal_exit.log", "w")
+ io = IO.popen("#{@ruby} -W0 #{filename}")
+ pid = io.pid
+ th = Thread.new {
+ io.read
+ io.close
+ $?
+ }
+ if !th.join(timeout)
+ Process.kill :KILL, pid
+ timeout_signaled = true
+ end
+ status = th.value
+ ensure
+ $stderr.reopen(old_stderr)
+ old_stderr.close
+ end
+ if status.signaled?
+ signo = status.termsig
+ signame = Signal.list.invert[signo]
+ unless ignore_signals and ignore_signals.include?(signame)
+ sigdesc = "signal #{signo}"
+ if signame
+ sigdesc = "SIG#{signame} (#{sigdesc})"
+ end
+ if timeout_signaled
+ sigdesc << " (timeout)"
+ end
+ faildesc = pretty(testsrc, "killed by #{sigdesc}", nil)
+ stderr_log = File.read("assert_normal_exit.log")
+ if !stderr_log.empty?
+ faildesc << "\n" if /\n\z/ !~ faildesc
+ stderr_log << "\n" if /\n\z/ !~ stderr_log
+ stderr_log.gsub!(/^.*\n/) { '| ' + $& }
+ faildesc << stderr_log
+ end
+ end
+ end
+ faildesc
+ }
+end
+
+def assert_finish(timeout_seconds, testsrc, message = '')
+ newtest
+ show_progress(message) {
+ faildesc = nil
+ filename = make_srcfile(testsrc)
+ io = IO.popen("#{@ruby} -W0 #{filename}")
+ pid = io.pid
+ waited = false
+ tlimit = Time.now + timeout_seconds
+ while Time.now < tlimit
+ if Process.waitpid pid, Process::WNOHANG
+ waited = true
+ break
+ end
+ sleep 0.1
+ end
+ if !waited
+ Process.kill(:KILL, pid)
+ Process.waitpid pid
+ faildesc = pretty(testsrc, "not finished in #{timeout_seconds} seconds", nil)
+ end
+ io.close
+ faildesc
+ }
+end
+
+def flunk(message = '')
+ newtest
+ show_progress('') { message }
+end
+
+def pretty(src, desc, result)
+ src = src.sub(/\A.*\n/, '')
+ (/\n/ =~ src ? "\n#{adjust_indent(src)}" : src) + " #=> #{desc}"
+end
+
+INDENT = 27
+
+def adjust_indent(src)
+ untabify(src).gsub(/^ {#{INDENT}}/o, '').gsub(/^/, ' ')
+end
+
+def untabify(str)
+ str.gsub(/^\t+/) {' ' * (8 * $&.size) }
+end
+
+def make_srcfile(src)
+ filename = 'bootstraptest.tmp.rb'
+ File.open(filename, 'w') {|f|
+ f.puts "GC.stress = true" if $stress
+ f.puts "print(begin; #{src}; end)"
+ }
+ filename
+end
+
+def get_result_string(src, opt = '')
+ if @ruby
+ filename = make_srcfile(src)
+ begin
+ `#{@ruby} -W0 #{opt} #{filename}`
+ ensure
+ raise Interrupt if $?.signaled? && $?.termsig == Signal.list["INT"]
+ raise CoreDumpError, "core dumped" if $? and $?.coredump?
+ end
+ else
+ eval(src).to_s
+ end
+end
+
+def with_stderr
+ out = err = nil
+ begin
+ r, w = IO.pipe
+ stderr = $stderr.dup
+ $stderr.reopen(w)
+ w.close
+ reader = Thread.start {r.read}
+ begin
+ out = yield
+ ensure
+ $stderr.reopen(stderr)
+ err = reader.value
+ end
+ ensure
+ w.close rescue nil
+ r.close rescue nil
+ end
+ return out, err
+end
+
+def newtest
+ @location = File.basename(caller(2).first)
+ @count += 1
+ cleanup_coredump
+end
+
+def error(msg, additional_message)
+ msg = "#{@failed}\##{@count} #{@location}#{@reset}: #{msg} #{additional_message}"
+ if @tty
+ $stderr.puts "#{@erase}#{msg}"
+ else
+ @errbuf.push msg
+ end
+ @error += 1
+end
+
+def in_temporary_working_directory(dir)
+ if dir
+ Dir.mkdir dir
+ Dir.chdir(dir) {
+ yield
+ }
+ else
+ Dir.mktmpdir(["bootstraptest", ".tmpwd"]) {|d|
+ Dir.chdir(d) {
+ yield
+ }
+ }
+ end
+end
+
+def cleanup_coredump
+ FileUtils.rm_f 'core'
+ FileUtils.rm_f Dir.glob('core.*')
+ FileUtils.rm_f @ruby+'.stackdump' if @ruby
+end
+
+class CoreDumpError < StandardError; end
+
+def check_coredump
+ if File.file?('core') or not Dir.glob('core.*').empty? or
+ (@ruby and File.exist?(@ruby+'.stackdump'))
+ raise CoreDumpError, "core dumped"
+ end
+end
+
+main
diff --git a/bootstraptest/test_attr.rb b/bootstraptest/test_attr.rb
new file mode 100644
index 0000000000..721a847145
--- /dev/null
+++ b/bootstraptest/test_attr.rb
@@ -0,0 +1,36 @@
+assert_equal 'ok', %q{
+ module M
+ class A
+ class << self
+ attr_accessor :at
+ def workflow_rule
+ yield self
+ end
+
+ def eval_str(str)
+ eval(str)
+ end
+ end
+ end
+ end
+ begin
+ M::A.eval_str(<<-END)
+ workflow_rule do |r|
+ r.at 1
+ end
+ END
+ rescue ArgumentError => e
+ print "ok"
+ end
+}, '[ruby-core:14641]'
+
+assert_equal %{ok}, %{
+ class A
+ attr :m
+ end
+ begin
+ A.new.m(3)
+ rescue ArgumentError => e
+ print "ok"
+ end
+}, '[ruby-core:15120]'
diff --git a/bootstraptest/test_autoload.rb b/bootstraptest/test_autoload.rb
new file mode 100644
index 0000000000..e8df6684b6
--- /dev/null
+++ b/bootstraptest/test_autoload.rb
@@ -0,0 +1,110 @@
+assert_equal 'ok', %q{
+ File.unlink('zzz.rb') if File.file?('zzz.rb')
+ instance_eval do
+ autoload :ZZZ, './zzz.rb'
+ begin
+ ZZZ
+ rescue LoadError
+ :ok
+ end
+ end
+}, '[ruby-dev:43816]'
+
+assert_equal 'ok', %q{
+ open('zzz.rb', 'w') {|f| f.puts '' }
+ instance_eval do
+ autoload :ZZZ, './zzz.rb'
+ begin
+ ZZZ
+ rescue NameError
+ :ok
+ end
+ end
+}, '[ruby-dev:43816]'
+
+assert_equal 'ok', %q{
+ open('zzz.rb', 'w') {|f| f.puts 'class ZZZ; def self.ok;:ok;end;end'}
+ instance_eval do
+ autoload :ZZZ, './zzz.rb'
+ ZZZ.ok
+ end
+}, '[ruby-dev:43816]'
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
+ autoload :ZZZ, "./zzz.rb"
+ ZZZ.ok
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
+ autoload :ZZZ, "./zzz.rb"
+ require "./zzz.rb"
+ ZZZ.ok
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
+ autoload :ZZZ, "./zzz.rb"
+ proc{$SAFE=4; ZZZ.ok}.call
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
+ autoload :ZZZ, "./zzz.rb"
+ require "./zzz.rb"
+ proc{$SAFE=4; ZZZ.ok}.call
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
+ autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
+ module M; end
+ Thread.new{M.instance_eval('$SAFE=4; ZZZ.new.hoge')}.value
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
+ autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
+ module M; end
+ Thread.new{$SAFE=4; M.instance_eval('ZZZ.new.hoge')}.value
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
+ autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
+ Thread.new{$SAFE=4; eval('ZZZ.new.hoge')}.value
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
+ autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
+ module M; end
+ Thread.new{eval('$SAFE=4; ZZZ.new.hoge')}.value
+}
+
+assert_equal 'okok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
+ autoload :ZZZ, "./zzz.rb"
+ t1 = Thread.new {ZZZ.ok}
+ t2 = Thread.new {ZZZ.ok}
+ [t1.value, t2.value].join
+}
+
+assert_finish 5, %q{
+ autoload :ZZZ, File.expand_path(__FILE__)
+ begin
+ ZZZ
+ rescue NameError
+ end
+}, '[ruby-core:21696]'
+
+assert_equal 'A::C', %q{
+ open("zzz.rb", "w") {}
+ class A
+ autoload :C, "./zzz"
+ class C
+ end
+ C
+ end
+}
diff --git a/bootstraptest/test_block.rb b/bootstraptest/test_block.rb
new file mode 100644
index 0000000000..6a2ccfc6da
--- /dev/null
+++ b/bootstraptest/test_block.rb
@@ -0,0 +1,599 @@
+assert_equal %q{1}, %q{
+ 1.times{
+ begin
+ a = 1
+ ensure
+ foo = nil
+ end
+ }
+}
+assert_equal %q{2}, %q{
+ [1,2,3].find{|x| x == 2}
+}
+assert_equal %q{2}, %q{
+ class E
+ include Enumerable
+ def each(&block)
+ [1, 2, 3].each(&block)
+ end
+ end
+ E.new.find {|x| x == 2 }
+}
+assert_equal %q{6}, %q{
+ sum = 0
+ for x in [1, 2, 3]
+ sum += x
+ end
+ sum
+}
+assert_equal %q{15}, %q{
+ sum = 0
+ for x in (1..5)
+ sum += x
+ end
+ sum
+}
+assert_equal %q{0}, %q{
+ sum = 0
+ for x in []
+ sum += x
+ end
+ sum
+}
+assert_equal %q{1}, %q{
+ ans = []
+ 1.times{
+ for n in 1..3
+ a = n
+ ans << a
+ end
+ }
+}
+assert_equal %q{1..3}, %q{
+ ans = []
+ for m in 1..3
+ for n in 1..3
+ a = [m, n]
+ ans << a
+ end
+ end
+}
+assert_equal %q{[1, 2, 3]}, %q{
+ (1..3).to_a
+}
+assert_equal %q{[4, 8, 12]}, %q{
+ (1..3).map{|e|
+ e * 4
+ }
+}
+assert_equal %q{[1, 2, 3]}, %q{
+ class C
+ include Enumerable
+ def each
+ [1,2,3].each{|e|
+ yield e
+ }
+ end
+ end
+
+ C.new.to_a
+}
+assert_equal %q{[4, 5, 6]}, %q{
+ class C
+ include Enumerable
+ def each
+ [1,2,3].each{|e|
+ yield e
+ }
+ end
+ end
+
+ C.new.map{|e|
+ e + 3
+ }
+}
+assert_equal %q{100}, %q{
+ def m
+ yield
+ end
+ def n
+ yield
+ end
+
+ m{
+ n{
+ 100
+ }
+ }
+}
+assert_equal %q{20}, %q{
+ def m
+ yield 1
+ end
+
+ m{|ib|
+ m{|jb|
+ i = 20
+ }
+ }
+}
+assert_equal %q{2}, %q{
+ def m
+ yield 1
+ end
+
+ m{|ib|
+ m{|jb|
+ ib = 20
+ kb = 2
+ }
+ }
+}
+assert_equal %q{3}, %q{
+ def iter1
+ iter2{
+ yield
+ }
+ end
+
+ def iter2
+ yield
+ end
+
+ iter1{
+ jb = 2
+ iter1{
+ jb = 3
+ }
+ jb
+ }
+}
+assert_equal %q{2}, %q{
+ def iter1
+ iter2{
+ yield
+ }
+ end
+
+ def iter2
+ yield
+ end
+
+ iter1{
+ jb = 2
+ iter1{
+ jb
+ }
+ jb
+ }
+}
+assert_equal %q{2}, %q{
+ def m
+ yield 1
+ end
+ m{|ib|
+ ib*2
+ }
+}
+assert_equal %q{92580}, %q{
+ def m
+ yield 12345, 67890
+ end
+ m{|ib,jb|
+ ib*2+jb
+ }
+}
+assert_equal %q{[10, nil]}, %q{
+ def iter
+ yield 10
+ end
+
+ a = nil
+ [iter{|a|
+ a
+ }, a]
+}
+assert_equal %q{21}, %q{
+ def iter
+ yield 10
+ end
+
+ iter{|a|
+ iter{|a|
+ a + 1
+ } + a
+ }
+}
+assert_equal %q{[10, 20, 30, 40, nil, nil, nil, nil]}, %q{
+ def iter
+ yield 10, 20, 30, 40
+ end
+
+ a = b = c = d = nil
+ iter{|a, b, c, d|
+ [a, b, c, d]
+ } + [a, b, c, d]
+}
+assert_equal %q{[10, 20, 30, 40, nil, nil]}, %q{
+ def iter
+ yield 10, 20, 30, 40
+ end
+
+ a = b = nil
+ iter{|a, b, c, d|
+ [a, b, c, d]
+ } + [a, b]
+}
+assert_equal %q{[1]}, %q{
+ $a = []
+
+ def iter
+ yield 1
+ end
+
+ def m
+ x = iter{|x|
+ $a << x
+ y = 0
+ }
+ end
+ m
+ $a
+}
+assert_equal %q{[1, [2]]}, %q{
+ def iter
+ yield 1, 2
+ end
+
+ iter{|a, *b|
+ [a, b]
+ }
+}
+assert_equal %q{[[1, 2]]}, %q{
+ def iter
+ yield 1, 2
+ end
+
+ iter{|*a|
+ [a]
+ }
+}
+assert_equal %q{[1, 2, []]}, %q{
+ def iter
+ yield 1, 2
+ end
+
+ iter{|a, b, *c|
+ [a, b, c]
+ }
+}
+assert_equal %q{[1, 2, nil, []]}, %q{
+ def iter
+ yield 1, 2
+ end
+
+ iter{|a, b, c, *d|
+ [a, b, c, d]
+ }
+}
+assert_equal %q{1}, %q{
+ def m
+ yield
+ end
+ m{
+ 1
+ }
+}
+assert_equal %q{15129}, %q{
+ def m
+ yield 123
+ end
+ m{|ib|
+ m{|jb|
+ ib*jb
+ }
+ }
+}
+assert_equal %q{2}, %q{
+ def m a
+ yield a
+ end
+ m(1){|ib|
+ m(2){|jb|
+ ib*jb
+ }
+ }
+}
+assert_equal %q{9}, %q{
+ sum = 0
+ 3.times{|ib|
+ 2.times{|jb|
+ sum += ib + jb
+ }}
+ sum
+}
+assert_equal %q{10}, %q{
+ 3.times{|bl|
+ break 10
+ }
+}
+assert_equal %q{[1, 2]}, %q{
+ def iter
+ yield 1,2,3
+ end
+
+ iter{|i, j|
+ [i, j]
+ }
+}
+assert_equal %q{[1, nil]}, %q{
+ def iter
+ yield 1
+ end
+
+ iter{|i, j|
+ [i, j]
+ }
+}
+
+assert_equal '0', %q{
+def m()
+end
+m {|(v0,*,(*)),|}
+m {|(*v0,(*)),|}
+m {|(v0,*v1,(*)),|}
+m {|((v0,*v1,v2)),|}
+m {|(v0,*v1,v2),|}
+m {|(v0,*v1,(v2)),|}
+m {|((*),*v0,v1),|}
+m {|((v0),*v1,v2),|}
+m {|(v0,v1,*v2,v3),|}
+m {|v0,(v1,*v2,v3),|}
+m {|(v0,*v1,v2),v3,|}
+m {|(v0,*v1,v2)|}
+m {|(v0,*v1,v2),&v3|}
+m {|(v0,*v1,v2),*|}
+m {|(v0,*v1,v2),*,&v3|}
+m {|*,(v0,*v1,v2)|}
+m {|*,(v0,*v1,v2),&v3|}
+m {|v0,*,(v1,*v2,v3)|}
+m {|v0,*,(v1,*v2,v3),&v4|}
+m {|(v0,*v1,v2),*,v3|}
+m {|(v0,*v1,v2),*,v3,&v4|}
+m {|(v0, *v1, v2)|}
+m {|(*,v)|}
+0
+}, "block parameter (shouldn't SEGV: [ruby-dev:31143])"
+
+assert_equal 'nil', %q{
+ def m
+ yield
+ end
+ m{|&b| b}.inspect
+}, '[ruby-dev:31147]'
+
+assert_equal 'nil', %q{
+ def m()
+ yield
+ end
+ m {|(v,(*))|}.inspect
+}, '[ruby-dev:31160]'
+
+assert_equal 'nil', %q{
+ def m()
+ yield
+ end
+ m {|(*,a,b)|}.inspect
+}, '[ruby-dev:31153]'
+
+assert_equal 'nil', %q{
+ def m()
+ yield
+ end
+ m {|((*))|}.inspect
+}
+
+assert_equal %q{[1, 1, [1, nil], [1, nil], [1, nil], [1, nil], [1, 1], 1, [1, nil], [1, nil], [1, nil], [1, nil], [[1, 1], [1, 1]], [1, 1], [1, 1], [1, 1], [1, nil], [1, nil], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[1, 1], [1, 1]], [[1, 1], [1, 1]], [[1, 1], [1, 1]], [1, 1], [1, 1], [[[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[1, 1], [1, 1]], [[1, 1], [1, 1]]]}, %q{
+def m(ary = [])
+ yield(ary)
+end
+
+$ans = []
+o = 1
+5.times{
+ v,(*) = o; $ans << o
+ m(o){|(v,(*))| $ans << v}
+ ((x, y)) = o; $ans << [x, y]
+ m(o){|((x, y))| $ans << [x, y]}
+ (((x, y))) = o; $ans << [x, y]
+ m(o){|(((x, y)))| $ans << [x, y]}
+ o = [o, o]
+}; $ans
+}
+
+assert_equal '0', %q{
+ def m()
+ yield [0]
+ end
+ m {|*,v| v}.inspect
+}, '[ruby-dev:31437]'
+assert_equal '[0]', %q{
+ def m
+ yield [0]
+ end
+ m{|v, &b| v}.inspect
+}, '[ruby-dev:31440]'
+assert_equal 'ok', %q{
+ begin
+ lambda{|a|}.call(1, 2)
+ rescue ArgumentError
+ :ok
+ else
+ :ng
+ end
+}, '[ruby-dev:31464]'
+assert_equal 'ok', %q{
+ begin
+ lambda{|&b|}.call(3)
+ rescue ArgumentError
+ :ok
+ else
+ :ng
+ end
+}, '[ruby-dev:31472]'
+assert_equal 'ok', %q{
+ class C
+ def each
+ yield [1,2]
+ yield 1,2
+ end
+ end
+ vs1 = []
+ C.new.each {|*v| vs1 << v }
+ vs2 = []
+ C.new.to_enum.each {|*v| vs2 << v }
+ vs1 == vs2 ? :ok : :ng
+}, '[ruby-dev:32329]'
+
+assert_normal_exit %q{
+ e = [1,2,3].each
+ 10000.times {
+ e = [e].each
+ }
+ Thread.new { GC.start }.join
+}, '[ruby-dev:32604]'
+
+
+assert_equal '[nil, []]', %q{
+ def m() yield nil,[] end
+ l = lambda {|*v| v}
+ GC.stress=true
+ r = m(&l)
+ GC.stress=false
+ r.inspect
+}, '[ruby-dev:32567]'
+
+assert_equal NilClass.to_s, %q{
+ r = false; 1.times{|&b| r = b}; r.class
+}
+
+assert_equal 'ok', %q{
+ class C
+ define_method(:foo) do |arg, &block|
+ if block then block.call else arg end
+ end
+ end
+ C.new.foo("ng") {"ok"}
+}, '[ruby-talk:266422]'
+
+assert_equal 'ok', %q{
+ class C
+ define_method(:xyz) do |o, k, &block|
+ block.call(o, k)
+ end
+ end
+ C.new.xyz("o","k") {|o, k| o+k}
+}, '[ruby-core:20544]'
+
+assert_equal 'ok', %q{
+ class C
+ define_method(:xyz) do |*args, &block|
+ block.call(*args)
+ end
+ end
+ C.new.xyz("o","k") {|*args| args.join("")}
+}, '[ruby-core:20544]'
+
+assert_equal 'ok', %q{
+ STDERR.reopen(STDOUT)
+ class C
+ define_method(:foo) do |&block|
+ block.call if block
+ end
+ result = "ng"
+ new.foo() {result = "ok"}
+ result
+ end
+}
+
+assert_equal "ok", %q{
+ class Bar
+ def bar; :ok; end
+ end
+ def foo
+ yield(Bar.new) if block_given?
+ end
+ foo(&:bar)
+}, '[ruby-core:14279]'
+
+assert_normal_exit %q{
+ class Controller
+ def respond_to(&block)
+ responder = Responder.new
+ block.call(responder)
+ responder.respond
+ end
+ def test_for_bug
+ respond_to{|format|
+ format.js{
+ puts "in test"
+ render{|obj|
+ puts obj
+ }
+ }
+ }
+ end
+ def render(&block)
+ puts "in render"
+ end
+ end
+
+ class Responder
+ def method_missing(symbol, &block)
+ puts "enter method_missing"
+ @response = Proc.new{
+ puts 'in method missing'
+ block.call
+ }
+ puts "leave method_missing"
+ end
+ def respond
+ @response.call
+ end
+ end
+ t = Controller.new
+ t.test_for_bug
+}, '[ruby-core:14395]'
+
+assert_equal 'true', %q{
+ class C0
+ def foo
+ block_given?
+ end
+ end
+
+ class C1 < C0
+ def foo
+ super
+ end
+ end
+
+ C1.new.foo{}
+}
+
+assert_equal 'true', %q{
+ class C0
+ def foo
+ block_given?
+ end
+ end
+
+ class C1 < C0
+ def foo
+ super()
+ end
+ end
+
+ C1.new.foo{}
+}
+
diff --git a/bootstraptest/test_class.rb b/bootstraptest/test_class.rb
new file mode 100644
index 0000000000..664dd2f166
--- /dev/null
+++ b/bootstraptest/test_class.rb
@@ -0,0 +1,159 @@
+# class
+assert_equal 'true', %q( class C; end
+ Object.const_defined?(:C) )
+assert_equal 'Class', %q( class C; end
+ C.class )
+assert_equal 'C', %q( class C; end
+ C.name )
+assert_equal 'C', %q( class C; end
+ C.new.class )
+assert_equal 'C', %q( class C; end
+ C.new.class.name )
+assert_equal 'Class', %q( class C; end
+ C.new.class.class )
+
+# inherited class
+assert_equal 'true', %q( class A; end
+ class C < A; end
+ Object.const_defined?(:C) )
+assert_equal 'Class', %q( class A; end
+ class C < A; end
+ C.class )
+assert_equal 'C', %q( class A; end
+ class C < A; end
+ C.name )
+assert_equal 'C', %q( class A; end
+ class C < A; end
+ C.new.class )
+assert_equal 'C', %q( class A; end
+ class C < A; end
+ C.new.class.name )
+assert_equal 'Class', %q( class A; end
+ class C < A; end
+ C.new.class.class )
+
+# module
+assert_equal 'true', %q( module M; end
+ Object.const_defined?(:M) )
+assert_equal 'Module', %q( module M; end
+ M.class )
+assert_equal 'M', %q( module M; end
+ M.name )
+assert_equal 'C', %q( module M; end
+ class C; include M; end
+ C.new.class )
+
+# nested class
+assert_equal 'A::B', %q( class A; end
+ class A::B; end
+ A::B )
+assert_equal 'A::B', %q( class A; end
+ class A::B; end
+ A::B.name )
+assert_equal 'A::B', %q( class A; end
+ class A::B; end
+ A::B.new.class )
+assert_equal 'Class', %q( class A; end
+ class A::B; end
+ A::B.new.class.class )
+assert_equal 'A::B::C', %q( class A; end
+ class A::B; end
+ class A::B::C; end
+ A::B::C )
+assert_equal 'A::B::C', %q( class A; end
+ class A::B; end
+ class A::B::C; end
+ A::B::C.name )
+assert_equal 'Class', %q( class A; end
+ class A::B; end
+ class A::B::C; end
+ A::B::C.class )
+assert_equal 'A::B::C', %q( class A; end
+ class A::B; end
+ class A::B::C; end
+ A::B::C.new.class )
+assert_equal 'Class', %q( class A; end
+ class A::B; end
+ class A::B::C; end
+ A::B::C.new.class.class )
+assert_equal 'A::B2', %q( class A; end
+ class A::B; end
+ class A::B2 < A::B; end
+ A::B2 )
+assert_equal 'Class', %q( class A; end
+ class A::B; end
+ class A::B2 < A::B; end
+ A::B2.class )
+
+# reopen
+assert_equal 'true', %q( class C; end; c1 = ::C
+ class C; end; c2 = ::C
+ c1.equal?(c2) )
+assert_equal '1', %q( class C; end
+ class A; end
+ begin class C < A; end; rescue TypeError; 1 end )
+assert_equal '1', %q( class C; end
+ begin module C; end; rescue TypeError; 1 end )
+assert_equal '1', %q( C = 1 # [yarv-dev:782]
+ begin class C; end; rescue TypeError; 1 end )
+assert_equal '1', %q( C = 1 # [yarv-dev:800]
+ begin module C; end; rescue TypeError; 1 end )
+
+# colon2, colon3
+assert_equal '1', %q( class A; end; A::C = 1; A::C )
+assert_equal '1', %q( A = 7; begin A::C = 7; rescue TypeError; 1 end )
+assert_equal '1', %q( begin 7::C = 7; rescue TypeError; 1 end )
+assert_equal 'C', %q( class A; class ::C; end end; C )
+assert_equal 'Class', %q( class A; class ::C; end end; C.class )
+assert_equal 'OK', %q( class A; ::C = "OK"; end; C )
+assert_equal 'String', %q( class A; ::C = "OK"; end; C.class )
+
+# class/module dup
+assert_equal 'Class', %q( class C; end; C.dup.class )
+assert_equal 'Module', %q( module M; end; M.dup.class )
+
+
+assert_equal "ok", %q{
+ module Foo
+ end
+
+ begin
+ def foo(&b)
+ Foo.module_eval &b
+ end
+ foo{
+ def bar
+ end
+ }
+ bar()
+ rescue NameError
+ :ok
+ end
+}, '[ruby-core:14378]'
+
+assert_equal '3', %q{
+ $i = 0
+ class C
+ def self.const_missing *args
+ $i+=1
+ end
+ end
+
+ 3.times{
+ C::FOO
+ }
+ $i
+}
+
+assert_match /::C\z/, %q{
+ c = nil
+ Module.new{|m| c = class m::C; name; end}
+ c
+}, '[ruby-dev:38456]'
+
+assert_normal_exit %q{
+ s = Symbol.dup
+ class << s
+ end
+ s.allocate.to_s
+}, '[ruby-core:30843]'
diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb
new file mode 100644
index 0000000000..bf7478006d
--- /dev/null
+++ b/bootstraptest/test_eval.rb
@@ -0,0 +1,324 @@
+assert_equal %q{ok}, %q{
+ def m
+ a = :ok
+ $b = binding
+ end
+ m
+ eval('a', $b)
+}
+assert_equal %q{[:ok, :ok2]}, %q{
+ def m
+ a = :ok
+ $b = binding
+ end
+ m
+ eval('b = :ok2', $b)
+ eval('[a, b]', $b)
+}
+assert_equal %q{[nil, 1]}, %q{
+ $ans = []
+ def m
+ $b = binding
+ end
+ m
+ $ans << eval(%q{
+ $ans << eval(%q{
+ a
+ }, $b)
+ a = 1
+ }, $b)
+ $ans
+}
+assert_equal %q{C}, %q{
+ Const = :top
+ class C
+ Const = :C
+ def m
+ binding
+ end
+ end
+ eval('Const', C.new.m)
+}
+assert_equal %q{top}, %q{
+ Const = :top
+ a = 1
+ class C
+ Const = :C
+ def m
+ eval('Const', TOPLEVEL_BINDING)
+ end
+ end
+ C.new.m
+}
+assert_equal %q{:ok
+ok}, %q{
+ class C
+ $b = binding
+ end
+ eval %q{
+ def m
+ :ok
+ end
+ }, $b
+ p C.new.m
+}
+assert_equal %q{ok}, %q{
+ b = proc{
+ a = :ok
+ binding
+ }.call
+ a = :ng
+ eval("a", b)
+}
+assert_equal %q{C}, %q{
+ class C
+ def foo
+ binding
+ end
+ end
+ C.new.foo.eval("self.class.to_s")
+}
+assert_equal %q{1}, %q{
+ eval('1')
+}
+assert_equal %q{1}, %q{
+ eval('a=1; a')
+}
+assert_equal %q{1}, %q{
+ a = 1
+ eval('a')
+}
+assert_equal %q{ok}, %q{
+ __send__ :eval, %{
+ :ok
+ }
+}
+assert_equal %q{ok}, %q{
+ 1.__send__ :instance_eval, %{
+ :ok
+ }
+}
+assert_equal %q{1}, %q{
+ 1.instance_eval{
+ self
+ }
+}
+assert_equal %q{foo}, %q{
+ 'foo'.instance_eval{
+ self
+ }
+}
+assert_equal %q{1}, %q{
+ class Fixnum
+ Const = 1
+ end
+ 1.instance_eval %{
+ Const
+ }
+}
+assert_equal %q{top}, %q{
+ Const = :top
+ class C
+ Const = :C
+ end
+ C.module_eval{
+ Const
+ }
+}
+assert_equal %q{C}, %q{
+ Const = :top
+ class C
+ Const = :C
+ end
+ C.class_eval %{
+ def m
+ Const
+ end
+ }
+ C.new.m
+}
+assert_equal %q{top}, %q{
+ Const = :top
+ class C
+ Const = :C
+ end
+ C.class_eval{
+ def m
+ Const
+ end
+ }
+ C.new.m
+}
+assert_equal %q{[:top, :C, :top, :C]}, %q{
+ Const = :top
+ class C
+ Const = :C
+ end
+ $nest = false
+ $ans = []
+ def m
+ $ans << Const
+ C.module_eval %{
+ $ans << Const
+ Boo = false unless defined? Boo
+ unless $nest
+ $nest = true
+ m
+ end
+ }
+ end
+ m
+ $ans
+}
+assert_equal %q{[10, main]}, %q{
+ $nested = false
+ $ans = []
+ $pr = proc{
+ $ans << self
+ unless $nested
+ $nested = true
+ $pr.call
+ end
+ }
+ class C
+ def initialize &b
+ 10.instance_eval(&b)
+ end
+ end
+ C.new(&$pr)
+ $ans
+}
+
+%w[break next redo].each do |keyword|
+ assert_match %r"Can't escape from eval with #{keyword}\z", %{
+ begin
+ eval "0 rescue #{keyword}"
+ rescue SyntaxError => e
+ e.message
+ end
+ }, '[ruby-dev:31372]'
+end
+
+assert_normal_exit %q{
+ STDERR.reopen(STDOUT)
+ class Foo
+ def self.add_method
+ class_eval("def some-bad-name; puts 'hello' unless @some_variable.some_function(''); end")
+ end
+ end
+ Foo.add_method
+}, '[ruby-core:14556] reported by Frederick Cheung'
+
+assert_equal 'ok', %q{
+ class Module
+ def my_module_eval(&block)
+ module_eval(&block)
+ end
+ end
+ class String
+ Integer.my_module_eval do
+ def hoge; end
+ end
+ end
+ if Integer.instance_methods(false).map{|m|m.to_sym}.include?(:hoge) &&
+ !String.instance_methods(false).map{|m|m.to_sym}.include?(:hoge)
+ :ok
+ else
+ :ng
+ end
+}, "[ruby-dev:34236]"
+
+assert_equal 'ok', %q{
+ begin
+ eval("class nil::Foo; end")
+ :ng
+ rescue Exception
+ :ok
+ end
+}
+
+assert_equal 'ok', %q{
+ begin
+ 0.instance_eval { def m() :m end }
+ 1.m
+ :ng
+ rescue Exception
+ :ok
+ end
+}, '[ruby-dev:34579]'
+
+assert_equal 'ok', %q{
+ begin
+ 12.instance_eval { @@a }
+ rescue NameError
+ :ok
+ end
+}, '[ruby-core:16794]'
+
+assert_equal 'ok', %q{
+ begin
+ 12.instance_exec { @@a }
+ rescue NameError
+ :ok
+ end
+}, '[ruby-core:16794]'
+
+assert_equal 'ok', %q{
+ nil.instance_eval {
+ def defd_using_instance_eval() :ok end
+ }
+ nil.defd_using_instance_eval
+}, '[ruby-core:28324]'
+
+assert_equal 'ok', %q{
+ nil.instance_exec {
+ def defd_using_instance_exec() :ok end
+ }
+ nil.defd_using_instance_exec
+}, '[ruby-core:28324]'
+
+assert_normal_exit %q{
+ eval("", method(:proc).call {}.binding)
+}
+
+assert_equal "", %q{
+ b = binding
+ 10.times{
+ eval('', b)
+ }
+ begin
+ eval('1.times{raise}', b)
+ rescue => e
+ e.message
+ end
+}, '[ruby-dev:35392]'
+
+assert_equal "[:x]", %q{
+ def kaboom!
+ yield.eval("local_variables")
+ end
+
+ for x in enum_for(:kaboom!)
+ binding
+ end
+}, '[ruby-core:25125]'
+
+assert_normal_exit %q{
+ hash = {}
+ ("aaaa".."matz").each_with_index do |s, i|
+ hash[s] = i
+ end
+ begin
+ eval "class C; @@h = #{hash.inspect}; end"
+ end
+}, '[ruby-core:25714]'
+
+assert_normal_exit %q{
+ begin
+ eval("# encoding:utf-16le\nfoo")
+ rescue Exception => e
+ p e
+ RubyVM::InstructionSequence.compile("p:hello")
+ end
+}, 'check escaping the internal value th->base_block'
+
diff --git a/bootstraptest/test_exception.rb b/bootstraptest/test_exception.rb
new file mode 100644
index 0000000000..35c8d25e37
--- /dev/null
+++ b/bootstraptest/test_exception.rb
@@ -0,0 +1,432 @@
+assert_equal %q{2}, %q{
+ begin
+ 1+1
+ ensure
+ 2+2
+ end
+}
+assert_equal %q{4}, %q{
+ begin
+ 1+1
+ begin
+ 2+2
+ ensure
+ 3+3
+ end
+ ensure
+ 4+4
+ end
+}
+assert_equal %q{4}, %q{
+ begin
+ 1+1
+ begin
+ 2+2
+ ensure
+ 3+3
+ end
+ ensure
+ 4+4
+ begin
+ 5+5
+ ensure
+ 6+6
+ end
+ end
+}
+assert_equal %q{NilClass}, %q{
+ a = nil
+ 1.times{|e|
+ begin
+ rescue => err
+ end
+ a = err.class
+ }
+ a
+}
+assert_equal %q{RuntimeError}, %q{
+ a = nil
+ 1.times{|e|
+ begin
+ raise
+ rescue => err
+ end
+ a = err.class
+ }
+ a
+}
+assert_equal %q{}, %q{
+ $!
+}
+assert_equal %q{FOO}, %q{
+ begin
+ raise "FOO"
+ rescue
+ $!
+ end
+}
+assert_equal %q{FOO}, %q{
+ def m
+ $!
+ end
+ begin
+ raise "FOO"
+ rescue
+ m()
+ end
+}
+assert_equal %q{[#<RuntimeError: BAR>, #<RuntimeError: FOO>]}, %q{
+ $ans = []
+ def m
+ $!
+ end
+ begin
+ raise "FOO"
+ rescue
+ begin
+ raise "BAR"
+ rescue
+ $ans << m()
+ end
+ $ans << m()
+ end
+ $ans
+}
+assert_equal %q{[#<RuntimeError: FOO>, #<RuntimeError: FOO>]}, %q{
+ $ans = []
+ def m
+ $!
+ end
+
+ begin
+ begin
+ raise "FOO"
+ ensure
+ $ans << m()
+ end
+ rescue
+ $ans << m()
+ end
+}
+assert_equal %q{[nil]}, %q{
+ $ans = []
+ def m
+ $!
+ end
+ def m2
+ 1.times{
+ begin
+ return
+ ensure
+ $ans << m
+ end
+ }
+ end
+ m2
+ $ans
+}
+assert_equal %q{ok}, %q{
+ begin
+ raise
+ rescue
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ begin
+ raise
+ rescue
+ :ok
+ ensure
+ :ng
+ end
+}
+assert_equal %q{RuntimeError}, %q{
+ begin
+ raise
+ rescue => e
+ e.class
+ end
+}
+assert_equal %q{ng}, %q{
+ begin
+ raise
+ rescue StandardError
+ :ng
+ rescue Exception
+ :ok
+ end
+}
+assert_equal %q{c}, %q{
+ begin
+ begin
+ raise "a"
+ rescue
+ raise "b"
+ ensure
+ raise "c"
+ end
+ rescue => e
+ e.message
+ end
+}
+assert_equal %q{33}, %q{
+ def m a, b
+ a + b
+ end
+ m(1, begin
+ raise
+ rescue
+ 2
+ end) +
+ m(10, begin
+ raise
+ rescue
+ 20
+ ensure
+ 30
+ end)
+}
+assert_equal %q{3}, %q{
+ def m a, b
+ a + b
+ end
+ m(begin
+ raise
+ rescue
+ 1
+ end,
+ begin
+ raise
+ rescue
+ 2
+ end)
+}
+assert_equal %q{ok3}, %q{
+ class E1 < Exception
+ end
+
+ def m
+ yield
+ end
+
+ begin
+ begin
+ begin
+ m{
+ raise
+ }
+ rescue E1
+ :ok2
+ ensure
+ end
+ rescue
+ :ok3
+ ensure
+ end
+ rescue E1
+ :ok
+ ensure
+ end
+}
+assert_equal %q{7}, %q{
+ $i = 0
+ def m
+ iter{
+ begin
+ $i += 1
+ begin
+ $i += 2
+ break
+ ensure
+
+ end
+ ensure
+ $i += 4
+ end
+ $i = 0
+ }
+ end
+
+ def iter
+ yield
+ end
+ m
+ $i
+}
+assert_equal %q{10}, %q{
+ $i = 0
+ def m
+ begin
+ $i += 1
+ begin
+ $i += 2
+ return
+ ensure
+ $i += 3
+ end
+ ensure
+ $i += 4
+ end
+ p :end
+ end
+ m
+ $i
+}
+assert_equal %q{1}, %q{
+ begin
+ 1
+ rescue
+ 2
+ end
+}
+assert_equal %q{4}, %q{
+ begin
+ 1
+ begin
+ 2
+ rescue
+ 3
+ end
+ 4
+ rescue
+ 5
+ end
+}
+assert_equal %q{3}, %q{
+ begin
+ 1
+ rescue
+ 2
+ else
+ 3
+ end
+}
+assert_equal %q{2}, %q{
+ begin
+ 1+1
+ rescue
+ 2+2
+ ensure
+ 3+3
+ end
+ }
+assert_equal %q{2}, %q{
+ begin
+ 1+1
+ rescue
+ 2+2
+ ensure
+ 3+3
+ end
+ }
+assert_equal %q{6}, %q{
+ begin
+ 1+1
+ rescue
+ 2+2
+ else
+ 3+3
+ ensure
+ 4+4
+ end
+ }
+assert_equal %q{12}, %q{
+ begin
+ 1+1
+ begin
+ 2+2
+ rescue
+ 3+3
+ else
+ 4+4
+ end
+ rescue
+ 5+5
+ else
+ 6+6
+ ensure
+ 7+7
+ end
+ }
+assert_equal %q{ok}, %q{ #
+ proc{
+ begin
+ raise
+ break
+ rescue
+ :ok
+ end
+ }.call
+}
+assert_equal %q{}, %q{
+ proc do
+ begin
+ raise StandardError
+ redo
+ rescue StandardError
+ end
+ end.call
+}
+
+##
+assert_match /undefined method `foo\'/, %q{#`
+ STDERR.reopen(STDOUT)
+ class C
+ def inspect
+ bar {}
+ end
+
+ def bar
+ raise
+ ensure
+ end
+ end
+ C.new.foo
+}, "[ruby-dev:31407]"
+
+assert_equal 'nil', %q{
+ doit = false
+ exc = nil
+ t = Thread.new {
+ begin
+ doit = true
+ sleep 10
+ ensure
+ exc = $!
+ end
+ }
+ Thread.pass until doit
+ t.kill
+ t.join
+ exc.inspect
+}, '[ruby-dev:32608]'
+
+assert_equal 'exception class/object expected', %q{
+ class ZeroDivisionError
+ def self.new(message)
+ 42
+ end
+ end
+ begin
+ 1/0
+ rescue Exception => e
+ e.message
+ end
+}, '[ruby-core:24767]'
+
+assert_equal 'ok', %q{
+ class C
+ def ===(o)
+ true
+ end
+ end
+ begin
+ begin
+ raise
+ rescue C.new
+ end
+ rescue TypeError
+ :ok
+ end
+}
diff --git a/bootstraptest/test_finalizer.rb b/bootstraptest/test_finalizer.rb
new file mode 100644
index 0000000000..22a16b1220
--- /dev/null
+++ b/bootstraptest/test_finalizer.rb
@@ -0,0 +1,8 @@
+assert_normal_exit %q{
+a1,a2,b1,b2=Array.new(4){""}
+ObjectSpace.define_finalizer(b2,proc{})
+ObjectSpace.define_finalizer(b1,proc{b1.inspect})
+
+ObjectSpace.define_finalizer(a2,proc{a1.inspect})
+ObjectSpace.define_finalizer(a1,proc{})
+}, '[ruby-dev:35778]'
diff --git a/bootstraptest/test_flip.rb b/bootstraptest/test_flip.rb
new file mode 100644
index 0000000000..ff194868b2
--- /dev/null
+++ b/bootstraptest/test_flip.rb
@@ -0,0 +1 @@
+assert_equal %q{E}, %q{$_ = "E"; eval("nil if true..~/^E/",nil,"-e"); $_}
diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb
new file mode 100644
index 0000000000..0390062a24
--- /dev/null
+++ b/bootstraptest/test_flow.rb
@@ -0,0 +1,591 @@
+assert_equal %q{[1, 2, 4, 5, 6, 7, 8]}, %q{$a = []; begin; ; $a << 1
+ [1,2].each{; $a << 2
+ break; $a << 3
+ }; $a << 4
+ begin; $a << 5
+ ensure; $a << 6
+ end; $a << 7
+; $a << 8
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 5, 6, 7, 8]}, %q{$a = []; begin; ; $a << 1
+ begin; $a << 2
+ [1,2].each do; $a << 3
+ break; $a << 4
+ end; $a << 5
+ ensure; $a << 6
+ end; $a << 7
+; $a << 8
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{ok}, %q{
+ ["a"].inject("ng"){|x,y|
+ break :ok
+ }
+}
+assert_equal %q{ok}, %q{
+ unless ''.respond_to? :lines
+ class String
+ def lines
+ self
+ end
+ end
+ end
+
+ ('a').lines.map{|e|
+ break :ok
+ }
+}
+assert_equal %q{[1, 2, 4, 5]}, %q{$a = []; begin; ; $a << 1
+ ["a"].inject("ng"){|x,y|; $a << 2
+ break :ok; $a << 3
+ }; $a << 4
+; $a << 5
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 4, 5]}, %q{$a = []; begin; ; $a << 1
+ ('a'..'b').map{|e|; $a << 2
+ break :ok; $a << 3
+ }; $a << 4
+; $a << 5
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 5, 7, 8]}, %q{$a = []; begin; ; $a << 1
+ [1,2].each do; $a << 2
+ begin; $a << 3
+ break; $a << 4
+ ensure; $a << 5
+ end; $a << 6
+ end; $a << 7
+; $a << 8
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 6, 9, 10]}, %q{$a = []; begin; ; $a << 1
+ i=0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ begin; $a << 5
+ ensure; $a << 6
+ break; $a << 7
+ end; $a << 8
+ end; $a << 9
+; $a << 10
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 7, 10, 11]}, %q{$a = []; begin; ; $a << 1
+ i=0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ begin; $a << 5
+ raise; $a << 6
+ ensure; $a << 7
+ break; $a << 8
+ end; $a << 9
+ end; $a << 10
+; $a << 11
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 7, 10, 11]}, %q{$a = []; begin; ; $a << 1
+ i=0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ begin; $a << 5
+ raise; $a << 6
+ rescue; $a << 7
+ break; $a << 8
+ end; $a << 9
+ end; $a << 10
+; $a << 11
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ [1,2].each do; $a << 2
+ begin; $a << 3
+ raise StandardError; $a << 4
+ ensure; $a << 5
+ break; $a << 6
+ end; $a << 7
+ end; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ [1,2].each do; $a << 2
+ begin; $a << 3
+ raise StandardError; $a << 4
+ rescue; $a << 5
+ break; $a << 6
+ end; $a << 7
+ end; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 6, 8, 10, 11]}, %q{$a = []; begin; ; $a << 1
+ [1,2].each do; $a << 2
+ begin; $a << 3
+ begin; $a << 4
+ break; $a << 5
+ ensure; $a << 6
+ end; $a << 7
+ ensure; $a << 8
+ end; $a << 9
+ end; $a << 10
+; $a << 11
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 6, 7, 8, 10, 13, 3, 4, 5, 6, 7, 8, 10, 13, 3, 4, 5, 6, 7, 8, 10, 13, 14, 15]}, %q{$a = []; begin; ; $a << 1
+ i = 0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ j = 0; $a << 5
+ while j<3; $a << 6
+ j+=1; $a << 7
+ begin; $a << 8
+ raise; $a << 9
+ rescue; $a << 10
+ break; $a << 11
+ end; $a << 12
+ end; $a << 13
+ end; $a << 14
+; $a << 15
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 16, 17]}, %q{$a = []; begin; ; $a << 1
+ i = 0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ j = 0; $a << 5
+ while j<3; $a << 6
+ j+=1; $a << 7
+ 1.times{; $a << 8
+ begin; $a << 9
+ raise; $a << 10
+ rescue; $a << 11
+ break; $a << 12
+ end; $a << 13
+ }; $a << 14
+ end; $a << 15
+ end; $a << 16
+; $a << 17
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 6, 7, 8, 10, 13, 3, 4, 5, 6, 7, 8, 10, 13, 3, 4, 5, 6, 7, 8, 10, 13, 14, 15]}, %q{$a = []; begin; ; $a << 1
+ i = 0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ j = 0; $a << 5
+ while j<3; $a << 6
+ j+=1; $a << 7
+ begin; $a << 8
+ raise; $a << 9
+ ensure; $a << 10
+ break; $a << 11
+ end; $a << 12
+ end; $a << 13
+ end; $a << 14
+; $a << 15
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 16, 17]}, %q{$a = []; begin; ; $a << 1
+ i = 0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ j = 0; $a << 5
+ while j<3; $a << 6
+ j+=1; $a << 7
+ 1.times{; $a << 8
+ begin; $a << 9
+ raise; $a << 10
+ ensure; $a << 11
+ break; $a << 12
+ end; $a << 13
+ }; $a << 14
+ end; $a << 15
+ end; $a << 16
+; $a << 17
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ while true; $a << 2
+ begin; $a << 3
+ break; $a << 4
+ ensure; $a << 5
+ break; $a << 6
+ end; $a << 7
+ end; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 5, 99]}, %q{
+$a = [];
+begin; ; $a << 1
+ while true; $a << 2
+ begin; $a << 3
+ break; $a << 4
+ ensure; $a << 5
+ raise; $a << 6
+ end; $a << 7
+ end; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 6, 8, 9, 10, 11]}, %q{$a = []; begin; ; $a << 1
+ begin; $a << 2
+ [1,2].each do; $a << 3
+ begin; $a << 4
+ break; $a << 5
+ ensure; $a << 6
+ end; $a << 7
+ end; $a << 8
+ ensure; $a << 9
+ end; $a << 10
+; $a << 11
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 4, 99]}, %q{$a = []; begin; ; $a << 1
+ begin; $a << 2
+ raise StandardError; $a << 3
+ ensure; $a << 4
+ end; $a << 5
+; $a << 6
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4]}, %q{$a = []; begin; ; $a << 1
+ begin; $a << 2
+ ensure; $a << 3
+ end ; $a << 4
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 5, 99]}, %q{$a = []; begin; ; $a << 1
+ [1,2].each do; $a << 2
+ begin; $a << 3
+ break; $a << 4
+ ensure; $a << 5
+ raise StandardError; $a << 6
+ end; $a << 7
+ end; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{3}, %q{
+ def m a, b
+ a + b
+ end
+ m(1,
+ while true
+ break 2
+ end
+ )
+}
+assert_equal %q{4}, %q{
+ def m a, b
+ a + b
+ end
+ m(1,
+ (i=0; while i<2
+ i+=1
+ class C
+ next 2
+ end
+ end; 3)
+ )
+}
+assert_equal %q{34}, %q{
+ def m a, b
+ a+b
+ end
+ m(1, 1.times{break 3}) +
+ m(10, (1.times{next 3}; 20))
+}
+assert_equal %q{[1, 2, 3, 6, 7]}, %q{$a = []; begin; ; $a << 1
+ 3.times{; $a << 2
+ class C; $a << 3
+ break; $a << 4
+ end; $a << 5
+ }; $a << 6
+; $a << 7
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ 3.times{; $a << 2
+ class A; $a << 3
+ class B; $a << 4
+ break; $a << 5
+ end; $a << 6
+ end; $a << 7
+ }; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 2, 3, 2, 3, 6, 7]}, %q{$a = []; begin; ; $a << 1
+ 3.times{; $a << 2
+ class C; $a << 3
+ next; $a << 4
+ end; $a << 5
+ }; $a << 6
+; $a << 7
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ 3.times{; $a << 2
+ class C; $a << 3
+ class D; $a << 4
+ next; $a << 5
+ end; $a << 6
+ end; $a << 7
+ }; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 6, 7]}, %q{$a = []; begin; ; $a << 1
+ while true; $a << 2
+ class C; $a << 3
+ break; $a << 4
+ end; $a << 5
+ end; $a << 6
+; $a << 7
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ while true; $a << 2
+ class C; $a << 3
+ class D; $a << 4
+ break; $a << 5
+ end; $a << 6
+ end; $a << 7
+ end; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 3, 4, 5, 3, 4, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ i=0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ class C; $a << 5
+ next 10; $a << 6
+ end; $a << 7
+ end; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{1}, %q{
+ 1.times{
+ while true
+ class C
+ begin
+ break
+ ensure
+ break
+ end
+ end
+ end
+ }
+}
+assert_equal %q{[1, 2, 3, 5, 2, 3, 5, 7, 8]}, %q{$a = []; begin; ; $a << 1
+ [1,2].each do; $a << 2
+ begin; $a << 3
+ next; $a << 4
+ ensure; $a << 5
+ end; $a << 6
+ end; $a << 7
+; $a << 8
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 6, 3, 5, 7, 8]}, %q{$a = []; begin; ; $a << 1
+ o = "test"; $a << 2
+ def o.test(a); $a << 3
+ return a; $a << 4
+ ensure; $a << 5
+ end; $a << 6
+ o.test(123); $a << 7
+; $a << 8
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 4, 7, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ def m1 *args; $a << 2
+ ; $a << 3
+ end; $a << 4
+ def m2; $a << 5
+ m1(:a, :b, (return 1; :c)); $a << 6
+ end; $a << 7
+ m2; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 8, 2, 3, 4, 5, 9, 10]}, %q{$a = []; begin; ; $a << 1
+ def m(); $a << 2
+ begin; $a << 3
+ 2; $a << 4
+ ensure; $a << 5
+ return 3; $a << 6
+ end; $a << 7
+ end; $a << 8
+ m; $a << 9
+; $a << 10
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 3, 11, 4, 5, 6, 7, 12, 13]}, %q{$a = []; begin; ; $a << 1
+ def m2; $a << 2
+ end; $a << 3
+ def m(); $a << 4
+ m2(begin; $a << 5
+ 2; $a << 6
+ ensure; $a << 7
+ return 3; $a << 8
+ end); $a << 9
+ 4; $a << 10
+ end; $a << 11
+ m(); $a << 12
+; $a << 13
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 16, 2, 3, 4, 5, 6, 7, 10, 11, 17, 18]}, %q{$a = []; begin; ; $a << 1
+ def m; $a << 2
+ 1; $a << 3
+ 1.times{; $a << 4
+ 2; $a << 5
+ begin; $a << 6
+ 3; $a << 7
+ return; $a << 8
+ 4; $a << 9
+ ensure; $a << 10
+ 5; $a << 11
+ end; $a << 12
+ 6; $a << 13
+ }; $a << 14
+ 7; $a << 15
+ end; $a << 16
+ m(); $a << 17
+; $a << 18
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[:ok, :ok2, :last]}, %q{
+ a = []
+ i = 0
+ begin
+ while i < 1
+ i+=1
+ begin
+ begin
+ next
+ ensure
+ a << :ok
+ end
+ ensure
+ a << :ok2
+ end
+ end
+ ensure
+ a << :last
+ end
+ a
+}
+assert_equal %q{[:ok, :ok2, :last]}, %q{
+ a = []
+ i = 0
+ begin
+ while i < 1
+ i+=1
+ begin
+ begin
+ break
+ ensure
+ a << :ok
+ end
+ ensure
+ a << :ok2
+ end
+ end
+ ensure
+ a << :last
+ end
+ a
+}
+assert_equal %q{[:ok, :ok2, :last]}, %q{
+ a = []
+ i = 0
+ begin
+ while i < 1
+ if i>0
+ break
+ end
+ i+=1
+ begin
+ begin
+ redo
+ ensure
+ a << :ok
+ end
+ ensure
+ a << :ok2
+ end
+ end
+ ensure
+ a << :last
+ end
+ a
+}
+assert_equal %Q{ENSURE\n}, %q{
+ def test
+ while true
+ return
+ end
+ ensure
+ puts("ENSURE")
+ end
+ test
+}, '[ruby-dev:37967]'
+
+[['[ruby-core:28129]', %q{
+ class Bug2728
+ include Enumerable
+ define_method(:dynamic_method) do
+ "dynamically defined method"
+ end
+ def each
+ begin
+ yield :foo
+ ensure
+ dynamic_method
+ end
+ end
+ end
+ e = Bug2728.new
+}],
+ ['[ruby-core:28132]', %q{
+ class Bug2729
+ include Enumerable
+ def each
+ begin
+ yield :foo
+ ensure
+ proc {}.call
+ end
+ end
+ end
+ e = Bug2729.new
+}],
+ ['[ruby-core:39125]', %q{
+ class Bug5234
+ include Enumerable
+ def each
+ begin
+ yield :foo
+ ensure
+ proc
+ end
+ end
+ end
+ e = Bug5234.new
+}],
+ ['[ruby-dev:45656]', %q{
+ class Bug6460
+ include Enumerable
+ def each
+ begin
+ yield :foo
+ ensure
+ 1.times { Proc.new }
+ end
+ end
+ end
+ e = Bug6460.new
+}]].each do |bug, src|
+ assert_equal "foo", src + %q{e.detect {true}}, bug
+ assert_equal "true", src + %q{e.any? {true}}, bug
+ assert_equal "false", src + %q{e.all? {false}}, bug
+ assert_equal "true", src + %q{e.include?(:foo)}, bug
+end
+
+assert_equal "foo", %q{
+ class Bug6460
+ def m1
+ m2 {|e|
+ return e
+ }
+ end
+
+ def m2
+ begin
+ yield :foo
+ ensure
+ begin
+ begin
+ yield :foo
+ ensure
+ Proc.new
+ raise ''
+ end
+ rescue
+ end
+ end
+ end
+ end
+ Bug6460.new.m1
+}, '[ruby-dev:46372]'
diff --git a/bootstraptest/test_fork.rb b/bootstraptest/test_fork.rb
new file mode 100644
index 0000000000..384294727f
--- /dev/null
+++ b/bootstraptest/test_fork.rb
@@ -0,0 +1,69 @@
+assert_equal '0', %q{
+ begin
+ GC.stress = true
+ pid = fork {}
+ Process.wait pid
+ $?.to_i
+ rescue NotImplementedError
+ 0
+ end
+}, '[ruby-dev:32404]'
+
+assert_finish 10, %q{
+ begin
+ children = (1..10).map{
+ Thread.start{fork{}}.value
+ }
+ while !children.empty? and pid = Process.wait
+ children.delete(pid)
+ end
+ rescue NotImplementedError
+ end
+}, '[ruby-core:22158]'
+
+assert_normal_exit(<<'End', '[ruby-dev:37934]')
+ Thread.new { sleep 1; Thread.kill Thread.main }
+ Process.setrlimit(:NPROC, 1)
+ fork {}
+End
+
+assert_equal 'ok', %q{
+ begin
+ if pid1 = fork
+ sleep 1
+ Process.kill("USR1", pid1)
+ _, s = Process.wait2(pid1)
+ s.success? ? :ok : :ng
+ else
+ if pid2 = fork
+ trap("USR1") { Time.now.to_s }
+ Process.wait2(pid2)
+ else
+ sleep 2
+ end
+ exit 0
+ end
+ rescue NotImplementedError
+ :ok
+ end
+}, '[ruby-core:28924]'
+
+assert_equal '[1, 2]', %q{
+ a = []
+ trap(:INT) { a.push(1) }
+ trap(:TERM) { a.push(2) }
+ pid = $$
+ begin
+ fork do
+ sleep 0.5
+ Process.kill(:INT, pid)
+ Process.kill(:TERM, pid)
+ end
+
+ sleep 1
+ a.sort
+ rescue NotImplementedError
+ [1, 2]
+ end
+}, '[ruby-dev:44005] [Ruby 1.9 - Bug #4950]'
+
diff --git a/bootstraptest/test_gc.rb b/bootstraptest/test_gc.rb
new file mode 100644
index 0000000000..eb68c9845e
--- /dev/null
+++ b/bootstraptest/test_gc.rb
@@ -0,0 +1,34 @@
+assert_normal_exit %q{
+a = []
+ms = "a".."k"
+("A".."Z").each do |mod|
+ mod = eval("module #{mod}; self; end")
+ ms.each do |meth|
+ iseq = RubyVM::InstructionSequence.compile("module #{mod}; def #{meth}; end; end")
+ GC.stress = true
+ iseq.eval
+ GC.stress = false
+ end
+ o = Object.new.extend(mod)
+ ms.each do |meth|
+ o.send(meth)
+ end
+end
+}, '[ruby-dev:39453]'
+
+assert_normal_exit %q{
+a = []
+ms = "a".."k"
+("A".."Z").each do |mod|
+ mod = eval("module #{mod}; self; end")
+ ms.each do |meth|
+ GC.stress = true
+ mod.module_eval {define_method(meth) {}}
+ GC.stress = false
+ end
+ o = Object.new.extend(mod)
+ ms.each do |meth|
+ o.send(meth)
+ end
+end
+}, '[ruby-dev:39453]'
diff --git a/bootstraptest/test_io.rb b/bootstraptest/test_io.rb
new file mode 100644
index 0000000000..f7360f34b3
--- /dev/null
+++ b/bootstraptest/test_io.rb
@@ -0,0 +1,112 @@
+assert_finish 5, %q{
+ r, w = IO.pipe
+ t1 = Thread.new { r.sysread(1) }
+ t2 = Thread.new { r.sysread(1) }
+ sleep 0.1
+ w.write "a"
+ sleep 0.1
+ w.write "a"
+}, '[ruby-dev:31866]'
+
+assert_finish 10, %q{
+ begin
+ require "io/nonblock"
+ require "timeout"
+ timeout(3) do
+ r, w = IO.pipe
+ w.nonblock?
+ w.nonblock = true
+ w.write_nonblock("a" * 100000)
+ w.nonblock = false
+ t1 = Thread.new { w.write("b" * 4096) }
+ t2 = Thread.new { w.write("c" * 4096) }
+ sleep 0.5
+ r.sysread(4096).length
+ sleep 0.5
+ r.sysread(4096).length
+ t1.join
+ t2.join
+ end
+ rescue LoadError, TimeoutError, NotImplementedError
+ end
+}, '[ruby-dev:32566]'
+
+assert_finish 1, %q{
+ r, w = IO.pipe
+ Thread.new {
+ w << "ab"
+ sleep 0.1
+ w << "ab"
+ }
+ r.gets("abab")
+}
+
+assert_equal 'ok', %q{
+ require 'tmpdir'
+ begin
+ tmpname = "#{Dir.tmpdir}/ruby-btest-#{$$}-#{rand(0x100000000).to_s(36)}"
+ rw = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL)
+ rescue Errno::EEXIST
+ retry
+ end
+ save = STDIN.dup
+ STDIN.reopen(rw)
+ STDIN.reopen(save)
+ rw.close
+ File.unlink(tmpname) unless RUBY_PLATFORM['nacl']
+ :ok
+}
+
+assert_equal 'ok', %q{
+ require 'tmpdir'
+ begin
+ tmpname = "#{Dir.tmpdir}/ruby-btest-#{$$}-#{rand(0x100000000).to_s(36)}"
+ rw = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL)
+ rescue Errno::EEXIST
+ retry
+ end
+ save = STDIN.dup
+ STDIN.reopen(rw)
+ STDIN.print "a"
+ STDIN.reopen(save)
+ rw.close
+ File.unlink(tmpname) unless RUBY_PLATFORM['nacl']
+ :ok
+}
+
+assert_equal 'ok', %q{
+ dup = STDIN.dup
+ dupfd = dup.fileno
+ dupfd == STDIN.dup.fileno ? :ng : :ok
+}, '[ruby-dev:46834]'
+
+assert_normal_exit %q{
+ ARGF.set_encoding "foo"
+}
+
+10.times do
+ assert_normal_exit %q{
+ at_exit { p :foo }
+
+ megacontent = "abc" * 12345678
+ #File.open("megasrc", "w") {|f| f << megacontent }
+
+ Thread.new { sleep rand*0.2; Process.kill(:INT, $$) }
+
+ r1, w1 = IO.pipe
+ r2, w2 = IO.pipe
+ t1 = Thread.new { w1 << megacontent; w1.close }
+ t2 = Thread.new { r2.read; r2.close }
+ IO.copy_stream(r1, w2) rescue nil
+ w2.close
+ r1.close
+ t1.join
+ t2.join
+ }, 'megacontent-copy_stream', ["INT"], :timeout => 10 or break
+end
+
+assert_normal_exit %q{
+ r, w = IO.pipe
+ STDOUT.reopen(w)
+ STDOUT.reopen(__FILE__, "r")
+}, '[ruby-dev:38131]'
diff --git a/bootstraptest/test_jump.rb b/bootstraptest/test_jump.rb
new file mode 100644
index 0000000000..595aaa7c4b
--- /dev/null
+++ b/bootstraptest/test_jump.rb
@@ -0,0 +1,308 @@
+assert_equal %q{ok}, %q{
+ def m
+ :ng1
+ mm{
+ yield
+ }
+ :ng2
+ end
+
+ def mm
+ :ng3
+ yield
+ :ng4
+ end
+
+ m{
+ break :ok
+ }
+}
+assert_equal %q{ok}, %q{
+ 3.times{
+ break :ok
+ }
+}
+assert_equal %q{}, %q{
+ catch(:foo){
+ throw :foo
+ }
+}
+assert_equal %q{false}, %q{
+ catch(:foo){
+ throw :foo, false
+ }
+}
+assert_equal %q{}, %q{
+ catch(:foo){
+ throw :foo, nil
+ }
+}
+assert_equal %q{ok}, %q{
+ catch(:foo){
+ throw :foo, :ok
+ }
+}
+assert_equal %q{}, %q{
+ catch(:foo){
+ 1.times{
+ throw :foo
+ }
+ }
+}
+assert_equal %q{ok}, %q{
+ catch(:foo){
+ 1.times{
+ throw :foo, :ok
+ }
+ }
+}
+assert_equal %q{ok}, %q{
+ catch(:foo){
+ catch(:bar){
+ throw :foo, :ok
+ }
+ :ng
+ }
+}
+assert_equal %q{ok}, %q{
+ catch(:foo){
+ catch(:bar){
+ 1.times{
+ throw :foo, :ok
+ }
+ }
+ :ng
+ }
+}
+assert_equal %q{2}, %q{
+ module Enumerable
+ def all_?
+ self.each{|e|
+ unless yield(e)
+ return false
+ end
+ }
+ true
+ end
+ end
+
+ xxx = 0
+ [1,2].each{|bi|
+ [3,4].each{|bj|
+ [true, nil, true].all_?{|be| be}
+ break
+ }
+ xxx += 1
+ }
+ xxx
+}
+assert_equal %q{ok}, %q{
+ def m
+ yield
+ end
+
+ m{
+ begin
+ ensure
+ break :ok
+ end
+ }
+}
+assert_equal %q{ok}, %q{
+ def m
+ yield
+ :ok
+ end
+ i=0
+ m{
+ if i>10
+ i*i
+ else
+ i+=1
+ next
+ end
+ }
+}
+assert_equal %q{ok}, %q{
+ def m
+ yield
+ end
+
+ m{
+ next :ok
+ }
+}
+assert_equal %q{131}, %q{
+ def m
+ yield + 10
+ end
+ i=0
+ m{
+ if i>10
+ i*i
+ else
+ i+=1
+ redo
+ end
+ }
+}
+assert_equal %q{ok}, %q{
+begin
+ eval %q{
+ 1.times{
+ retry
+ }
+ }
+rescue SyntaxError
+ :ok
+end
+}
+assert_equal %q{3}, %q{
+ def m
+ return 3
+ end
+ m
+}
+assert_equal %q{ok}, %q{
+ def m
+ :ng1
+ mm{
+ return :ok
+ }
+ :ng2
+ end
+
+ def mm
+ :ng3
+ yield
+ :ng4
+ end
+ m
+}
+assert_equal %q{100}, %q{
+ $i = 0
+ def m
+ begin
+ iter{
+ return
+ }
+ ensure
+ $i = 100
+ end
+ end
+
+ def iter
+ yield
+ end
+ m
+ $i
+}
+assert_equal %q{ok}, %q{
+ def m
+ begin
+ raise
+ rescue
+ return :ok
+ end
+ :ng
+ end
+ m
+}
+assert_equal %q{1}, %q{
+ def m
+ begin
+ raise
+ rescue
+ return 1
+ end
+ end
+
+ m
+}
+assert_equal %q{1}, %q{
+ def m
+ begin
+ #
+ ensure
+ return 1
+ end
+ end
+
+ m
+}
+assert_equal 'ok', %q{
+ begin
+ catch {|t| throw t, :ok }
+ rescue ArgumentError
+ :ng
+ end
+}, '[ruby-dev:31609]'
+
+assert_equal "1", %q{
+ catch do |t|
+ begin
+ throw t, 1
+ 2
+ ensure
+ 3
+ end
+ end
+}, "[ruby-dev:31698]"
+
+assert_normal_exit %q{
+ f = 0
+ 1.times do
+ begin
+ f += 1
+ ensure
+ redo unless f > 2
+ end
+ end
+}
+
+assert_normal_exit %q{
+ -> do
+ 1.times do
+ begin
+ raise
+ rescue
+ return
+ end
+ end
+ end.call
+}
+
+assert_normal_exit %q{
+ while true
+ begin
+ raise
+ next
+ rescue
+ end
+ break
+ end
+}, '[ruby-core:28172]'
+
+assert_equal "true", %q{
+ class Object
+ def return_eigenclass
+ class << self
+ return self
+ end
+ end
+ end
+ s = "foo"
+ s.return_eigenclass == class << s; self; end
+}, '[ruby-core:21379]'
+
+assert_equal "true", %q{
+ class Object
+ def yield_eigenclass
+ class << self
+ yield self
+ end
+ end
+ end
+ s = "foo"
+ s.yield_eigenclass {|c| c == class << s; self; end }
+}, '[ruby-dev:40975]'
diff --git a/bootstraptest/test_literal.rb b/bootstraptest/test_literal.rb
new file mode 100644
index 0000000000..5a9497c642
--- /dev/null
+++ b/bootstraptest/test_literal.rb
@@ -0,0 +1,226 @@
+# empty program
+assert_equal '', ''
+assert_equal '', ' '
+assert_equal '', "\n"
+
+# special const
+assert_equal 'true', 'true'
+assert_equal 'TrueClass', 'true.class'
+assert_equal 'false', 'false'
+assert_equal 'FalseClass', 'false.class'
+assert_equal '', 'nil'
+assert_equal 'nil', 'nil.inspect'
+assert_equal 'NilClass', 'nil.class'
+assert_equal 'sym', ':sym'
+assert_equal ':sym', ':sym.inspect'
+assert_equal 'Symbol', ':sym.class'
+assert_equal '1234', '1234'
+assert_equal 'Fixnum', '1234.class'
+assert_equal '1234', '1_2_3_4'
+assert_equal 'Fixnum', '1_2_3_4.class'
+assert_equal '18', '0x12'
+assert_equal 'Fixnum', '0x12.class'
+assert_equal '15', '0o17'
+assert_equal 'Fixnum', '0o17.class'
+assert_equal '5', '0b101'
+assert_equal 'Fixnum', '0b101.class'
+assert_equal '123456789012345678901234567890', '123456789012345678901234567890'
+assert_equal 'Bignum', '123456789012345678901234567890.class'
+assert_equal '2.0', '2.0'
+assert_equal 'Float', '1.3.class'
+
+# self
+assert_equal 'main', 'self'
+assert_equal 'Object', 'self.class'
+
+# string literal
+assert_equal 'a', '?a'
+assert_equal 'String', '?a.class'
+assert_equal 'A', '?A'
+assert_equal 'String', '?A.class'
+assert_equal "\n", '?\n'
+assert_equal 'String', '?\n.class'
+assert_equal ' ', '?\ '
+assert_equal 'String', '?\ .class'
+assert_equal 'string', "'string'"
+assert_equal 'string', '"string"'
+assert_equal 'string', '%(string)'
+assert_equal 'string', '%q(string)'
+assert_equal 'string', '%Q(string)'
+assert_equal 'string string', '"string string"'
+assert_equal ' ', '" "'
+assert_equal "\0", '"\0"'
+assert_equal "\1", '"\1"'
+assert_equal "3", '"\x33"'
+assert_equal "\n", '"\n"'
+
+# dynamic string literal
+assert_equal '2', '"#{1 + 1}"'
+assert_equal '16', '"#{2 ** 4}"'
+assert_equal 'string', 's = "string"; "#{s}"'
+
+# dynamic symbol literal
+assert_equal 'a3c', ':"a#{1+2}c"'
+assert_equal ':a3c', ':"a#{1+2}c".inspect'
+assert_equal 'Symbol', ':"a#{1+2}c".class'
+
+# xstring
+unless nacl?
+ assert_equal "foo\n", %q(`echo foo`)
+ assert_equal "foo\n", %q(s = "foo"; `echo #{s}`)
+end
+
+# regexp
+assert_equal '', '//.source'
+assert_equal 'Regexp', '//.class'
+assert_equal '0', '// =~ "a"'
+assert_equal '0', '// =~ ""'
+assert_equal 'a', '/a/.source'
+assert_equal 'Regexp', '/a/.class'
+assert_equal '0', '/a/ =~ "a"'
+assert_equal '0', '/test/ =~ "test"'
+assert_equal '', '/test/ =~ "tes"'
+assert_equal '0', 're = /test/; re =~ "test"'
+assert_equal '0', 'str = "test"; /test/ =~ str'
+assert_equal '0', 're = /test/; str = "test"; re =~ str'
+
+# dynacmi regexp
+assert_equal 'regexp', %q(/re#{'ge'}xp/.source)
+assert_equal 'Regexp', %q(/re#{'ge'}xp/.class)
+
+# array
+assert_equal 'Array', '[].class'
+assert_equal '0', '[].size'
+assert_equal '0', '[].length'
+assert_equal '[]', '[].inspect'
+assert_equal 'Array', '[0].class'
+assert_equal '1', '[3].size'
+assert_equal '[3]', '[3].inspect'
+assert_equal '3', 'a = [3]; a[0]'
+assert_equal 'Array', '[1,2].class'
+assert_equal '2', '[1,2].size'
+assert_equal '[1, 2]', '[1,2].inspect'
+assert_equal 'Array', '[1,2,3,4,5].class'
+assert_equal '5', '[1,2,3,4,5].size'
+assert_equal '[1, 2, 3, 4, 5]', '[1,2,3,4,5].inspect'
+assert_equal '1', 'a = [1,2]; a[0]'
+assert_equal '2', 'a = [1,2]; a[1]'
+assert_equal 'Array', 'a = [1 + 2, 3 + 4, 5 + 6]; a.class'
+assert_equal '[3, 7, 11]', 'a = [1 + 2, 3 + 4, 5 + 6]; a.inspect'
+assert_equal '7', 'a = [1 + 2, 3 + 4, 5 + 6]; a[1]'
+assert_equal '1', '([0][0] += 1)'
+assert_equal '1', '([2][0] -= 1)'
+assert_equal 'Array', 'a = [obj = Object.new]; a.class'
+assert_equal '1', 'a = [obj = Object.new]; a.size'
+assert_equal 'true', 'a = [obj = Object.new]; a[0] == obj'
+assert_equal '5', 'a = [1,2,3]; a[1] = 5; a[1]'
+assert_equal 'bar', '[*:foo];:bar'
+assert_equal '[1, 2]', 'def nil.to_a; [2]; end; [1, *nil]'
+assert_equal '[1, 2]', 'def nil.to_a; [1, 2]; end; [*nil]'
+assert_equal '[0, 1, {2=>3}]', '[0, *[1], 2=>3]', "[ruby-dev:31592]"
+
+
+# hash
+assert_equal 'Hash', '{}.class'
+assert_equal '{}', '{}.inspect'
+assert_equal 'Hash', '{1=>2}.class'
+assert_equal '{1=>2}', '{1=>2}.inspect'
+assert_equal '2', 'h = {1 => 2}; h[1]'
+assert_equal '0', 'h = {1 => 2}; h.delete(1); h.size'
+assert_equal '', 'h = {1 => 2}; h.delete(1); h[1]'
+assert_equal '2', 'h = {"string" => "literal", "goto" => "hell"}; h.size'
+assert_equal 'literal', 'h = {"string"=>"literal", "goto"=>"hell"}; h["string"]'
+assert_equal 'hell', 'h = {"string"=>"literal", "goto"=>"hell"}; h["goto"]'
+
+# range
+assert_equal 'Range', '(1..2).class'
+assert_equal '1..2', '(1..2).inspect'
+assert_equal '1', '(1..2).begin'
+assert_equal '2', '(1..2).end'
+assert_equal 'false', '(1..2).exclude_end?'
+assert_equal 'Range', 'r = 1..2; r.class'
+assert_equal '1..2', 'r = 1..2; r.inspect'
+assert_equal '1', 'r = 1..2; r.begin'
+assert_equal '2', 'r = 1..2; r.end'
+assert_equal 'false', 'r = 1..2; r.exclude_end?'
+assert_equal 'Range', '(1...3).class'
+assert_equal '1...3', '(1...3).inspect'
+assert_equal '1', '(1...3).begin'
+assert_equal '3', '(1...3).end'
+assert_equal 'true', '(1...3).exclude_end?'
+assert_equal 'Range', 'r = (1...3); r.class'
+assert_equal '1...3', 'r = (1...3); r.inspect'
+assert_equal '1', 'r = (1...3); r.begin'
+assert_equal '3', 'r = (1...3); r.end'
+assert_equal 'true', 'r = (1...3); r.exclude_end?'
+assert_equal 'Range', 'r = (1+2 .. 3+4); r.class'
+assert_equal '3..7', 'r = (1+2 .. 3+4); r.inspect'
+assert_equal '3', 'r = (1+2 .. 3+4); r.begin'
+assert_equal '7', 'r = (1+2 .. 3+4); r.end'
+assert_equal 'false', 'r = (1+2 .. 3+4); r.exclude_end?'
+assert_equal 'Range', 'r = (1+2 ... 3+4); r.class'
+assert_equal '3...7', 'r = (1+2 ... 3+4); r.inspect'
+assert_equal '3', 'r = (1+2 ... 3+4); r.begin'
+assert_equal '7', 'r = (1+2 ... 3+4); r.end'
+assert_equal 'true', 'r = (1+2 ... 3+4); r.exclude_end?'
+assert_equal 'Range', 'r = ("a".."c"); r.class'
+assert_equal '"a".."c"', 'r = ("a".."c"); r.inspect'
+assert_equal 'a', 'r = ("a".."c"); r.begin'
+assert_equal 'c', 'r = ("a".."c"); r.end'
+
+assert_equal 'String', '__FILE__.class'
+assert_equal 'Fixnum', '__LINE__.class'
+
+###
+
+assert_equal 'ok', %q{
+ # this cause "called on terminated object".
+ ObjectSpace.each_object(Module) {|m| m.name.inspect }
+ :ok
+}
+
+assert_normal_exit %q{
+ begin
+ r = 0**-1
+ r + r
+ rescue
+ end
+}, '[ruby-dev:34524]'
+
+assert_normal_exit %q{
+ begin
+ r = Marshal.load("\x04\bU:\rRational[\ai\x06i\x05")
+ r + r
+ rescue
+ end
+}, '[ruby-dev:34536]'
+
+assert_equal 'ok', %q{
+ "#{}""#{}ok"
+}, '[ruby-dev:38968]'
+
+assert_equal 'ok', %q{
+ "#{}o""#{}k""#{}"
+}, '[ruby-core:25284]'
+
+assert_equal 'ok', %q{ # long array literal
+ x = nil
+ eval "a = [#{(1..10_000).map{'x'}.join(", ")}]"
+ :ok
+}
+
+assert_equal 'ok', %q{ # long array literal (optimized)
+ eval "a = [#{(1..10_000).to_a.join(", ")}]"
+ :ok
+}
+
+assert_equal 'ok', %q{ # long hash literal
+ x = nil
+ eval "a = {#{(1..10_000).map{|n| "#{n} => x"}.join(', ')}}"
+ :ok
+}
+
+assert_equal 'ok', %q{ # long hash literal (optimized)
+ eval "a = {#{(1..10_000).map{|n| "#{n} => #{n}"}.join(', ')}}"
+ :ok
+}
diff --git a/bootstraptest/test_load.rb b/bootstraptest/test_load.rb
new file mode 100644
index 0000000000..e63c93a8f4
--- /dev/null
+++ b/bootstraptest/test_load.rb
@@ -0,0 +1,27 @@
+assert_equal 'ok', %q{
+ open("require-lock-test.rb", "w") {|f|
+ f.puts "sleep 0.1"
+ f.puts "module M"
+ f.puts "end"
+ }
+ $:.unshift Dir.pwd
+ vs = (1..2).map {|i|
+ Thread.start {
+ require "require-lock-test"
+ M
+ }
+ }.map {|t| t.value }
+ vs[0] == M && vs[1] == M ? :ok : :ng
+}, '[ruby-dev:32048]'
+
+assert_equal 'ok', %q{
+ %w[a a/foo b].each {|d| Dir.mkdir(d)}
+ open("b/foo", "w") {|f| f.puts "$ok = :ok"}
+ $:.replace(%w[a b])
+ begin
+ load "foo"
+ $ok
+ rescue => e
+ e.message
+ end
+}, '[ruby-dev:38097]'
diff --git a/bootstraptest/test_marshal.rb b/bootstraptest/test_marshal.rb
new file mode 100644
index 0000000000..7e34176169
--- /dev/null
+++ b/bootstraptest/test_marshal.rb
@@ -0,0 +1,5 @@
+
+assert_normal_exit %q{
+ Marshal.load(Marshal.dump({"k"=>"v"}), lambda {|v| v})
+}
+
diff --git a/bootstraptest/test_massign.rb b/bootstraptest/test_massign.rb
new file mode 100644
index 0000000000..0f63dd424a
--- /dev/null
+++ b/bootstraptest/test_massign.rb
@@ -0,0 +1,183 @@
+assert_equal '[[1], 2, 3]', '*v1, (a, b) = [1,[2, 3]]; [v1, a, b]'
+assert_equal '[[1], 2, 3]', '*v1,(*), (a, b) = [1,:x,[2, 3]]; [v1, a, b]'
+
+assert_equal '[]', '*a = *nil; a'
+assert_equal '[nil]', '*a = nil; a'
+assert_equal '2', 'a, a = 1, 2; a', "[ruby-dev:31522]"
+assert_equal '[1, 2]', 'a, b = 1, 2'
+assert_equal '[1, 2]', %q{
+ ans = []
+ trace_var(:$a){|v| ans << v}
+ trace_var(:$b){|v| ans << v}
+ $a, $b = 1, 2
+ ans
+}
+
+assert_equal 'ok', %q{
+ r = :ok
+ :ng.tap {|(r)|}
+ r
+}, '[ruby-dev:31507]'
+
+=begin
+# generated by this script:
+
+3.times{|i|
+ 8.times{|e|
+ ary = (0...e).to_a
+ a,b,c,d,e,f = nil
+ vals = %w(a b c d e f)
+ vals[i] = '*' + vals[i]
+ program = "#{vals.join(", ")} = *ary"
+ eval(program)
+ ans = [a,b,c,d,e,f]
+ puts %Q{
+ assert_equal "#{ans.inspect}", %q{
+ ary = #{ary.inspect}
+ #{program}; [a, b, c, d, e, f]
+ }}
+ }
+}
+=end
+
+ assert_equal "[[], nil, nil, nil, nil, nil]", %q{
+ ary = []
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[[], 0, nil, nil, nil, nil]", %q{
+ ary = [0]
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[[], 0, 1, nil, nil, nil]", %q{
+ ary = [0, 1]
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[[], 0, 1, 2, nil, nil]", %q{
+ ary = [0, 1, 2]
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[[], 0, 1, 2, 3, nil]", %q{
+ ary = [0, 1, 2, 3]
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[[], 0, 1, 2, 3, 4]", %q{
+ ary = [0, 1, 2, 3, 4]
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[[0], 1, 2, 3, 4, 5]", %q{
+ ary = [0, 1, 2, 3, 4, 5]
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[[0, 1], 2, 3, 4, 5, 6]", %q{
+ ary = [0, 1, 2, 3, 4, 5, 6]
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[nil, [], nil, nil, nil, nil]", %q{
+ ary = []
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, [], nil, nil, nil, nil]", %q{
+ ary = [0]
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, [], 1, nil, nil, nil]", %q{
+ ary = [0, 1]
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, [], 1, 2, nil, nil]", %q{
+ ary = [0, 1, 2]
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, [], 1, 2, 3, nil]", %q{
+ ary = [0, 1, 2, 3]
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, [], 1, 2, 3, 4]", %q{
+ ary = [0, 1, 2, 3, 4]
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, [1], 2, 3, 4, 5]", %q{
+ ary = [0, 1, 2, 3, 4, 5]
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, [1, 2], 3, 4, 5, 6]", %q{
+ ary = [0, 1, 2, 3, 4, 5, 6]
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[nil, nil, [], nil, nil, nil]", %q{
+ ary = []
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, nil, [], nil, nil, nil]", %q{
+ ary = [0]
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, 1, [], nil, nil, nil]", %q{
+ ary = [0, 1]
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, 1, [], 2, nil, nil]", %q{
+ ary = [0, 1, 2]
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, 1, [], 2, 3, nil]", %q{
+ ary = [0, 1, 2, 3]
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, 1, [], 2, 3, 4]", %q{
+ ary = [0, 1, 2, 3, 4]
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, 1, [2], 3, 4, 5]", %q{
+ ary = [0, 1, 2, 3, 4, 5]
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, 1, [2, 3], 4, 5, 6]", %q{
+ ary = [0, 1, 2, 3, 4, 5, 6]
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+
+#
+assert_equal 'ok', %q{
+ a,s=[],"aaa"
+ 300.times { a<<s; s=s.succ }
+ eval <<-END__
+ GC.stress=true
+ Fiber.new do
+ #{ a.join(",") },*zzz=1
+ end.resume
+ END__
+ :ok
+}, '[ruby-dev:32581]'
+
+assert_equal 'ok', %q{
+ while true
+ *, z = 1
+ break
+ end
+ :ok
+}, '[ruby-dev:32892]'
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb
new file mode 100644
index 0000000000..ed22608aea
--- /dev/null
+++ b/bootstraptest/test_method.rb
@@ -0,0 +1,1264 @@
+# regular argument
+assert_equal '1', 'def m() 1 end; m()'
+assert_equal '1', 'def m(a) a end; m(1)'
+assert_equal '[1, 2]', 'def m(a,b) [a, b] end; m(1,2)'
+assert_equal '[1, 2, 3]', 'def m(a,b,c) [a, b, c] end; m(1,2,3)'
+assert_equal 'wrong number of arguments (1 for 0)', %q{
+ def m; end
+ begin
+ m(1)
+ rescue => e
+ e.message
+ end
+}
+
+assert_equal 'wrong number of arguments (0 for 1)', %q{
+ def m a; end
+ begin
+ m
+ rescue => e
+ e.message
+ end
+}
+
+# default argument
+assert_equal '1', 'def m(x=1) x end; m()'
+assert_equal '1', 'def m(x=7) x end; m(1)'
+assert_equal '1', 'def m(a,x=1) x end; m(7)'
+assert_equal '1', 'def m(a,x=7) x end; m(7,1)'
+assert_equal '1', 'def m(a,b,x=1) x end; m(7,7)'
+assert_equal '1', 'def m(a,b,x=7) x end; m(7,7,1)'
+assert_equal '1', 'def m(a,x=1,y=1) x end; m(7)'
+assert_equal '1', 'def m(a,x=1,y=1) y end; m(7)'
+assert_equal '1', 'def m(a,x=7,y=1) x end; m(7,1)'
+assert_equal '1', 'def m(a,x=7,y=1) y end; m(7,1)'
+assert_equal '1', 'def m(a,x=7,y=7) x end; m(7,1,1)'
+assert_equal '1', 'def m(a,x=7,y=7) y end; m(7,1,1)'
+
+# rest argument
+assert_equal '[]', 'def m(*a) a end; m().inspect'
+assert_equal '[1]', 'def m(*a) a end; m(1).inspect'
+assert_equal '[1, 2]', 'def m(*a) a end; m(1,2).inspect'
+assert_equal '[]', 'def m(x,*a) a end; m(7).inspect'
+assert_equal '[1]', 'def m(x,*a) a end; m(7,1).inspect'
+assert_equal '[1, 2]', 'def m(x,*a) a end; m(7,1,2).inspect'
+assert_equal '[]', 'def m(x,y,*a) a end; m(7,7).inspect'
+assert_equal '[1]', 'def m(x,y,*a) a end; m(7,7,1).inspect'
+assert_equal '[1, 2]', 'def m(x,y,*a) a end; m(7,7,1,2).inspect'
+assert_equal '[]', 'def m(x,y=7,*a) a end; m(7).inspect'
+assert_equal '[]', 'def m(x,y,z=7,*a) a end; m(7,7).inspect'
+assert_equal '[]', 'def m(x,y,z=7,*a) a end; m(7,7,7).inspect'
+assert_equal '[]', 'def m(x,y,z=7,zz=7,*a) a end; m(7,7,7).inspect'
+assert_equal '[]', 'def m(x,y,z=7,zz=7,*a) a end; m(7,7,7,7).inspect'
+assert_equal '1', 'def m(x,y,z=7,zz=1,*a) zz end; m(7,7,7).inspect'
+assert_equal '1', 'def m(x,y,z=7,zz=1,*a) zz end; m(7,7,7).inspect'
+assert_equal '1', 'def m(x,y,z=7,zz=7,*a) zz end; m(7,7,7,1).inspect'
+
+# block argument
+assert_equal 'Proc', 'def m(&block) block end; m{}.class'
+assert_equal 'nil', 'def m(&block) block end; m().inspect'
+assert_equal 'Proc', 'def m(a,&block) block end; m(7){}.class'
+assert_equal 'nil', 'def m(a,&block) block end; m(7).inspect'
+assert_equal '1', 'def m(a,&block) a end; m(1){}'
+assert_equal 'Proc', 'def m(a,b=nil,&block) block end; m(7){}.class'
+assert_equal 'nil', 'def m(a,b=nil,&block) block end; m(7).inspect'
+assert_equal 'Proc', 'def m(a,b=nil,&block) block end; m(7,7){}.class'
+assert_equal '1', 'def m(a,b=nil,&block) b end; m(7,1){}'
+assert_equal 'Proc', 'def m(a,b=nil,*c,&block) block end; m(7){}.class'
+assert_equal 'nil', 'def m(a,b=nil,*c,&block) block end; m(7).inspect'
+assert_equal '1', 'def m(a,b=nil,*c,&block) a end; m(1).inspect'
+assert_equal '1', 'def m(a,b=1,*c,&block) b end; m(7).inspect'
+assert_equal '1', 'def m(a,b=7,*c,&block) b end; m(7,1).inspect'
+assert_equal '[1]', 'def m(a,b=7,*c,&block) c end; m(7,7,1).inspect'
+
+# splat
+assert_equal '1', 'def m(a) a end; m(*[1])'
+assert_equal '1', 'def m(x,a) a end; m(7,*[1])'
+assert_equal '1', 'def m(x,y,a) a end; m(7,7,*[1])'
+assert_equal '1', 'def m(a,b) a end; m(*[1,7])'
+assert_equal '1', 'def m(a,b) b end; m(*[7,1])'
+assert_equal '1', 'def m(x,a,b) b end; m(7,*[7,1])'
+assert_equal '1', 'def m(x,y,a,b) b end; m(7,7,*[7,1])'
+assert_equal '1', 'def m(a,b,c) a end; m(*[1,7,7])'
+assert_equal '1', 'def m(a,b,c) b end; m(*[7,1,7])'
+assert_equal '1', 'def m(a,b,c) c end; m(*[7,7,1])'
+assert_equal '1', 'def m(x,a,b,c) a end; m(7,*[1,7,7])'
+assert_equal '1', 'def m(x,y,a,b,c) a end; m(7,7,*[1,7,7])'
+
+# hash argument
+assert_equal '1', 'def m(h) h end; m(7=>1)[7]'
+assert_equal '1', 'def m(h) h end; m(7=>1).size'
+assert_equal '1', 'def m(h) h end; m(7=>1, 8=>7)[7]'
+assert_equal '2', 'def m(h) h end; m(7=>1, 8=>7).size'
+assert_equal '1', 'def m(h) h end; m(7=>1, 8=>7, 9=>7)[7]'
+assert_equal '3', 'def m(h) h end; m(7=>1, 8=>7, 9=>7).size'
+assert_equal '1', 'def m(x,h) h end; m(7, 7=>1)[7]'
+assert_equal '1', 'def m(x,h) h end; m(7, 7=>1, 8=>7)[7]'
+assert_equal '1', 'def m(x,h) h end; m(7, 7=>1, 8=>7, 9=>7)[7]'
+assert_equal '1', 'def m(x,y,h) h end; m(7,7, 7=>1)[7]'
+assert_equal '1', 'def m(x,y,h) h end; m(7,7, 7=>1, 8=>7)[7]'
+assert_equal '1', 'def m(x,y,h) h end; m(7,7, 7=>1, 8=>7, 9=>7)[7]'
+
+# block argument
+assert_equal '1', %q(def m(&block) mm(&block) end
+ def mm() yield 1 end
+ m {|a| a })
+assert_equal '1', %q(def m(x,&block) mm(x,&block) end
+ def mm(x) yield 1 end
+ m(7) {|a| a })
+assert_equal '1', %q(def m(x,y,&block) mm(x,y,&block) end
+ def mm(x,y) yield 1 end
+ m(7,7) {|a| a })
+
+# recursive call
+assert_equal '1', %q(def m(n) n == 0 ? 1 : m(n-1) end; m(5))
+
+# instance method
+assert_equal '1', %q(class C; def m() 1 end end; C.new.m)
+assert_equal '1', %q(class C; def m(a) a end end; C.new.m(1))
+assert_equal '1', %q(class C; def m(a = 1) a end end; C.new.m)
+assert_equal '[1]', %q(class C; def m(*a) a end end; C.new.m(1).inspect)
+assert_equal '1', %q( class C
+ def m() mm() end
+ def mm() 1 end
+ end
+ C.new.m )
+
+# singleton method (const)
+assert_equal '1', %q(class C; def C.m() 1 end end; C.m)
+assert_equal '1', %q(class C; def C.m(a) a end end; C.m(1))
+assert_equal '1', %q(class C; def C.m(a = 1) a end end; C.m)
+assert_equal '[1]', %q(class C; def C.m(*a) a end end; C.m(1).inspect)
+assert_equal '1', %q(class C; end; def C.m() 1 end; C.m)
+assert_equal '1', %q(class C; end; def C.m(a) a end; C.m(1))
+assert_equal '1', %q(class C; end; def C.m(a = 1) a end; C.m)
+assert_equal '[1]', %q(class C; end; def C.m(*a) a end; C.m(1).inspect)
+assert_equal '1', %q(class C; def m() 7 end end; def C.m() 1 end; C.m)
+assert_equal '1', %q( class C
+ def C.m() mm() end
+ def C.mm() 1 end
+ end
+ C.m )
+
+# singleton method (lvar)
+assert_equal '1', %q(obj = Object.new; def obj.m() 1 end; obj.m)
+assert_equal '1', %q(obj = Object.new; def obj.m(a) a end; obj.m(1))
+assert_equal '1', %q(obj = Object.new; def obj.m(a=1) a end; obj.m)
+assert_equal '[1]', %q(obj = Object.new; def obj.m(*a) a end; obj.m(1))
+assert_equal '1', %q(class C; def m() 7 end; end
+ obj = C.new
+ def obj.m() 1 end
+ obj.m)
+
+# inheritance
+assert_equal '1', %q(class A; def m(a) a end end
+ class B < A; end
+ B.new.m(1))
+assert_equal '1', %q(class A; end
+ class B < A; def m(a) a end end
+ B.new.m(1))
+assert_equal '1', %q(class A; def m(a) a end end
+ class B < A; end
+ class C < B; end
+ C.new.m(1))
+
+# include
+assert_equal '1', %q(class A; def m(a) a end end
+ module M; end
+ class B < A; include M; end
+ B.new.m(1))
+assert_equal '1', %q(class A; end
+ module M; def m(a) a end end
+ class B < A; include M; end
+ B.new.m(1))
+
+# alias
+assert_equal '1', %q( def a() 1 end
+ alias m a
+ m() )
+assert_equal '1', %q( class C
+ def a() 1 end
+ alias m a
+ end
+ C.new.m )
+assert_equal '1', %q( class C
+ def a() 1 end
+ alias :m a
+ end
+ C.new.m )
+assert_equal '1', %q( class C
+ def a() 1 end
+ alias m :a
+ end
+ C.new.m )
+assert_equal '1', %q( class C
+ def a() 1 end
+ alias :m :a
+ end
+ C.new.m )
+assert_equal '1', %q( class C
+ def a() 1 end
+ alias m a
+ undef a
+ end
+ C.new.m )
+
+# undef
+assert_equal '1', %q( class C
+ def m() end
+ undef m
+ end
+ begin C.new.m; rescue NoMethodError; 1 end )
+assert_equal '1', %q( class A
+ def m() end
+ end
+ class C < A
+ def m() end
+ undef m
+ end
+ begin C.new.m; rescue NoMethodError; 1 end )
+assert_equal '1', %q( class A; def a() end end # [yarv-dev:999]
+ class B < A
+ def b() end
+ undef a, b
+ end
+ begin B.new.a; rescue NoMethodError; 1 end )
+assert_equal '1', %q( class A; def a() end end # [yarv-dev:999]
+ class B < A
+ def b() end
+ undef a, b
+ end
+ begin B.new.b; rescue NoMethodError; 1 end )
+
+assert_equal '3', %q{
+ def m1
+ 1
+ end
+ alias m2 m1
+ alias :"#{'m3'}" m1
+ m1 + m2 + m3
+}, '[ruby-dev:32308]'
+assert_equal '1', %q{
+ def foobar
+ end
+ undef :"foo#{:bar}"
+ 1
+}, '[ruby-dev:32308]'
+assert_equal '1', %q{
+ def foobar
+ 1
+ end
+ alias :"bar#{:baz}" :"foo#{:bar}"
+ barbaz
+}, '[ruby-dev:32308]'
+
+# private
+assert_equal '1', %q( class C
+ def m() mm() end
+ def mm() 1 end
+ private :mm
+ end
+ C.new.m )
+assert_equal '1', %q( class C
+ def m() 7 end
+ private :m
+ end
+ begin C.m; rescue NoMethodError; 1 end )
+assert_equal '1', %q( class C
+ def C.m() mm() end
+ def C.mm() 1 end
+ private_class_method :mm
+ end
+ C.m )
+assert_equal '1', %q( class C
+ def C.m() 7 end
+ private_class_method :m
+ end
+ begin C.m; rescue NoMethodError; 1 end )
+assert_equal '1', %q( class C; def m() 1 end end
+ C.new.m # cache
+ class C
+ alias mm m; private :mm
+ end
+ C.new.m
+ begin C.new.mm; 7; rescue NoMethodError; 1 end )
+
+# nested method
+assert_equal '1', %q( class C
+ def m
+ def mm() 1 end
+ end
+ end
+ C.new.m
+ C.new.mm )
+assert_equal '1', %q( class C
+ def m
+ def mm() 1 end
+ end
+ end
+ instance_eval "C.new.m; C.new.mm" )
+
+# method_missing
+assert_equal ':m', %q( class C
+ def method_missing(mid, *args) mid end
+ end
+ C.new.m.inspect )
+assert_equal ':mm', %q( class C
+ def method_missing(mid, *args) mid end
+ end
+ C.new.mm.inspect )
+assert_equal '[1, 2]', %q( class C
+ def method_missing(mid, *args) args end
+ end
+ C.new.m(1,2).inspect )
+assert_equal '1', %q( class C
+ def method_missing(mid, *args) yield 1 end
+ end
+ C.new.m {|a| a })
+assert_equal 'nil', %q( class C
+ def method_missing(mid, *args, &block) block end
+ end
+ C.new.m.inspect )
+
+# send
+assert_equal '1', %q( class C; def m() 1 end end;
+ C.new.__send__(:m) )
+assert_equal '1', %q( class C; def m() 1 end end;
+ C.new.send(:m) )
+assert_equal '1', %q( class C; def m(a) a end end;
+ C.new.send(:m,1) )
+assert_equal '1', %q( class C; def m(a,b) a end end;
+ C.new.send(:m,1,7) )
+assert_equal '1', %q( class C; def m(x,a=1) a end end;
+ C.new.send(:m,7) )
+assert_equal '1', %q( class C; def m(x,a=7) a end end;
+ C.new.send(:m,7,1) )
+assert_equal '[1, 2]', %q( class C; def m(*a) a end end;
+ C.new.send(:m,1,2).inspect )
+assert_equal '1', %q( class C; def m() 7 end; private :m end
+ begin C.new.public_send(:m); rescue NoMethodError; 1 end )
+assert_equal '1', %q( class C; def m() 1 end; private :m end
+ C.new.send(:m) )
+
+# with block
+assert_equal '[[:ok1, :foo], [:ok2, :foo, :bar]]',
+%q{
+ class C
+ def [](a)
+ $ary << [yield, a]
+ end
+ def []=(a, b)
+ $ary << [yield, a, b]
+ end
+ end
+
+ $ary = []
+ C.new[:foo, &lambda{:ok1}]
+ C.new[:foo, &lambda{:ok2}] = :bar
+ $ary
+}
+
+# with
+assert_equal '[:ok1, [:ok2, 11]]', %q{
+ class C
+ def []
+ $ary << :ok1
+ 10
+ end
+ def []=(a)
+ $ary << [:ok2, a]
+ end
+ end
+ $ary = []
+ C.new[]+=1
+ $ary
+}
+
+# splat and block arguments
+assert_equal %q{[[[:x, :y, :z], NilClass], [[1, :x, :y, :z], NilClass], [[1, 2, :x, :y, :z], NilClass], [[:obj], NilClass], [[1, :obj], NilClass], [[1, 2, :obj], NilClass], [[], Proc], [[1], Proc], [[1, 2], Proc], [[], Proc], [[1], Proc], [[1, 2], Proc], [[:x, :y, :z], Proc], [[1, :x, :y, :z], Proc], [[1, 2, :x, :y, :z], Proc]]}, %q{
+def m(*args, &b)
+ $result << [args, b.class]
+end
+$result = []
+ary = [:x, :y, :z]
+obj = :obj
+b = Proc.new{}
+
+m(*ary)
+m(1,*ary)
+m(1,2,*ary)
+m(*obj)
+m(1,*obj)
+m(1,2,*obj)
+m(){}
+m(1){}
+m(1,2){}
+m(&b)
+m(1,&b)
+m(1,2,&b)
+m(*ary,&b)
+m(1,*ary,&b)
+m(1,2,*ary,&b)
+$result
+}
+
+# aset and splat
+assert_equal '4', %q{class Foo;def []=(a,b,c,d);end;end;Foo.new[1,*a=[2,3]]=4}
+assert_equal '4', %q{class Foo;def []=(a,b,c,d);end;end;def m(&blk)Foo.new[1,*a=[2,3],&blk]=4;end;m{}}
+
+# post test
+assert_equal %q{[1, 2, :o1, :o2, [], 3, 4, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4)}
+
+assert_equal %q{[1, 2, 3, :o2, [], 4, 5, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5)}
+
+assert_equal %q{[1, 2, 3, 4, [], 5, 6, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6)}
+
+assert_equal %q{[1, 2, 3, 4, [5], 6, 7, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7)}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6], 7, 8, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8)}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6, 7], 8, 9, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8, 9)}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6, 7, 8], 9, 10, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6, 7, 8, 9], 10, 11, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)}
+
+assert_equal %q{[1, 2, :o1, :o2, [], 3, 4, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4){}}
+
+assert_equal %q{[1, 2, 3, :o2, [], 4, 5, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5){}}
+
+assert_equal %q{[1, 2, 3, 4, [], 5, 6, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6){}}
+
+assert_equal %q{[1, 2, 3, 4, [5], 6, 7, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7){}}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6], 7, 8, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8){}}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6, 7], 8, 9, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8, 9){}}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6, 7, 8], 9, 10, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10){}}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6, 7, 8, 9], 10, 11, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11){}}
+
+assert_equal %q{[1, 2, :o1, :o2, [], 3, 4, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, x, y]
+end
+; m(1, 2, 3, 4)}
+
+assert_equal %q{[1, 2, 3, :o2, [], 4, 5, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, x, y]
+end
+; m(1, 2, 3, 4, 5)}
+
+assert_equal %q{[1, 2, 3, 4, [], 5, 6, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, x, y]
+end
+; m(1, 2, 3, 4, 5, 6)}
+
+
+#
+# super
+#
+=begin
+# below programs are generated by this program:
+
+BASE = <<EOS__
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; <TEST>; super; end; end
+EOS__
+
+tests = {
+%q{
+ def m
+} => %q{
+ C1.new.m
+},
+#
+%q{
+ def m a
+} => %q{
+ C1.new.m 1
+},
+%q{
+ def m a
+ a = :a
+} => %q{
+ C1.new.m 1
+},
+#
+%q{
+ def m a, o=:o
+} => %q{
+ C1.new.m 1
+ C1.new.m 1, 2
+},
+%q{
+ def m a, o=:o
+ a = :a
+} => %q{
+ C1.new.m 1
+ C1.new.m 1, 2
+},
+%q{
+ def m a, o=:o
+ o = :x
+} => %q{
+ C1.new.m 1
+ C1.new.m 1, 2
+},
+#
+%q{
+ def m a, *r
+} => %q{
+ C1.new.m 1
+ C1.new.m 1, 2
+ C1.new.m 1, 2, 3
+},
+%q{
+ def m a, *r
+ r = [:x, :y]
+} => %q{
+ C1.new.m 1
+ C1.new.m 1, 2
+ C1.new.m 1, 2, 3
+},
+#
+%q{
+ def m a, o=:o, *r
+} => %q{
+ C1.new.m 1
+ C1.new.m 1, 2
+ C1.new.m 1, 2, 3
+ C1.new.m 1, 2, 3, 4
+},
+#
+%q{
+ def m a, o=:o, *r, &b
+} => %q{
+ C1.new.m 1
+ C1.new.m 1, 2
+ C1.new.m 1, 2, 3
+ C1.new.m 1, 2, 3, 4
+ C1.new.m(1){}
+ C1.new.m(1, 2){}
+ C1.new.m(1, 2, 3){}
+ C1.new.m(1, 2, 3, 4){}
+},
+#
+"def m(m1, m2, o1=:o1, o2=:o2, p1, p2)" =>
+%q{
+C1.new.m(1,2,3,4)
+C1.new.m(1,2,3,4,5)
+C1.new.m(1,2,3,4,5,6)
+},
+#
+"def m(m1, m2, *r, p1, p2)" =>
+%q{
+C1.new.m(1,2,3,4)
+C1.new.m(1,2,3,4,5)
+C1.new.m(1,2,3,4,5,6)
+C1.new.m(1,2,3,4,5,6,7)
+C1.new.m(1,2,3,4,5,6,7,8)
+},
+#
+"def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2)" =>
+%q{
+C1.new.m(1,2,3,4)
+C1.new.m(1,2,3,4,5)
+C1.new.m(1,2,3,4,5,6)
+C1.new.m(1,2,3,4,5,6,7)
+C1.new.m(1,2,3,4,5,6,7,8)
+C1.new.m(1,2,3,4,5,6,7,8,9)
+},
+
+###
+}
+
+
+tests.each{|setup, methods| setup = setup.dup; setup.strip!
+ setup = BASE.gsub(/<TEST>/){setup}
+ methods.split(/\n/).each{|m| m = m.dup; m.strip!
+ next if m.empty?
+ expr = "#{setup}; #{m}"
+ result = eval(expr)
+ puts "assert_equal %q{#{result.inspect}}, %q{\n#{expr}}"
+ puts
+ }
+}
+
+=end
+
+assert_equal %q{[:C0_m, [1, 2, :o1, :o2, 3, 4]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, p1, p2); super; end; end
+; C1.new.m(1,2,3,4)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, :o2, 4, 5]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6)}
+
+assert_equal %q{[:C0_m, [1, :o]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, 2]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r; super; end; end
+; C1.new.m 1, 2}
+
+assert_equal %q{[:C0_m, [1, 2, 3]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r; super; end; end
+; C1.new.m 1, 2, 3}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r; super; end; end
+; C1.new.m 1, 2, 3, 4}
+
+assert_equal %q{[:C0_m, [:a]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a
+ a = :a; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6,7)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7, 8]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6,7,8)}
+
+assert_equal %q{[:C0_m, [1, :o]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, 2]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m 1, 2}
+
+assert_equal %q{[:C0_m, [1, 2, 3]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m 1, 2, 3}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m 1, 2, 3, 4}
+
+assert_equal %q{[:C0_m, [1, :o]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m(1){}}
+
+assert_equal %q{[:C0_m, [1, 2]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m(1, 2){}}
+
+assert_equal %q{[:C0_m, [1, 2, 3]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m(1, 2, 3){}}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m(1, 2, 3, 4){}}
+
+assert_equal %q{[:C0_m, [1, :x]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o
+ o = :x; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, :x]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o
+ o = :x; super; end; end
+; C1.new.m 1, 2}
+
+assert_equal %q{[:C0_m, [:a, :o]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o
+ a = :a; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [:a, 2]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o
+ a = :a; super; end; end
+; C1.new.m 1, 2}
+
+assert_equal %q{[:C0_m, [1]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, :x, :y]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, *r
+ r = [:x, :y]; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, :x, :y]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, *r
+ r = [:x, :y]; super; end; end
+; C1.new.m 1, 2}
+
+assert_equal %q{[:C0_m, [1, :x, :y]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, *r
+ r = [:x, :y]; super; end; end
+; C1.new.m 1, 2, 3}
+
+assert_equal %q{[:C0_m, [1, 2, :o1, :o2, 3, 4]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, :o2, 4, 5]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6,7)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7, 8]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6,7,8)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7, 8, 9]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6,7,8,9)}
+
+assert_equal %q{[:C0_m, [1]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, *r; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, 2]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, *r; super; end; end
+; C1.new.m 1, 2}
+
+assert_equal %q{[:C0_m, [1, 2, 3]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, *r; super; end; end
+; C1.new.m 1, 2, 3}
+
+assert_equal %q{[:C0_m, []]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m; super; end; end
+; C1.new.m}
+
+assert_equal %q{[:C0_m, [1, :o]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, 2]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o; super; end; end
+; C1.new.m 1, 2}
+
+assert_equal %q{[:ok, :ok, :ok, :ok, :ok, :ok, :ng, :ng]}, %q{
+ $ans = []
+ class Foo
+ def m
+ end
+ end
+
+ c1 = c2 = nil
+
+ lambda{
+ $SAFE = 4
+ c1 = Class.new{
+ def m
+ end
+ }
+ c2 = Class.new(Foo){
+ alias mm m
+ }
+ }.call
+
+ def test
+ begin
+ yield
+ rescue SecurityError
+ $ans << :ok
+ else
+ $ans << :ng
+ end
+ end
+
+ o1 = c1.new
+ o2 = c2.new
+
+ test{o1.m}
+ test{o2.mm}
+ test{o1.send :m}
+ test{o2.send :mm}
+ test{o1.public_send :m}
+ test{o2.public_send :mm}
+ test{o1.method(:m).call}
+ test{o2.method(:mm).call}
+ $ans
+}
+
+assert_equal 'ok', %q{
+ class C
+ def x=(n)
+ end
+ def m
+ self.x = :ok
+ end
+ end
+ C.new.m
+}
+
+assert_equal 'ok', %q{
+ proc{
+ $SAFE = 1
+ class C
+ def m
+ :ok
+ end
+ end
+ }.call
+ C.new.m
+}, '[ruby-core:11998]'
+
+assert_equal 'ok', %q{
+ proc{
+ $SAFE = 2
+ class C
+ def m
+ :ok
+ end
+ end
+ }.call
+ C.new.m
+}, '[ruby-core:11998]'
+
+assert_equal 'ok', %q{
+ proc{
+ $SAFE = 3
+ class C
+ def m
+ :ng
+ end
+ end
+ }.call
+ begin
+ C.new.m
+ rescue SecurityError
+ :ok
+ end
+}, '[ruby-core:11998]'
+
+assert_equal 'ok', %q{
+ class B
+ def m() :fail end
+ end
+ class C < B
+ undef m
+ begin
+ remove_method :m
+ rescue NameError
+ end
+ end
+ begin
+ C.new.m
+ rescue NameError
+ :ok
+ end
+}, '[ruby-dev:31816], [ruby-dev:31817]'
+
+assert_normal_exit %q{
+ begin
+ Process.setrlimit(Process::RLIMIT_STACK, 4_202_496)
+ # FreeBSD fails this less than 4M + 8K bytes.
+ rescue Exception
+ exit
+ end
+ class C
+ attr "a" * (10*1024*1024)
+ end
+}, '[ruby-dev:31818]'
+
+assert_equal 'ok', %q{
+ class Module
+ def define_method2(name, &block)
+ define_method(name, &block)
+ end
+ end
+ class C
+ define_method2(:m) {|x, y| :fail }
+ end
+ begin
+ C.new.m([1,2])
+ rescue ArgumentError
+ :ok
+ end
+}
+
+assert_not_match /method_missing/, %q{
+ STDERR.reopen(STDOUT)
+ variable_or_mehtod_not_exist
+}
+
+assert_equal '[false, false, false, false, true, true]', %q{
+ class C
+ define_method(:foo) {
+ block_given?
+ }
+ end
+
+ C.new.foo {}
+
+ class D
+ def foo
+ D.module_eval{
+ define_method(:m1){
+ block_given?
+ }
+ }
+ end
+ def bar
+ D.module_eval{
+ define_method(:m2){
+ block_given?
+ }
+ }
+ end
+ end
+
+ D.new.foo
+ D.new.bar{}
+ [C.new.foo, C.new.foo{}, D.new.m1, D.new.m1{}, D.new.m2, D.new.m2{}]
+}, '[ruby-core:14813]'
+
+assert_equal 'ok', %q{
+ class Foo
+ define_method(:foo) do |&b|
+ b.call
+ end
+ end
+ Foo.new.foo do
+ break :ok
+ end
+}, '[ruby-dev:36028]'
+
+assert_equal '[1, 2, [3, 4]]', %q{
+ def regular(a, b, *c)
+ [a, b, c]
+ end
+ regular(*[], 1, *[], *[2, 3], *[], 4)
+}, '[ruby-core:19413]'
+
+assert_equal '[1, [:foo, 3, 4, :foo]]', %q{
+ def regular(a, *b)
+ [a, b]
+ end
+ a = b = [:foo]
+ regular(1, *a, *[3, 4], *b)
+}
+
+assert_equal '["B", "A"]', %q{
+ class A
+ def m
+ 'A'
+ end
+ end
+
+ class B < A
+ define_method(:m) do
+ ['B', super()]
+ end
+ end
+
+ class C < B
+ end
+
+ C.new.m
+}
+
+assert_equal 'ok', %q{
+ module Foo
+ def foo
+ begin
+ super
+ rescue NoMethodError
+ :ok
+ end
+ end
+ module_function :foo
+ end
+ Foo.foo
+}, '[ruby-dev:37587]'
+
+assert_equal 'Object#foo', %q{
+ class Object
+ def self.foo
+ "Object.foo"
+ end
+ def foo
+ "Object#foo"
+ end
+ end
+
+ module Foo
+ def foo
+ begin
+ super
+ rescue NoMethodError
+ :ok
+ end
+ end
+ module_function :foo
+ end
+ Foo.foo
+}, '[ruby-dev:37587]'
+
+assert_normal_exit %q{
+ class BasicObject
+ remove_method :method_missing
+ end
+ begin
+ "a".lalala!
+ rescue NoMethodError => e
+ e.message == "undefined method `lalala!' for \"a\":String" ? :ok : :ng
+ end
+}, '[ruby-core:22298]'
+
+assert_equal 'ok', %q{
+ "hello"[0] ||= "H"
+ "ok"
+}
+
+assert_equal 'ok', %q{
+ "hello"[0, 1] ||= "H"
+ "ok"
+}
+
+assert_equal 'ok', %q{
+ class C
+ define_method(:foo) do
+ C.class_eval { remove_method(:foo) }
+ super()
+ end
+ end
+ begin
+ C.new.foo
+ rescue NoMethodError
+ 'ok'
+ end
+}
+assert_equal 'ok', %q{
+ [0][0, &proc{}] += 21
+ 'ok'
+}, '[ruby-core:30534]'
+
+# should not cache when splat
+assert_equal 'ok', %q{
+ class C
+ attr_reader :a
+ def initialize
+ @a = 1
+ end
+ end
+
+ def m *args
+ C.new.a(*args)
+ end
+
+ m()
+ begin
+ m(1)
+ rescue ArgumentError
+ 'ok'
+ end
+}
+
+assert_equal 'DC', %q{
+ $result = []
+
+ class C
+ def foo *args
+ $result << 'C'
+ end
+ end
+ class D
+ def foo *args
+ $result << 'D'
+ end
+ end
+
+ o1 = $o1 = C.new
+ o2 = $o2 = D.new
+
+ args = Object.new
+ def args.to_a
+ test1 $o2, nil
+ []
+ end
+ def test1 o, args
+ o.foo(*args)
+ end
+ test1 o1, args
+ $result.join
+}
+
+assert_equal 'DC', %q{
+ $result = []
+
+ class C
+ def foo *args
+ $result << 'C'
+ end
+ end
+ class D
+ def foo *args
+ $result << 'D'
+ end
+ end
+
+ o1 = $o1 = C.new
+ o2 = $o2 = D.new
+
+ block = Object.new
+ def block.to_proc
+ test2 $o2, %w(a, b, c), nil
+ Proc.new{}
+ end
+ def test2 o, args, block
+ o.foo(*args, &block)
+ end
+ test2 o1, [], block
+ $result.join
+}
diff --git a/bootstraptest/test_objectspace.rb b/bootstraptest/test_objectspace.rb
new file mode 100644
index 0000000000..862a94e376
--- /dev/null
+++ b/bootstraptest/test_objectspace.rb
@@ -0,0 +1,46 @@
+assert_normal_exit %q{
+ eval("", TOPLEVEL_BINDING)
+ minobj = ObjectSpace.to_enum(:each_object).min_by {|a| a.object_id }
+ maxobj = ObjectSpace.to_enum(:each_object).max_by {|a| a.object_id }
+ (((minobj.object_id-100)..(minobj.object_id+100))+
+ ((maxobj.object_id-100)..(maxobj.object_id+100))).each {|id|
+ begin
+ o = ObjectSpace._id2ref(id)
+ rescue RangeError
+ next
+ end
+ o.inspect if defined?(o.inspect)
+ }
+}, '[ruby-dev:31911]'
+
+assert_normal_exit %q{
+ ary = (1..10).to_a
+ ary.permutation(2) {|x|
+ if x == [1,2]
+ ObjectSpace.each_object(String) {|s|
+ s.clear if !s.frozen? && (s.length == 40 || s.length == 80)
+ }
+ end
+ }
+}, '[ruby-dev:31982]'
+
+assert_normal_exit %q{
+ ary = (1..100).to_a
+ ary.permutation(2) {|x|
+ if x == [1,2]
+ ObjectSpace.each_object(Array) {|o| o.clear if o == ary && o.object_id != ary.object_id }
+ end
+ }
+}, '[ruby-dev:31985]'
+
+assert_normal_exit %q{
+ ObjectSpace.define_finalizer("") do
+ Mutex.new.lock
+ end
+}, '[ruby-dev:44049]'
+
+assert_normal_exit %q{
+ ObjectSpace.define_finalizer("") do
+ Thread.new {}
+ end
+}, '[ruby-core:37858]'
diff --git a/bootstraptest/test_proc.rb b/bootstraptest/test_proc.rb
new file mode 100644
index 0000000000..c23394e8d2
--- /dev/null
+++ b/bootstraptest/test_proc.rb
@@ -0,0 +1,483 @@
+assert_equal %q{[1, 2, 3]}, %q{
+ def getproc &b
+ b
+ end
+
+ def m
+ yield
+ end
+
+ m{
+ i = 1
+ m{
+ j = 2
+ m{
+ k = 3
+ getproc{
+ [i, j, k]
+ }
+ }
+ }
+ }.call
+}
+assert_equal %q{7}, %q{
+ def make_proc(&b)
+ b
+ end
+
+ def make_closure
+ a = 0
+ make_proc{
+ a+=1
+ }
+ end
+
+ cl = make_closure
+ cl.call + cl.call * cl.call
+}
+assert_equal %q{ok}, %q{
+ class C
+ def foo
+ :ok
+ end
+ end
+
+ def block
+ C.method(:new).to_proc
+ end
+ b = block()
+ b.call.foo
+}
+assert_equal %q{[0, 1, :last, 0, 2, :last]}, %q{
+ def proc &b
+ b
+ end
+
+ pr = []
+ proc{|i_b|
+ p3 = proc{|j_b|
+ pr << proc{|k_b|
+ [i_b, j_b, k_b]
+ }
+ }
+ p3.call(1)
+ p3.call(2)
+ }.call(0)
+
+ pr[0].call(:last).concat pr[1].call(:last)
+}
+assert_equal %q{12}, %q{
+ def iter
+ yield
+ end
+
+ def getproc &b
+ b
+ end
+
+ iter{
+ bvar = 3
+ getproc{
+ bvar2 = 4
+ bvar * bvar2
+ }
+ }.call
+}
+assert_equal %q{200}, %q{
+ def iter
+ yield
+ end
+
+ def getproc &b
+ b
+ end
+
+ loc1 = 0
+ pr1 = iter{
+ bl1 = 1
+ getproc{
+ loc1 += 1
+ bl1 += 1
+ loc1 + bl1
+ }
+ }
+
+ pr2 = iter{
+ bl1 = 1
+ getproc{
+ loc1 += 1
+ bl1 += 1
+ loc1 + bl1
+ }
+ }
+
+ pr1.call; pr2.call
+ pr1.call; pr2.call
+ pr1.call; pr2.call
+ (pr1.call + pr2.call) * loc1
+}
+assert_equal %q{[1, 2]}, %q{
+ def proc(&pr)
+ pr
+ end
+
+ def m
+ a = 1
+ m2{
+ a
+ }
+ end
+
+ def m2
+ b = 2
+ proc{
+ [yield, b]
+ }
+ end
+
+ pr = m
+ x = ['a', 1,2,3,4,5,6,7,8,9,0,
+ 1,2,3,4,5,6,7,8,9,0,
+ 1,2,3,4,5,6,7,8,9,0,
+ 1,2,3,4,5,6,7,8,9,0,
+ 1,2,3,4,5,6,7,8,9,0,]
+ pr.call
+}
+assert_equal %q{1}, %q{
+ def proc(&pr)
+ pr
+ end
+
+ def m
+ a = 1
+ m2{
+ a
+ }
+ end
+
+ def m2
+ b = 2
+ proc{
+ [yield, b]
+ }
+ 100000.times{|x|
+ "#{x}"
+ }
+ yield
+ end
+ m
+}
+assert_equal %q{[:C, :C]}, %q{
+ Const = :top
+ class C
+ Const = :C
+ $pr = proc{
+ (1..2).map{
+ Const
+ }
+ }
+ end
+ $pr.call
+}
+assert_equal %q{top}, %q{
+ Const = :top
+ class C
+ Const = :C
+ end
+ pr = proc{
+ Const
+ }
+ C.class_eval %q{
+ pr.call
+ }
+}
+assert_equal %q{1}, %q{
+ def m(&b)
+ b
+ end
+
+ m{|e_proctest| e_proctest}.call(1)
+}
+assert_equal %q{12}, %q{
+ def m(&b)
+ b
+ end
+
+ m{|e_proctest1, e_proctest2|
+ a = e_proctest1 * e_proctest2 * 2
+ a * 3
+ }.call(1, 2)
+}
+assert_equal %q{[[], [1], [1, 2], [1, 2, 3]]}, %q{
+ [
+ Proc.new{|*args| args}.call(),
+ Proc.new{|*args| args}.call(1),
+ Proc.new{|*args| args}.call(1, 2),
+ Proc.new{|*args| args}.call(1, 2, 3),
+ ]
+}
+assert_equal %q{[[nil, []], [1, []], [1, [2]], [1, [2, 3]]]}, %q{
+ [
+ Proc.new{|a, *b| [a, b]}.call(),
+ Proc.new{|a, *b| [a, b]}.call(1),
+ Proc.new{|a, *b| [a, b]}.call(1, 2),
+ Proc.new{|a, *b| [a, b]}.call(1, 2, 3),
+ ]
+}
+assert_equal %q{0}, %q{
+ pr = proc{
+ $SAFE
+ }
+ $SAFE = 1
+ pr.call
+}
+assert_equal %q{[1, 0]}, %q{
+ pr = proc{
+ $SAFE += 1
+ }
+ [pr.call, $SAFE]
+}
+assert_equal %q{1}, %q{
+ def m(&b)
+ b
+ end
+ m{1}.call
+}
+assert_equal %q{3}, %q{
+ def m(&b)
+ b
+ end
+
+ m{
+ a = 1
+ a + 2
+ }.call
+}
+assert_equal %Q{ok\n}, %q{
+ class A; def get_block; proc {puts "ok"} end end
+ block = A.new.get_block
+ GC.start
+ block.call
+}, '[ruby-core:14885]'
+
+assert_equal 'ok', %q{
+ a = lambda {|x, y, &b| b }
+ b = a.curry[1]
+ if b.call(2){} == nil
+ :ng
+ else
+ :ok
+ end
+}, '[ruby-core:15551]'
+
+assert_equal 'ok', %q{
+ lambda {
+ break :ok
+ :ng
+ }.call
+}, '[ruby-dev:34646]'
+
+assert_equal %q{[:bar, :foo]}, %q{
+ def foo
+ klass = Class.new do
+ define_method(:bar) do
+ return :bar
+ end
+ end
+ [klass.new.bar, :foo]
+ end
+ foo
+}, "[ ruby-Bugs-19304 ]"
+
+assert_equal 'ok', %q{
+ $x = :ok
+ def def7(x, y)
+ x[y]
+ $x = :ng
+ end
+ def test_def7
+ def7(lambda {|x| x.call}, Proc.new {return})
+ $x = :ng
+ end
+ test_def7
+ $x
+}, '[ruby-core:17164]'
+
+assert_equal 'ok', %q{
+ lambda { a = lambda { return }; $x = :ng; a[]; $x = :ok }.call
+ $x
+}, '[ruby-core:17164]'
+
+assert_equal 'ok', %q{
+ lambda { a = lambda { break }; $x = :ng; a[]; $x = :ok }.call
+ $x
+}, '[ruby-core:17164]'
+
+assert_equal 'ok', %q{
+ def def8
+ $x = :ng
+ lambda { a = Proc.new { return }; a[]}.call
+ $x = :ok
+ end
+ def8
+ $x
+}, '[ruby-core:17164]'
+
+
+assert_equal 'ok', %q{
+ def def9
+ lambda {|a| $x = :ok; a[]; $x = :ng }.call(Proc.new { return })
+ $x = :ng
+ end
+ def9
+ $x
+}, '[ruby-core:17164]'
+
+assert_equal 'ok', %q{
+ def def10
+ $x = :ng
+ lambda { 1.times { return } }.call
+ $x = :ok
+ end
+ $x = :ok
+ def10
+ $x
+}, '[ruby-core:17164]'
+
+assert_equal 'ok', %q{
+ def def11
+ yield
+ end
+ begin
+ lambda { def11 { return } }.call
+ rescue LocalJumpError
+ :ng
+ else
+ :ok
+ end
+}, '[ruby-core:17164]'
+
+assert_equal 'ok', %q{
+ def def12
+ b = Proc.new { $x = :ng; lambda { return }.call; $x = :ok }.call
+ end
+ def12
+ $x
+}, '[ruby-core:17164]'
+
+assert_equal 'ok', %q{
+ def m
+ pr = proc{
+ proc{
+ return :ok
+ }
+ }.call
+ pr.call
+ :ng
+ end
+ m()
+}
+
+assert_equal 'ok', %q{
+ class Foo
+ def call_it
+ p = Proc.new
+ p.call
+ end
+ end
+
+ def give_it
+ proc { :ok }
+ end
+
+ f = Foo.new
+ a_proc = give_it
+ f.call_it(&give_it())
+}, '[ruby-core:15711]'
+
+assert_equal 'foo!', %q{
+ class FooProc < Proc
+ def initialize
+ @foo = "foo!"
+ end
+
+ def bar
+ @foo
+ end
+ end
+
+ def bar
+ FooProc.new &lambda{
+ p 1
+ }
+ end
+
+ fp = bar(&lambda{
+ p 2
+ })
+
+ fp.bar
+}, 'Subclass of Proc'
+
+assert_equal 'ok', %q{
+ o = Object.new
+ def o.write(s); end
+ $stderr = o
+ at_exit{
+ print $!.message
+ }
+ raise "ok"
+}
+
+assert_equal 'ok', %q{
+ lambda do
+ class A
+ class B
+ proc{return :ng}.call
+ end
+ end
+ end.call
+ :ok
+}
+
+assert_equal 'ok', %q{
+ $proc = proc{return}
+ begin
+ lambda do
+ class A
+ class B
+ $proc.call
+ end
+ end
+ end.call
+ :ng
+ rescue LocalJumpError
+ :ok
+ end
+}
+
+assert_equal 'ok', %q{
+ def x
+ binding
+ end
+ b = x{|a| a }
+ b.eval('yield("ok")')
+}, '[Bug #5634]'
+
+assert_equal 'ok', %q{
+ def x
+ binding
+ end
+ eval("x { 'ok' }").eval "yield"
+}, '[Bug #5634]'
+
+assert_equal 'ok', %q{
+ def x
+ binding
+ end
+ def m
+ x{ 'ok' }
+ end
+ eval('yield', m)
+}, '[Bug #5634]'
+
diff --git a/bootstraptest/test_struct.rb b/bootstraptest/test_struct.rb
new file mode 100644
index 0000000000..a65964d5f9
--- /dev/null
+++ b/bootstraptest/test_struct.rb
@@ -0,0 +1,5 @@
+assert_equal 'Struct::Foo', %q{
+ Struct.instance_eval { const_set(:Foo, nil) }
+ Struct.new("Foo")
+ Struct::Foo
+}
diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb
new file mode 100644
index 0000000000..80eaa6416d
--- /dev/null
+++ b/bootstraptest/test_syntax.rb
@@ -0,0 +1,902 @@
+assert_equal %q{4}, %q{1 && 2 && 3 && 4}
+assert_equal %q{}, %q{1 && nil && 3 && 4}
+assert_equal %q{}, %q{1 && 2 && 3 && nil}
+assert_equal %q{false}, %q{1 && 2 && 3 && false}
+assert_equal %q{4}, %q{1 and 2 and 3 and 4}
+assert_equal %q{}, %q{1 and nil and 3 and 4}
+assert_equal %q{}, %q{1 and 2 and 3 and nil}
+assert_equal %q{false}, %q{1 and 2 and 3 and false}
+assert_equal %q{}, %q{nil && true}
+assert_equal %q{false}, %q{false && true}
+assert_equal %q{}, %q{
+ case 1
+ when 2
+ :ng
+ end}
+assert_equal %q{ok}, %q{
+ case 1
+ when 10,20,30
+ :ng1
+ when 1,2,3
+ :ok
+ when 100,200,300
+ :ng2
+ else
+ :elseng
+ end}
+assert_equal %q{elseok}, %q{
+ case 123
+ when 10,20,30
+ :ng1
+ when 1,2,3
+ :ng2
+ when 100,200,300
+ :ng3
+ else
+ :elseok
+ end
+}
+assert_equal %q{ok}, %q{
+ case 'test'
+ when /testx/
+ :ng1
+ when /test/
+ :ok
+ when /tetxx/
+ :ng2
+ else
+ :ng_else
+ end
+}
+assert_equal %q{ok}, %q{
+ case Object.new
+ when Object
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ case Object
+ when Object.new
+ :ng
+ else
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ case 'test'
+ when 'tes'
+ :ng
+ when 'te'
+ :ng
+ else
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ case 'test'
+ when 'tes'
+ :ng
+ when 'te'
+ :ng
+ when 'test'
+ :ok
+ end
+}
+assert_equal %q{ng}, %q{
+ case 'test'
+ when 'tes'
+ :ng
+ when /te/
+ :ng
+ else
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ case 'test'
+ when 'tes'
+ :ng
+ when /test/
+ :ok
+ else
+ :ng
+ end
+}
+assert_equal %q{100}, %q{
+ def test(arg)
+ case 1
+ when 2
+ 3
+ end
+ return arg
+ end
+
+ test(100)
+}
+assert_equal %q{ok}, %q{
+ ary = [1, 2]
+ case 1
+ when *ary
+ :ok
+ else
+ :ng
+ end
+}
+assert_equal %q{ok}, %q{
+ ary = [1, 2]
+ case 3
+ when *ary
+ :ng
+ else
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ ary = [1, 2]
+ case 1
+ when :x, *ary
+ :ok
+ when :z
+ :ng1
+ else
+ :ng2
+ end
+}
+assert_equal %q{ok}, %q{
+ ary = [1, 2]
+ case 3
+ when :x, *ary
+ :ng1
+ when :z
+ :ng2
+ else
+ :ok
+ end
+}
+assert_equal %q{[:false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep]}, %q{
+
+ def make_perm ary, num
+ if num == 1
+ ary.map{|e| [e]}
+ else
+ base = make_perm(ary, num-1)
+ res = []
+ base.each{|b|
+ ary.each{|e|
+ res << [e] + b
+ }
+ }
+ res
+ end
+ end
+
+ def each_test
+ conds = make_perm(['fv', 'tv'], 3)
+ bangs = make_perm(['', '!'], 3)
+ exprs = make_perm(['and', 'or'], 3)
+ ['if', 'unless'].each{|syn|
+ conds.each{|cs|
+ bangs.each{|bs|
+ exprs.each{|es|
+ yield(syn, cs, bs, es)
+ }
+ }
+ }
+ }
+ end
+
+ fv = false
+ tv = true
+
+ $ans = []
+ each_test{|syn, conds, bangs, exprs|
+ c1, c2, c3 = conds
+ bang1, bang2, bang3 = bangs
+ e1, e2 = exprs
+ eval %Q{
+ #{syn} #{bang1}#{c1} #{e1} #{bang2}#{c2} #{e2} #{bang3}#{c3}
+ $ans << :then
+ else
+ $ans << :false
+ end
+ }
+ }
+
+ each_test{|syn, conds, bangs, exprs|
+ c1, c2, c3 = conds
+ bang1, bang2, bang3 = bangs
+ e1, e2 = exprs
+ eval %Q{
+ #{syn} #{bang1}#{c1} #{e1} #{bang2}#{c2} #{e2} #{bang3}#{c3}
+ $ans << :then
+ end
+ $ans << :sep
+ }
+ }
+ $ans
+}
+assert_equal %q{}, %q{
+ defined?(m)
+}
+assert_equal %q{method}, %q{
+ def m
+ end
+ defined?(m)
+}
+assert_equal %q{}, %q{
+ defined?(a.class)
+}
+assert_equal %q{method}, %q{
+ a = 1
+ defined?(a.class)
+}
+assert_equal %q{["method", "method", "method", "method", nil, nil, "method", "method", "method", nil]}, %q{
+ class C
+ def test
+ [defined?(m1()), defined?(self.m1), defined?(C.new.m1),
+ defined?(m2()), defined?(self.m2), defined?(C.new.m2),
+ defined?(m3()), defined?(self.m3), defined?(C.new.m3)]
+ end
+ def m1
+ end
+ private
+ def m2
+ end
+ protected
+ def m3
+ end
+ end
+ C.new.test + [defined?(C.new.m3)]
+}
+assert_equal %q{[nil, nil, nil, nil, "global-variable", "global-variable", nil, nil]}, %q{
+ $ans = [defined?($1), defined?($2), defined?($3), defined?($4)]
+ /(a)(b)/ =~ 'ab'
+ $ans + [defined?($1), defined?($2), defined?($3), defined?($4)]
+}
+assert_equal %q{nilselftruefalse}, %q{
+ defined?(nil) + defined?(self) +
+ defined?(true) + defined?(false)
+}
+assert_equal %q{}, %q{
+ defined?(@a)
+}
+assert_equal %q{instance-variable}, %q{
+ @a = 1
+ defined?(@a)
+}
+assert_equal %q{}, %q{
+ defined?(@@a)
+}
+assert_equal %q{class variable}, %q{
+ @@a = 1
+ defined?(@@a)
+}
+assert_equal %q{}, %q{
+ defined?($a)
+}
+assert_equal %q{global-variable}, %q{
+ $a = 1
+ defined?($a)
+}
+assert_equal %q{}, %q{
+ defined?(C_definedtest)
+}
+assert_equal %q{constant}, %q{
+ C_definedtest = 1
+ defined?(C_definedtest)
+}
+assert_equal %q{}, %q{
+ defined?(::C_definedtest)
+}
+assert_equal %q{constant}, %q{
+ C_definedtest = 1
+ defined?(::C_definedtest)
+}
+assert_equal %q{}, %q{
+ defined?(C_definedtestA::C_definedtestB::C_definedtestC)
+}
+assert_equal %q{constant}, %q{
+ class C_definedtestA
+ class C_definedtestB
+ C_definedtestC = 1
+ end
+ end
+ defined?(C_definedtestA::C_definedtestB::C_definedtestC)
+}
+assert_equal %q{30}, %q{
+ sum = 0
+ 30.times{|ib|
+ if ib % 10 == 0 .. true
+ sum += ib
+ end
+ }
+ sum
+}
+assert_equal %q{63}, %q{
+ sum = 0
+ 30.times{|ib|
+ if ib % 10 == 0 ... true
+ sum += ib
+ end
+ }
+ sum
+}
+assert_equal %q{[["NUM", "Type: NUM\n"], ["NUM", "123\n"], ["NUM", "456\n"], ["NUM", "Type: ARP\n"], ["NUM", "aaa\n"], ["NUM", "bbb\n"], ["NUM", "\f\n"], ["ARP", "Type: ARP\n"], ["ARP", "aaa\n"], ["ARP", "bbb\n"]]}, %q{
+ t = nil
+ unless ''.respond_to? :lines
+ class String
+ def lines
+ self
+ end
+ end
+ end
+ ary = []
+"this must not print
+Type: NUM
+123
+456
+Type: ARP
+aaa
+bbb
+\f
+this must not print
+hoge
+Type: ARP
+aaa
+bbb
+".lines.each{|l|
+ if (t = l[/^Type: (.*)/, 1])..(/^\f/ =~ l)
+ ary << [t, l]
+ end
+ }
+ ary
+}
+assert_equal %q{1}, %q{if true then 1 ; end}
+assert_equal %q{}, %q{if false then 1 ; end}
+assert_equal %q{1}, %q{if true then 1 ; else; 2; end}
+assert_equal %q{2}, %q{if false then 1 ; else; 2; end}
+assert_equal %q{}, %q{if true then ; elsif true then ; 1 ; end}
+assert_equal %q{1}, %q{if false then ; elsif true then ; 1 ; end}
+assert_equal %q{}, %q{unless true then 1 ; end}
+assert_equal %q{1}, %q{unless false then 1 ; end}
+assert_equal %q{2}, %q{unless true then 1 ; else; 2; end}
+assert_equal %q{1}, %q{unless false then 1 ; else; 2; end}
+assert_equal %q{1}, %q{1 if true}
+assert_equal %q{}, %q{1 if false}
+assert_equal %q{}, %q{1 if nil}
+assert_equal %q{}, %q{1 unless true}
+assert_equal %q{1}, %q{1 unless false}
+assert_equal %q{1}, %q{1 unless nil}
+assert_equal %q{1}, %q{1 || 2 || 3 || 4}
+assert_equal %q{1}, %q{1 || false || 3 || 4}
+assert_equal %q{2}, %q{nil || 2 || 3 || 4}
+assert_equal %q{2}, %q{false || 2 || 3 || 4}
+assert_equal %q{false}, %q{nil || false || nil || false}
+assert_equal %q{1}, %q{1 or 2 or 3 or 4}
+assert_equal %q{1}, %q{1 or false or 3 or 4}
+assert_equal %q{2}, %q{nil or 2 or 3 or 4}
+assert_equal %q{2}, %q{false or 2 or 3 or 4}
+assert_equal %q{false}, %q{nil or false or nil or false}
+assert_equal %q{elseng}, %q{
+ case
+ when 1==2, 2==3
+ :ng1
+ when false, 4==5
+ :ok
+ when false
+ :ng2
+ else
+ :elseng
+ end
+}
+assert_equal %q{ok}, %q{
+ case
+ when nil, nil
+ :ng1
+ when 1,2,3
+ :ok
+ when false, false
+ :ng2
+ else
+ :elseng
+ end
+}
+assert_equal %q{elseok}, %q{
+ case
+ when nil
+ :ng1
+ when false
+ :ng2
+ else
+ :elseok
+ end}
+assert_equal %q{}, %q{
+ case
+ when 1
+ end
+}
+assert_equal %q{ok}, %q{
+ r = nil
+ ary = []
+ case
+ when false
+ r = :ng1
+ when false, false
+ r = :ng2
+ when *ary
+ r = :ng3
+ when false, *ary
+ r = :ng4
+ when true, *ary
+ r = :ok
+ end
+ r
+}
+assert_equal %q{ok}, %q{
+ ary = []
+ case
+ when false, *ary
+ :ng
+ else
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ ary = [false, nil]
+ case
+ when *ary
+ :ng
+ else
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ ary = [false, nil]
+ case
+ when *ary
+ :ng
+ when true
+ :ok
+ else
+ :ng2
+ end
+}
+assert_equal %q{ng}, %q{
+ ary = [false, nil]
+ case
+ when *ary
+ :ok
+ else
+ :ng
+ end
+}
+assert_equal %q{ok}, %q{
+ ary = [false, true]
+ case
+ when *ary
+ :ok
+ else
+ :ng
+ end
+}
+assert_equal %q{ok}, %q{
+ ary = [false, true]
+ case
+ when false, false
+ when false, *ary
+ :ok
+ else
+ :ng
+ end
+}
+assert_equal %q{}, %q{
+ i = 0
+ while i < 10
+ i+=1
+ end}
+assert_equal %q{10}, %q{
+ i = 0
+ while i < 10
+ i+=1
+ end; i}
+assert_equal %q{}, %q{
+ i = 0
+ until i > 10
+ i+=1
+ end}
+assert_equal %q{11}, %q{
+ i = 0
+ until i > 10
+ i+=1
+ end; i}
+assert_equal %q{1}, %q{
+ i = 0
+ begin
+ i+=1
+ end while false
+ i
+}
+assert_equal %q{1}, %q{
+ i = 0
+ begin
+ i+=1
+ end until true
+ i
+}
+def assert_syntax_error expected, code, message = ''
+ assert_equal "#{expected}",
+ "begin eval(%q{#{code}}, nil, '', 0)"'; rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end', message
+end
+assert_syntax_error "unterminated string meets end of file", '().."', '[ruby-dev:29732]'
+assert_equal %q{[]}, %q{$&;[]}, '[ruby-dev:31068]'
+assert_syntax_error "syntax error, unexpected *, expecting '}'", %q{{*0}}, '[ruby-dev:31072]'
+assert_syntax_error "`@0' is not allowed as an instance variable name", %q{@0..0}, '[ruby-dev:31095]'
+assert_syntax_error "identifier $00 is not valid to get", %q{$00..0}, '[ruby-dev:31100]'
+assert_syntax_error "identifier $00 is not valid to set", %q{0..$00=1}
+assert_equal %q{0}, %q{[*0];0}, '[ruby-dev:31102]'
+assert_syntax_error "syntax error, unexpected ')'", %q{v0,(*,v1,) = 0}, '[ruby-dev:31104]'
+assert_equal %q{1}, %q{
+ class << (ary=[]); def []; 0; end; def []=(x); super(0,x);end;end; ary[]+=1
+}, '[ruby-dev:31110]'
+assert_syntax_error "Can't set variable $1", %q{0..$1=1}, '[ruby-dev:31118]'
+assert_valid_syntax %q{1.times{1+(1&&next)}}, '[ruby-dev:31119]'
+assert_valid_syntax %q{x=-1;loop{x+=1&&redo if (x+=1).zero?}}, '[ruby-dev:31119]'
+assert_syntax_error %q{syntax error, unexpected end-of-input}, %q{!}, '[ruby-dev:31243]'
+assert_equal %q{[nil]}, %q{[()]}, '[ruby-dev:31252]'
+assert_equal %q{true}, %q{!_=()}, '[ruby-dev:31263]'
+assert_equal 'ok', %q{while true; redo; end if 1 == 2; :ok}, '[ruby-dev:31360]'
+assert_equal 'ok', %q{
+ 1.times {
+ begin
+ ensure
+ next
+ end
+ }; :ok
+}, '[ruby-dev:31373]'
+assert_equal 'ok', %q{
+ flag = false
+ 1.times {
+ next if flag
+ flag = true
+ begin
+ ensure
+ redo
+ end
+ }; :ok
+}, '[ruby-dev:31373]'
+
+assert_equal 'ok', %q{
+ 1.times{
+ p(1, (next; 2))
+ }; :ok
+}
+assert_equal '3', %q{
+ i = 0
+ 1 + (while true
+ break 2 if (i+=1) > 1
+ next
+ end)
+}
+assert_equal '3', %q{
+ i = 0
+ 1 + (while true
+ break 2 if (i+=1) > 1
+ p(1, (next; 2))
+ end)
+}
+# redo
+assert_equal 'ok', %q{
+ i = 0
+ 1.times{
+ break if i>1
+ i+=1
+ p(1, (redo; 2))
+ }; :ok
+}
+assert_equal '3', %q{
+ i = 0
+ 1 + (while true
+ break 2 if (i+=1) > 1
+ redo
+ end)
+}
+assert_equal '3', %q{
+ i = 0
+ 1 + (while true
+ break 2 if (i+=1) > 1
+ p(1, (redo; 2))
+ end)
+}
+assert_equal '1', %q{
+ a = [0]
+ a[*a]+=1
+}
+assert_equal '2', %q{
+ ary = [0]
+ case 1
+ when *ary, 1
+ 1
+ end +
+ case
+ when *ary
+ 1
+ end
+}
+
+assert_match /invalid multibyte char/, %q{
+ STDERR.reopen(STDOUT)
+ eval("\"\xf0".force_encoding("utf-8"))
+}, '[ruby-dev:32429]'
+
+# method ! and !=
+assert_equal 'true', %q{!false}
+assert_equal 'true', %q{1 == 1}
+assert_equal 'true', %q{1 != 2}
+assert_equal 'true', %q{
+ class C; def !=(obj); true; end; end
+ C.new != 1
+}
+assert_equal 'true', %q{
+ class C; def !@; true; end; end
+ !C.new
+}
+assert_normal_exit %q{
+ eval "while true; return; end rescue p $!"
+}, '[ruby-dev:31663]'
+assert_equal '1', %q{
+ def bar
+ raise
+ end
+
+ def foo
+ 1.times{
+ begin
+ return bar
+ rescue
+ :ok
+ end
+ }
+ end
+
+ foo
+}
+
+assert_equal 'ok', %q{
+ counter = 2
+ while true
+ counter -= 1
+ next if counter != 0
+ break
+ end
+ :ok
+}, '[ruby-core:14385]'
+
+assert_equal 'ok', %q{
+ counter = 2
+ while true
+ counter -= 1
+ next if counter != 0
+ break :ok
+ end # direct
+}, '[ruby-core:14385]'
+
+assert_equal 'ok', %q{
+ counter = 2
+ while true
+ counter -= 1
+ break if counter == 0
+ "#{next}"
+ end
+ :ok
+}, 'reported by Yusuke ENDOH'
+
+assert_equal 'ok', %q{
+ counter = 2
+ while true
+ counter -= 1
+ break if counter == 0
+ next
+ redo
+ end
+ :ok
+}, 'reported by Yusuke ENDOH'
+
+assert_equal 'ok', %q{
+ counter = 2
+ while true
+ counter -= 1
+ break if counter == 0
+ next
+ "#{ redo }"
+ end
+ :ok
+}, 'reported by Yusuke ENDOH'
+
+assert_normal_exit %q{
+ begin
+ raise
+ rescue
+ counter = 2
+ while true
+ counter -= 1
+ break if counter == 0
+ next
+ retry
+ end
+ end
+}, 'reported by Yusuke ENDOH'
+
+assert_normal_exit %q{
+ counter = 2
+ while true
+ counter -= 1
+ break if counter == 0
+ next
+ "#{ break }"
+ end
+}, 'reported by Yusuke ENDOH'
+
+assert_normal_exit %q{
+ counter = 2
+ while true
+ counter -= 1
+ next if counter != 0
+ "#{ break }"
+ end
+}, 'reported by Yusuke ENDOH'
+
+assert_equal 'ok', %q{
+ 1.times do
+ [
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ begin
+ false ? next : p
+ break while true
+ end
+ ]
+ end
+ :ok
+}, '[ruby-dev:32882]'
+
+assert_equal "1\n2\n", %q{
+ i = 0
+ while i<2
+ i += 1
+ next p(i)
+ end
+}
+
+assert_valid_syntax('1.times {|i|print (42),1;}', '[ruby-list:44479]')
+
+assert_equal 'ok', %q{
+ def a() end
+ begin
+ if defined?(a(1).a)
+ :ng
+ else
+ :ok
+ end
+ rescue
+ :ng
+ end
+}, '[ruby-core:16010]'
+
+assert_equal 'ok', %q{
+ def a() end
+ begin
+ if defined?(a::B)
+ :ng
+ else
+ :ok
+ end
+ rescue
+ :ng
+ end
+}, '[ruby-core:16010]'
+
+assert_normal_exit %q{
+ defined? C && 0
+}
+
+assert_normal_exit %q{
+ class C
+ def m
+ defined?(super())
+ end
+ end
+ C.new.m
+}
+
+assert_equal 'ok', %q{
+ class X < RuntimeError;end
+ x = [X]
+ begin
+ raise X
+ rescue *x
+ :ok
+ end
+}, '[ruby-core:14537]'
+
+assert_equal 'ok', %q{
+ a = [false]
+ (a[0] &&= true) == false ? :ok : :ng
+}, '[ruby-dev:34679]'
+
+assert_normal_exit %q{
+ a = []
+ 100.times {|i| a << i << nil << nil }
+ p a.compact!
+}
+
+assert_equal 'ok', %q{
+ "#{}""#{}ok"
+}, '[ruby-dev:38968]'
+
+
+assert_equal 'ok', %q{
+ "o" "#{}k"
+}, '[ruby-dev:38980]'
+
+bug2415 = '[ruby-core:26961]'
+assert_normal_exit %q{
+ 0.times do
+ 0.times do
+ def x(a=1, b, *rest); nil end
+ end
+ end
+}, bug2415
+
+assert_normal_exit %q{
+ 0.times do
+ 0.times do
+ def x@; nil end
+ end
+ end
+}, bug2415
+
+assert_normal_exit %q{
+ 0.times do
+ 0.times do
+ def x(a = 0.times do
+ def y(a=1, b, *rest); nil; end
+ end)
+ nil
+ end
+ end
+ end
+}, bug2415
+
+assert_normal_exit %q{
+ 0.times do
+ 0.times do
+ def x(a = 0.times do
+ def x@; nil; end
+ end)
+ nil
+ end
+ end
+ end
+}, bug2415
+
+assert_normal_exit %q{
+ a {
+ b {|c.d| }
+ e
+ }
+}, '[ruby-dev:39861]'
+
+bug1240 = '[ruby-core:22637]'
+assert_valid_syntax('x y { "#{}".z { } }', bug1240)
+assert_valid_syntax('x y { "#{}".z do end }', bug1240)
+
+assert_valid_syntax('y "#{a 1}" do end', '[ruby-core:29579]')
+assert_normal_exit %q{
+ def foo(&block)
+ yield
+ end
+
+ foo do
+ s = defined?(raise + 1)
+ Class
+ end
+}, '[ruby-core:30293]'
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb
new file mode 100644
index 0000000000..121def8b42
--- /dev/null
+++ b/bootstraptest/test_thread.rb
@@ -0,0 +1,456 @@
+# Thread and Fiber
+
+assert_equal %q{ok}, %q{
+ Thread.new{
+ }.join
+ :ok
+}
+assert_equal %q{ok}, %q{
+ Thread.new{
+ :ok
+ }.value
+}
+assert_equal %q{20100}, %q{
+ v = 0
+ (1..200).map{|i|
+ Thread.new{
+ i
+ }
+ }.each{|t|
+ v += t.value
+ }
+ v
+}
+assert_equal %q{5000}, %q{
+ 5000.times{|e|
+ (1..2).map{
+ Thread.new{
+ }
+ }.each{|e|
+ e.join()
+ }
+ }
+}
+assert_equal %q{5000}, %q{
+ 5000.times{|e|
+ (1..2).map{
+ Thread.new{
+ }
+ }.each{|e|
+ e.join(1000000000)
+ }
+ }
+}
+assert_equal %q{5000}, %q{
+ 5000.times{
+ t = Thread.new{}
+ while t.alive?
+ Thread.pass
+ end
+ }
+}
+assert_equal %q{100}, %q{
+ 100.times{
+ Thread.new{loop{Thread.pass}}
+ }
+}
+assert_equal %q{ok}, %q{
+ Thread.new{
+ :ok
+ }.join.value
+}
+assert_equal %q{ok}, %q{
+ begin
+ Thread.new{
+ raise "ok"
+ }.join
+ rescue => e
+ e
+ end
+}
+assert_equal %q{ok}, %q{
+ ans = nil
+ t = Thread.new{
+ begin
+ sleep 0.5
+ ensure
+ ans = :ok
+ end
+ }
+ Thread.pass
+ t.kill
+ t.join
+ ans
+}
+assert_equal %q{ok}, %q{
+ t = Thread.new{
+ sleep
+ }
+ sleep 0.1
+ t.raise
+ begin
+ t.join
+ :ng
+ rescue
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ t = Thread.new{
+ loop{}
+ }
+ Thread.pass
+ t.raise
+ begin
+ t.join
+ :ng
+ rescue
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ t = Thread.new{
+ }
+ Thread.pass
+ t.join
+ t.raise # raise to exited thread
+ begin
+ t.join
+ :ok
+ rescue
+ :ng
+ end
+}
+assert_equal %q{run}, %q{
+ t = Thread.new{
+ loop{}
+ }
+ st = t.status
+ t.kill
+ st
+}
+assert_equal %q{sleep}, %q{
+ t = Thread.new{
+ sleep
+ }
+ sleep 0.1
+ st = t.status
+ t.kill
+ st
+}
+assert_equal %q{false}, %q{
+ t = Thread.new{
+ }
+ t.kill
+ sleep 0.1
+ t.status
+}
+assert_equal %q{[ThreadGroup, true]}, %q{
+ ptg = Thread.current.group
+ Thread.new{
+ ctg = Thread.current.group
+ [ctg.class, ctg == ptg]
+ }.value
+}
+assert_equal %q{[1, 1]}, %q{
+ thg = ThreadGroup.new
+
+ t = Thread.new{
+ thg.add Thread.current
+ sleep
+ }
+ sleep 0.1
+ [thg.list.size, ThreadGroup::Default.list.size]
+}
+assert_equal %q{true}, %q{
+ thg = ThreadGroup.new
+
+ t = Thread.new{sleep 5}
+ thg.add t
+ thg.list.include?(t)
+}
+assert_equal %q{[true, nil, true]}, %q{
+ /a/ =~ 'a'
+ $a = $~
+ Thread.new{
+ $b = $~
+ /b/ =~ 'b'
+ $c = $~
+ }.join
+ $d = $~
+ [$a == $d, $b, $c != $d]
+}
+assert_equal %q{11}, %q{
+ Thread.current[:a] = 1
+ Thread.new{
+ Thread.current[:a] = 10
+ Thread.pass
+ Thread.current[:a]
+ }.value + Thread.current[:a]
+}
+assert_normal_exit %q{
+ begin
+ 100.times do |i|
+ begin
+ th = Thread.start(Thread.current) {|u| u.raise }
+ raise
+ rescue
+ ensure
+ th.join
+ end
+ end
+ rescue
+ end
+}, '[ruby-dev:31371]'
+
+assert_equal 'true', %{
+ t = Thread.new { loop {} }
+ begin
+ pid = fork {
+ exit t.status != "run"
+ }
+ Process.wait pid
+ $?.success?
+ rescue NotImplementedError
+ true
+ end
+}
+
+assert_equal 'ok', %{
+ open("zzz.rb", "w") do |f|
+ f.puts <<-END
+ begin
+ Thread.new { fork { GC.start } }.join
+ pid, status = Process.wait2
+ $result = status.success? ? :ok : :ng
+ rescue NotImplementedError
+ $result = :ok
+ end
+ END
+ end
+ require "./zzz.rb"
+ $result
+}
+
+assert_finish 3, %{
+ th = Thread.new {sleep 2}
+ th.join(1)
+ th.join
+}
+
+assert_finish 3, %{
+ require 'timeout'
+ th = Thread.new {sleep 2}
+ begin
+ Timeout.timeout(1) {th.join}
+ rescue Timeout::Error
+ end
+ th.join
+}
+
+assert_normal_exit %q{
+ STDERR.reopen(STDOUT)
+ exec "/"
+}
+
+assert_normal_exit %q{
+ (0..10).map {
+ Thread.new {
+ 10000.times {
+ Object.new.to_s
+ }
+ }
+ }.each {|t|
+ t.join
+ }
+}
+
+assert_equal 'ok', %q{
+ def m
+ t = Thread.new { while true; // =~ "" end }
+ sleep 0.1
+ 10.times {
+ if /((ab)*(ab)*)*(b)/ =~ "ab"*7
+ return :ng if !$4
+ return :ng if $~.size != 5
+ end
+ }
+ :ok
+ ensure
+ Thread.kill t
+ end
+ m
+}, '[ruby-dev:34492]'
+
+assert_normal_exit %q{
+ at_exit { Fiber.new{}.resume }
+}
+
+assert_normal_exit %q{
+ g = enum_for(:local_variables)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ g = enum_for(:block_given?)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ g = enum_for(:binding)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ g = "abc".enum_for(:scan, /./)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ g = Module.enum_for(:new)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ Fiber.new(&Object.method(:class_eval)).resume("foo")
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ Thread.new("foo", &Object.method(:class_eval)).join
+}, '[ruby-dev:34128]'
+
+assert_equal 'ok', %q{
+ begin
+ Thread.new { Thread.stop }
+ Thread.stop
+ :ng
+ rescue Exception
+ :ok
+ end
+}
+
+assert_equal 'ok', %q{
+ begin
+ m1, m2 = Mutex.new, Mutex.new
+ Thread.new { m1.lock; sleep 1; m2.lock }
+ m2.lock; sleep 1; m1.lock
+ :ng
+ rescue Exception
+ :ok
+ end
+}
+
+assert_equal 'ok', %q{
+ m = Mutex.new
+ Thread.new { m.lock }; sleep 1; m.lock
+ :ok
+}
+
+assert_equal 'ok', %q{
+ m = Mutex.new
+ Thread.new { m.lock }; m.lock
+ :ok
+}
+
+assert_equal 'ok', %q{
+ m = Mutex.new
+ Thread.new { m.lock }.join; m.lock
+ :ok
+}
+
+assert_equal 'ok', %q{
+ m = Mutex.new
+ Thread.new { m.lock; sleep 2 }
+ sleep 1; m.lock
+ :ok
+}
+
+assert_equal 'ok', %q{
+ m = Mutex.new
+ Thread.new { m.lock; sleep 2; m.unlock }
+ sleep 1; m.lock
+ :ok
+}
+
+assert_equal 'ok', %q{
+ t = Thread.new {`echo`}
+ t.join
+ $? ? :ng : :ok
+}, '[ruby-dev:35414]'
+
+assert_equal 'ok', %q{
+ begin
+ 100.times{
+ (1..100).map{ Thread.new(true) {|x| x == false } }.each{|th| th.join}
+ }
+ rescue NoMemoryError, StandardError
+ end
+ :ok
+}
+
+assert_equal 'ok', %{
+ open("zzz.rb", "w") do |f|
+ f.puts <<-END
+ begin
+ m = Mutex.new
+ Thread.new { m.lock; sleep 1 }
+ sleep 0.3
+ parent = Thread.current
+ Thread.new do
+ sleep 0.3
+ begin
+ fork { GC.start }
+ rescue Exception
+ parent.raise $!
+ end
+ end
+ m.lock
+ pid, status = Process.wait2
+ $result = status.success? ? :ok : :ng
+ rescue NotImplementedError
+ $result = :ok
+ end
+ END
+ end
+ require "./zzz.rb"
+ $result
+}
+
+assert_finish 3, %q{
+ require 'thread'
+
+ lock = Mutex.new
+ cond = ConditionVariable.new
+ t = Thread.new do
+ lock.synchronize do
+ cond.wait(lock)
+ end
+ end
+
+ begin
+ pid = fork do
+ # Child
+ STDOUT.write "This is the child process.\n"
+ STDOUT.write "Child process exiting.\n"
+ end
+ Process.waitpid(pid)
+ rescue NotImplementedError
+ end
+}, '[ruby-core:23572]'
+
+assert_equal 'ok', %q{
+ begin
+ Process.waitpid2(fork {sleep 1})[1].success? ? 'ok' : 'ng'
+ rescue NotImplementedError
+ 'ok'
+ end
+}
+
+assert_equal 'foo', %q{
+ f = proc {|s| /#{ sleep 1; s }/o }
+ [ Thread.new { f.call("foo"); nil },
+ Thread.new { sleep 0.5; f.call("bar"); nil },
+ ].each {|t| t.join }
+ GC.start
+ f.call.source
+}
diff --git a/class.c b/class.c
index 9e41b1e260..36e7b76caf 100644
--- a/class.c
+++ b/class.c
@@ -2,107 +2,249 @@
class.c -
- $Author: nobu $
- $Date: 2005/09/28 14:42:46 $
+ $Author$
created at: Tue Aug 10 15:05:44 JST 1993
- Copyright (C) 1993-2003 Yukihiro Matsumoto
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby.h"
-#include "rubysig.h"
-#include "node.h"
-#include "st.h"
+/*!
+ * \defgroup class Classes and their hierarchy.
+ * \par Terminology
+ * - class: same as in Ruby.
+ * - singleton class: class for a particular object
+ * - eigenclass: = singleton class
+ * - metaclass: class of a class. metaclass is a kind of singleton class.
+ * - metametaclass: class of a metaclass.
+ * - meta^(n)-class: class of a meta^(n-1)-class.
+ * - attached object: A singleton class knows its unique instance.
+ * The instance is called the attached object for the singleton class.
+ * \{
+ */
+
+#include "ruby/ruby.h"
+#include "ruby/st.h"
+#include "method.h"
+#include "constant.h"
+#include "vm_core.h"
+#include "internal.h"
#include <ctype.h>
extern st_table *rb_class_tbl;
+static ID id_attached;
+
+/**
+ * Allocates a struct RClass for a new class.
+ *
+ * \param flags initial value for basic.flags of the returned class.
+ * \param klass the class of the returned class.
+ * \return an uninitialized Class object.
+ * \pre \p klass must refer \c Class class or an ancestor of Class.
+ * \pre \code (flags | T_CLASS) != 0 \endcode
+ * \post the returned class can safely be \c #initialize 'd.
+ *
+ * \note this function is not Class#allocate.
+ */
+static VALUE
+class_alloc(VALUE flags, VALUE klass)
+{
+ NEWOBJ_OF(obj, struct RClass, klass, flags);
+ obj->ptr = ALLOC(rb_classext_t);
+ RCLASS_IV_TBL(obj) = 0;
+ RCLASS_CONST_TBL(obj) = 0;
+ RCLASS_M_TBL(obj) = 0;
+ RCLASS_SUPER(obj) = 0;
+ RCLASS_ORIGIN(obj) = (VALUE)obj;
+ RCLASS_IV_INDEX_TBL(obj) = 0;
+ RCLASS_REFINED_CLASS(obj) = Qnil;
+ RCLASS_EXT(obj)->allocator = 0;
+ return (VALUE)obj;
+}
+
+/*!
+ * A utility function that wraps class_alloc.
+ *
+ * allocates a class and initializes safely.
+ * \param super a class from which the new class derives.
+ * \return a class object.
+ * \pre \a super must be a class.
+ * \post the metaclass of the new class is Class.
+ */
VALUE
-rb_class_boot(super)
- VALUE super;
+rb_class_boot(VALUE super)
{
- NEWOBJ(klass, struct RClass);
- OBJSETUP(klass, rb_cClass, T_CLASS);
+ VALUE klass = class_alloc(T_CLASS, rb_cClass);
- klass->super = super;
- klass->iv_tbl = 0;
- klass->m_tbl = 0; /* safe GC */
- klass->m_tbl = st_init_numtable();
+ RCLASS_SUPER(klass) = super;
+ RCLASS_M_TBL(klass) = st_init_numtable();
OBJ_INFECT(klass, super);
return (VALUE)klass;
}
-VALUE
-rb_class_new(super)
- VALUE super;
+
+/*!
+ * Ensures a class can be derived from super.
+ *
+ * \param super a reference to an object.
+ * \exception TypeError if \a super is not a Class or \a super is a singleton class.
+ */
+void
+rb_check_inheritable(VALUE super)
{
- Check_Type(super, T_CLASS);
+ if (!RB_TYPE_P(super, T_CLASS)) {
+ rb_raise(rb_eTypeError, "superclass must be a Class (%s given)",
+ rb_obj_classname(super));
+ }
+ if (RBASIC(super)->flags & FL_SINGLETON) {
+ rb_raise(rb_eTypeError, "can't make subclass of singleton class");
+ }
if (super == rb_cClass) {
rb_raise(rb_eTypeError, "can't make subclass of Class");
}
- if (FL_TEST(super, FL_SINGLETON)) {
- rb_raise(rb_eTypeError, "can't make subclass of virtual class");
- }
+}
+
+
+/*!
+ * Creates a new class.
+ * \param super a class from which the new class derives.
+ * \exception TypeError \a super is not inheritable.
+ * \exception TypeError \a super is the Class class.
+ */
+VALUE
+rb_class_new(VALUE super)
+{
+ Check_Type(super, T_CLASS);
+ rb_check_inheritable(super);
return rb_class_boot(super);
}
+static NODE*
+rewrite_cref_stack(NODE *node, VALUE old_klass, VALUE new_klass)
+{
+ NODE *new_node;
+ if (!node) {
+ return NULL;
+ }
+ if (node->nd_clss == old_klass) {
+ new_node = NEW_CREF(new_klass);
+ new_node->nd_next = node->nd_next;
+ } else {
+ new_node = NEW_CREF(node->nd_clss);
+ new_node->nd_next = rewrite_cref_stack(node->nd_next, old_klass, new_klass);
+ }
+ return new_node;
+}
+
+static void
+clone_method(VALUE klass, ID mid, const rb_method_entry_t *me)
+{
+ VALUE newiseqval;
+ if (me->def && me->def->type == VM_METHOD_TYPE_ISEQ) {
+ rb_iseq_t *iseq;
+ newiseqval = rb_iseq_clone(me->def->body.iseq->self, klass);
+ GetISeqPtr(newiseqval, iseq);
+ iseq->cref_stack = rewrite_cref_stack(me->def->body.iseq->cref_stack, me->klass, klass);
+ rb_add_method(klass, mid, VM_METHOD_TYPE_ISEQ, iseq, me->flag);
+ RB_GC_GUARD(newiseqval);
+ }
+ else {
+ rb_method_entry_set(klass, mid, me, me->flag);
+ }
+}
+
static int
-clone_method(mid, body, tbl)
- ID mid;
- NODE *body;
- st_table *tbl;
+clone_method_i(st_data_t key, st_data_t value, st_data_t data)
{
- st_insert(tbl, mid, (st_data_t)NEW_METHOD(body->nd_body, body->nd_noex));
+ clone_method((VALUE)data, (ID)key, (const rb_method_entry_t *)value);
return ST_CONTINUE;
}
+static int
+clone_const(ID key, const rb_const_entry_t *ce, st_table *tbl)
+{
+ rb_const_entry_t *nce = ALLOC(rb_const_entry_t);
+ *nce = *ce;
+ st_insert(tbl, key, (st_data_t)nce);
+ return ST_CONTINUE;
+}
+
+static int
+clone_const_i(st_data_t key, st_data_t value, st_data_t data)
+{
+ return clone_const((ID)key, (const rb_const_entry_t *)value, (st_table *)data);
+}
+
+static void
+class_init_copy_check(VALUE clone, VALUE orig)
+{
+ if (orig == rb_cBasicObject) {
+ rb_raise(rb_eTypeError, "can't copy the root class");
+ }
+ if (RCLASS_SUPER(clone) != 0 || clone == rb_cBasicObject) {
+ rb_raise(rb_eTypeError, "already initialized class");
+ }
+ if (FL_TEST(orig, FL_SINGLETON)) {
+ rb_raise(rb_eTypeError, "can't copy singleton class");
+ }
+}
+
/* :nodoc: */
VALUE
-rb_mod_init_copy(clone, orig)
- VALUE clone, orig;
+rb_mod_init_copy(VALUE clone, VALUE orig)
{
+ if (RB_TYPE_P(clone, T_CLASS)) {
+ class_init_copy_check(clone, orig);
+ }
rb_obj_init_copy(clone, orig);
if (!FL_TEST(CLASS_OF(clone), FL_SINGLETON)) {
RBASIC(clone)->klass = rb_singleton_class_clone(orig);
+ rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);
}
- RCLASS(clone)->super = RCLASS(orig)->super;
- if (RCLASS(orig)->iv_tbl) {
- ID id;
+ RCLASS_SUPER(clone) = RCLASS_SUPER(orig);
+ RCLASS_EXT(clone)->allocator = RCLASS_EXT(orig)->allocator;
+ if (RCLASS_IV_TBL(orig)) {
+ st_data_t id;
- RCLASS(clone)->iv_tbl = st_copy(RCLASS(orig)->iv_tbl);
- id = rb_intern("__classpath__");
- st_delete(RCLASS(clone)->iv_tbl, (st_data_t*)&id, 0);
- id = rb_intern("__classid__");
- st_delete(RCLASS(clone)->iv_tbl, (st_data_t*)&id, 0);
+ if (RCLASS_IV_TBL(clone)) {
+ st_free_table(RCLASS_IV_TBL(clone));
+ }
+ RCLASS_IV_TBL(clone) = st_copy(RCLASS_IV_TBL(orig));
+ CONST_ID(id, "__tmp_classpath__");
+ st_delete(RCLASS_IV_TBL(clone), &id, 0);
+ CONST_ID(id, "__classpath__");
+ st_delete(RCLASS_IV_TBL(clone), &id, 0);
+ CONST_ID(id, "__classid__");
+ st_delete(RCLASS_IV_TBL(clone), &id, 0);
+ }
+ if (RCLASS_CONST_TBL(orig)) {
+ if (RCLASS_CONST_TBL(clone)) {
+ rb_free_const_table(RCLASS_CONST_TBL(clone));
+ }
+ RCLASS_CONST_TBL(clone) = st_init_numtable();
+ st_foreach(RCLASS_CONST_TBL(orig), clone_const_i, (st_data_t)RCLASS_CONST_TBL(clone));
}
- if (RCLASS(orig)->m_tbl) {
- RCLASS(clone)->m_tbl = st_init_numtable();
- st_foreach(RCLASS(orig)->m_tbl, clone_method,
- (st_data_t)RCLASS(clone)->m_tbl);
+ if (RCLASS_M_TBL(orig)) {
+ if (RCLASS_M_TBL(clone)) {
+ rb_free_m_table(RCLASS_M_TBL(clone));
+ }
+ RCLASS_M_TBL(clone) = st_init_numtable();
+ st_foreach(RCLASS_M_TBL(orig), clone_method_i, (st_data_t)clone);
}
return clone;
}
-/* :nodoc: */
VALUE
-rb_class_init_copy(clone, orig)
- VALUE clone, orig;
+rb_singleton_class_clone(VALUE obj)
{
- if (RCLASS(clone)->super != 0) {
- rb_raise(rb_eTypeError, "already initialized class");
- }
- if (FL_TEST(orig, FL_SINGLETON)) {
- rb_raise(rb_eTypeError, "can't copy singleton class");
- }
- return rb_mod_init_copy(clone, orig);
+ return rb_singleton_class_clone_and_attach(obj, Qundef);
}
VALUE
-rb_singleton_class_clone(obj)
- VALUE obj;
+rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
{
VALUE klass = RBASIC(obj)->klass;
@@ -110,71 +252,196 @@ rb_singleton_class_clone(obj)
return klass;
else {
/* copy singleton(unnamed) class */
- NEWOBJ(clone, struct RClass);
- OBJSETUP(clone, 0, RBASIC(klass)->flags);
+ VALUE clone = class_alloc(RBASIC(klass)->flags, 0);
if (BUILTIN_TYPE(obj) == T_CLASS) {
- RBASIC(clone)->klass = (VALUE)clone;
+ RBASIC(clone)->klass = clone;
}
else {
RBASIC(clone)->klass = rb_singleton_class_clone(klass);
}
- clone->super = RCLASS(klass)->super;
- clone->iv_tbl = 0;
- clone->m_tbl = 0;
- if (RCLASS(klass)->iv_tbl) {
- clone->iv_tbl = st_copy(RCLASS(klass)->iv_tbl);
+ RCLASS_SUPER(clone) = RCLASS_SUPER(klass);
+ RCLASS_EXT(clone)->allocator = RCLASS_EXT(klass)->allocator;
+ if (RCLASS_IV_TBL(klass)) {
+ RCLASS_IV_TBL(clone) = st_copy(RCLASS_IV_TBL(klass));
}
- clone->m_tbl = st_init_numtable();
- st_foreach(RCLASS(klass)->m_tbl, clone_method,
- (st_data_t)clone->m_tbl);
- rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);
+ if (RCLASS_CONST_TBL(klass)) {
+ RCLASS_CONST_TBL(clone) = st_init_numtable();
+ st_foreach(RCLASS_CONST_TBL(klass), clone_const_i, (st_data_t)RCLASS_CONST_TBL(clone));
+ }
+ if (attach != Qundef) {
+ rb_singleton_class_attached(clone, attach);
+ }
+ RCLASS_M_TBL(clone) = st_init_numtable();
+ st_foreach(RCLASS_M_TBL(klass), clone_method_i, (st_data_t)clone);
+ rb_singleton_class_attached(RBASIC(clone)->klass, clone);
FL_SET(clone, FL_SINGLETON);
- return (VALUE)clone;
+ return clone;
}
}
+/*!
+ * Attach a object to a singleton class.
+ * @pre \a klass is the singleton class of \a obj.
+ */
void
-rb_singleton_class_attached(klass, obj)
- VALUE klass, obj;
+rb_singleton_class_attached(VALUE klass, VALUE obj)
{
if (FL_TEST(klass, FL_SINGLETON)) {
- if (!RCLASS(klass)->iv_tbl) {
- RCLASS(klass)->iv_tbl = st_init_numtable();
+ if (!RCLASS_IV_TBL(klass)) {
+ RCLASS_IV_TBL(klass) = st_init_numtable();
}
- st_insert(RCLASS(klass)->iv_tbl, rb_intern("__attached__"), obj);
+ st_insert(RCLASS_IV_TBL(klass), id_attached, obj);
}
}
-VALUE
-rb_make_metaclass(obj, super)
- VALUE obj, super;
+
+
+#define METACLASS_OF(k) RBASIC(k)->klass
+
+/*!
+ * whether k is a meta^(n)-class of Class class
+ * @retval 1 if \a k is a meta^(n)-class of Class class (n >= 0)
+ * @retval 0 otherwise
+ */
+#define META_CLASS_OF_CLASS_CLASS_P(k) (METACLASS_OF(k) == (k))
+
+
+/*!
+ * ensures \a klass belongs to its own eigenclass.
+ * @return the eigenclass of \a klass
+ * @post \a klass belongs to the returned eigenclass.
+ * i.e. the attached object of the eigenclass is \a klass.
+ * @note this macro creates a new eigenclass if necessary.
+ */
+#define ENSURE_EIGENCLASS(klass) \
+ (rb_ivar_get(METACLASS_OF(klass), id_attached) == (klass) ? METACLASS_OF(klass) : make_metaclass(klass))
+
+
+/*!
+ * Creates a metaclass of \a klass
+ * \param klass a class
+ * \return created metaclass for the class
+ * \pre \a klass is a Class object
+ * \pre \a klass has no singleton class.
+ * \post the class of \a klass is the returned class.
+ * \post the returned class is meta^(n+1)-class when \a klass is a meta^(n)-klass for n >= 0
+ */
+static inline VALUE
+make_metaclass(VALUE klass)
+{
+ VALUE super;
+ VALUE metaclass = rb_class_boot(Qundef);
+
+ FL_SET(metaclass, FL_SINGLETON);
+ rb_singleton_class_attached(metaclass, klass);
+
+ if (META_CLASS_OF_CLASS_CLASS_P(klass)) {
+ METACLASS_OF(klass) = METACLASS_OF(metaclass) = metaclass;
+ }
+ else {
+ VALUE tmp = METACLASS_OF(klass); /* for a meta^(n)-class klass, tmp is meta^(n)-class of Class class */
+ METACLASS_OF(klass) = metaclass;
+ METACLASS_OF(metaclass) = ENSURE_EIGENCLASS(tmp);
+ }
+
+ super = RCLASS_SUPER(klass);
+ while (RB_TYPE_P(super, T_ICLASS)) super = RCLASS_SUPER(super);
+ RCLASS_SUPER(metaclass) = super ? ENSURE_EIGENCLASS(super) : rb_cClass;
+
+ OBJ_INFECT(metaclass, RCLASS_SUPER(metaclass));
+
+ return metaclass;
+}
+
+/*!
+ * Creates a singleton class for \a obj.
+ * \pre \a obj must not a immediate nor a special const.
+ * \pre \a obj must not a Class object.
+ * \pre \a obj has no singleton class.
+ */
+static inline VALUE
+make_singleton_class(VALUE obj)
{
- VALUE klass = rb_class_boot(super);
+ VALUE orig_class = RBASIC(obj)->klass;
+ VALUE klass = rb_class_boot(orig_class);
+
FL_SET(klass, FL_SINGLETON);
RBASIC(obj)->klass = klass;
rb_singleton_class_attached(klass, obj);
- if (BUILTIN_TYPE(obj) == T_CLASS && FL_TEST(obj, FL_SINGLETON)) {
- RBASIC(klass)->klass = klass;
- RCLASS(klass)->super = RBASIC(rb_class_real(RCLASS(obj)->super))->klass;
+
+ METACLASS_OF(klass) = METACLASS_OF(rb_class_real(orig_class));
+ return klass;
+}
+
+
+static VALUE
+boot_defclass(const char *name, VALUE super)
+{
+ extern st_table *rb_class_tbl;
+ VALUE obj = rb_class_boot(super);
+ ID id = rb_intern(name);
+
+ rb_name_class(obj, id);
+ st_add_direct(rb_class_tbl, id, obj);
+ rb_const_set((rb_cObject ? rb_cObject : obj), id, obj);
+ return obj;
+}
+
+void
+Init_class_hierarchy(void)
+{
+ id_attached = rb_intern("__attached__");
+
+ rb_cBasicObject = boot_defclass("BasicObject", 0);
+ rb_cObject = boot_defclass("Object", rb_cBasicObject);
+ rb_cModule = boot_defclass("Module", rb_cObject);
+ rb_cClass = boot_defclass("Class", rb_cModule);
+
+ rb_const_set(rb_cObject, rb_intern("BasicObject"), rb_cBasicObject);
+ RBASIC(rb_cClass)->klass
+ = RBASIC(rb_cModule)->klass
+ = RBASIC(rb_cObject)->klass
+ = RBASIC(rb_cBasicObject)->klass
+ = rb_cClass;
+}
+
+
+/*!
+ * \internal
+ * Creates a new *singleton class* for an object.
+ *
+ * \pre \a obj has no singleton class.
+ * \note DO NOT USE the function in an extension libraries. Use \ref rb_singleton_class.
+ * \param obj An object.
+ * \param unused ignored.
+ * \return The singleton class of the object.
+ */
+VALUE
+rb_make_metaclass(VALUE obj, VALUE unused)
+{
+ if (BUILTIN_TYPE(obj) == T_CLASS) {
+ return make_metaclass(obj);
}
else {
- VALUE metasuper = RBASIC(rb_class_real(super))->klass;
-
- /* metaclass of a superclass may be NULL at boot time */
- if (metasuper) {
- RBASIC(klass)->klass = metasuper;
- }
+ return make_singleton_class(obj);
}
-
- return klass;
}
+
+/*!
+ * Defines a new class.
+ * \param id ignored
+ * \param super A class from which the new class will derive. NULL means \c Object class.
+ * \return the created class
+ * \throw TypeError if super is not a \c Class object.
+ *
+ * \note the returned class will not be associated with \a id.
+ * You must explicitly set a class name if necessary.
+ */
VALUE
-rb_define_class_id(id, super)
- ID id;
- VALUE super;
+rb_define_class_id(ID id, VALUE super)
{
VALUE klass;
@@ -185,31 +452,43 @@ rb_define_class_id(id, super)
return klass;
}
-void
-rb_check_inheritable(super)
- VALUE super;
-{
- if (TYPE(super) != T_CLASS) {
- rb_raise(rb_eTypeError, "superclass must be a Class (%s given)",
- rb_obj_classname(super));
- }
- if (RBASIC(super)->flags & FL_SINGLETON) {
- rb_raise(rb_eTypeError, "can't make subclass of virtual class");
- }
-}
+/*!
+ * Calls Class#inherited.
+ * \param super A class which will be called #inherited.
+ * NULL means Object class.
+ * \param klass A Class object which derived from \a super
+ * \return the value \c Class#inherited's returns
+ * \pre Each of \a super and \a klass must be a \c Class object.
+ */
VALUE
-rb_class_inherited(super, klass)
- VALUE super, klass;
+rb_class_inherited(VALUE super, VALUE klass)
{
+ ID inherited;
if (!super) super = rb_cObject;
- return rb_funcall(super, rb_intern("inherited"), 1, klass);
+ CONST_ID(inherited, "inherited");
+ return rb_funcall(super, inherited, 1, klass);
}
+
+
+/*!
+ * Defines a top-level class.
+ * \param name name of the class
+ * \param super a class from which the new class will derive.
+ * NULL means \c Object class.
+ * \return the created class
+ * \throw TypeError if the constant name \a name is already taken but
+ * the constant is not a \c Class.
+ * \throw NameError if the class is already defined but the class can not
+ * be reopened because its superclass is not \a super.
+ * \post top-level constant named \a name refers the returned class.
+ *
+ * \note if a class named \a name is already defined and its superclass is
+ * \a super, the function just returns the defined class.
+ */
VALUE
-rb_define_class(name, super)
- const char *name;
- VALUE super;
+rb_define_class(const char *name, VALUE super)
{
VALUE klass;
ID id;
@@ -217,11 +496,11 @@ rb_define_class(name, super)
id = rb_intern(name);
if (rb_const_defined(rb_cObject, id)) {
klass = rb_const_get(rb_cObject, id);
- if (TYPE(klass) != T_CLASS) {
+ if (!RB_TYPE_P(klass, T_CLASS)) {
rb_raise(rb_eTypeError, "%s is not a class", name);
}
- if (rb_class_real(RCLASS(klass)->super) != super) {
- rb_name_error(id, "%s is already defined", name);
+ if (rb_class_real(RCLASS_SUPER(klass)) != super) {
+ rb_raise(rb_eTypeError, "superclass mismatch for class %s", name);
}
return klass;
}
@@ -237,55 +516,86 @@ rb_define_class(name, super)
return klass;
}
+
+/*!
+ * Defines a class under the namespace of \a outer.
+ * \param outer a class which contains the new class.
+ * \param name name of the new class
+ * \param super a class from which the new class will derive.
+ * NULL means \c Object class.
+ * \return the created class
+ * \throw TypeError if the constant name \a name is already taken but
+ * the constant is not a \c Class.
+ * \throw NameError if the class is already defined but the class can not
+ * be reopened because its superclass is not \a super.
+ * \post top-level constant named \a name refers the returned class.
+ *
+ * \note if a class named \a name is already defined and its superclass is
+ * \a super, the function just returns the defined class.
+ */
VALUE
-rb_define_class_under(outer, name, super)
- VALUE outer;
- const char *name;
- VALUE super;
+rb_define_class_under(VALUE outer, const char *name, VALUE super)
+{
+ return rb_define_class_id_under(outer, rb_intern(name), super);
+}
+
+
+/*!
+ * Defines a class under the namespace of \a outer.
+ * \param outer a class which contains the new class.
+ * \param id name of the new class
+ * \param super a class from which the new class will derive.
+ * NULL means \c Object class.
+ * \return the created class
+ * \throw TypeError if the constant name \a name is already taken but
+ * the constant is not a \c Class.
+ * \throw NameError if the class is already defined but the class can not
+ * be reopened because its superclass is not \a super.
+ * \post top-level constant named \a name refers the returned class.
+ *
+ * \note if a class named \a name is already defined and its superclass is
+ * \a super, the function just returns the defined class.
+ */
+VALUE
+rb_define_class_id_under(VALUE outer, ID id, VALUE super)
{
VALUE klass;
- ID id;
- id = rb_intern(name);
if (rb_const_defined_at(outer, id)) {
klass = rb_const_get_at(outer, id);
- if (TYPE(klass) != T_CLASS) {
- rb_raise(rb_eTypeError, "%s is not a class", name);
+ if (!RB_TYPE_P(klass, T_CLASS)) {
+ rb_raise(rb_eTypeError, "%s is not a class", rb_id2name(id));
}
- if (rb_class_real(RCLASS(klass)->super) != super) {
- rb_name_error(id, "%s is already defined", name);
+ if (rb_class_real(RCLASS_SUPER(klass)) != super) {
+ rb_name_error(id, "%s is already defined", rb_id2name(id));
}
return klass;
}
if (!super) {
rb_warn("no super class for `%s::%s', Object assumed",
- rb_class2name(outer), name);
+ rb_class2name(outer), rb_id2name(id));
}
klass = rb_define_class_id(id, super);
- rb_set_class_path(klass, outer, name);
+ rb_set_class_path_string(klass, outer, rb_id2str(id));
rb_const_set(outer, id, klass);
rb_class_inherited(super, klass);
+ rb_gc_register_mark_object(klass);
return klass;
}
VALUE
-rb_module_new()
+rb_module_new(void)
{
- NEWOBJ(mdl, struct RClass);
- OBJSETUP(mdl, rb_cModule, T_MODULE);
+ VALUE mdl = class_alloc(T_MODULE, rb_cModule);
- mdl->super = 0;
- mdl->iv_tbl = 0;
- mdl->m_tbl = 0;
- mdl->m_tbl = st_init_numtable();
+ RCLASS_M_TBL(mdl) = st_init_numtable();
return (VALUE)mdl;
}
VALUE
-rb_define_module_id(id)
- ID id;
+rb_define_module_id(ID id)
{
VALUE mdl;
@@ -296,8 +606,7 @@ rb_define_module_id(id)
}
VALUE
-rb_define_module(name)
- const char *name;
+rb_define_module(const char *name)
{
VALUE module;
ID id;
@@ -305,7 +614,7 @@ rb_define_module(name)
id = rb_intern(name);
if (rb_const_defined(rb_cObject, id)) {
module = rb_const_get(rb_cObject, id);
- if (TYPE(module) == T_MODULE)
+ if (RB_TYPE_P(module, T_MODULE))
return module;
rb_raise(rb_eTypeError, "%s is not a module", rb_obj_classname(module));
}
@@ -317,45 +626,50 @@ rb_define_module(name)
}
VALUE
-rb_define_module_under(outer, name)
- VALUE outer;
- const char *name;
+rb_define_module_under(VALUE outer, const char *name)
+{
+ return rb_define_module_id_under(outer, rb_intern(name));
+}
+
+VALUE
+rb_define_module_id_under(VALUE outer, ID id)
{
VALUE module;
- ID id;
- id = rb_intern(name);
if (rb_const_defined_at(outer, id)) {
module = rb_const_get_at(outer, id);
- if (TYPE(module) == T_MODULE)
+ if (RB_TYPE_P(module, T_MODULE))
return module;
rb_raise(rb_eTypeError, "%s::%s is not a module",
rb_class2name(outer), rb_obj_classname(module));
}
module = rb_define_module_id(id);
rb_const_set(outer, id, module);
- rb_set_class_path(module, outer, name);
+ rb_set_class_path_string(module, outer, rb_id2str(id));
+ rb_gc_register_mark_object(module);
return module;
}
-static VALUE
-include_class_new(module, super)
- VALUE module, super;
+VALUE
+rb_include_class_new(VALUE module, VALUE super)
{
- NEWOBJ(klass, struct RClass);
- OBJSETUP(klass, rb_cClass, T_ICLASS);
+ VALUE klass = class_alloc(T_ICLASS, rb_cClass);
if (BUILTIN_TYPE(module) == T_ICLASS) {
module = RBASIC(module)->klass;
}
- if (!RCLASS(module)->iv_tbl) {
- RCLASS(module)->iv_tbl = st_init_numtable();
+ if (!RCLASS_IV_TBL(module)) {
+ RCLASS_IV_TBL(module) = st_init_numtable();
}
- klass->iv_tbl = RCLASS(module)->iv_tbl;
- klass->m_tbl = RCLASS(module)->m_tbl;
- klass->super = super;
- if (TYPE(module) == T_ICLASS) {
+ if (!RCLASS_CONST_TBL(module)) {
+ RCLASS_CONST_TBL(module) = st_init_numtable();
+ }
+ RCLASS_IV_TBL(klass) = RCLASS_IV_TBL(module);
+ RCLASS_CONST_TBL(klass) = RCLASS_CONST_TBL(module);
+ RCLASS_M_TBL(klass) = RCLASS_M_TBL(RCLASS_ORIGIN(module));
+ RCLASS_SUPER(klass) = super;
+ if (RB_TYPE_P(module, T_ICLASS)) {
RBASIC(klass)->klass = RBASIC(module)->klass;
}
else {
@@ -367,81 +681,167 @@ include_class_new(module, super)
return (VALUE)klass;
}
+static int include_modules_at(VALUE klass, VALUE c, VALUE module);
+
void
-rb_include_module(klass, module)
- VALUE klass, module;
+rb_include_module(VALUE klass, VALUE module)
{
- VALUE p, c;
int changed = 0;
rb_frozen_class_p(klass);
- if (!OBJ_TAINTED(klass)) {
+ if (!OBJ_UNTRUSTED(klass)) {
rb_secure(4);
}
-
- if (NIL_P(module)) return;
- if (klass == module) return;
- if (TYPE(module) != T_MODULE) {
+ if (!RB_TYPE_P(module, T_MODULE)) {
Check_Type(module, T_MODULE);
}
OBJ_INFECT(klass, module);
- c = klass;
+
+ changed = include_modules_at(klass, RCLASS_ORIGIN(klass), module);
+ if (changed < 0)
+ rb_raise(rb_eArgError, "cyclic include detected");
+ if (changed) rb_clear_cache();
+}
+
+static int
+add_refined_method_entry_i(st_data_t key, st_data_t value, st_data_t data)
+{
+ rb_add_refined_method_entry((VALUE) data, (ID) key);
+ return ST_CONTINUE;
+}
+
+static int
+include_modules_at(VALUE klass, VALUE c, VALUE module)
+{
+ VALUE p;
+ int changed = 0;
+
while (module) {
- int superclass_seen = Qfalse;
+ int superclass_seen = FALSE;
- if (RCLASS(klass)->m_tbl == RCLASS(module)->m_tbl)
- rb_raise(rb_eArgError, "cyclic include detected");
+ if (RCLASS_ORIGIN(module) != module)
+ goto skip;
+ if (RCLASS_M_TBL(klass) && RCLASS_M_TBL(klass) == RCLASS_M_TBL(module))
+ return -1;
/* ignore if the module included already in superclasses */
- for (p = RCLASS(klass)->super; p; p = RCLASS(p)->super) {
+ for (p = RCLASS_SUPER(klass); p; p = RCLASS_SUPER(p)) {
switch (BUILTIN_TYPE(p)) {
case T_ICLASS:
- if (RCLASS(p)->m_tbl == RCLASS(module)->m_tbl) {
+ if (RCLASS_M_TBL(p) == RCLASS_M_TBL(module)) {
if (!superclass_seen) {
- c = p; /* move insertion point */
+ c = p; /* move insertion point */
}
goto skip;
}
break;
case T_CLASS:
- superclass_seen = Qtrue;
+ superclass_seen = TRUE;
break;
}
}
- c = RCLASS(c)->super = include_class_new(module, RCLASS(c)->super);
- changed = 1;
+ c = RCLASS_SUPER(c) = rb_include_class_new(module, RCLASS_SUPER(c));
+ if (FL_TEST(klass, RMODULE_IS_REFINEMENT)) {
+ VALUE refined_class =
+ rb_refinement_module_get_refined_class(klass);
+
+ st_foreach(RMODULE_M_TBL(module), add_refined_method_entry_i,
+ (st_data_t) refined_class);
+ FL_SET(c, RMODULE_INCLUDED_INTO_REFINEMENT);
+ }
+ if (RMODULE_M_TBL(module) && RMODULE_M_TBL(module)->num_entries)
+ changed = 1;
skip:
- module = RCLASS(module)->super;
+ module = RCLASS_SUPER(module);
}
+
+ return changed;
+}
+
+static int
+move_refined_method(st_data_t key, st_data_t value, st_data_t data)
+{
+ rb_method_entry_t *me = (rb_method_entry_t *) value;
+ st_table *tbl = (st_table *) data;
+
+ if (me->def->type == VM_METHOD_TYPE_REFINED) {
+ if (me->def->body.orig_me) {
+ rb_method_entry_t *orig_me = me->def->body.orig_me, *new_me;
+ me->def->body.orig_me = NULL;
+ new_me = ALLOC(rb_method_entry_t);
+ *new_me = *me;
+ st_add_direct(tbl, key, (st_data_t) new_me);
+ *me = *orig_me;
+ xfree(orig_me);
+ return ST_CONTINUE;
+ }
+ else {
+ st_add_direct(tbl, key, (st_data_t) me);
+ return ST_DELETE;
+ }
+ }
+ else {
+ return ST_CONTINUE;
+ }
+}
+
+void
+rb_prepend_module(VALUE klass, VALUE module)
+{
+ VALUE origin;
+ int changed = 0;
+
+ rb_frozen_class_p(klass);
+ if (!OBJ_UNTRUSTED(klass)) {
+ rb_secure(4);
+ }
+
+ Check_Type(module, T_MODULE);
+
+ OBJ_INFECT(klass, module);
+
+ origin = RCLASS_ORIGIN(klass);
+ if (origin == klass) {
+ origin = class_alloc(T_ICLASS, klass);
+ RCLASS_SUPER(origin) = RCLASS_SUPER(klass);
+ RCLASS_SUPER(klass) = origin;
+ RCLASS_ORIGIN(klass) = origin;
+ RCLASS_M_TBL(origin) = RCLASS_M_TBL(klass);
+ RCLASS_M_TBL(klass) = st_init_numtable();
+ st_foreach(RCLASS_M_TBL(origin), move_refined_method,
+ (st_data_t) RCLASS_M_TBL(klass));
+ }
+ changed = include_modules_at(klass, klass, module);
+ if (changed < 0)
+ rb_raise(rb_eArgError, "cyclic prepend detected");
if (changed) rb_clear_cache();
}
/*
* call-seq:
* mod.included_modules -> array
- *
+ *
* Returns the list of modules included in <i>mod</i>.
- *
+ *
* module Mixin
* end
- *
+ *
* module Outer
* include Mixin
* end
- *
+ *
* Mixin.included_modules #=> []
* Outer.included_modules #=> [Mixin]
*/
VALUE
-rb_mod_included_modules(mod)
- VALUE mod;
+rb_mod_included_modules(VALUE mod)
{
VALUE ary = rb_ary_new();
VALUE p;
- for (p = RCLASS(mod)->super; p; p = RCLASS(p)->super) {
+ for (p = RCLASS_SUPER(mod); p; p = RCLASS_SUPER(p)) {
if (BUILTIN_TYPE(p) == T_ICLASS) {
rb_ary_push(ary, RBASIC(p)->klass);
}
@@ -451,11 +851,11 @@ rb_mod_included_modules(mod)
/*
* call-seq:
- * mod.include?(module) => true or false
- *
+ * mod.include?(module) -> true or false
+ *
* Returns <code>true</code> if <i>module</i> is included in
* <i>mod</i> or one of <i>mod</i>'s ancestors.
- *
+ *
* module A
* end
* class B
@@ -469,14 +869,12 @@ rb_mod_included_modules(mod)
*/
VALUE
-rb_mod_include_p(mod, mod2)
- VALUE mod;
- VALUE mod2;
+rb_mod_include_p(VALUE mod, VALUE mod2)
{
VALUE p;
Check_Type(mod2, T_MODULE);
- for (p = RCLASS(mod)->super; p; p = RCLASS(p)->super) {
+ for (p = RCLASS_SUPER(mod); p; p = RCLASS_SUPER(p)) {
if (BUILTIN_TYPE(p) == T_ICLASS) {
if (RBASIC(p)->klass == mod2) return Qtrue;
}
@@ -487,32 +885,31 @@ rb_mod_include_p(mod, mod2)
/*
* call-seq:
* mod.ancestors -> array
- *
+ *
* Returns a list of modules included in <i>mod</i> (including
* <i>mod</i> itself).
- *
+ *
* module Mod
* include Math
* include Comparable
* end
- *
+ *
* Mod.ancestors #=> [Mod, Comparable, Math]
* Math.ancestors #=> [Math]
*/
VALUE
-rb_mod_ancestors(mod)
- VALUE mod;
+rb_mod_ancestors(VALUE mod)
{
VALUE p, ary = rb_ary_new();
- for (p = mod; p; p = RCLASS(p)->super) {
+ for (p = mod; p; p = RCLASS_SUPER(p)) {
if (FL_TEST(p, FL_SINGLETON))
continue;
if (BUILTIN_TYPE(p) == T_ICLASS) {
rb_ary_push(ary, RBASIC(p)->klass);
}
- else {
+ else if (p == RCLASS_ORIGIN(p)) {
rb_ary_push(ary, p);
}
}
@@ -523,13 +920,10 @@ rb_mod_ancestors(mod)
#define VISI_CHECK(x,f) (VISI(x) == (f))
static int
-ins_methods_push(name, type, ary, visi)
- ID name;
- long type;
- VALUE ary;
- long visi;
+ins_methods_push(ID name, long type, VALUE ary, long visi)
{
if (type == -1) return ST_CONTINUE;
+
switch (visi) {
case NOEX_PRIVATE:
case NOEX_PROTECTED:
@@ -541,77 +935,63 @@ ins_methods_push(name, type, ary, visi)
break;
}
if (visi) {
- rb_ary_push(ary, rb_str_new2(rb_id2name(name)));
+ rb_ary_push(ary, ID2SYM(name));
}
return ST_CONTINUE;
}
static int
-ins_methods_i(name, type, ary)
- ID name;
- long type;
- VALUE ary;
+ins_methods_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push(name, type, ary, -1); /* everything but private */
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, -1); /* everything but private */
}
static int
-ins_methods_prot_i(name, type, ary)
- ID name;
- long type;
- VALUE ary;
+ins_methods_prot_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push(name, type, ary, NOEX_PROTECTED);
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PROTECTED);
}
static int
-ins_methods_priv_i(name, type, ary)
- ID name;
- long type;
- VALUE ary;
+ins_methods_priv_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push(name, type, ary, NOEX_PRIVATE);
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PRIVATE);
}
static int
-ins_methods_pub_i(name, type, ary)
- ID name;
- long type;
- VALUE ary;
+ins_methods_pub_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push(name, type, ary, NOEX_PUBLIC);
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PUBLIC);
}
static int
-method_entry(key, body, list)
- ID key;
- NODE *body;
- st_table *list;
+method_entry_i(st_data_t key, st_data_t value, st_data_t data)
{
+ const rb_method_entry_t *me = (const rb_method_entry_t *)value;
+ st_table *list = (st_table *)data;
long type;
- if (key == ID_ALLOCATOR) return ST_CONTINUE;
if (!st_lookup(list, key, 0)) {
- if (!body->nd_body) type = -1; /* none */
- else type = VISI(body->nd_noex);
+ if (UNDEFINED_METHOD_ENTRY_P(me)) {
+ type = -1; /* none */
+ }
+ else {
+ type = VISI(me->flag);
+ }
st_add_direct(list, key, type);
}
return ST_CONTINUE;
}
static VALUE
-class_instance_method_list(argc, argv, mod, func)
- int argc;
- VALUE *argv;
- VALUE mod;
- int (*func) _((ID, long, VALUE));
+class_instance_method_list(int argc, VALUE *argv, VALUE mod, int obj, int (*func) (st_data_t, st_data_t, st_data_t))
{
VALUE ary;
- int recur;
+ int recur, prepended = 0;
st_table *list;
if (argc == 0) {
- recur = Qtrue;
+ recur = TRUE;
}
else {
VALUE r;
@@ -619,11 +999,16 @@ class_instance_method_list(argc, argv, mod, func)
recur = RTEST(r);
}
+ if (!recur && RCLASS_ORIGIN(mod) != mod) {
+ mod = RCLASS_ORIGIN(mod);
+ prepended = 1;
+ }
+
list = st_init_numtable();
- for (; mod; mod = RCLASS(mod)->super) {
- st_foreach(RCLASS(mod)->m_tbl, method_entry, (st_data_t)list);
- if (BUILTIN_TYPE(mod) == T_ICLASS) continue;
- if (FL_TEST(mod, FL_SINGLETON)) continue;
+ for (; mod; mod = RCLASS_SUPER(mod)) {
+ if (RCLASS_M_TBL(mod)) st_foreach(RCLASS_M_TBL(mod), method_entry_i, (st_data_t)list);
+ if (BUILTIN_TYPE(mod) == T_ICLASS && !prepended) continue;
+ if (obj && FL_TEST(mod, FL_SINGLETON)) continue;
if (!recur) break;
}
ary = rb_ary_new();
@@ -635,15 +1020,15 @@ class_instance_method_list(argc, argv, mod, func)
/*
* call-seq:
- * mod.instance_methods(include_super=true) => array
- *
- * Returns an array containing the names of public instance methods in
- * the receiver. For a module, these are the public methods; for a
- * class, they are the instance (not singleton) methods. With no
+ * mod.instance_methods(include_super=true) -> array
+ *
+ * Returns an array containing the names of the public and protected instance
+ * methods in the receiver. For a module, these are the public and protected methods;
+ * for a class, they are the instance (not singleton) methods. With no
* argument, or with an argument that is <code>false</code>, the
* instance methods in <i>mod</i> are returned, otherwise the methods
* in <i>mod</i> and <i>mod</i>'s superclasses are returned.
- *
+ *
* module A
* def method1() end
* end
@@ -653,139 +1038,214 @@ class_instance_method_list(argc, argv, mod, func)
* class C < B
* def method3() end
* end
- *
- * A.instance_methods #=> ["method1"]
- * B.instance_methods(false) #=> ["method2"]
- * C.instance_methods(false) #=> ["method3"]
+ *
+ * A.instance_methods #=> [:method1]
+ * B.instance_methods(false) #=> [:method2]
+ * C.instance_methods(false) #=> [:method3]
* C.instance_methods(true).length #=> 43
*/
VALUE
-rb_class_instance_methods(argc, argv, mod)
- int argc;
- VALUE *argv;
- VALUE mod;
+rb_class_instance_methods(int argc, VALUE *argv, VALUE mod)
{
- return class_instance_method_list(argc, argv, mod, ins_methods_i);
+ return class_instance_method_list(argc, argv, mod, 0, ins_methods_i);
}
/*
* call-seq:
- * mod.protected_instance_methods(include_super=true) => array
- *
+ * mod.protected_instance_methods(include_super=true) -> array
+ *
* Returns a list of the protected instance methods defined in
* <i>mod</i>. If the optional parameter is not <code>false</code>, the
* methods of any ancestors are included.
*/
VALUE
-rb_class_protected_instance_methods(argc, argv, mod)
- int argc;
- VALUE *argv;
- VALUE mod;
+rb_class_protected_instance_methods(int argc, VALUE *argv, VALUE mod)
{
- return class_instance_method_list(argc, argv, mod, ins_methods_prot_i);
+ return class_instance_method_list(argc, argv, mod, 0, ins_methods_prot_i);
}
/*
* call-seq:
- * mod.private_instance_methods(include_super=true) => array
- *
+ * mod.private_instance_methods(include_super=true) -> array
+ *
* Returns a list of the private instance methods defined in
* <i>mod</i>. If the optional parameter is not <code>false</code>, the
* methods of any ancestors are included.
- *
+ *
* module Mod
* def method1() end
* private :method1
* def method2() end
* end
- * Mod.instance_methods #=> ["method2"]
- * Mod.private_instance_methods #=> ["method1"]
+ * Mod.instance_methods #=> [:method2]
+ * Mod.private_instance_methods #=> [:method1]
*/
VALUE
-rb_class_private_instance_methods(argc, argv, mod)
- int argc;
- VALUE *argv;
- VALUE mod;
+rb_class_private_instance_methods(int argc, VALUE *argv, VALUE mod)
{
- return class_instance_method_list(argc, argv, mod, ins_methods_priv_i);
+ return class_instance_method_list(argc, argv, mod, 0, ins_methods_priv_i);
}
/*
* call-seq:
- * mod.public_instance_methods(include_super=true) => array
- *
+ * mod.public_instance_methods(include_super=true) -> array
+ *
* Returns a list of the public instance methods defined in <i>mod</i>.
* If the optional parameter is not <code>false</code>, the methods of
* any ancestors are included.
*/
VALUE
-rb_class_public_instance_methods(argc, argv, mod)
- int argc;
- VALUE *argv;
- VALUE mod;
+rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
{
- return class_instance_method_list(argc, argv, mod, ins_methods_pub_i);
+ return class_instance_method_list(argc, argv, mod, 0, ins_methods_pub_i);
}
/*
* call-seq:
- * obj.singleton_methods(all=true) => array
- *
+ * obj.methods(all=true) -> array
+ *
+ * Returns a list of the names of public and protected methods of
+ * <i>obj</i>. This will include all the methods accessible in
+ * <i>obj</i>'s ancestors.
+ * If the <i>all</i> parameter is set to <code>false</code>, only those methods
+ * in the receiver will be listed.
+ *
+ * class Klass
+ * def klass_method()
+ * end
+ * end
+ * k = Klass.new
+ * k.methods[0..9] #=> [:klass_method, :nil?, :===,
+ * # :==~, :!, :eql?
+ * # :hash, :<=>, :class, :singleton_class]
+ * k.methods.length #=> 57
+ */
+
+VALUE
+rb_obj_methods(int argc, VALUE *argv, VALUE obj)
+{
+ retry:
+ if (argc == 0) {
+ return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_i);
+ }
+ else {
+ VALUE recur;
+
+ rb_scan_args(argc, argv, "1", &recur);
+ if (RTEST(recur)) {
+ argc = 0;
+ goto retry;
+ }
+ return rb_obj_singleton_methods(argc, argv, obj);
+ }
+}
+
+/*
+ * call-seq:
+ * obj.protected_methods(all=true) -> array
+ *
+ * Returns the list of protected methods accessible to <i>obj</i>. If
+ * the <i>all</i> parameter is set to <code>false</code>, only those methods
+ * in the receiver will be listed.
+ */
+
+VALUE
+rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj)
+{
+ return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_prot_i);
+}
+
+/*
+ * call-seq:
+ * obj.private_methods(all=true) -> array
+ *
+ * Returns the list of private methods accessible to <i>obj</i>. If
+ * the <i>all</i> parameter is set to <code>false</code>, only those methods
+ * in the receiver will be listed.
+ */
+
+VALUE
+rb_obj_private_methods(int argc, VALUE *argv, VALUE obj)
+{
+ return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_priv_i);
+}
+
+/*
+ * call-seq:
+ * obj.public_methods(all=true) -> array
+ *
+ * Returns the list of public methods accessible to <i>obj</i>. If
+ * the <i>all</i> parameter is set to <code>false</code>, only those methods
+ * in the receiver will be listed.
+ */
+
+VALUE
+rb_obj_public_methods(int argc, VALUE *argv, VALUE obj)
+{
+ return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_pub_i);
+}
+
+/*
+ * call-seq:
+ * obj.singleton_methods(all=true) -> array
+ *
* Returns an array of the names of singleton methods for <i>obj</i>.
* If the optional <i>all</i> parameter is true, the list will include
* methods in modules included in <i>obj</i>.
- *
+ * Only public and protected singleton methods are returned.
+ *
* module Other
* def three() end
* end
- *
+ *
* class Single
* def Single.four() end
* end
- *
+ *
* a = Single.new
- *
+ *
* def a.one()
* end
- *
+ *
* class << a
* include Other
* def two()
* end
* end
- *
- * Single.singleton_methods #=> ["four"]
- * a.singleton_methods(false) #=> ["two", "one"]
- * a.singleton_methods #=> ["two", "one", "three"]
+ *
+ * Single.singleton_methods #=> [:four]
+ * a.singleton_methods(false) #=> [:two, :one]
+ * a.singleton_methods #=> [:two, :one, :three]
*/
VALUE
-rb_obj_singleton_methods(argc, argv, obj)
- int argc;
- VALUE *argv;
- VALUE obj;
+rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj)
{
VALUE recur, ary, klass;
st_table *list;
- rb_scan_args(argc, argv, "01", &recur);
if (argc == 0) {
recur = Qtrue;
}
+ else {
+ rb_scan_args(argc, argv, "01", &recur);
+ }
klass = CLASS_OF(obj);
list = st_init_numtable();
if (klass && FL_TEST(klass, FL_SINGLETON)) {
- st_foreach(RCLASS(klass)->m_tbl, method_entry, (st_data_t)list);
- klass = RCLASS(klass)->super;
+ if (RCLASS_M_TBL(klass))
+ st_foreach(RCLASS_M_TBL(klass), method_entry_i, (st_data_t)list);
+ klass = RCLASS_SUPER(klass);
}
if (RTEST(recur)) {
- while (klass && (FL_TEST(klass, FL_SINGLETON) || TYPE(klass) == T_ICLASS)) {
- st_foreach(RCLASS(klass)->m_tbl, method_entry, (st_data_t)list);
- klass = RCLASS(klass)->super;
+ while (klass && (FL_TEST(klass, FL_SINGLETON) || RB_TYPE_P(klass, T_ICLASS))) {
+ if (RCLASS_M_TBL(klass))
+ st_foreach(RCLASS_M_TBL(klass), method_entry_i, (st_data_t)list);
+ klass = RCLASS_SUPER(klass);
}
}
ary = rb_ary_new();
@@ -795,239 +1255,425 @@ rb_obj_singleton_methods(argc, argv, obj)
return ary;
}
+/*!
+ * \}
+ */
+/*!
+ * \defgroup defmethod Defining methods
+ * There are some APIs to define a method from C.
+ * These API takes a C function as a method body.
+ *
+ * \par Method body functions
+ * Method body functions must return a VALUE and
+ * can be one of the following form:
+ * <dl>
+ * <dt>Fixed number of parameters</dt>
+ * <dd>
+ * This form is a normal C function, excepting it takes
+ * a receiver object as the first argument.
+ *
+ * \code
+ * static VALUE my_method(VALUE self, VALUE x, VALUE y);
+ * \endcode
+ * </dd>
+ * <dt>argc and argv style</dt>
+ * <dd>
+ * This form takes three parameters: \a argc, \a argv and \a self.
+ * \a self is the receiver. \a argc is the number of arguments.
+ * \a argv is a pointer to an array of the arguments.
+ *
+ * \code
+ * static VALUE my_method(int argc, VALUE *argv, VALUE self);
+ * \endcode
+ * </dd>
+ * <dt>Ruby array style</dt>
+ * <dd>
+ * This form takes two parameters: self and args.
+ * \a self is the receiver. \a args is an Array object which
+ * contains the arguments.
+ *
+ * \code
+ * static VALUE my_method(VALUE self, VALUE args);
+ * \endcode
+ * </dd>
+ *
+ * \par Number of parameters
+ * Method defining APIs takes the number of parameters which the
+ * method will takes. This number is called \a argc.
+ * \a argc can be:
+ * <dl>
+ * <dt>zero or positive number</dt>
+ * <dd>This means the method body function takes a fixed number of parameters</dd>
+ * <dt>-1</dt>
+ * <dd>This means the method body function is "argc and argv" style.</dd>
+ * <dt>-2</dt>
+ * <dd>This means the method body function is "self and args" style.</dd>
+ * </dl>
+ * \{
+ */
+
void
-rb_define_method_id(klass, name, func, argc)
- VALUE klass;
- ID name;
- VALUE (*func)();
- int argc;
+rb_define_method_id(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc)
{
- rb_add_method(klass, name, NEW_CFUNC(func,argc), NOEX_PUBLIC);
+ rb_add_method_cfunc(klass, mid, func, argc, NOEX_PUBLIC);
}
void
-rb_define_method(klass, name, func, argc)
- VALUE klass;
- const char *name;
- VALUE (*func)();
- int argc;
+rb_define_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
{
- ID id = rb_intern(name);
- int ex = NOEX_PUBLIC;
-
-
- rb_add_method(klass, id, NEW_CFUNC(func, argc), ex);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PUBLIC);
}
void
-rb_define_protected_method(klass, name, func, argc)
- VALUE klass;
- const char *name;
- VALUE (*func)();
- int argc;
+rb_define_protected_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
{
- rb_add_method(klass, rb_intern(name), NEW_CFUNC(func, argc), NOEX_PROTECTED);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PROTECTED);
}
void
-rb_define_private_method(klass, name, func, argc)
- VALUE klass;
- const char *name;
- VALUE (*func)();
- int argc;
+rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
{
- rb_add_method(klass, rb_intern(name), NEW_CFUNC(func, argc), NOEX_PRIVATE);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PRIVATE);
}
void
-rb_undef_method(klass, name)
- VALUE klass;
- const char *name;
+rb_undef_method(VALUE klass, const char *name)
{
- rb_add_method(klass, rb_intern(name), 0, NOEX_UNDEF);
+ rb_add_method(klass, rb_intern(name), VM_METHOD_TYPE_UNDEF, 0, NOEX_UNDEF);
}
+/*!
+ * \}
+ */
+/*!
+ * \addtogroup class
+ * \{
+ */
+
#define SPECIAL_SINGLETON(x,c) do {\
if (obj == (x)) {\
- return c;\
+ return (c);\
}\
} while (0)
+static inline VALUE
+special_singleton_class_of(VALUE obj)
+{
+ SPECIAL_SINGLETON(Qnil, rb_cNilClass);
+ SPECIAL_SINGLETON(Qfalse, rb_cFalseClass);
+ SPECIAL_SINGLETON(Qtrue, rb_cTrueClass);
+ return Qnil;
+}
+
VALUE
-rb_singleton_class(obj)
- VALUE obj;
+rb_special_singleton_class(VALUE obj)
+{
+ return special_singleton_class_of(obj);
+}
+
+/*!
+ * \internal
+ * Returns the singleton class of \a obj. Creates it if necessary.
+ *
+ * \note DO NOT expose the returned singleton class to
+ * outside of class.c.
+ * Use \ref rb_singleton_class instead for
+ * consistency of the metaclass hierarchy.
+ */
+static VALUE
+singleton_class_of(VALUE obj)
{
VALUE klass;
- if (FIXNUM_P(obj) || SYMBOL_P(obj)) {
+ if (FIXNUM_P(obj) || FLONUM_P(obj) || SYMBOL_P(obj)) {
rb_raise(rb_eTypeError, "can't define singleton");
}
- if (rb_special_const_p(obj)) {
- SPECIAL_SINGLETON(Qnil, rb_cNilClass);
- SPECIAL_SINGLETON(Qfalse, rb_cFalseClass);
- SPECIAL_SINGLETON(Qtrue, rb_cTrueClass);
- rb_bug("unknown immediate %ld", obj);
+ if (SPECIAL_CONST_P(obj)) {
+ klass = special_singleton_class_of(obj);
+ if (NIL_P(klass))
+ rb_bug("unknown immediate %p", (void *)obj);
+ return klass;
+ }
+ else {
+ enum ruby_value_type type = BUILTIN_TYPE(obj);
+ if (type == T_FLOAT || type == T_BIGNUM) {
+ rb_raise(rb_eTypeError, "can't define singleton");
+ }
}
- DEFER_INTS;
if (FL_TEST(RBASIC(obj)->klass, FL_SINGLETON) &&
- rb_iv_get(RBASIC(obj)->klass, "__attached__") == obj) {
+ rb_ivar_get(RBASIC(obj)->klass, id_attached) == obj) {
klass = RBASIC(obj)->klass;
}
else {
klass = rb_make_metaclass(obj, RBASIC(obj)->klass);
}
+
if (OBJ_TAINTED(obj)) {
OBJ_TAINT(klass);
}
else {
FL_UNSET(klass, FL_TAINT);
}
+ if (OBJ_UNTRUSTED(obj)) {
+ OBJ_UNTRUST(klass);
+ }
+ else {
+ FL_UNSET(klass, FL_UNTRUSTED);
+ }
if (OBJ_FROZEN(obj)) OBJ_FREEZE(klass);
- ALLOW_INTS;
return klass;
}
+
+/*!
+ * Returns the singleton class of \a obj. Creates it if necessary.
+ *
+ * \param obj an arbitrary object.
+ * \throw TypeError if \a obj is a Fixnum or a Symbol.
+ * \return the singleton class.
+ *
+ * \post \a obj has its own singleton class.
+ * \post if \a obj is a class,
+ * the returned singleton class also has its own
+ * singleton class in order to keep consistency of the
+ * inheritance structure of metaclasses.
+ * \note a new singleton class will be created
+ * if \a obj does not have it.
+ * \note the singleton classes for nil, true and false are:
+ * NilClass, TrueClass and FalseClass.
+ */
+VALUE
+rb_singleton_class(VALUE obj)
+{
+ VALUE klass = singleton_class_of(obj);
+
+ /* ensures an exposed class belongs to its own eigenclass */
+ if (RB_TYPE_P(obj, T_CLASS)) (void)ENSURE_EIGENCLASS(klass);
+
+ return klass;
+}
+
+/*!
+ * \}
+ */
+
+/*!
+ * \addtogroup defmethod
+ * \{
+ */
+
+/*!
+ * Defines a singleton method for \a obj.
+ * \param obj an arbitrary object
+ * \param name name of the singleton method
+ * \param func the method body
+ * \param argc the number of parameters, or -1 or -2. see \ref defmethod.
+ */
void
-rb_define_singleton_method(obj, name, func, argc)
- VALUE obj;
- const char *name;
- VALUE (*func)();
- int argc;
+rb_define_singleton_method(VALUE obj, const char *name, VALUE (*func)(ANYARGS), int argc)
{
- rb_define_method(rb_singleton_class(obj), name, func, argc);
+ rb_define_method(singleton_class_of(obj), name, func, argc);
}
+
+
+/*!
+ * Defines a module function for \a module.
+ * \param module an module or a class.
+ * \param name name of the function
+ * \param func the method body
+ * \param argc the number of parameters, or -1 or -2. see \ref defmethod.
+ */
void
-rb_define_module_function(module, name, func, argc)
- VALUE module;
- const char *name;
- VALUE (*func)();
- int argc;
+rb_define_module_function(VALUE module, const char *name, VALUE (*func)(ANYARGS), int argc)
{
rb_define_private_method(module, name, func, argc);
rb_define_singleton_method(module, name, func, argc);
}
+
+/*!
+ * Defines a global function
+ * \param name name of the function
+ * \param func the method body
+ * \param argc the number of parameters, or -1 or -2. see \ref defmethod.
+ */
void
-rb_define_global_function(name, func, argc)
- const char *name;
- VALUE (*func)();
- int argc;
+rb_define_global_function(const char *name, VALUE (*func)(ANYARGS), int argc)
{
rb_define_module_function(rb_mKernel, name, func, argc);
}
+
+/*!
+ * Defines an alias of a method.
+ * \param klass the class which the original method belongs to
+ * \param name1 a new name for the method
+ * \param name2 the original name of the method
+ */
void
-rb_define_alias(klass, name1, name2)
- VALUE klass;
- const char *name1, *name2;
+rb_define_alias(VALUE klass, const char *name1, const char *name2)
{
rb_alias(klass, rb_intern(name1), rb_intern(name2));
}
+/*!
+ * Defines (a) public accessor method(s) for an attribute.
+ * \param klass the class which the attribute will belongs to
+ * \param name name of the attribute
+ * \param read a getter method for the attribute will be defined if \a read is non-zero.
+ * \param write a setter method for the attribute will be defined if \a write is non-zero.
+ */
void
-rb_define_attr(klass, name, read, write)
- VALUE klass;
- const char *name;
- int read, write;
+rb_define_attr(VALUE klass, const char *name, int read, int write)
+{
+ rb_attr(klass, rb_intern(name), read, write, FALSE);
+}
+
+int
+rb_obj_basic_to_s_p(VALUE obj)
{
- rb_attr(klass, rb_intern(name), read, write, Qfalse);
+ const rb_method_entry_t *me = rb_method_entry(CLASS_OF(obj), rb_intern("to_s"), 0);
+ if (me && me->def && me->def->type == VM_METHOD_TYPE_CFUNC &&
+ me->def->body.cfunc.func == rb_any_to_s)
+ return 1;
+ return 0;
}
-#ifdef HAVE_STDARG_PROTOTYPES
#include <stdarg.h>
-#define va_init_list(a,b) va_start(a,b)
-#else
-#include <varargs.h>
-#define va_init_list(a,b) va_start(a)
-#endif
int
-#ifdef HAVE_STDARG_PROTOTYPES
rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
-#else
-rb_scan_args(argc, argv, fmt, va_alist)
- int argc;
- const VALUE *argv;
- const char *fmt;
- va_dcl
-#endif
-{
- int n, i = 0;
+{
+ int i;
const char *p = fmt;
VALUE *var;
va_list vargs;
-
- va_init_list(vargs, fmt);
-
- if (*p == '*') goto rest_arg;
+ int f_var = 0, f_hash = 0, f_block = 0;
+ int n_lead = 0, n_opt = 0, n_trail = 0, n_mand;
+ int argi = 0;
+ VALUE hash = Qnil;
if (ISDIGIT(*p)) {
- n = *p - '0';
- if (n > argc)
- rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, n);
- for (i=0; i<n; i++) {
- var = va_arg(vargs, VALUE*);
- if (var) *var = argv[i];
+ n_lead = *p - '0';
+ p++;
+ if (ISDIGIT(*p)) {
+ n_opt = *p - '0';
+ p++;
+ if (ISDIGIT(*p)) {
+ n_trail = *p - '0';
+ p++;
+ goto block_arg;
+ }
}
+ }
+ if (*p == '*') {
+ f_var = 1;
p++;
+ if (ISDIGIT(*p)) {
+ n_trail = *p - '0';
+ p++;
+ }
}
- else {
- goto error;
+ block_arg:
+ if (*p == ':') {
+ f_hash = 1;
+ p++;
}
-
- if (ISDIGIT(*p)) {
- n = i + *p - '0';
- for (; i<n; i++) {
- var = va_arg(vargs, VALUE*);
- if (argc > i) {
- if (var) *var = argv[i];
- }
- else {
- if (var) *var = Qnil;
- }
- }
+ if (*p == '&') {
+ f_block = 1;
p++;
}
+ if (*p != '\0') {
+ rb_fatal("bad scan arg format: %s", fmt);
+ }
+ n_mand = n_lead + n_trail;
+
+ if (argc < n_mand)
+ goto argc_error;
+
+ va_start(vargs, fmt);
+
+ /* capture an option hash - phase 1: pop */
+ if (f_hash && n_mand < argc) {
+ VALUE last = argv[argc - 1];
- if(*p == '*') {
- rest_arg:
- var = va_arg(vargs, VALUE*);
- if (argc > i) {
- if (var) *var = rb_ary_new4(argc-i, argv+i);
- i = argc;
+ if (NIL_P(last)) {
+ /* nil is taken as an empty option hash only if it is not
+ ambiguous; i.e. '*' is not specified and arguments are
+ given more than sufficient */
+ if (!f_var && n_mand + n_opt < argc)
+ argc--;
+ }
+ else {
+ hash = rb_check_hash_type(last);
+ if (!NIL_P(hash))
+ argc--;
+ }
+ }
+ /* capture leading mandatory arguments */
+ for (i = n_lead; i-- > 0; ) {
+ var = va_arg(vargs, VALUE *);
+ if (var) *var = argv[argi];
+ argi++;
+ }
+ /* capture optional arguments */
+ for (i = n_opt; i-- > 0; ) {
+ var = va_arg(vargs, VALUE *);
+ if (argi < argc - n_trail) {
+ if (var) *var = argv[argi];
+ argi++;
+ }
+ else {
+ if (var) *var = Qnil;
+ }
+ }
+ /* capture variable length arguments */
+ if (f_var) {
+ int n_var = argc - argi - n_trail;
+
+ var = va_arg(vargs, VALUE *);
+ if (0 < n_var) {
+ if (var) *var = rb_ary_new4(n_var, &argv[argi]);
+ argi += n_var;
}
else {
if (var) *var = rb_ary_new();
}
- p++;
}
-
- if (*p == '&') {
- var = va_arg(vargs, VALUE*);
+ /* capture trailing mandatory arguments */
+ for (i = n_trail; i-- > 0; ) {
+ var = va_arg(vargs, VALUE *);
+ if (var) *var = argv[argi];
+ argi++;
+ }
+ /* capture an option hash - phase 2: assignment */
+ if (f_hash) {
+ var = va_arg(vargs, VALUE *);
+ if (var) *var = hash;
+ }
+ /* capture iterator block */
+ if (f_block) {
+ var = va_arg(vargs, VALUE *);
if (rb_block_given_p()) {
*var = rb_block_proc();
}
else {
*var = Qnil;
}
- p++;
}
va_end(vargs);
- if (*p != '\0') {
- goto error;
- }
-
- if (argc > i) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, i);
+ if (argi < argc) {
+ argc_error:
+ rb_error_arity(argc, n_mand, f_var ? UNLIMITED_ARGUMENTS : n_mand + n_opt);
}
return argc;
-
- error:
- rb_fatal("bad scan arg format: %s", fmt);
- return 0;
}
+
+/*!
+ * \}
+ */
diff --git a/common.mk b/common.mk
index 3584b83e35..2e90d074bd 100644
--- a/common.mk
+++ b/common.mk
@@ -1,28 +1,54 @@
bin: $(PROGRAM) $(WPROGRAM)
-lib: $(LIBRUBY);
-dll: $(LIBRUBY_SO);
+lib: $(LIBRUBY)
+dll: $(LIBRUBY_SO)
-RUBYOPT =
+.SUFFIXES: .inc .h .c .y .i .$(DTRACE_EXT)
+
+# V=0 quiet, V=1 verbose. other values don't work.
+V = 0
+Q1 = $(V:1=)
+Q = $(Q1:0=@)
+ECHO = $(ECHO1:0=@echo)
+
+RUBYLIB = $(PATH_SEPARATOR)
+RUBYOPT = -
+RUN_OPTS = --disable-gems
+
+SPEC_GIT_BASE = git://github.com/rubyspec
+MSPEC_GIT_URL = $(SPEC_GIT_BASE)/mspec.git
+RUBYSPEC_GIT_URL = $(SPEC_GIT_BASE)/rubyspec.git
STATIC_RUBY = static-ruby
EXTCONF = extconf.rb
-RBCONFIG = ./.rbconfig.time
+LIBRUBY_EXTS = ./.libruby-with-ext.time
+REVISION_H = ./.revision.time
+PLATFORM_D = ./$(PLATFORM_DIR)/.time
+RDOCOUT = $(EXTOUT)/rdoc
+CAPIOUT = doc/capi
DMYEXT = dmyext.$(OBJEXT)
-MAINOBJ = main.$(OBJEXT)
-EXTOBJS =
+NORMALMAINOBJ = main.$(OBJEXT)
+MAINOBJ = $(NORMALMAINOBJ)
+EXTOBJS =
DLDOBJS = $(DMYEXT)
+EXTSOLIBS =
+MINIOBJS = $(ARCHMINIOBJS) dmyencoding.$(OBJEXT) dmyversion.$(OBJEXT) miniprelude.$(OBJEXT)
+ENC_MK = enc.mk
-OBJS = array.$(OBJEXT) \
+COMMONOBJS = array.$(OBJEXT) \
bignum.$(OBJEXT) \
class.$(OBJEXT) \
compar.$(OBJEXT) \
+ complex.$(OBJEXT) \
dir.$(OBJEXT) \
- dln.$(OBJEXT) \
+ dln_find.$(OBJEXT) \
enum.$(OBJEXT) \
+ enumerator.$(OBJEXT) \
error.$(OBJEXT) \
eval.$(OBJEXT) \
+ load.$(OBJEXT) \
+ proc.$(OBJEXT) \
file.$(OBJEXT) \
gc.$(OBJEXT) \
hash.$(OBJEXT) \
@@ -30,142 +56,528 @@ OBJS = array.$(OBJEXT) \
io.$(OBJEXT) \
marshal.$(OBJEXT) \
math.$(OBJEXT) \
+ node.$(OBJEXT) \
numeric.$(OBJEXT) \
object.$(OBJEXT) \
pack.$(OBJEXT) \
parse.$(OBJEXT) \
process.$(OBJEXT) \
- prec.$(OBJEXT) \
random.$(OBJEXT) \
range.$(OBJEXT) \
+ rational.$(OBJEXT) \
re.$(OBJEXT) \
- regex.$(OBJEXT) \
+ regcomp.$(OBJEXT) \
+ regenc.$(OBJEXT) \
+ regerror.$(OBJEXT) \
+ regexec.$(OBJEXT) \
+ regparse.$(OBJEXT) \
+ regsyntax.$(OBJEXT) \
ruby.$(OBJEXT) \
+ safe.$(OBJEXT) \
signal.$(OBJEXT) \
sprintf.$(OBJEXT) \
st.$(OBJEXT) \
+ strftime.$(OBJEXT) \
string.$(OBJEXT) \
struct.$(OBJEXT) \
time.$(OBJEXT) \
+ transcode.$(OBJEXT) \
util.$(OBJEXT) \
variable.$(OBJEXT) \
- version.$(OBJEXT) \
+ compile.$(OBJEXT) \
+ debug.$(OBJEXT) \
+ iseq.$(OBJEXT) \
+ vm.$(OBJEXT) \
+ vm_dump.$(OBJEXT) \
+ vm_backtrace.$(OBJEXT) \
+ vm_trace.$(OBJEXT) \
+ thread.$(OBJEXT) \
+ cont.$(OBJEXT) \
+ $(BUILTIN_ENCOBJS) \
+ $(BUILTIN_TRANSOBJS) \
$(MISSING)
+EXPORTOBJS = $(DLNOBJ) \
+ encoding.$(OBJEXT) \
+ version.$(OBJEXT) \
+ $(COMMONOBJS)
+
+OBJS = $(EXPORTOBJS) prelude.$(OBJEXT)
+ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT)
+
+GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
+
+PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(srcdir)/enc/prelude.rb $(DEFAULT_PRELUDES)
+GEM_PRELUDE = $(srcdir)/gem_prelude.rb
+YES_GEM_PRELUDE = $(GEM_PRELUDE)
+NO_GEM_PRELUDE =
+PRELUDES = prelude.c miniprelude.c
+GOLFPRELUDES = golf_prelude.c
+
SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
- --make="$(MAKE)" \
+ --extout="$(EXTOUT)" \
--mflags="$(MFLAGS)" \
--make-flags="$(MAKEFLAGS)"
-EXTMK_ARGS = $(SCRIPT_ARGS) --extout="$(EXTOUT)" --extension $(EXTS) --extstatic $(EXTSTATIC) --
+EXTMK_ARGS = $(SCRIPT_ARGS) --extension $(EXTS) --extstatic $(EXTSTATIC) \
+ --make-flags="V=$(V) MINIRUBY='$(MINIRUBY)'" --
+INSTRUBY = $(SUDO) $(MINIRUBY) $(srcdir)/tool/rbinstall.rb
+INSTRUBY_ARGS = $(SCRIPT_ARGS) \
+ --data-mode=$(INSTALL_DATA_MODE) \
+ --prog-mode=$(INSTALL_PROG_MODE) \
+ --installed-list $(INSTALLED_LIST) \
+ --mantype="$(MANTYPE)"
+INSTALL_PROG_MODE = 0755
+INSTALL_DATA_MODE = 0644
+
+PRE_LIBRUBY_UPDATE = $(MINIRUBY) -e 'ARGV[1] or File.unlink(ARGV[0]) rescue nil' -- \
+ $(LIBRUBY_EXTS) $(LIBRUBY_SO_UPDATE)
+
+TESTSDIR = $(srcdir)/test
+TESTWORKDIR = testwork
+
+TESTRUN_SCRIPT = $(srcdir)/test.rb
+
+BOOTSTRAPRUBY = $(BASERUBY)
+
+COMPILE_PRELUDE = $(MINIRUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb
+
+all: showflags main docs
+
+main: showflags $(EXTSTATIC:static=lib)encs exts
+ @$(NULLCMD)
+
+.PHONY: showflags
+exts enc trans: showflags
+showflags:
+ $(MESSAGE_BEGIN) \
+ " CC = $(CC)" \
+ " LD = $(LD)" \
+ " LDSHARED = $(LDSHARED)" \
+ " CFLAGS = $(CFLAGS)" \
+ " XCFLAGS = $(XCFLAGS)" \
+ " CPPFLAGS = $(CPPFLAGS)" \
+ " DLDFLAGS = $(DLDFLAGS)" \
+ " SOLIBS = $(SOLIBS)" \
+ $(MESSAGE_END)
+
+.PHONY: showconfig
+showconfig:
+ @$(MESSAGE_BEGIN) \
+ "$(configure_args)" \
+ $(MESSAGE_END)
-all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY)
- @$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS)
-prog: $(PROGRAM) $(WPROGRAM)
+exts: build-ext
-miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) $(MINIOBJS) $(OBJS) $(DMYEXT)
+EXTS_MK = exts.mk
+$(EXTS_MK): $(MKFILES) all-incs $(PREP) $(RBCONFIG) $(LIBRUBY)
+ $(ECHO) generating makefile $@
+ $(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --command-output=$(EXTS_MK) $(EXTMK_ARGS) configure
-$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP)
+configure-ext: $(EXTS_MK)
-$(LIBRUBY_A): $(OBJS) $(DMYEXT) $(ARCHFILE)
+build-ext: $(EXTS_MK)
+ $(Q)$(MAKE) -f $(EXTS_MK) $(MFLAGS) $(EXTSTATIC) LIBRUBY_EXTS=$(LIBRUBY_EXTS) ENCOBJS="$(ENCOBJS)"
-$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP)
+$(MKMAIN_CMD): $(MKFILES) all-incs $(PREP) $(RBCONFIG) $(LIBRUBY)
+ $(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --command-output=$@ $(EXTMK_ARGS)
+
+prog: program wprogram
+
+loadpath: $(PREP) PHONY
+ $(MINIRUBY) -e 'p $$:'
+
+$(PREP): $(MKFILES)
+
+miniruby$(EXEEXT): config.status $(ALLOBJS) $(ARCHFILE) $(DTRACE_OBJ)
+
+objs: $(ALLOBJS)
+
+GORUBY = go$(RUBY_INSTALL_NAME)
+golf: $(LIBRUBY) $(GOLFOBJS) PHONY
+ $(Q) $(MAKE) $(MFLAGS) MAINOBJ="$(GOLFOBJS)" PROGRAM=$(GORUBY)$(EXEEXT) program
+capi: $(CAPIOUT)/.timestamp PHONY
+
+$(CAPIOUT)/.timestamp: Doxyfile $(PREP)
+ $(Q) $(MAKEDIRS) "$(@D)"
+ $(ECHO) generating capi
+ $(Q) $(DOXYGEN) -b
+ $(Q) $(MINIRUBY) -e 'File.open(ARGV[0], "w"){|f| f.puts(Time.now)}' "$@"
+
+Doxyfile: $(srcdir)/template/Doxyfile.tmpl $(PREP) $(srcdir)/tool/generic_erb.rb $(RBCONFIG)
+ $(ECHO) generating $@
+ $(Q) $(MINIRUBY) $(srcdir)/tool/generic_erb.rb -o $@ $(srcdir)/template/Doxyfile.tmpl \
+ --srcdir="$(srcdir)" --miniruby="$(MINIRUBY)"
+
+program: showflags $(PROGRAM)
+wprogram: showflags $(WPROGRAM)
+
+$(PROGRAM) $(WPROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP)
+
+$(LIBRUBY_A): $(OBJS) $(MAINOBJ) $(DTRACE_OBJ) $(DTRACE_GLOMMED_OBJ) $(DMYEXT) $(ARCHFILE)
+
+$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(LIBRUBY_SO_UPDATE) $(BUILTIN_ENCOBJS)
+
+$(LIBRUBY_EXTS):
+ @exit > $@
$(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A)
- @$(RM) $@
+ $(Q)$(RM) $@
$(PURIFY) $(CC) $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)$@ $(LDFLAGS) $(XLDFLAGS)
-ruby.imp: $(OBJS)
- @$(NM) -Pgp $(OBJS) | awk 'BEGIN{print "#!"}; $$2~/^[BD]$$/{print $$1}' | sort -u -o $@
+ruby.imp: $(EXPORTOBJS)
+ $(Q)$(NM) -Pgp $(EXPORTOBJS) | \
+ awk 'BEGIN{print "#!"}; $$2~/^[BDT]$$/&&$$1!~/^(Init_|.*_threadptr_|\.)/{print $$1}' | \
+ sort -u -o $@
+
+install: install-$(INSTALLDOC)
+docs: $(DOCTARGETS)
+pkgconfig-data: $(ruby_pc)
+$(ruby_pc): $(srcdir)/template/ruby.pc.in config.status
-install: install-nodoc $(RDOCTARGET)
-install-all: install-nodoc install-doc
+install-all: docs pre-install-all do-install-all post-install-all
+pre-install-all:: pre-install-local pre-install-ext pre-install-doc
+do-install-all: all
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=all --rdoc-output="$(RDOCOUT)"
+post-install-all:: post-install-local post-install-ext post-install-doc
+ @$(NULLCMD)
+
+install-nodoc: pre-install-nodoc do-install-nodoc post-install-nodoc
+pre-install-nodoc:: pre-install-local pre-install-ext
+do-install-nodoc: main
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS)
+post-install-nodoc:: post-install-local post-install-ext
-install-nodoc: install-local install-ext
install-local: pre-install-local do-install-local post-install-local
+pre-install-local:: pre-install-bin pre-install-lib pre-install-man
+do-install-local: $(PROGRAM)
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local
+post-install-local:: post-install-bin post-install-lib post-install-man
+
install-ext: pre-install-ext do-install-ext post-install-ext
+pre-install-ext:: pre-install-ext-arch pre-install-ext-comm
+do-install-ext: exts
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext
+post-install-ext:: post-install-ext-arch post-install-ext-comm
+
+install-arch: pre-install-arch do-install-arch post-install-arch
+pre-install-arch:: pre-install-bin pre-install-ext-arch
+do-install-arch: main
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin --install=ext-arch
+post-install-arch:: post-install-bin post-install-ext-arch
+
+install-comm: pre-install-comm do-install-comm post-install-comm
+pre-install-comm:: pre-install-lib pre-install-ext-comm pre-install-man
+do-install-comm: $(PREP)
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
+post-install-comm:: post-install-lib post-install-ext-comm post-install-man
-do-install-local: $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --mantype="$(MANTYPE)"
-do-install-ext: $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) install
+install-bin: pre-install-bin do-install-bin post-install-bin
+pre-install-bin:: install-prereq
+do-install-bin: $(PROGRAM)
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin
+post-install-bin::
+ @$(NULLCMD)
-install-bin: $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --install=bin
-install-lib: $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --install=lib
-install-man: $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --install=man --mantype="$(MANTYPE)"
+install-lib: pre-install-lib do-install-lib post-install-lib
+pre-install-lib:: install-prereq
+do-install-lib: $(PREP)
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib
+post-install-lib::
+ @$(NULLCMD)
+
+install-ext-comm: pre-install-ext-comm do-install-ext-comm post-install-ext-comm
+pre-install-ext-comm:: install-prereq
+do-install-ext-comm: exts
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-comm
+post-install-ext-comm::
+ @$(NULLCMD)
+
+install-ext-arch: pre-install-ext-arch do-install-ext-arch post-install-ext-arch
+pre-install-ext-arch:: install-prereq
+do-install-ext-arch: exts
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-arch
+post-install-ext-arch::
+ @$(NULLCMD)
+
+install-man: pre-install-man do-install-man post-install-man
+pre-install-man:: install-prereq
+do-install-man: $(PREP)
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man
+post-install-man::
+ @$(NULLCMD)
+
+install-capi: capi pre-install-capi do-install-capi post-install-capi
+pre-install-capi:: install-prereq
+do-install-capi: $(PREP)
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=capi
+post-install-capi::
+ @$(NULLCMD)
+
+what-where: no-install
+no-install: no-install-$(INSTALLDOC)
+what-where-all: no-install-all
+no-install-all: pre-no-install-all dont-install-all post-no-install-all
+pre-no-install-all:: pre-no-install-local pre-no-install-ext pre-no-install-doc
+dont-install-all: $(PROGRAM)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=all --rdoc-output="$(RDOCOUT)"
+post-no-install-all:: post-no-install-local post-no-install-ext post-no-install-doc
+ @$(NULLCMD)
+
+what-where-nodoc: no-install-nodoc
+no-install-nodoc: pre-no-install-nodoc dont-install-nodoc post-no-install-nodoc
+pre-no-install-nodoc:: pre-no-install-local pre-no-install-ext
+dont-install-nodoc: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS)
+post-no-install-nodoc:: post-no-install-local post-no-install-ext
-what-where-all no-install-all: no-install no-install-doc
-what-where no-install: no-install-local no-install-ext
what-where-local: no-install-local
-no-install-local: $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/instruby.rb -n $(SCRIPT_ARGS) --mantype="$(MANTYPE)"
+no-install-local: pre-no-install-local dont-install-local post-no-install-local
+pre-no-install-local:: pre-no-install-bin pre-no-install-lib pre-no-install-man
+dont-install-local: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local
+post-no-install-local:: post-no-install-bin post-no-install-lib post-no-install-man
+
what-where-ext: no-install-ext
-no-install-ext: $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/ext/extmk.rb -n $(EXTMK_ARGS) install
+no-install-ext: pre-no-install-ext dont-install-ext post-no-install-ext
+pre-no-install-ext:: pre-no-install-ext-arch pre-no-install-ext-comm
+dont-install-ext: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext
+post-no-install-ext:: post-no-install-ext-arch post-no-install-ext-comm
+
+what-where-arch: no-install-arch
+no-install-arch: pre-no-install-arch dont-install-arch post-no-install-arch
+pre-no-install-arch:: pre-no-install-bin pre-no-install-ext-arch
+dont-install-arch: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin --install=ext-arch
+post-no-install-arch:: post-no-install-lib post-no-install-man post-no-install-ext-arch
+
+what-where-comm: no-install-comm
+no-install-comm: pre-no-install-comm dont-install-comm post-no-install-comm
+pre-no-install-comm:: pre-no-install-lib pre-no-install-ext-comm pre-no-install-man
+dont-install-comm: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
+post-no-install-comm:: post-no-install-lib post-no-install-ext-comm post-no-install-man
-install-doc: pre-install-doc do-install-doc post-install-doc
+what-where-bin: no-install-bin
+no-install-bin: pre-no-install-bin dont-install-bin post-no-install-bin
+pre-no-install-bin:: install-prereq
+dont-install-bin: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin
+post-no-install-bin::
+ @$(NULLCMD)
+
+what-where-lib: no-install-lib
+no-install-lib: pre-no-install-lib dont-install-lib post-no-install-lib
+pre-no-install-lib:: install-prereq
+dont-install-lib: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib
+post-no-install-lib::
+ @$(NULLCMD)
+
+what-where-ext-comm: no-install-ext-comm
+no-install-ext-comm: pre-no-install-ext-comm dont-install-ext-comm post-no-install-ext-comm
+pre-no-install-ext-comm:: install-prereq
+dont-install-ext-comm: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-comm
+post-no-install-ext-comm::
+ @$(NULLCMD)
+
+what-where-ext-arch: no-install-ext-arch
+no-install-ext-arch: pre-no-install-ext-arch dont-install-ext-arch post-no-install-ext-arch
+pre-no-install-ext-arch:: install-prereq
+dont-install-ext-arch: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-arch
+post-no-install-ext-arch::
+ @$(NULLCMD)
+
+what-where-man: no-install-man
+no-install-man: pre-no-install-man dont-install-man post-no-install-man
+pre-no-install-man:: install-prereq
+dont-install-man: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man
+post-no-install-man::
+ @$(NULLCMD)
+
+install-doc: rdoc pre-install-doc do-install-doc post-install-doc
+pre-install-doc:: install-prereq
do-install-doc: $(PROGRAM)
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
+post-install-doc::
+ @$(NULLCMD)
+
+rdoc: PHONY main
@echo Generating RDoc documentation
- $(RUNRUBY) "$(srcdir)/bin/rdoc" --all --ri --op "$(RIDATADIR)" "$(srcdir)"
-
-pre-install: pre-install-local pre-install-ext
-pre-install-local:: PHONY
- $(PREINSTALL)
-pre-install-ext:: PHONY
-pre-install-doc:: PHONY
-
-post-install: post-install-local post-install-ext
-post-install-local:: PHONY
-post-install-ext:: PHONY
-post-install-doc:: PHONY
-
-clean: clean-ext clean-local
-clean-local::
- @$(RM) $(OBJS) $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
- @$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) $(ARCHFILE)
-clean-ext:
- @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) clean
-
-distclean: distclean-ext distclean-local
+ $(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --root "$(srcdir)" --page-dir "$(srcdir)/doc" --encoding=UTF-8 --no-force-update --all --ri --op "$(RDOCOUT)" --debug $(RDOCFLAGS) "$(srcdir)"
+
+rdoc-coverage: PHONY main
+ @echo Generating RDoc coverage report
+ $(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --root "$(srcdir)" --encoding=UTF-8 --all --quiet -C $(RDOCFLAGS) "$(srcdir)"
+
+nodoc: PHONY
+
+what-where-doc: no-install-doc
+no-install-doc: pre-no-install-doc dont-install-doc post-no-install-doc
+pre-no-install-doc:: install-prereq
+dont-install-doc:: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
+post-no-install-doc::
+ @$(NULLCMD)
+
+CLEAR_INSTALLED_LIST = clear-installed-list
+
+install-prereq: $(CLEAR_INSTALLED_LIST) PHONY
+
+clear-installed-list: PHONY
+ @> $(INSTALLED_LIST) set MAKE="$(MAKE)"
+
+clean: clean-ext clean-local clean-enc clean-golf clean-rdoc clean-capi clean-extout clean-platform
+clean-local:: PHONY
+ $(Q)$(RM) $(OBJS) $(MINIOBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
+ $(Q)$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) $(ARCHFILE) .*.time
+ $(Q)$(RM) y.tab.c y.output encdb.h transdb.h prelude.c config.log rbconfig.rb $(ruby_pc) probes.h probes.$(OBJEXT) probes.stamp ruby-glommed.$(OBJEXT)
+clean-ext:: PHONY
+clean-golf: PHONY
+ $(Q)$(RM) $(GORUBY)$(EXEEXT) $(GOLFOBJS)
+clean-rdoc: PHONY
+clean-capi: PHONY
+clean-platform: PHONY
+clean-extout: PHONY
+clean-docs: clean-rdoc clean-capi
+
+distclean: distclean-ext distclean-local distclean-enc distclean-golf distclean-extout distclean-platform
distclean-local:: clean-local
- @$(RM) $(MKFILES) config.h rbconfig.rb
- @$(RM) config.cache config.log config.status
- @$(RM) *~ *.bak *.stackdump core *.core gmon.out y.tab.c y.output $(PREP)
-distclean-ext:
- @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) distclean
+ $(Q)$(RM) $(MKFILES) yasmdata.rb *.inc
+ $(Q)$(RM) config.cache config.status config.status.lineno $(PRELUDES)
+ $(Q)$(RM) *~ *.bak *.stackdump core *.core gmon.out $(PREP)
+distclean-ext:: PHONY
+distclean-golf: clean-golf
+ $(Q)$(RM) $(GOLFPRELUDES)
+distclean-rdoc: PHONY
+distclean-capi: PHONY
+distclean-extout: clean-extout
+distclean-platform: clean-platform
+
+realclean:: realclean-ext realclean-local realclean-enc realclean-golf realclean-extout
+realclean-local:: distclean-local
+ $(Q)$(RM) parse.c parse.h lex.c newline.c revision.h
+realclean-ext::
+realclean-golf: distclean-golf
+realclean-capi: PHONY
+realclean-extout: distclean-extout
+
+clean-ext distclean-ext realclean-ext::
+ $(Q)$(RM) $(EXTS_MK)
+
+clean-enc distclean-enc realclean-enc: PHONY
+
+check: main test test-all
+ $(ECHO) check succeeded
+check-ruby: test test-ruby
-realclean:: distclean
- @$(RM) parse.c lex.c
+fake: $(CROSS_COMPILING)-fake
+yes-fake: $(arch)-fake.rb $(RBCONFIG) PHONY
+no-fake: PHONY
-check: test test-all
+btest: $(TEST_RUNNABLE)-btest
+no-btest: PHONY
+yes-btest: fake miniruby$(EXEEXT) PHONY
+ $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(BTESTRUBY)" $(OPTS) $(TESTOPTS)
-test: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) PHONY
- @$(MINIRUBY) $(srcdir)/rubytest.rb
+btest-ruby: $(TEST_RUNNABLE)-btest-ruby
+no-btest-ruby: PHONY
+yes-btest-ruby: prog PHONY
+ $(Q)$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib" -q $(OPTS) $(TESTOPTS)
-test-all:
- $(RUNRUBY) -C "$(srcdir)/test" runner.rb --runner=$(TESTUI) $(TESTS)
+test-sample: $(TEST_RUNNABLE)-test-sample
+no-test-sample: PHONY
+yes-test-sample: prog PHONY
+ $(Q)$(RUNRUBY) $(srcdir)/tool/rubytest.rb $(OPTS) $(TESTOPTS)
-extconf:
- $(MINIRUBY) -I$(srcdir)/lib -run -e mkdir -- -p "$(EXTCONFDIR)"
+test-knownbugs: test-knownbug
+test-knownbug: $(TEST_RUNNABLE)-test-knownbug
+no-test-knownbug: PHONY
+yes-test-knownbug: prog PHONY
+ -$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM)" $(OPTS) $(TESTOPTS) $(srcdir)/KNOWNBUGS.rb
+
+test: test-sample btest-ruby test-knownbug
+
+test-all: $(TEST_RUNNABLE)-test-all
+yes-test-all: prog PHONY
+ $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS) $(TESTS)
+TESTS_BUILD = mkmf
+no-test-all: PHONY
+ $(MINIRUBY) -I"$(srcdir)/lib" "$(srcdir)/test/runner.rb" $(TESTOPTS) $(TESTS_BUILD)
+
+test-ruby: $(TEST_RUNNABLE)-test-ruby
+no-test-ruby: PHONY
+yes-test-ruby: prog encs PHONY
+ $(RUNRUBY) "$(srcdir)/test/runner.rb" -q $(TESTOPTS) -- ruby -ext-
+
+extconf: $(PREP)
+ $(Q) $(MAKEDIRS) "$(EXTCONFDIR)"
$(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
-$(RBCONFIG): $(srcdir)/mkconfig.rb config.status $(PREP)
- @$(MINIRUBY) $(srcdir)/mkconfig.rb -timestamp=$@ \
+$(RBCONFIG): $(srcdir)/tool/mkconfig.rb config.status $(srcdir)/version.h $(PREP)
+ $(Q)$(MINIRUBY) $(srcdir)/tool/mkconfig.rb -timestamp=$@ \
-install_name=$(RUBY_INSTALL_NAME) \
-so_name=$(RUBY_SO_NAME) rbconfig.rb
+test-rubyspec-precheck:
+
+test-rubyspec: test-rubyspec-precheck
+ $(RUNRUBY) $(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/default.mspec $(MSPECOPT)
+
+RUNNABLE = $(LIBRUBY_RELATIVE:no=un)-runnable
+runnable: $(RUNNABLE) prog $(srcdir)/tool/mkrunnable.rb PHONY
+ $(Q) $(MINIRUBY) $(srcdir)/tool/mkrunnable.rb -v $(EXTOUT)
+yes-runnable: PHONY
+
+encs: enc trans
+libencs: libenc libtrans
+encs enc trans libencs libenc libtrans: showflags $(ENC_MK) $(LIBRUBY) $(PREP)
+ $(ECHO) making $@
+ $(Q) $(MAKE) -f $(ENC_MK) V="$(V)" \
+ RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" \
+ $(MFLAGS) $@
+
+
+libenc enc: {$(VPATH)}encdb.h
+libtrans trans: {$(VPATH)}transdb.h
+
+$(ENC_MK): $(srcdir)/enc/make_encmake.rb $(srcdir)/enc/Makefile.in $(srcdir)/enc/depend \
+ $(srcdir)/enc/encinit.c.erb $(srcdir)/lib/mkmf.rb $(RBCONFIG)
+ $(ECHO) generating $@
+ $(Q) $(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" --builtin-transes="$(BUILTIN_TRANSOBJS)" --module$(EXTSTATIC) $@ $(ENCS)
+
.PRECIOUS: $(MKFILES)
+.PHONY: PHONY all fake prereq incs srcs preludes help
.PHONY: test install install-nodoc install-doc dist
+.PHONY: loadpath golf capi rdoc install-prereq clear-installed-list
+.PHONY: clean clean-ext clean-local clean-enc clean-golf clean-rdoc clean-extout
+.PHONY: distclean distclean-ext distclean-local distclean-enc distclean-golf distclean-extout
+.PHONY: realclean realclean-ext realclean-local realclean-enc realclean-golf realclean-extout
+.PHONY: check test test-all btest btest-ruby test-sample test-knownbug
+.PHONY: run runruby parse benchmark benchmark-each tbench gdb gdb-ruby
+.PHONY: update-mspec update-rubyspec test-rubyspec
PHONY:
-{$(VPATH)}parse.c: parse.y
+{$(VPATH)}parse.c: {$(VPATH)}parse.y $(srcdir)/tool/ytab.sed {$(VPATH)}id.h
+{$(VPATH)}parse.h: {$(VPATH)}parse.c
+
+{$(srcdir)}.y.c:
+ $(ECHO) generating $@
+ $(Q)$(BASERUBY) $(srcdir)/tool/id2token.rb --path-separator=$(PATH_SEPARATOR) --vpath=$(VPATH) id.h $(SRC_FILE) > parse.tmp.y
+ $(Q)$(YACC) -d $(YFLAGS) -o y.tab.c parse.tmp.y
+ $(Q)$(RM) parse.tmp.y
+ $(Q)sed -f $(srcdir)/tool/ytab.sed -e "/^#/s!parse\.tmp\.[iy]!parse.y!" -e "/^#/s!y\.tab\.c!$@!" y.tab.c > $@.new
+ $(Q)$(MV) $@.new $@
+ $(Q)sed -e "/^#line.*y\.tab\.h/d;/^#line.*parse.*\.y/d" y.tab.h > $(@:.c=.h)
+ $(Q)$(RM) y.tab.c y.tab.h
acosh.$(OBJEXT): {$(VPATH)}acosh.c
-alloca.$(OBJEXT): {$(VPATH)}alloca.c
+alloca.$(OBJEXT): {$(VPATH)}alloca.c {$(VPATH)}config.h
crypt.$(OBJEXT): {$(VPATH)}crypt.c
dup2.$(OBJEXT): {$(VPATH)}dup2.c
erf.$(OBJEXT): {$(VPATH)}erf.c
@@ -174,132 +586,460 @@ flock.$(OBJEXT): {$(VPATH)}flock.c
memcmp.$(OBJEXT): {$(VPATH)}memcmp.c
memmove.$(OBJEXT): {$(VPATH)}memmove.c
mkdir.$(OBJEXT): {$(VPATH)}mkdir.c
-vsnprintf.$(OBJEXT): {$(VPATH)}vsnprintf.c
-strcasecmp.$(OBJEXT): {$(VPATH)}strcasecmp.c
-strncasecmp.$(OBJEXT): {$(VPATH)}strncasecmp.c
+setproctitle.$(OBJEXT): {$(VPATH)}setproctitle.c {$(VPATH)}util.h $(RUBY_H_INCLUDES)
strchr.$(OBJEXT): {$(VPATH)}strchr.c
strdup.$(OBJEXT): {$(VPATH)}strdup.c
strerror.$(OBJEXT): {$(VPATH)}strerror.c
-strftime.$(OBJEXT): {$(VPATH)}strftime.c
+strlcat.$(OBJEXT): {$(VPATH)}strlcat.c
+strlcpy.$(OBJEXT): {$(VPATH)}strlcpy.c
strstr.$(OBJEXT): {$(VPATH)}strstr.c
strtod.$(OBJEXT): {$(VPATH)}strtod.c
strtol.$(OBJEXT): {$(VPATH)}strtol.c
-strtoul.$(OBJEXT): {$(VPATH)}strtoul.c
nt.$(OBJEXT): {$(VPATH)}nt.c
-x68.$(OBJEXT): {$(VPATH)}x68.c
os2.$(OBJEXT): {$(VPATH)}os2.c
dl_os2.$(OBJEXT): {$(VPATH)}dl_os2.c
+ia64.$(OBJEXT): {$(VPATH)}ia64.s
+ $(CC) $(CFLAGS) -c $<
-# when I use -I., there is confliction at "OpenFile"
-# so, set . into environment varible "include"
-win32.$(OBJEXT): {$(VPATH)}win32.c
+$(PLATFORM_D):
+ $(Q) $(MAKEDIRS) $(PLATFORM_DIR)
+ @exit > $@
###
-array.$(OBJEXT): {$(VPATH)}array.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}util.h {$(VPATH)}st.h
-bignum.$(OBJEXT): {$(VPATH)}bignum.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-class.$(OBJEXT): {$(VPATH)}class.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubysig.h {$(VPATH)}node.h {$(VPATH)}st.h
-compar.$(OBJEXT): {$(VPATH)}compar.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-dir.$(OBJEXT): {$(VPATH)}dir.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}util.h
-dln.$(OBJEXT): {$(VPATH)}dln.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}dln.h
-dmydln.$(OBJEXT): {$(VPATH)}dmydln.c {$(VPATH)}dln.c {$(VPATH)}ruby.h \
- config.h {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}dln.h
+RUBY_H_INCLUDES = {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}defines.h \
+ {$(VPATH)}intern.h {$(VPATH)}missing.h {$(VPATH)}st.h \
+ {$(VPATH)}subst.h
+ENCODING_H_INCLUDES= {$(VPATH)}encoding.h {$(VPATH)}oniguruma.h
+PROBES_H_INCLUDES = {$(VPATH)}probes.h
+VM_CORE_H_INCLUDES = {$(VPATH)}vm_core.h {$(VPATH)}thread_$(THREAD_MODEL).h \
+ {$(VPATH)}node.h {$(VPATH)}method.h {$(VPATH)}ruby_atomic.h \
+ {$(VPATH)}vm_debug.h {$(VPATH)}id.h
+
+addr2line.$(OBJEXT): {$(VPATH)}addr2line.c {$(VPATH)}addr2line.h {$(VPATH)}config.h
+array.$(OBJEXT): {$(VPATH)}array.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES) {$(VPATH)}id.h
+bignum.$(OBJEXT): {$(VPATH)}bignum.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
+ {$(VPATH)}thread.h {$(VPATH)}internal.h
+class.$(OBJEXT): {$(VPATH)}class.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h {$(VPATH)}constant.h
+compar.$(OBJEXT): {$(VPATH)}compar.c $(RUBY_H_INCLUDES)
+complex.$(OBJEXT): {$(VPATH)}complex.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}internal.h
+dir.$(OBJEXT): {$(VPATH)}dir.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
+ $(ENCODING_H_INCLUDES) \
+ {$(VPATH)}internal.h
+dln.$(OBJEXT): {$(VPATH)}dln.c {$(VPATH)}dln.h $(RUBY_H_INCLUDES)
+dln_find.$(OBJEXT): {$(VPATH)}dln_find.c {$(VPATH)}dln.h $(RUBY_H_INCLUDES)
+dmydln.$(OBJEXT): {$(VPATH)}dmydln.c $(RUBY_H_INCLUDES)
dmyext.$(OBJEXT): {$(VPATH)}dmyext.c
-enum.$(OBJEXT): {$(VPATH)}enum.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}node.h {$(VPATH)}util.h
-error.$(OBJEXT): {$(VPATH)}error.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}env.h {$(VPATH)}st.h
-eval.$(OBJEXT): {$(VPATH)}eval.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}node.h {$(VPATH)}env.h {$(VPATH)}util.h \
- {$(VPATH)}rubysig.h {$(VPATH)}st.h {$(VPATH)}dln.h
-file.$(OBJEXT): {$(VPATH)}file.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubyio.h {$(VPATH)}rubysig.h {$(VPATH)}util.h \
- {$(VPATH)}dln.h
-gc.$(OBJEXT): {$(VPATH)}gc.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubysig.h {$(VPATH)}st.h {$(VPATH)}node.h \
- {$(VPATH)}env.h {$(VPATH)}re.h {$(VPATH)}regex.h
-hash.$(OBJEXT): {$(VPATH)}hash.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}st.h {$(VPATH)}util.h {$(VPATH)}rubysig.h
-inits.$(OBJEXT): {$(VPATH)}inits.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-io.$(OBJEXT): {$(VPATH)}io.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubyio.h {$(VPATH)}rubysig.h {$(VPATH)}util.h \
- {$(VPATH)}env.h
-main.$(OBJEXT): {$(VPATH)}main.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-marshal.$(OBJEXT): {$(VPATH)}marshal.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubyio.h {$(VPATH)}st.h {$(VPATH)}util.h
-math.$(OBJEXT): {$(VPATH)}math.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-numeric.$(OBJEXT): {$(VPATH)}numeric.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}env.h {$(VPATH)}defines.h {$(VPATH)}intern.h \
- {$(VPATH)}missing.h
-object.$(OBJEXT): {$(VPATH)}object.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}st.h {$(VPATH)}util.h
-pack.$(OBJEXT): {$(VPATH)}pack.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-parse.$(OBJEXT): {$(VPATH)}parse.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}env.h {$(VPATH)}node.h {$(VPATH)}st.h \
- {$(VPATH)}regex.h {$(VPATH)}util.h {$(VPATH)}lex.c
-prec.$(OBJEXT): {$(VPATH)}prec.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-process.$(OBJEXT): {$(VPATH)}process.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubysig.h {$(VPATH)}st.h
-random.$(OBJEXT): {$(VPATH)}random.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-range.$(OBJEXT): {$(VPATH)}range.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-re.$(OBJEXT): {$(VPATH)}re.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}re.h {$(VPATH)}regex.h
-regex.$(OBJEXT): {$(VPATH)}regex.c config.h {$(VPATH)}regex.h
-ruby.$(OBJEXT): {$(VPATH)}ruby.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}dln.h {$(VPATH)}node.h {$(VPATH)}util.h
-signal.$(OBJEXT): {$(VPATH)}signal.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubysig.h
-sprintf.$(OBJEXT): {$(VPATH)}sprintf.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-st.$(OBJEXT): {$(VPATH)}st.c config.h {$(VPATH)}st.h
-string.$(OBJEXT): {$(VPATH)}string.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}re.h {$(VPATH)}regex.h
-struct.$(OBJEXT): {$(VPATH)}struct.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-time.$(OBJEXT): {$(VPATH)}time.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-util.$(OBJEXT): {$(VPATH)}util.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+dmyencoding.$(OBJEXT): {$(VPATH)}dmyencoding.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}regenc.h {$(VPATH)}util.h $(ENCODING_H_INCLUDES) \
+ {$(VPATH)}encoding.c {$(VPATH)}internal.h
+encoding.$(OBJEXT): {$(VPATH)}encoding.c $(RUBY_H_INCLUDES) \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}regenc.h {$(VPATH)}util.h \
+ {$(VPATH)}internal.h
+enum.$(OBJEXT): {$(VPATH)}enum.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h \
+ {$(VPATH)}util.h {$(VPATH)}id.h
+enumerator.$(OBJEXT): {$(VPATH)}enumerator.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}internal.h
+error.$(OBJEXT): {$(VPATH)}error.c {$(VPATH)}known_errors.inc \
+ $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) $(ENCODING_H_INCLUDES) \
+ {$(VPATH)}internal.h
+eval.$(OBJEXT): {$(VPATH)}eval.c {$(VPATH)}eval_intern.h {$(VPATH)}vm.h \
+ $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}eval_error.c \
+ {$(VPATH)}eval_jump.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
+load.$(OBJEXT): {$(VPATH)}load.c {$(VPATH)}eval_intern.h \
+ {$(VPATH)}util.h $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
+ {$(VPATH)}dln.h {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
+file.$(OBJEXT): {$(VPATH)}file.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}util.h {$(VPATH)}dln.h \
+ {$(VPATH)}internal.h
+gc.$(OBJEXT): {$(VPATH)}gc.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
+ {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
+ {$(VPATH)}gc.h {$(VPATH)}io.h {$(VPATH)}eval_intern.h {$(VPATH)}util.h \
+ {$(VPATH)}internal.h {$(VPATH)}constant.h \
+ {$(VPATH)}thread.h $(PROBES_H_INCLUDES)
+hash.$(OBJEXT): {$(VPATH)}hash.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
+inits.$(OBJEXT): {$(VPATH)}inits.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}internal.h
+io.$(OBJEXT): {$(VPATH)}io.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
+ {$(VPATH)}util.h $(ENCODING_H_INCLUDES) {$(VPATH)}dln.h \
+ {$(VPATH)}internal.h {$(VPATH)}thread.h {$(VPATH)}id.h
+main.$(OBJEXT): {$(VPATH)}main.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h {$(VPATH)}vm_debug.h
+marshal.$(OBJEXT): {$(VPATH)}marshal.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}util.h {$(VPATH)}internal.h
+math.$(OBJEXT): {$(VPATH)}math.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}internal.h
+node.$(OBJEXT): {$(VPATH)}node.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES)
+numeric.$(OBJEXT): {$(VPATH)}numeric.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}util.h $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h {$(VPATH)}id.h
+object.$(OBJEXT): {$(VPATH)}object.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
+ {$(VPATH)}internal.h {$(VPATH)}constant.h $(ENCODING_H_INCLUDES) $(PROBES_H_INCLUDES)
+pack.$(OBJEXT): {$(VPATH)}pack.c $(RUBY_H_INCLUDES) {$(VPATH)}encoding.h \
+ {$(VPATH)}oniguruma.h
+parse.$(OBJEXT): {$(VPATH)}parse.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}id.h {$(VPATH)}regenc.h \
+ {$(VPATH)}regex.h {$(VPATH)}util.h {$(VPATH)}lex.c \
+ {$(VPATH)}defs/keywords {$(VPATH)}id.c {$(VPATH)}parse.y \
+ {$(VPATH)}parse.h {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
+proc.$(OBJEXT): {$(VPATH)}proc.c {$(VPATH)}eval_intern.h \
+ $(RUBY_H_INCLUDES) {$(VPATH)}gc.h $(VM_CORE_H_INCLUDES) \
+ {$(VPATH)}internal.h {$(VPATH)}iseq.h
+process.$(OBJEXT): {$(VPATH)}process.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}util.h {$(VPATH)}io.h $(ENCODING_H_INCLUDES) {$(VPATH)}dln.h \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h \
+ {$(VPATH)}thread.h
+random.$(OBJEXT): {$(VPATH)}random.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}siphash.c {$(VPATH)}siphash.h
+range.$(OBJEXT): {$(VPATH)}range.c $(RUBY_H_INCLUDES) \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h {$(VPATH)}id.h
+rational.$(OBJEXT): {$(VPATH)}rational.c $(RUBY_H_INCLUDES) {$(VPATH)}internal.h
+re.$(OBJEXT): {$(VPATH)}re.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
+ {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) {$(VPATH)}util.h \
+ {$(VPATH)}regint.h {$(VPATH)}regenc.h {$(VPATH)}internal.h
+regcomp.$(OBJEXT): {$(VPATH)}regcomp.c {$(VPATH)}regparse.h \
+ {$(VPATH)}regint.h {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h \
+ $(RUBY_H_INCLUDES)
+regenc.$(OBJEXT): {$(VPATH)}regenc.c {$(VPATH)}regint.h \
+ {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
+regerror.$(OBJEXT): {$(VPATH)}regerror.c {$(VPATH)}regint.h \
+ {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
+regexec.$(OBJEXT): {$(VPATH)}regexec.c {$(VPATH)}regint.h \
+ {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
+regparse.$(OBJEXT): {$(VPATH)}regparse.c {$(VPATH)}regparse.h \
+ {$(VPATH)}regint.h {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h \
+ $(RUBY_H_INCLUDES)
+regsyntax.$(OBJEXT): {$(VPATH)}regsyntax.c {$(VPATH)}regint.h \
+ {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
+ruby.$(OBJEXT): {$(VPATH)}ruby.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}eval_intern.h $(VM_CORE_H_INCLUDES) \
+ {$(VPATH)}dln.h {$(VPATH)}internal.h
+safe.$(OBJEXT): {$(VPATH)}safe.c $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES)
+signal.$(OBJEXT): {$(VPATH)}signal.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES)
+sprintf.$(OBJEXT): {$(VPATH)}sprintf.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
+ {$(VPATH)}regex.h {$(VPATH)}vsnprintf.c $(ENCODING_H_INCLUDES)
+st.$(OBJEXT): {$(VPATH)}st.c $(RUBY_H_INCLUDES)
+strftime.$(OBJEXT): {$(VPATH)}strftime.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}timev.h $(ENCODING_H_INCLUDES)
+string.$(OBJEXT): {$(VPATH)}string.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
+ {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
+struct.$(OBJEXT): {$(VPATH)}struct.c $(RUBY_H_INCLUDES) {$(VPATH)}internal.h
+thread.$(OBJEXT): {$(VPATH)}thread.c {$(VPATH)}eval_intern.h \
+ $(RUBY_H_INCLUDES) {$(VPATH)}gc.h $(VM_CORE_H_INCLUDES) \
+ {$(VPATH)}thread_$(THREAD_MODEL).c $(ENCODING_H_INCLUDES) \
+ {$(VPATH)}internal.h {$(VPATH)}io.h {$(VPATH)}thread.h
+transcode.$(OBJEXT): {$(VPATH)}transcode.c $(RUBY_H_INCLUDES) \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}transcode_data.h {$(VPATH)}internal.h
+cont.$(OBJEXT): {$(VPATH)}cont.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}gc.h {$(VPATH)}eval_intern.h \
+ {$(VPATH)}internal.h
+time.$(OBJEXT): {$(VPATH)}time.c $(RUBY_H_INCLUDES) \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}timev.h {$(VPATH)}internal.h
+util.$(OBJEXT): {$(VPATH)}util.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
+ {$(VPATH)}internal.h
+variable.$(OBJEXT): {$(VPATH)}variable.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}node.h {$(VPATH)}util.h {$(VPATH)}encoding.h \
+ {$(VPATH)}oniguruma.h {$(VPATH)}internal.h {$(VPATH)}constant.h
+version.$(OBJEXT): {$(VPATH)}version.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}version.h $(srcdir)/version.h $(srcdir)/revision.h {$(VPATH)}config.h \
+ verconf.h
+dmyversion.$(OBJEXT): {$(VPATH)}dmyversion.c version.$(OBJEXT)
+
+compile.$(OBJEXT): {$(VPATH)}compile.c {$(VPATH)}iseq.h \
+ $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}insns.inc \
+ {$(VPATH)}insns_info.inc {$(VPATH)}optinsn.inc \
+ {$(VPATH)}optunifs.inc {$(VPATH)}opt_sc.inc {$(VPATH)}insns.inc \
+ {$(VPATH)}internal.h
+iseq.$(OBJEXT): {$(VPATH)}iseq.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
+ $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}insns.inc \
+ {$(VPATH)}insns_info.inc {$(VPATH)}node_name.inc {$(VPATH)}internal.h
+vm.$(OBJEXT): {$(VPATH)}vm.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
+ {$(VPATH)}eval_intern.h $(RUBY_H_INCLUDES) $(ENCODING_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}vm_method.c {$(VPATH)}vm_eval.c \
+ {$(VPATH)}vm_insnhelper.c {$(VPATH)}vm_insnhelper.h {$(VPATH)}vm_exec.c \
+ {$(VPATH)}vm_exec.h {$(VPATH)}insns.def {$(VPATH)}vmtc.inc \
+ {$(VPATH)}vm.inc {$(VPATH)}insns.inc \
+ {$(VPATH)}internal.h {$(VPATH)}vm.h {$(VPATH)}constant.h \
+ $(PROBES_H_INCLUDES) {$(VPATH)}probes_helper.h
+vm_dump.$(OBJEXT): {$(VPATH)}vm_dump.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}addr2line.h \
+ {$(VPATH)}internal.h
+debug.$(OBJEXT): {$(VPATH)}debug.c $(RUBY_H_INCLUDES) \
+ $(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}eval_intern.h \
{$(VPATH)}util.h
-variable.$(OBJEXT): {$(VPATH)}variable.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}env.h {$(VPATH)}node.h {$(VPATH)}st.h {$(VPATH)}util.h
-version.$(OBJEXT): {$(VPATH)}version.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}version.h
-
-dist: $(PROGRAM)
- $(RUNRUBY) $(srcdir)/distruby.rb
+id.$(OBJEXT): {$(VPATH)}id.c $(RUBY_H_INCLUDES) {$(VPATH)}id.h {$(VPATH)}vm_opts.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}vm_backtrace.c \
+ $(VM_CORE_H_INCLUDES) $(RUBY_H_INCLUDES) $(ENCODING_H_INCLUDES) \
+ {$(VPATH)}internal.h {$(VPATH)}iseq.h {$(VPATH)}debug.h
+vm_trace.$(OBJEXT): {$(VPATH)}vm_trace.c $(ENCODING_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) $(RUBY_H_INCLUDES) {$(VPATH)}debug.h \
+ {$(VPATH)}internal.h
+miniprelude.$(OBJEXT): {$(VPATH)}miniprelude.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h
+prelude.$(OBJEXT): {$(VPATH)}prelude.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h
+golf_prelude.$(OBJEXT): {$(VPATH)}golf_prelude.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h
+goruby.$(OBJEXT): {$(VPATH)}goruby.c {$(VPATH)}main.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}vm_debug.h {$(VPATH)}node.h
+
+ascii.$(OBJEXT): {$(VPATH)}ascii.c {$(VPATH)}regenc.h {$(VPATH)}config.h \
+ {$(VPATH)}oniguruma.h {$(VPATH)}missing.h $(RUBY_H_INCLUDES)
+us_ascii.$(OBJEXT): {$(VPATH)}us_ascii.c {$(VPATH)}regenc.h \
+ {$(VPATH)}config.h {$(VPATH)}oniguruma.h {$(VPATH)}missing.h $(RUBY_H_INCLUDES)
+unicode.$(OBJEXT): {$(VPATH)}unicode.c {$(VPATH)}regint.h \
+ {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}regenc.h \
+ {$(VPATH)}oniguruma.h {$(VPATH)}st.h {$(VPATH)}ruby.h \
+ {$(VPATH)}missing.h {$(VPATH)}intern.h \
+ {$(VPATH)}enc/unicode/name2ctype.h {$(VPATH)}enc/unicode/casefold.h \
+ {$(VPATH)}subst.h $(RUBY_H_INCLUDES)
+
+utf_8.$(OBJEXT): {$(VPATH)}utf_8.c {$(VPATH)}regenc.h {$(VPATH)}config.h \
+ {$(VPATH)}oniguruma.h {$(VPATH)}missing.h $(RUBY_H_INCLUDES)
+
+win32/win32.$(OBJEXT): {$(VPATH)}win32/win32.c $(RUBY_H_INCLUDES) $(PLATFORM_D)
+win32/file.$(OBJEXT): {$(VPATH)}win32/file.c $(RUBY_H_INCLUDES) $(PLATFORM_D)
+
+$(NEWLINE_C): $(srcdir)/enc/trans/newline.trans $(srcdir)/tool/transcode-tblgen.rb
+ $(Q) $(BASERUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo $@ $(srcdir)/enc/trans/newline.trans
+newline.$(OBJEXT): $(NEWLINE_C) {$(VPATH)}defines.h \
+ {$(VPATH)}intern.h {$(VPATH)}missing.h {$(VPATH)}st.h \
+ {$(VPATH)}transcode_data.h {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}subst.h
+
+DTRACE_DEPENDENT_OBJS = array.$(OBJEXT) \
+ eval.$(OBJEXT) \
+ gc.$(OBJEXT) \
+ hash.$(OBJEXT) \
+ load.$(OBJEXT) \
+ object.$(OBJEXT) \
+ parse.$(OBJEXT) \
+ string.$(OBJEXT) \
+ vm.$(OBJEXT)
+
+probes.$(OBJEXT): $(DTRACE_DEPENDENT_OBJS)
+ruby-glommed.$(OBJEXT): $(OBJS) $(DTRACE_OBJ)
+
+$(OBJS): {$(VPATH)}config.h {$(VPATH)}missing.h
+
+INSNS2VMOPT = --srcdir="$(srcdir)"
+
+{$(VPATH)}minsns.inc: $(srcdir)/template/minsns.inc.tmpl
+
+{$(VPATH)}opt_sc.inc: $(srcdir)/template/opt_sc.inc.tmpl
+
+{$(VPATH)}optinsn.inc: $(srcdir)/template/optinsn.inc.tmpl
+
+{$(VPATH)}optunifs.inc: $(srcdir)/template/optunifs.inc.tmpl
+
+{$(VPATH)}insns.inc: $(srcdir)/template/insns.inc.tmpl
+
+{$(VPATH)}insns_info.inc: $(srcdir)/template/insns_info.inc.tmpl
+
+{$(VPATH)}vmtc.inc: $(srcdir)/template/vmtc.inc.tmpl
+
+{$(VPATH)}vm.inc: $(srcdir)/template/vm.inc.tmpl
+
+srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c {$(VPATH)}newline.c {$(VPATH)}id.c srcs-ext srcs-enc
+
+EXT_SRCS = $(srcdir)/ext/ripper/ripper.c $(srcdir)/ext/json/parser/parser.c \
+ $(srcdir)/ext/dl/callback/callback.c
+
+srcs-ext: $(EXT_SRCS)
+
+srcs-enc: $(ENC_MK)
+ $(ECHO) making srcs under enc
+ $(Q) $(MAKE) -f $(ENC_MK) RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(MFLAGS) srcs
+
+all-incs: incs
+incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}encdb.h {$(VPATH)}transdb.h {$(VPATH)}known_errors.inc \
+ $(srcdir)/revision.h $(REVISION_H) enc/unicode/name2ctype.h {$(VPATH)}id.h {$(VPATH)}probes.dmyh
+
+insns: $(INSNS)
+
+id.h: $(srcdir)/tool/generic_erb.rb $(srcdir)/template/id.h.tmpl $(srcdir)/defs/id.def
+ $(ECHO) generating $@
+ $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb --output=$@ \
+ $(srcdir)/template/$@.tmpl
+
+id.c: $(srcdir)/tool/generic_erb.rb $(srcdir)/template/id.c.tmpl $(srcdir)/defs/id.def
+ $(ECHO) generating $@
+ $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb --output=$@ \
+ $(srcdir)/template/$@.tmpl
+
+node_name.inc: {$(VPATH)}node.h
+ $(ECHO) generating $@
+ $(Q) $(BASERUBY) -n $(srcdir)/tool/node_name.rb < $? > $@
+
+encdb.h: $(PREP) $(srcdir)/tool/generic_erb.rb $(srcdir)/template/encdb.h.tmpl
+ $(ECHO) generating $@
+ $(Q) $(MINIRUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/encdb.h.tmpl $(srcdir)/enc enc
+
+transdb.h: $(PREP) srcs-enc $(srcdir)/tool/generic_erb.rb $(srcdir)/template/transdb.h.tmpl
+ $(ECHO) generating $@
+ $(Q) $(MINIRUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/transdb.h.tmpl $(srcdir)/enc/trans enc/trans
+
+enc/encinit.c: $(ENC_MK) $(srcdir)/enc/encinit.c.erb
+
+known_errors.inc: $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_errors.def
+ $(ECHO) generating $@
+ $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_errors.def
+
+$(MINIPRELUDE_C): $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb
+ $(ECHO) generating $@
+ $(Q) $(BASERUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb $@
+
+prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) \
+ $(srcdir)/lib/rubygems/defaults.rb \
+ $(srcdir)/lib/rubygems/core_ext/kernel_gem.rb \
+ $(PRELUDE_SCRIPTS) $(PREP)
+ $(ECHO) generating $@
+ $(Q) $(COMPILE_PRELUDE) $(PRELUDE_SCRIPTS) $@
+
+golf_prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) $(srcdir)/prelude.rb $(srcdir)/golf_prelude.rb $(PREP)
+ $(ECHO) generating $@
+ $(Q) $(COMPILE_PRELUDE) $(srcdir)/golf_prelude.rb $@
+
+probes.dmyh: {$(srcdir)}probes.d $(srcdir)/tool/gen_dummy_probes.rb
+ $(BASERUBY) $(srcdir)/tool/gen_dummy_probes.rb $(srcdir)/probes.d > $@
+
+probes.h: {$(VPATH)}probes.$(DTRACE_EXT)
+
+prereq: incs srcs preludes PHONY
+
+preludes: {$(VPATH)}miniprelude.c
+preludes: {$(srcdir)}golf_prelude.c
+
+$(srcdir)/revision.h:
+ @exit > $@
+
+$(REVISION_H): $(srcdir)/version.h $(srcdir)/ChangeLog $(srcdir)/tool/file2lastrev.rb $(REVISION_FORCE)
+ -$(Q) $(BASERUBY) $(srcdir)/tool/file2lastrev.rb --revision.h "$(srcdir)" > revision.tmp
+ $(Q)$(IFCHANGE) "--timestamp=$@" "$(srcdir)/revision.h" revision.tmp
+
+$(srcdir)/ext/ripper/ripper.c: parse.y
+ $(ECHO) generating $@
+ $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
+ Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. RUBY="$(BASERUBY)"
+
+$(srcdir)/ext/json/parser/parser.c: $(srcdir)/ext/json/parser/parser.rl
+ $(ECHO) generating $@
+ $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk $(MFLAGS) \
+ Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=.
+
+$(srcdir)/ext/dl/callback/callback.c: $(srcdir)/ext/dl/callback/mkcallback.rb $(srcdir)/ext/dl/dl.h
+ $(ECHO) generating $@
+ $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
+ Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. RUBY="$(BASERUBY)"
+
+##
+
+run: fake miniruby$(EXEEXT) PHONY
+ $(BTESTRUBY) $(TESTRUN_SCRIPT) $(RUNOPT)
+
+runruby: $(PROGRAM) PHONY
+ $(RUNRUBY) $(TESTRUN_SCRIPT)
+
+parse: fake miniruby$(EXEEXT) PHONY
+ $(BTESTRUBY) $(srcdir)/tool/parse.rb $(TESTRUN_SCRIPT)
+
+COMPARE_RUBY = $(BASERUBY)
+ITEM =
+OPTS =
+
+benchmark: $(PROGRAM) PHONY
+ $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
+ --pattern='bm_' --directory=$(srcdir)/benchmark $(OPTS)
+
+benchmark-each: $(PROGRAM) PHONY
+ $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
+ --pattern=$(ITEM) --directory=$(srcdir)/benchmark $(OPTS)
+
+tbench: $(PROGRAM) PHONY
+ $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
+ --pattern='bmx_' --directory=$(srcdir)/benchmark $(OPTS)
+
+run.gdb:
+ echo b ruby_debug_breakpoint > run.gdb
+ echo '# handle SIGINT nostop' >> run.gdb
+ echo '# handle SIGPIPE nostop' >> run.gdb
+ echo '# b rb_longjmp' >> run.gdb
+ echo source $(srcdir)/breakpoints.gdb >> run.gdb
+ echo source $(srcdir)/.gdbinit >> run.gdb
+ echo 'set $$_exitcode = -999' >> run.gdb
+ echo run >> run.gdb
+ echo 'if $$_exitcode != -999' >> run.gdb
+ echo ' quit' >> run.gdb
+ echo end >> run.gdb
+
+
+gdb: miniruby$(EXEEXT) run.gdb PHONY
+ gdb -x run.gdb --quiet --args $(MINIRUBY) $(TESTRUN_SCRIPT)
+
+gdb-ruby: $(PROGRAM) run.gdb PHONY
+ $(Q) $(RUNRUBY_COMMAND) $(RUNRUBY_DEBUGGER) -- $(TESTRUN_SCRIPT)
+
+dist:
+ $(BASERUBY) $(srcdir)/tool/make-snapshot tmp $(RELNAME)
+
+up::
+ -$(Q)$(MAKE) $(MFLAGS) REVISION_FORCE=PHONY "$(REVISION_H)"
+
+info: info-program info-libruby_a info-libruby_so info-arch
+info-program:
+ @echo PROGRAM=$(PROGRAM)
+info-libruby_a:
+ @echo LIBRUBY_A=$(LIBRUBY_A)
+info-libruby_so:
+ @echo LIBRUBY_SO=$(LIBRUBY_SO)
+info-arch:
+ @echo arch=$(arch)
+
+change: PHONY
+ $(BASERUBY) -C "$(srcdir)" ./tool/change_maker.rb $(CHANGES) > change.log
+
+love: sudo-precheck up all test install test-all
+ @echo love is all you need
+
+sudo-precheck:
+ @$(SUDO) echo > $(NULL)
+
+help: PHONY
+ $(MESSAGE_BEGIN) \
+ " Makefile of Ruby" \
+ "" \
+ "targets:" \
+ " all (default): builds all of below" \
+ " miniruby: builds only miniruby" \
+ " encs: builds encodings" \
+ " exts: builds extensions" \
+ " main: builds encodings, extensions and ruby" \
+ " docs: builds documents" \
+ " run: runs test.rb by miniruby" \
+ " runruby: runs test.rb by ruby you just built" \
+ " gdb: runs test.rb by miniruby under gdb" \
+ " gdb-ruby: runs test.rb by ruby under gdb" \
+ " check: equals make test test-all" \
+ " test: ruby core tests" \
+ " test-all: all ruby tests" \
+ " test-rubyspec: run RubySpec test suite" \
+ " update-rubyspec: update local copy of RubySpec" \
+ " benchmark: benchmark this ruby and COMPARE_RUBY" \
+ " install: install all ruby distributions" \
+ " install-nodoc: install without rdoc" \
+ " install-cross: install cross compiling staff" \
+ " clean: clean for tarball" \
+ " distclean: clean for repository" \
+ " change: make change log template" \
+ " golf: for golfers" \
+ "" \
+ "see DeveloperHowto for more detail: " \
+ " http://bugs.ruby-lang.org/wiki/ruby/DeveloperHowto" \
+ $(MESSAGE_END)
diff --git a/compar.c b/compar.c
index 3cd3216b77..65def78484 100644
--- a/compar.c
+++ b/compar.c
@@ -2,40 +2,21 @@
compar.c -
- $Author: dave $
- $Date: 2003/12/19 00:01:18 $
+ $Author$
created at: Thu Aug 26 14:39:48 JST 1993
- Copyright (C) 1993-2003 Yukihiro Matsumoto
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
VALUE rb_mComparable;
static ID cmp;
-int
-rb_cmpint(val, a, b)
- VALUE val, a, b;
-{
- if (NIL_P(val)) {
- rb_cmperr(a, b);
- }
- if (FIXNUM_P(val)) return FIX2INT(val);
- if (TYPE(val) == T_BIGNUM) {
- if (RBIGNUM(val)->sign) return 1;
- return -1;
- }
- if (RTEST(rb_funcall(val, '>', 1, INT2FIX(0)))) return 1;
- if (RTEST(rb_funcall(val, '<', 1, INT2FIX(0)))) return -1;
- return 0;
-}
-
void
-rb_cmperr(x, y)
- VALUE x, y;
+rb_cmperr(VALUE x, VALUE y)
{
const char *classname;
@@ -50,37 +31,33 @@ rb_cmperr(x, y)
rb_obj_classname(x), classname);
}
-#define cmperr() (rb_cmperr(x, y), Qnil)
-
static VALUE
-cmp_eq(a)
- VALUE *a;
+cmp_eq(VALUE *a)
{
VALUE c = rb_funcall(a[0], cmp, 1, a[1]);
- if (NIL_P(c)) return Qnil;
+ if (NIL_P(c)) return Qfalse;
if (rb_cmpint(c, a[0], a[1]) == 0) return Qtrue;
return Qfalse;
}
static VALUE
-cmp_failed()
+cmp_failed(void)
{
- return Qnil;
+ return Qfalse;
}
/*
* call-seq:
- * obj == other => true or false
- *
+ * obj == other -> true or false
+ *
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns 0. Also returns true if
* _obj_ and _other_ are the same object.
*/
static VALUE
-cmp_equal(x, y)
- VALUE x, y;
+cmp_equal(VALUE x, VALUE y)
{
VALUE a[2];
@@ -92,99 +69,89 @@ cmp_equal(x, y)
/*
* call-seq:
- * obj > other => true or false
- *
+ * obj > other -> true or false
+ *
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns 1.
*/
static VALUE
-cmp_gt(x, y)
- VALUE x, y;
+cmp_gt(VALUE x, VALUE y)
{
VALUE c = rb_funcall(x, cmp, 1, y);
- if (NIL_P(c)) return cmperr();
if (rb_cmpint(c, x, y) > 0) return Qtrue;
return Qfalse;
}
/*
* call-seq:
- * obj >= other => true or false
- *
+ * obj >= other -> true or false
+ *
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns 0 or 1.
*/
static VALUE
-cmp_ge(x, y)
- VALUE x, y;
+cmp_ge(VALUE x, VALUE y)
{
VALUE c = rb_funcall(x, cmp, 1, y);
- if (NIL_P(c)) return cmperr();
if (rb_cmpint(c, x, y) >= 0) return Qtrue;
return Qfalse;
}
/*
* call-seq:
- * obj < other => true or false
- *
+ * obj < other -> true or false
+ *
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns -1.
*/
static VALUE
-cmp_lt(x, y)
- VALUE x, y;
+cmp_lt(VALUE x, VALUE y)
{
VALUE c = rb_funcall(x, cmp, 1, y);
- if (NIL_P(c)) return cmperr();
if (rb_cmpint(c, x, y) < 0) return Qtrue;
return Qfalse;
}
-
/*
* call-seq:
- * obj <= other => true or false
- *
+ * obj <= other -> true or false
+ *
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns -1 or 0.
*/
static VALUE
-cmp_le(x, y)
- VALUE x, y;
+cmp_le(VALUE x, VALUE y)
{
VALUE c = rb_funcall(x, cmp, 1, y);
- if (NIL_P(c)) return cmperr();
if (rb_cmpint(c, x, y) <= 0) return Qtrue;
return Qfalse;
}
/*
* call-seq:
- * obj.between?(min, max) => true or false
- *
+ * obj.between?(min, max) -> true or false
+ *
* Returns <code>false</code> if <i>obj</i> <code><=></code>
* <i>min</i> is less than zero or if <i>anObject</i> <code><=></code>
* <i>max</i> is greater than zero, <code>true</code> otherwise.
- *
+ *
* 3.between?(1, 5) #=> true
* 6.between?(1, 5) #=> false
* 'cat'.between?('ant', 'dog') #=> true
* 'gnu'.between?('ant', 'dog') #=> false
- *
+ *
*/
static VALUE
-cmp_between(x, min, max)
- VALUE x, min, max;
+cmp_between(VALUE x, VALUE min, VALUE max)
{
if (RTEST(cmp_lt(x, min))) return Qfalse;
if (RTEST(cmp_gt(x, max))) return Qfalse;
@@ -196,11 +163,13 @@ cmp_between(x, min, max)
* may be ordered. The class must define the <code><=></code> operator,
* which compares the receiver against another object, returning -1, 0,
* or +1 depending on whether the receiver is less than, equal to, or
- * greater than the other object. <code>Comparable</code> uses
+ * greater than the other object. If the other object is not comparable
+ * then the <code><=></code> operator should return nil.
+ * <code>Comparable</code> uses
* <code><=></code> to implement the conventional comparison operators
* (<code><</code>, <code><=</code>, <code>==</code>, <code>>=</code>,
* and <code>></code>) and the method <code>between?</code>.
- *
+ *
* class SizeMatters
* include Comparable
* attr :str
@@ -214,23 +183,26 @@ cmp_between(x, min, max)
* @str
* end
* end
- *
+ *
* s1 = SizeMatters.new("Z")
* s2 = SizeMatters.new("YY")
* s3 = SizeMatters.new("XXX")
* s4 = SizeMatters.new("WWWW")
* s5 = SizeMatters.new("VVVVV")
- *
+ *
* s1 < s2 #=> true
* s4.between?(s1, s3) #=> false
* s4.between?(s3, s5) #=> true
* [ s3, s2, s5, s4, s1 ].sort #=> [Z, YY, XXX, WWWW, VVVVV]
- *
+ *
*/
void
-Init_Comparable()
+Init_Comparable(void)
{
+#undef rb_intern
+#define rb_intern(str) rb_intern_const(str)
+
rb_mComparable = rb_define_module("Comparable");
rb_define_method(rb_mComparable, "==", cmp_equal, 1);
rb_define_method(rb_mComparable, ">", cmp_gt, 1);
diff --git a/compile.c b/compile.c
new file mode 100644
index 0000000000..7dffe08141
--- /dev/null
+++ b/compile.c
@@ -0,0 +1,5851 @@
+/**********************************************************************
+
+ compile.c - ruby node tree -> VM instruction sequence
+
+ $Author$
+ created at: 04/01/01 03:42:15 JST
+
+ Copyright (C) 2004-2007 Koichi Sasada
+
+**********************************************************************/
+
+#include "ruby/ruby.h"
+#include "internal.h"
+#include <math.h>
+
+#define USE_INSN_STACK_INCREASE 1
+#include "vm_core.h"
+#include "iseq.h"
+#include "insns.inc"
+#include "insns_info.inc"
+
+#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
+#define FIXNUM_INC(n, i) ((n)+(INT2FIX(i)&~FIXNUM_FLAG))
+#define FIXNUM_OR(n, i) ((n)|INT2FIX(i))
+
+typedef struct iseq_link_element {
+ enum {
+ ISEQ_ELEMENT_NONE,
+ ISEQ_ELEMENT_LABEL,
+ ISEQ_ELEMENT_INSN,
+ ISEQ_ELEMENT_ADJUST
+ } type;
+ struct iseq_link_element *next;
+ struct iseq_link_element *prev;
+} LINK_ELEMENT;
+
+typedef struct iseq_link_anchor {
+ LINK_ELEMENT anchor;
+ LINK_ELEMENT *last;
+} LINK_ANCHOR;
+
+typedef struct iseq_label_data {
+ LINK_ELEMENT link;
+ int label_no;
+ int position;
+ int sc_state;
+ int set;
+ int sp;
+} LABEL;
+
+typedef struct iseq_insn_data {
+ LINK_ELEMENT link;
+ enum ruby_vminsn_type insn_id;
+ unsigned int line_no;
+ int operand_size;
+ int sc_state;
+ VALUE *operands;
+} INSN;
+
+typedef struct iseq_adjust_data {
+ LINK_ELEMENT link;
+ LABEL *label;
+ int line_no;
+} ADJUST;
+
+struct ensure_range {
+ LABEL *begin;
+ LABEL *end;
+ struct ensure_range *next;
+};
+
+struct iseq_compile_data_ensure_node_stack {
+ NODE *ensure_node;
+ struct iseq_compile_data_ensure_node_stack *prev;
+ struct ensure_range *erange;
+};
+
+/**
+ * debug function(macro) interface depend on CPDEBUG
+ * if it is less than 0, runtime option is in effect.
+ *
+ * debug level:
+ * 0: no debug output
+ * 1: show node type
+ * 2: show node important parameters
+ * ...
+ * 5: show other parameters
+ * 10: show every AST array
+ */
+
+#ifndef CPDEBUG
+#define CPDEBUG 0
+#endif
+
+#if CPDEBUG >= 0
+#define compile_debug CPDEBUG
+#else
+#define compile_debug iseq->compile_data->option->debug_level
+#endif
+
+#if CPDEBUG
+
+#define compile_debug_print_indent(level) \
+ ruby_debug_print_indent((level), compile_debug, gl_node_level * 2)
+
+#define debugp(header, value) (void) \
+ (compile_debug_print_indent(1) && \
+ ruby_debug_print_value(1, compile_debug, (header), (value)))
+
+#define debugi(header, id) (void) \
+ (compile_debug_print_indent(1) && \
+ ruby_debug_print_id(1, compile_debug, (header), (id)))
+
+#define debugp_param(header, value) (void) \
+ (compile_debug_print_indent(1) && \
+ ruby_debug_print_value(1, compile_debug, (header), (value)))
+
+#define debugp_verbose(header, value) (void) \
+ (compile_debug_print_indent(2) && \
+ ruby_debug_print_value(2, compile_debug, (header), (value)))
+
+#define debugp_verbose_node(header, value) (void) \
+ (compile_debug_print_indent(10) && \
+ ruby_debug_print_value(10, compile_debug, (header), (value)))
+
+#define debug_node_start(node) ((void) \
+ (compile_debug_print_indent(1) && \
+ (ruby_debug_print_node(1, CPDEBUG, "", (NODE *)(node)), gl_node_level)), \
+ gl_node_level++)
+
+#define debug_node_end() gl_node_level --
+
+#else
+
+static inline ID
+r_id(ID id)
+{
+ return id;
+}
+
+static inline VALUE
+r_value(VALUE value)
+{
+ return value;
+}
+
+#define debugi(header, id) r_id(id)
+#define debugp(header, value) r_value(value)
+#define debugp_verbose(header, value) r_value(value)
+#define debugp_verbose_node(header, value) r_value(value)
+#define debugp_param(header, value) r_value(value)
+#define debug_node_start(node) ((void)0)
+#define debug_node_end() ((void)0)
+#endif
+
+#if CPDEBUG > 1 || CPDEBUG < 0
+#define debugs if (compile_debug_print_indent(1)) ruby_debug_printf
+#define debug_compile(msg, v) ((void)(compile_debug_print_indent(1) && fputs((msg), stderr)), (v))
+#else
+#define debugs if(0)printf
+#define debug_compile(msg, v) (v)
+#endif
+
+
+/* create new label */
+#define NEW_LABEL(l) new_label_body(iseq, (l))
+
+#define iseq_path(iseq) \
+ (((rb_iseq_t*)DATA_PTR(iseq))->location.path)
+
+#define iseq_absolute_path(iseq) \
+ (((rb_iseq_t*)DATA_PTR(iseq))->location.absolute_path)
+
+#define NEW_ISEQVAL(node, name, type, line_no) \
+ new_child_iseq(iseq, (node), (name), 0, (type), (line_no))
+
+#define NEW_CHILD_ISEQVAL(node, name, type, line_no) \
+ new_child_iseq(iseq, (node), (name), iseq->self, (type), (line_no))
+
+/* add instructions */
+#define ADD_SEQ(seq1, seq2) \
+ APPEND_LIST((seq1), (seq2))
+
+/* add an instruction */
+#define ADD_INSN(seq, line, insn) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) new_insn_body(iseq, (line), BIN(insn), 0))
+
+/* add an instruction with some operands (1, 2, 3, 5) */
+#define ADD_INSN1(seq, line, insn, op1) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) \
+ new_insn_body(iseq, (line), BIN(insn), 1, (VALUE)(op1)))
+
+/* add an instruction with label operand (alias of ADD_INSN1) */
+#define ADD_INSNL(seq, line, insn, label) ADD_INSN1(seq, line, insn, label)
+
+#define ADD_INSN2(seq, line, insn, op1, op2) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) \
+ new_insn_body(iseq, (line), BIN(insn), 2, (VALUE)(op1), (VALUE)(op2)))
+
+#define ADD_INSN3(seq, line, insn, op1, op2, op3) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) \
+ new_insn_body(iseq, (line), BIN(insn), 3, (VALUE)(op1), (VALUE)(op2), (VALUE)(op3)))
+
+/* Specific Insn factory */
+#define ADD_SEND(seq, line, id, argc) \
+ ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (VALUE)INT2FIX(0))
+
+#define ADD_CALL_RECEIVER(seq, line) \
+ ADD_INSN((seq), (line), putself)
+
+#define ADD_CALL(seq, line, id, argc) \
+ ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (VALUE)INT2FIX(VM_CALL_FCALL))
+
+#define ADD_CALL_WITH_BLOCK(seq, line, id, argc, block) \
+ ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(VM_CALL_FCALL))
+
+#define ADD_SEND_R(seq, line, id, argc, block, flag) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) \
+ new_insn_send(iseq, (line), \
+ (VALUE)(id), (VALUE)(argc), (VALUE)(block), (VALUE)(flag)))
+
+#define ADD_TRACE(seq, line, event) \
+ do { \
+ if ((event) == RUBY_EVENT_LINE && iseq->coverage && \
+ (line) != iseq->compile_data->last_coverable_line) { \
+ RARRAY_PTR(iseq->coverage)[(line) - 1] = INT2FIX(0); \
+ iseq->compile_data->last_coverable_line = (line); \
+ ADD_INSN1((seq), (line), trace, INT2FIX(RUBY_EVENT_COVERAGE)); \
+ } \
+ if (iseq->compile_data->option->trace_instruction) { \
+ ADD_INSN1((seq), (line), trace, INT2FIX(event)); \
+ } \
+ } while (0)
+
+/* add label */
+#define ADD_LABEL(seq, label) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) (label))
+
+#define APPEND_LABEL(seq, before, label) \
+ APPEND_ELEM((seq), (before), (LINK_ELEMENT *) (label))
+
+#define ADD_ADJUST(seq, line, label) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) new_adjust_body(iseq, (label), (line)))
+
+#define ADD_ADJUST_RESTORE(seq, label) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) new_adjust_body(iseq, (label), -1))
+
+#define ADD_CATCH_ENTRY(type, ls, le, iseqv, lc) \
+ (rb_ary_push(iseq->compile_data->catch_table_ary, \
+ rb_ary_new3(5, (type), \
+ (VALUE)(ls) | 1, (VALUE)(le) | 1, \
+ (VALUE)(iseqv), (VALUE)(lc) | 1)))
+
+/* compile node */
+#define COMPILE(anchor, desc, node) \
+ (debug_compile("== " desc "\n", \
+ iseq_compile_each(iseq, (anchor), (node), 0)))
+
+/* compile node, this node's value will be popped */
+#define COMPILE_POPED(anchor, desc, node) \
+ (debug_compile("== " desc "\n", \
+ iseq_compile_each(iseq, (anchor), (node), 1)))
+
+/* compile node, which is popped when 'poped' is true */
+#define COMPILE_(anchor, desc, node, poped) \
+ (debug_compile("== " desc "\n", \
+ iseq_compile_each(iseq, (anchor), (node), (poped))))
+
+#define OPERAND_AT(insn, idx) \
+ (((INSN*)(insn))->operands[(idx)])
+
+#define INSN_OF(insn) \
+ (((INSN*)(insn))->insn_id)
+
+/* error */
+#define COMPILE_ERROR(strs) \
+{ \
+ VALUE tmp = GET_THREAD()->errinfo; \
+ if (compile_debug) rb_compile_bug strs; \
+ GET_THREAD()->errinfo = iseq->compile_data->err_info; \
+ rb_compile_error strs; \
+ iseq->compile_data->err_info = GET_THREAD()->errinfo; \
+ GET_THREAD()->errinfo = tmp; \
+ ret = 0; \
+ break; \
+}
+
+#define ERROR_ARGS ruby_sourcefile, nd_line(node),
+
+
+#define COMPILE_OK 1
+#define COMPILE_NG 0
+
+
+/* leave name uninitialized so that compiler warn if INIT_ANCHOR is
+ * missing */
+#define DECL_ANCHOR(name) \
+ LINK_ANCHOR *name, name##_body__ = {{0,},}
+#define INIT_ANCHOR(name) \
+ (name##_body__.last = &name##_body__.anchor, name = &name##_body__)
+
+#define hide_obj(obj) do {OBJ_FREEZE(obj); RBASIC(obj)->klass = 0;} while (0)
+
+#include "optinsn.inc"
+#if OPT_INSTRUCTIONS_UNIFICATION
+#include "optunifs.inc"
+#endif
+
+/* for debug */
+#if CPDEBUG < 0
+#define ISEQ_ARG iseq,
+#define ISEQ_ARG_DECLARE rb_iseq_t *iseq,
+#else
+#define ISEQ_ARG
+#define ISEQ_ARG_DECLARE
+#endif
+
+#if CPDEBUG
+#define gl_node_level iseq->compile_data->node_level
+#if 0
+static void debug_list(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor);
+#endif
+#endif
+
+static void dump_disasm_list(LINK_ELEMENT *elem);
+
+static int insn_data_length(INSN *iobj);
+static int insn_data_line_no(INSN *iobj);
+static int calc_sp_depth(int depth, INSN *iobj);
+
+static INSN *new_insn_body(rb_iseq_t *iseq, int line_no, int insn_id, int argc, ...);
+static LABEL *new_label_body(rb_iseq_t *iseq, long line);
+static ADJUST *new_adjust_body(rb_iseq_t *iseq, LABEL *label, int line);
+
+static int iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *anchor, NODE * n, int);
+static int iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
+static int iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
+static int iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
+
+static int iseq_set_local_table(rb_iseq_t *iseq, ID *tbl);
+static int iseq_set_exception_local_table(rb_iseq_t *iseq);
+static int iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *anchor, NODE * node);
+
+static int iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
+static int iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
+static int iseq_set_exception_table(rb_iseq_t *iseq);
+static int iseq_set_optargs_table(rb_iseq_t *iseq);
+
+/*
+ * To make Array to LinkedList, use link_anchor
+ */
+
+static void
+verify_list(ISEQ_ARG_DECLARE const char *info, LINK_ANCHOR *anchor)
+{
+#if CPDEBUG
+ int flag = 0;
+ LINK_ELEMENT *list, *plist;
+
+ if (!compile_debug) return;
+
+ list = anchor->anchor.next;
+ plist = &anchor->anchor;
+ while (list) {
+ if (plist != list->prev) {
+ flag += 1;
+ }
+ plist = list;
+ list = list->next;
+ }
+
+ if (anchor->last != plist && anchor->last != 0) {
+ flag |= 0x70000;
+ }
+
+ if (flag != 0) {
+ rb_bug("list verify error: %08x (%s)", flag, info);
+ }
+#endif
+}
+#if CPDEBUG < 0
+#define verify_list(info, anchor) verify_list(iseq, (info), (anchor))
+#endif
+
+/*
+ * elem1, elem2 => elem1, elem2, elem
+ */
+static void
+ADD_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor, LINK_ELEMENT *elem)
+{
+ elem->prev = anchor->last;
+ anchor->last->next = elem;
+ anchor->last = elem;
+ verify_list("add", anchor);
+}
+
+/*
+ * elem1, before, elem2 => elem1, before, elem, elem2
+ */
+static void
+APPEND_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor, LINK_ELEMENT *before, LINK_ELEMENT *elem)
+{
+ elem->prev = before;
+ elem->next = before->next;
+ elem->next->prev = elem;
+ before->next = elem;
+ if (before == anchor->last) anchor->last = elem;
+ verify_list("add", anchor);
+}
+#if CPDEBUG < 0
+#define ADD_ELEM(anchor, elem) ADD_ELEM(iseq, (anchor), (elem))
+#define APPEND_ELEM(anchor, before, elem) ADD_ELEM(iseq, (anchor), (before), (elem))
+#endif
+
+static int
+iseq_add_mark_object(rb_iseq_t *iseq, VALUE v)
+{
+ if (!SPECIAL_CONST_P(v)) {
+ rb_ary_push(iseq->mark_ary, v);
+ }
+ return COMPILE_OK;
+}
+
+#define ruby_sourcefile RSTRING_PTR(iseq->location.path)
+
+static int
+iseq_add_mark_object_compile_time(rb_iseq_t *iseq, VALUE v)
+{
+ if (!SPECIAL_CONST_P(v)) {
+ rb_ary_push(iseq->compile_data->mark_ary, v);
+ }
+ return COMPILE_OK;
+}
+
+static int
+validate_label(st_data_t name, st_data_t label, st_data_t arg)
+{
+ rb_iseq_t *iseq = (rb_iseq_t *)arg;
+ LABEL *lobj = (LABEL *)label;
+ if (!lobj->link.next) {
+ do {
+ int ret;
+ COMPILE_ERROR((ruby_sourcefile, lobj->position,
+ "%s: undefined label", rb_id2name((ID)name)));
+ if (ret) break;
+ } while (0);
+ }
+ return ST_CONTINUE;
+}
+
+static void
+validate_labels(rb_iseq_t *iseq, st_table *labels_table)
+{
+ st_foreach(labels_table, validate_label, (st_data_t)iseq);
+ if (!NIL_P(iseq->compile_data->err_info)) {
+ rb_exc_raise(iseq->compile_data->err_info);
+ }
+}
+
+VALUE
+rb_iseq_compile_node(VALUE self, NODE *node)
+{
+ DECL_ANCHOR(ret);
+ rb_iseq_t *iseq;
+ INIT_ANCHOR(ret);
+ GetISeqPtr(self, iseq);
+
+ if (node == 0) {
+ COMPILE(ret, "nil", node);
+ iseq_set_local_table(iseq, 0);
+ }
+ else if (nd_type(node) == NODE_SCOPE) {
+ /* iseq type of top, method, class, block */
+ iseq_set_local_table(iseq, node->nd_tbl);
+ iseq_set_arguments(iseq, ret, node->nd_args);
+
+ switch (iseq->type) {
+ case ISEQ_TYPE_BLOCK:
+ {
+ LABEL *start = iseq->compile_data->start_label = NEW_LABEL(0);
+ LABEL *end = iseq->compile_data->end_label = NEW_LABEL(0);
+
+ ADD_LABEL(ret, start);
+ ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_B_CALL);
+ COMPILE(ret, "block body", node->nd_body);
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_B_RETURN);
+ ADD_LABEL(ret, end);
+
+ /* wide range catch handler must put at last */
+ ADD_CATCH_ENTRY(CATCH_TYPE_REDO, start, end, 0, start);
+ ADD_CATCH_ENTRY(CATCH_TYPE_NEXT, start, end, 0, end);
+ break;
+ }
+ case ISEQ_TYPE_CLASS:
+ {
+ ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_CLASS);
+ COMPILE(ret, "scoped node", node->nd_body);
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_END);
+ break;
+ }
+ case ISEQ_TYPE_METHOD:
+ {
+ ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_CALL);
+ COMPILE(ret, "scoped node", node->nd_body);
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_RETURN);
+ break;
+ }
+ default: {
+ COMPILE(ret, "scoped node", node->nd_body);
+ break;
+ }
+ }
+ }
+ else {
+ switch (iseq->type) {
+ case ISEQ_TYPE_METHOD:
+ case ISEQ_TYPE_CLASS:
+ case ISEQ_TYPE_BLOCK:
+ case ISEQ_TYPE_EVAL:
+ case ISEQ_TYPE_MAIN:
+ case ISEQ_TYPE_TOP:
+ rb_compile_error(ERROR_ARGS "compile/should not be reached: %s:%d",
+ __FILE__, __LINE__);
+ break;
+ case ISEQ_TYPE_RESCUE:
+ iseq_set_exception_local_table(iseq);
+ COMPILE(ret, "rescue", node);
+ break;
+ case ISEQ_TYPE_ENSURE:
+ iseq_set_exception_local_table(iseq);
+ COMPILE_POPED(ret, "ensure", node);
+ break;
+ case ISEQ_TYPE_DEFINED_GUARD:
+ iseq_set_local_table(iseq, 0);
+ COMPILE(ret, "defined guard", node);
+ break;
+ default:
+ rb_bug("unknown scope");
+ }
+ }
+
+ if (iseq->type == ISEQ_TYPE_RESCUE || iseq->type == ISEQ_TYPE_ENSURE) {
+ ADD_INSN2(ret, 0, getlocal, INT2FIX(2), INT2FIX(0));
+ ADD_INSN1(ret, 0, throw, INT2FIX(0) /* continue throw */ );
+ }
+ else {
+ ADD_INSN(ret, iseq->compile_data->last_line, leave);
+ }
+
+#if SUPPORT_JOKE
+ if (iseq->compile_data->labels_table) {
+ validate_labels(iseq, iseq->compile_data->labels_table);
+ }
+#endif
+ return iseq_setup(iseq, ret);
+}
+
+int
+rb_iseq_translate_threaded_code(rb_iseq_t *iseq)
+{
+#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
+ const void * const *table = rb_vm_get_insns_address_table();
+ unsigned long i;
+
+ iseq->iseq_encoded = ALLOC_N(VALUE, iseq->iseq_size);
+ MEMCPY(iseq->iseq_encoded, iseq->iseq, VALUE, iseq->iseq_size);
+
+ for (i = 0; i < iseq->iseq_size; /* */ ) {
+ int insn = (int)iseq->iseq_encoded[i];
+ int len = insn_len(insn);
+ iseq->iseq_encoded[i] = (VALUE)table[insn];
+ i += len;
+ }
+#else
+ iseq->iseq_encoded = iseq->iseq;
+#endif
+ return COMPILE_OK;
+}
+
+/*********************************************/
+/* definition of data structure for compiler */
+/*********************************************/
+
+static void *
+compile_data_alloc(rb_iseq_t *iseq, size_t size)
+{
+ void *ptr = 0;
+ struct iseq_compile_data_storage *storage =
+ iseq->compile_data->storage_current;
+
+ if (storage->pos + size > storage->size) {
+ unsigned long alloc_size = storage->size * 2;
+
+ retry:
+ if (alloc_size < size) {
+ alloc_size *= 2;
+ goto retry;
+ }
+ storage->next = (void *)ALLOC_N(char, alloc_size +
+ sizeof(struct
+ iseq_compile_data_storage));
+ storage = iseq->compile_data->storage_current = storage->next;
+ storage->next = 0;
+ storage->pos = 0;
+ storage->size = alloc_size;
+ storage->buff = (char *)(&storage->buff + 1);
+ }
+
+ ptr = (void *)&storage->buff[storage->pos];
+ storage->pos += size;
+ return ptr;
+}
+
+static INSN *
+compile_data_alloc_insn(rb_iseq_t *iseq)
+{
+ return (INSN *)compile_data_alloc(iseq, sizeof(INSN));
+}
+
+static LABEL *
+compile_data_alloc_label(rb_iseq_t *iseq)
+{
+ return (LABEL *)compile_data_alloc(iseq, sizeof(LABEL));
+}
+
+static ADJUST *
+compile_data_alloc_adjust(rb_iseq_t *iseq)
+{
+ return (ADJUST *)compile_data_alloc(iseq, sizeof(ADJUST));
+}
+
+/*
+ * elem1, elemX => elem1, elem2, elemX
+ */
+static void
+INSERT_ELEM_NEXT(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
+{
+ elem2->next = elem1->next;
+ elem2->prev = elem1;
+ elem1->next = elem2;
+ if (elem2->next) {
+ elem2->next->prev = elem2;
+ }
+}
+
+#if 0 /* unused */
+/*
+ * elemX, elem1 => elemX, elem2, elem1
+ */
+static void
+INSERT_ELEM_PREV(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
+{
+ elem2->prev = elem1->prev;
+ elem2->next = elem1;
+ elem1->prev = elem2;
+ if (elem2->prev) {
+ elem2->prev->next = elem2;
+ }
+}
+#endif
+
+/*
+ * elemX, elem1, elemY => elemX, elem2, elemY
+ */
+static void
+REPLACE_ELEM(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
+{
+ elem2->prev = elem1->prev;
+ elem2->next = elem1->next;
+ if (elem1->prev) {
+ elem1->prev->next = elem2;
+ }
+ if (elem1->next) {
+ elem1->next->prev = elem2;
+ }
+}
+
+static void
+REMOVE_ELEM(LINK_ELEMENT *elem)
+{
+ elem->prev->next = elem->next;
+ if (elem->next) {
+ elem->next->prev = elem->prev;
+ }
+}
+
+static LINK_ELEMENT *
+FIRST_ELEMENT(LINK_ANCHOR *anchor)
+{
+ return anchor->anchor.next;
+}
+
+#if 0 /* unused */
+static LINK_ELEMENT *
+LAST_ELEMENT(LINK_ANCHOR *anchor)
+{
+ return anchor->last;
+}
+#endif
+
+static LINK_ELEMENT *
+POP_ELEMENT(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor)
+{
+ LINK_ELEMENT *elem = anchor->last;
+ anchor->last = anchor->last->prev;
+ anchor->last->next = 0;
+ verify_list("pop", anchor);
+ return elem;
+}
+#if CPDEBUG < 0
+#define POP_ELEMENT(anchor) POP_ELEMENT(iseq, (anchor))
+#endif
+
+#if 0 /* unused */
+static LINK_ELEMENT *
+SHIFT_ELEMENT(LINK_ANCHOR *anchor)
+{
+ LINK_ELEMENT *elem = anchor->anchor.next;
+ if (elem) {
+ anchor->anchor.next = elem->next;
+ }
+ return elem;
+}
+#endif
+
+#if 0 /* unused */
+static int
+LIST_SIZE(LINK_ANCHOR *anchor)
+{
+ LINK_ELEMENT *elem = anchor->anchor.next;
+ int size = 0;
+ while (elem) {
+ size += 1;
+ elem = elem->next;
+ }
+ return size;
+}
+#endif
+
+static int
+LIST_SIZE_ZERO(LINK_ANCHOR *anchor)
+{
+ if (anchor->anchor.next == 0) {
+ return 1;
+ }
+ else {
+ return 0;
+ }
+}
+
+/*
+ * anc1: e1, e2, e3
+ * anc2: e4, e5
+ *#=>
+ * anc1: e1, e2, e3, e4, e5
+ * anc2: e4, e5 (broken)
+ */
+static void
+APPEND_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc1, LINK_ANCHOR *anc2)
+{
+ if (anc2->anchor.next) {
+ anc1->last->next = anc2->anchor.next;
+ anc2->anchor.next->prev = anc1->last;
+ anc1->last = anc2->last;
+ }
+ verify_list("append", anc1);
+}
+#if CPDEBUG < 0
+#define APPEND_LIST(anc1, anc2) APPEND_LIST(iseq, (anc1), (anc2))
+#endif
+
+/*
+ * anc1: e1, e2, e3
+ * anc2: e4, e5
+ *#=>
+ * anc1: e4, e5, e1, e2, e3
+ * anc2: e4, e5 (broken)
+ */
+static void
+INSERT_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc1, LINK_ANCHOR *anc2)
+{
+ if (anc2->anchor.next) {
+ LINK_ELEMENT *first = anc1->anchor.next;
+ anc1->anchor.next = anc2->anchor.next;
+ anc1->anchor.next->prev = &anc1->anchor;
+ anc2->last->next = first;
+ if (first) {
+ first->prev = anc2->last;
+ }
+ else {
+ anc1->last = anc2->last;
+ }
+ }
+
+ verify_list("append", anc1);
+}
+#if CPDEBUG < 0
+#define INSERT_LIST(anc1, anc2) INSERT_LIST(iseq, (anc1), (anc2))
+#endif
+
+#if 0 /* unused */
+/*
+ * anc1: e1, e2, e3
+ * anc2: e4, e5
+ *#=>
+ * anc1: e4, e5
+ * anc2: e1, e2, e3
+ */
+static void
+SWAP_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc1, LINK_ANCHOR *anc2)
+{
+ LINK_ANCHOR tmp = *anc2;
+
+ /* it has bug */
+ *anc2 = *anc1;
+ *anc1 = tmp;
+
+ verify_list("swap1", anc1);
+ verify_list("swap2", anc2);
+}
+#if CPDEBUG < 0
+#define SWAP_LIST(anc1, anc2) SWAP_LIST(iseq, (anc1), (anc2))
+#endif
+
+static LINK_ANCHOR *
+REVERSE_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc)
+{
+ LINK_ELEMENT *first, *last, *elem, *e;
+ first = &anc->anchor;
+ elem = first->next;
+ last = anc->last;
+
+ if (elem != 0) {
+ anc->anchor.next = last;
+ anc->last = elem;
+ }
+ else {
+ /* null list */
+ return anc;
+ }
+ while (elem) {
+ e = elem->next;
+ elem->next = elem->prev;
+ elem->prev = e;
+ elem = e;
+ }
+
+ first->next = last;
+ last->prev = first;
+ anc->last->next = 0;
+
+ verify_list("reverse", anc);
+ return anc;
+}
+#if CPDEBUG < 0
+#define REVERSE_LIST(anc) REVERSE_LIST(iseq, (anc))
+#endif
+#endif
+
+#if CPDEBUG && 0
+static void
+debug_list(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor)
+{
+ LINK_ELEMENT *list = FIRST_ELEMENT(anchor);
+ printf("----\n");
+ printf("anch: %p, frst: %p, last: %p\n", &anchor->anchor,
+ anchor->anchor.next, anchor->last);
+ while (list) {
+ printf("curr: %p, next: %p, prev: %p, type: %d\n", list, list->next,
+ list->prev, FIX2INT(list->type));
+ list = list->next;
+ }
+ printf("----\n");
+
+ dump_disasm_list(anchor->anchor.next);
+ verify_list("debug list", anchor);
+}
+#if CPDEBUG < 0
+#define debug_list(anc) debug_list(iseq, (anc))
+#endif
+#endif
+
+static LABEL *
+new_label_body(rb_iseq_t *iseq, long line)
+{
+ LABEL *labelobj = compile_data_alloc_label(iseq);
+
+ labelobj->link.type = ISEQ_ELEMENT_LABEL;
+ labelobj->link.next = 0;
+
+ labelobj->label_no = iseq->compile_data->label_no++;
+ labelobj->sc_state = 0;
+ labelobj->sp = -1;
+ return labelobj;
+}
+
+static ADJUST *
+new_adjust_body(rb_iseq_t *iseq, LABEL *label, int line)
+{
+ ADJUST *adjust = compile_data_alloc_adjust(iseq);
+ adjust->link.type = ISEQ_ELEMENT_ADJUST;
+ adjust->link.next = 0;
+ adjust->label = label;
+ adjust->line_no = line;
+ return adjust;
+}
+
+static INSN *
+new_insn_core(rb_iseq_t *iseq, int line_no,
+ int insn_id, int argc, VALUE *argv)
+{
+ INSN *iobj = compile_data_alloc_insn(iseq);
+ /* printf("insn_id: %d, line: %d\n", insn_id, line_no); */
+
+ iobj->link.type = ISEQ_ELEMENT_INSN;
+ iobj->link.next = 0;
+ iobj->insn_id = insn_id;
+ iobj->line_no = line_no;
+ iobj->operands = argv;
+ iobj->operand_size = argc;
+ iobj->sc_state = 0;
+ return iobj;
+}
+
+static INSN *
+new_insn_body(rb_iseq_t *iseq, int line_no, int insn_id, int argc, ...)
+{
+ VALUE *operands = 0;
+ va_list argv;
+ if (argc > 0) {
+ int i;
+ va_init_list(argv, argc);
+ operands = (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * argc);
+ for (i = 0; i < argc; i++) {
+ VALUE v = va_arg(argv, VALUE);
+ operands[i] = v;
+ }
+ va_end(argv);
+ }
+ return new_insn_core(iseq, line_no, insn_id, argc, operands);
+}
+
+static rb_call_info_t *
+new_callinfo(rb_iseq_t *iseq, ID mid, int argc, VALUE block, unsigned long flag)
+{
+ rb_call_info_t *ci = (rb_call_info_t *)compile_data_alloc(iseq, sizeof(rb_call_info_t));
+ ci->mid = mid;
+ ci->flag = flag;
+ ci->orig_argc = argc;
+ ci->argc = argc;
+
+ if (block) {
+ GetISeqPtr(block, ci->blockiseq);
+ }
+ else {
+ ci->blockiseq = 0;
+ if (!(ci->flag & (VM_CALL_ARGS_SPLAT | VM_CALL_ARGS_BLOCKARG))) {
+ ci->flag |= VM_CALL_ARGS_SKIP_SETUP;
+ }
+ }
+ ci->vmstat = 0;
+ ci->blockptr = 0;
+ ci->recv = Qundef;
+ ci->call = 0; /* TODO: should set default function? */
+
+ ci->aux.index = iseq->callinfo_size++;
+
+ return ci;
+}
+
+static INSN *
+new_insn_send(rb_iseq_t *iseq, int line_no, VALUE id, VALUE argc, VALUE block, VALUE flag)
+{
+ VALUE *operands = (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * 1);
+ operands[0] = (VALUE)new_callinfo(iseq, SYM2ID(id), FIX2INT(argc), block, FIX2INT(flag));
+ return new_insn_core(iseq, line_no, BIN(send), 1, operands);
+}
+
+static VALUE
+new_child_iseq(rb_iseq_t *iseq, NODE *node,
+ VALUE name, VALUE parent, enum iseq_type type, int line_no)
+{
+ VALUE ret;
+
+ debugs("[new_child_iseq]> ---------------------------------------\n");
+ ret = rb_iseq_new_with_opt(node, name,
+ iseq_path(iseq->self), iseq_absolute_path(iseq->self),
+ INT2FIX(line_no), parent, type, iseq->compile_data->option);
+ debugs("[new_child_iseq]< ---------------------------------------\n");
+ iseq_add_mark_object(iseq, ret);
+ return ret;
+}
+
+static int
+iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
+{
+ /* debugs("[compile step 2] (iseq_array_to_linkedlist)\n"); */
+
+ if (compile_debug > 5)
+ dump_disasm_list(FIRST_ELEMENT(anchor));
+
+ debugs("[compile step 3.1 (iseq_optimize)]\n");
+ iseq_optimize(iseq, anchor);
+
+ if (compile_debug > 5)
+ dump_disasm_list(FIRST_ELEMENT(anchor));
+
+ if (iseq->compile_data->option->instructions_unification) {
+ debugs("[compile step 3.2 (iseq_insns_unification)]\n");
+ iseq_insns_unification(iseq, anchor);
+ if (compile_debug > 5)
+ dump_disasm_list(FIRST_ELEMENT(anchor));
+ }
+
+ if (iseq->compile_data->option->stack_caching) {
+ debugs("[compile step 3.3 (iseq_set_sequence_stackcaching)]\n");
+ iseq_set_sequence_stackcaching(iseq, anchor);
+ if (compile_debug > 5)
+ dump_disasm_list(FIRST_ELEMENT(anchor));
+ }
+
+ debugs("[compile step 4.1 (iseq_set_sequence)]\n");
+ iseq_set_sequence(iseq, anchor);
+ if (compile_debug > 5)
+ dump_disasm_list(FIRST_ELEMENT(anchor));
+
+ debugs("[compile step 4.2 (iseq_set_exception_table)]\n");
+ iseq_set_exception_table(iseq);
+
+ debugs("[compile step 4.3 (set_optargs_table)] \n");
+ iseq_set_optargs_table(iseq);
+
+ debugs("[compile step 5 (iseq_translate_threaded_code)] \n");
+ rb_iseq_translate_threaded_code(iseq);
+
+ if (compile_debug > 1) {
+ VALUE str = rb_iseq_disasm(iseq->self);
+ printf("%s\n", StringValueCStr(str));
+ fflush(stdout);
+ }
+ debugs("[compile step: finish]\n");
+
+ return 0;
+}
+
+static int
+iseq_set_exception_local_table(rb_iseq_t *iseq)
+{
+ ID id_dollar_bang;
+
+ CONST_ID(id_dollar_bang, "#$!");
+ iseq->local_table = (ID *)ALLOC_N(ID, 1);
+ iseq->local_table_size = 1;
+ iseq->local_size = iseq->local_table_size + 1;
+ iseq->local_table[0] = id_dollar_bang;
+ return COMPILE_OK;
+}
+
+static int
+get_lvar_level(rb_iseq_t *iseq)
+{
+ int lev = 0;
+ while (iseq != iseq->local_iseq) {
+ lev++;
+ iseq = iseq->parent_iseq;
+ }
+ return lev;
+}
+
+static int
+get_dyna_var_idx_at_raw(rb_iseq_t *iseq, ID id)
+{
+ int i;
+
+ for (i = 0; i < iseq->local_table_size; i++) {
+ if (iseq->local_table[i] == id) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+static int
+get_local_var_idx(rb_iseq_t *iseq, ID id)
+{
+ int idx = get_dyna_var_idx_at_raw(iseq->local_iseq, id);
+
+ if (idx < 0) {
+ rb_bug("get_local_var_idx: %d", idx);
+ }
+
+ return idx;
+}
+
+static int
+get_dyna_var_idx(rb_iseq_t *iseq, ID id, int *level, int *ls)
+{
+ int lv = 0, idx = -1;
+
+ while (iseq) {
+ idx = get_dyna_var_idx_at_raw(iseq, id);
+ if (idx >= 0) {
+ break;
+ }
+ iseq = iseq->parent_iseq;
+ lv++;
+ }
+
+ if (idx < 0) {
+ rb_bug("get_dyna_var_idx: -1");
+ }
+
+ *level = lv;
+ *ls = iseq->local_size;
+ return idx;
+}
+
+static int
+iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
+{
+ debugs("iseq_set_arguments: %s\n", node_args ? "" : "0");
+
+ if (node_args) {
+ struct rb_args_info *args = node_args->nd_ainfo;
+ ID rest_id = 0;
+ int last_comma = 0;
+ ID block_id = 0;
+
+ if (nd_type(node_args) != NODE_ARGS) {
+ rb_bug("iseq_set_arguments: NODE_ARGS is expected, but %s",
+ ruby_node_name(nd_type(node_args)));
+ }
+
+
+ iseq->argc = (int)args->pre_args_num;
+ debugs(" - argc: %d\n", iseq->argc);
+
+ rest_id = args->rest_arg;
+ if (rest_id == 1) {
+ last_comma = 1;
+ rest_id = 0;
+ }
+ block_id = args->block_arg;
+
+ if (args->first_post_arg) {
+ iseq->arg_post_start = get_dyna_var_idx_at_raw(iseq, args->first_post_arg);
+ iseq->arg_post_len = args->post_args_num;
+ }
+
+ if (args->opt_args) {
+ NODE *node = args->opt_args;
+ LABEL *label;
+ VALUE labels = rb_ary_tmp_new(1);
+ int i = 0, j;
+
+ while (node) {
+ label = NEW_LABEL(nd_line(node));
+ rb_ary_push(labels, (VALUE)label | 1);
+ ADD_LABEL(optargs, label);
+ COMPILE_POPED(optargs, "optarg", node->nd_body);
+ node = node->nd_next;
+ i += 1;
+ }
+
+ /* last label */
+ label = NEW_LABEL(nd_line(node_args));
+ rb_ary_push(labels, (VALUE)label | 1);
+ ADD_LABEL(optargs, label);
+ i += 1;
+
+ iseq->arg_opts = i;
+ iseq->arg_opt_table = ALLOC_N(VALUE, i);
+ MEMCPY(iseq->arg_opt_table, RARRAY_PTR(labels), VALUE, i);
+ for (j = 0; j < i; j++) {
+ iseq->arg_opt_table[j] &= ~1;
+ }
+ rb_ary_clear(labels);
+ }
+ else {
+ iseq->arg_opts = 0;
+ }
+
+ if (args->kw_args) {
+ NODE *node = args->kw_args;
+ VALUE keywords = rb_ary_tmp_new(1);
+ int i = 0, j;
+
+ iseq->arg_keyword = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
+ COMPILE(optargs, "kwarg", args->kw_rest_arg);
+ while (node) {
+ rb_ary_push(keywords, INT2FIX(node->nd_body->nd_vid));
+ COMPILE_POPED(optargs, "kwarg", node); /* nd_type(node) == NODE_KW_ARG */
+ node = node->nd_next;
+ i += 1;
+ }
+ iseq->arg_keyword_check = (args->kw_rest_arg->nd_vid & ID_SCOPE_MASK) == ID_JUNK;
+ iseq->arg_keywords = i;
+ iseq->arg_keyword_table = ALLOC_N(ID, i);
+ for (j = 0; j < i; j++) {
+ iseq->arg_keyword_table[j] = FIX2INT(RARRAY_PTR(keywords)[j]);
+ }
+ ADD_INSN(optargs, nd_line(args->kw_args), pop);
+ }
+ else if (args->kw_rest_arg) {
+ iseq->arg_keyword = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
+ COMPILE(optargs, "kwarg", args->kw_rest_arg);
+ iseq->arg_keyword_check = (args->kw_rest_arg->nd_vid & ID_SCOPE_MASK) == ID_JUNK;
+ ADD_INSN(optargs, nd_line(args->kw_rest_arg), pop);
+ }
+ else {
+ iseq->arg_keyword = -1;
+ }
+
+ if (args->pre_init) { /* m_init */
+ COMPILE_POPED(optargs, "init arguments (m)", args->pre_init);
+ }
+ if (args->post_init) { /* p_init */
+ COMPILE_POPED(optargs, "init arguments (p)", args->post_init);
+ }
+
+ if (rest_id) {
+ iseq->arg_rest = get_dyna_var_idx_at_raw(iseq, rest_id);
+
+ if (iseq->arg_rest == -1) {
+ rb_bug("arg_rest: -1");
+ }
+
+ if (iseq->arg_post_start == 0) {
+ iseq->arg_post_start = iseq->arg_rest + 1;
+ }
+ }
+
+ if (block_id) {
+ iseq->arg_block = get_dyna_var_idx_at_raw(iseq, block_id);
+ }
+
+ if (iseq->arg_opts != 0 || iseq->arg_post_len != 0 ||
+ iseq->arg_rest != -1 || iseq->arg_block != -1 ||
+ iseq->arg_keyword != -1) {
+ iseq->arg_simple = 0;
+
+ /* set arg_size: size of arguments */
+ if (iseq->arg_keyword != -1) {
+ iseq->arg_size = iseq->arg_keyword + 1;
+ }
+ else if (iseq->arg_block != -1) {
+ iseq->arg_size = iseq->arg_block + 1;
+ }
+ else if (iseq->arg_post_len) {
+ iseq->arg_size = iseq->arg_post_start + iseq->arg_post_len;
+ }
+ else if (iseq->arg_rest != -1) {
+ iseq->arg_size = iseq->arg_rest + 1;
+ }
+ else if (iseq->arg_opts) {
+ iseq->arg_size = iseq->argc + iseq->arg_opts - 1;
+ }
+ else {
+ iseq->arg_size = iseq->argc;
+ }
+ }
+ else {
+ iseq->arg_simple = 1;
+ iseq->arg_size = iseq->argc;
+ }
+
+ if (iseq->type == ISEQ_TYPE_BLOCK) {
+ if (iseq->arg_opts == 0 && iseq->arg_post_len == 0 && iseq->arg_rest == -1) {
+ if (iseq->argc == 1 && last_comma == 0) {
+ /* {|a|} */
+ iseq->arg_simple |= 0x02;
+ }
+ }
+ }
+ }
+ else {
+ iseq->arg_simple = 1;
+ }
+
+ return COMPILE_OK;
+}
+
+static int
+iseq_set_local_table(rb_iseq_t *iseq, ID *tbl)
+{
+ int size;
+
+ if (tbl) {
+ size = (int)*tbl;
+ tbl++;
+ }
+ else {
+ size = 0;
+ }
+
+ if (size > 0) {
+ iseq->local_table = (ID *)ALLOC_N(ID, size);
+ MEMCPY(iseq->local_table, tbl, ID, size);
+ }
+
+ iseq->local_size = iseq->local_table_size = size;
+ iseq->local_size += 1;
+ /*
+ if (lfp == dfp ) { // top, class, method
+ dfp[-1]: svar
+ else { // block
+ dfp[-1]: cref
+ }
+ */
+
+ debugs("iseq_set_local_table: %d, %d\n", iseq->local_size, iseq->local_table_size);
+ return COMPILE_OK;
+}
+
+static int
+cdhash_cmp(VALUE val, VALUE lit)
+{
+ if (val == lit) return 0;
+ if (SPECIAL_CONST_P(lit)) {
+ return val != lit;
+ }
+ if (SPECIAL_CONST_P(val) || BUILTIN_TYPE(val) != BUILTIN_TYPE(lit)) {
+ return -1;
+ }
+ if (BUILTIN_TYPE(lit) == T_STRING) {
+ return rb_str_hash_cmp(lit, val);
+ }
+ return !rb_eql(lit, val);
+}
+
+static st_index_t
+cdhash_hash(VALUE a)
+{
+ if (SPECIAL_CONST_P(a)) return (st_index_t)a;
+ if (RB_TYPE_P(a, T_STRING)) return rb_str_hash(a);
+ {
+ VALUE hval = rb_hash(a);
+ return (st_index_t)FIX2LONG(hval);
+ }
+}
+
+static const struct st_hash_type cdhash_type = {
+ cdhash_cmp,
+ cdhash_hash,
+};
+
+struct cdhash_set_label_struct {
+ VALUE hash;
+ int pos;
+ int len;
+};
+
+static int
+cdhash_set_label_i(VALUE key, VALUE val, void *ptr)
+{
+ struct cdhash_set_label_struct *data = (struct cdhash_set_label_struct *)ptr;
+ LABEL *lobj = (LABEL *)(val & ~1);
+ rb_hash_aset(data->hash, key, INT2FIX(lobj->position - (data->pos+data->len)));
+ return ST_CONTINUE;
+}
+
+/**
+ ruby insn object list -> raw instruction sequence
+ */
+static int
+iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
+{
+ LABEL *lobj;
+ INSN *iobj;
+ struct iseq_line_info_entry *line_info_table;
+ unsigned int last_line = 0;
+ LINK_ELEMENT *list;
+ VALUE *generated_iseq;
+
+ int k, pos, sp, stack_max = 0, line = 0;
+
+ /* set label position */
+ list = FIRST_ELEMENT(anchor);
+ k = pos = 0;
+ while (list) {
+ switch (list->type) {
+ case ISEQ_ELEMENT_INSN:
+ {
+ iobj = (INSN *)list;
+ line = iobj->line_no;
+ pos += insn_data_length(iobj);
+ k++;
+ break;
+ }
+ case ISEQ_ELEMENT_LABEL:
+ {
+ lobj = (LABEL *)list;
+ lobj->position = pos;
+ lobj->set = TRUE;
+ break;
+ }
+ case ISEQ_ELEMENT_NONE:
+ {
+ /* ignore */
+ break;
+ }
+ case ISEQ_ELEMENT_ADJUST:
+ {
+ ADJUST *adjust = (ADJUST *)list;
+ if (adjust->line_no != -1) {
+ pos += 2 /* insn + 1 operand */;
+ k++;
+ }
+ break;
+ }
+ default:
+ dump_disasm_list(FIRST_ELEMENT(anchor));
+ dump_disasm_list(list);
+ rb_compile_error(RSTRING_PTR(iseq->location.path), line,
+ "error: set_sequence");
+ break;
+ }
+ list = list->next;
+ }
+
+ /* make instruction sequence */
+ generated_iseq = ALLOC_N(VALUE, pos);
+ line_info_table = ALLOC_N(struct iseq_line_info_entry, k);
+ iseq->ic_entries = ALLOC_N(struct iseq_inline_cache_entry, iseq->ic_size);
+ MEMZERO(iseq->ic_entries, struct iseq_inline_cache_entry, iseq->ic_size);
+ iseq->callinfo_entries = ALLOC_N(rb_call_info_t, iseq->callinfo_size);
+ /* MEMZERO(iseq->callinfo_entries, rb_call_info_t, iseq->callinfo_size); */
+
+ list = FIRST_ELEMENT(anchor);
+ k = pos = sp = 0;
+
+ while (list) {
+ switch (list->type) {
+ case ISEQ_ELEMENT_INSN:
+ {
+ int j, len, insn;
+ const char *types;
+ VALUE *operands;
+
+ iobj = (INSN *)list;
+
+ /* update sp */
+ sp = calc_sp_depth(sp, iobj);
+ if (sp > stack_max) {
+ stack_max = sp;
+ }
+
+ /* fprintf(stderr, "insn: %-16s, sp: %d\n", insn_name(iobj->insn_id), sp); */
+ operands = iobj->operands;
+ insn = iobj->insn_id;
+ generated_iseq[pos] = insn;
+ types = insn_op_types(insn);
+ len = insn_len(insn);
+
+ /* operand check */
+ if (iobj->operand_size != len - 1) {
+ /* printf("operand size miss! (%d, %d)\n", iobj->operand_size, len); */
+ dump_disasm_list(list);
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "operand size miss! (%d for %d)",
+ iobj->operand_size, len - 1);
+ xfree(generated_iseq);
+ xfree(line_info_table);
+ return 0;
+ }
+
+ for (j = 0; types[j]; j++) {
+ char type = types[j];
+ /* printf("--> [%c - (%d-%d)]\n", type, k, j); */
+ switch (type) {
+ case TS_OFFSET:
+ {
+ /* label(destination position) */
+ lobj = (LABEL *)operands[j];
+ if (!lobj->set) {
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "unknown label");
+ }
+ if (lobj->sp == -1) {
+ lobj->sp = sp;
+ }
+ generated_iseq[pos + 1 + j] = lobj->position - (pos + len);
+ break;
+ }
+ case TS_CDHASH:
+ {
+ VALUE map = operands[j];
+ struct cdhash_set_label_struct data;
+ data.hash = map;
+ data.pos = pos;
+ data.len = len;
+ rb_hash_foreach(map, cdhash_set_label_i, (VALUE)&data);
+
+ hide_obj(map);
+ generated_iseq[pos + 1 + j] = map;
+ break;
+ }
+ case TS_LINDEX:
+ case TS_NUM: /* ulong */
+ generated_iseq[pos + 1 + j] = FIX2INT(operands[j]);
+ break;
+ case TS_ISEQ: /* iseq */
+ {
+ VALUE v = operands[j];
+ rb_iseq_t *block = 0;
+ if (v) {
+ GetISeqPtr(v, block);
+ }
+ generated_iseq[pos + 1 + j] = (VALUE)block;
+ break;
+ }
+ case TS_VALUE: /* VALUE */
+ {
+ VALUE v = operands[j];
+ generated_iseq[pos + 1 + j] = v;
+ /* to mark ruby object */
+ iseq_add_mark_object(iseq, v);
+ break;
+ }
+ case TS_IC: /* inline cache */
+ {
+ int ic_index = FIX2INT(operands[j]);
+ IC ic = &iseq->ic_entries[ic_index];
+ if (UNLIKELY(ic_index >= iseq->ic_size)) {
+ rb_bug("iseq_set_sequence: ic_index overflow: index: %d, size: %d", ic_index, iseq->ic_size);
+ }
+ generated_iseq[pos + 1 + j] = (VALUE)ic;
+ break;
+ }
+ case TS_CALLINFO: /* call info */
+ {
+ rb_call_info_t *base_ci = (rb_call_info_t *)operands[j];
+ rb_call_info_t *ci = &iseq->callinfo_entries[base_ci->aux.index];
+ *ci = *base_ci;
+
+ if (UNLIKELY(base_ci->aux.index >= iseq->callinfo_size)) {
+ rb_bug("iseq_set_sequence: ci_index overflow: index: %d, size: %d", base_ci->argc, iseq->callinfo_size);
+ }
+ generated_iseq[pos + 1 + j] = (VALUE)ci;
+ break;
+ }
+ case TS_ID: /* ID */
+ generated_iseq[pos + 1 + j] = SYM2ID(operands[j]);
+ break;
+ case TS_GENTRY:
+ {
+ struct rb_global_entry *entry =
+ (struct rb_global_entry *)(operands[j] & (~1));
+ generated_iseq[pos + 1 + j] = (VALUE)entry;
+ }
+ break;
+ default:
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "unknown operand type: %c", type);
+ xfree(generated_iseq);
+ xfree(line_info_table);
+ return 0;
+ }
+ }
+ if (last_line != iobj->line_no) {
+ line_info_table[k].line_no = last_line = iobj->line_no;
+ line_info_table[k].position = pos;
+ k++;
+ }
+ pos += len;
+ break;
+ }
+ case ISEQ_ELEMENT_LABEL:
+ {
+ lobj = (LABEL *)list;
+ if (lobj->sp == -1) {
+ lobj->sp = sp;
+ }
+ else {
+ sp = lobj->sp;
+ }
+ break;
+ }
+ case ISEQ_ELEMENT_ADJUST:
+ {
+ ADJUST *adjust = (ADJUST *)list;
+ int orig_sp = sp;
+
+ if (adjust->label) {
+ sp = adjust->label->sp;
+ }
+ else {
+ sp = 0;
+ }
+
+ if (adjust->line_no != -1) {
+ if (orig_sp - sp > 0) {
+ if (last_line != (unsigned int)adjust->line_no) {
+ line_info_table[k].line_no = last_line = adjust->line_no;
+ line_info_table[k].position = pos;
+ k++;
+ }
+ generated_iseq[pos++] = BIN(adjuststack);
+ generated_iseq[pos++] = orig_sp - sp;
+ }
+ else if (orig_sp - sp == 0) {
+ /* jump to next insn */
+ if (last_line != (unsigned int)adjust->line_no) {
+ line_info_table[k].line_no = last_line = adjust->line_no;
+ line_info_table[k].position = pos;
+ k++;
+ }
+ generated_iseq[pos++] = BIN(jump);
+ generated_iseq[pos++] = 0;
+ }
+ else {
+ rb_bug("iseq_set_sequence: adjust bug");
+ }
+ }
+ break;
+ }
+ default:
+ /* ignore */
+ break;
+ }
+ list = list->next;
+ }
+
+#if 0 /* XXX */
+ /* this check need dead code elimination */
+ if (sp != 1) {
+ rb_bug("SP is not 0 on %s (%d)\n", RSTRING_PTR(iseq->name), sp);
+ }
+#endif
+
+ iseq->iseq = (void *)generated_iseq;
+ iseq->iseq_size = pos;
+ iseq->stack_max = stack_max;
+
+ line_info_table = ruby_xrealloc(line_info_table, k * sizeof(struct iseq_line_info_entry));
+ iseq->line_info_table = line_info_table;
+ iseq->line_info_size = k;
+
+ return COMPILE_OK;
+}
+
+static int
+label_get_position(LABEL *lobj)
+{
+ return lobj->position;
+}
+
+static int
+label_get_sp(LABEL *lobj)
+{
+ return lobj->sp;
+}
+
+static int
+iseq_set_exception_table(rb_iseq_t *iseq)
+{
+ VALUE *tptr, *ptr;
+ int tlen, i;
+ struct iseq_catch_table_entry *entry;
+
+ tlen = (int)RARRAY_LEN(iseq->compile_data->catch_table_ary);
+ tptr = RARRAY_PTR(iseq->compile_data->catch_table_ary);
+
+ iseq->catch_table = tlen ? ALLOC_N(struct iseq_catch_table_entry, tlen) : 0;
+ iseq->catch_table_size = tlen;
+
+ for (i = 0; i < tlen; i++) {
+ ptr = RARRAY_PTR(tptr[i]);
+ entry = &iseq->catch_table[i];
+ entry->type = (enum catch_type)(ptr[0] & 0xffff);
+ entry->start = label_get_position((LABEL *)(ptr[1] & ~1));
+ entry->end = label_get_position((LABEL *)(ptr[2] & ~1));
+ entry->iseq = ptr[3];
+
+ /* register iseq as mark object */
+ if (entry->iseq != 0) {
+ iseq_add_mark_object(iseq, entry->iseq);
+ }
+
+ /* stack depth */
+ if (ptr[4]) {
+ LABEL *lobj = (LABEL *)(ptr[4] & ~1);
+ entry->cont = label_get_position(lobj);
+ entry->sp = label_get_sp(lobj);
+
+ /* TODO: Dirty Hack! Fix me */
+ if (entry->type == CATCH_TYPE_RESCUE ||
+ entry->type == CATCH_TYPE_BREAK ||
+ entry->type == CATCH_TYPE_NEXT) {
+ entry->sp--;
+ }
+ }
+ else {
+ entry->cont = 0;
+ }
+ }
+
+ iseq->compile_data->catch_table_ary = 0; /* free */
+ return COMPILE_OK;
+}
+
+/*
+ * set optional argument table
+ * def foo(a, b=expr1, c=expr2)
+ * =>
+ * b:
+ * expr1
+ * c:
+ * expr2
+ */
+static int
+iseq_set_optargs_table(rb_iseq_t *iseq)
+{
+ int i;
+
+ if (iseq->arg_opts != 0) {
+ for (i = 0; i < iseq->arg_opts; i++) {
+ iseq->arg_opt_table[i] =
+ label_get_position((LABEL *)iseq->arg_opt_table[i]);
+ }
+ }
+ return COMPILE_OK;
+}
+
+static LINK_ELEMENT *
+get_destination_insn(INSN *iobj)
+{
+ LABEL *lobj = (LABEL *)OPERAND_AT(iobj, 0);
+ LINK_ELEMENT *list;
+
+ list = lobj->link.next;
+ while (list) {
+ if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
+ break;
+ }
+ list = list->next;
+ }
+ return list;
+}
+
+static LINK_ELEMENT *
+get_next_insn(INSN *iobj)
+{
+ LINK_ELEMENT *list = iobj->link.next;
+
+ while (list) {
+ if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
+ return list;
+ }
+ list = list->next;
+ }
+ return 0;
+}
+
+static LINK_ELEMENT *
+get_prev_insn(INSN *iobj)
+{
+ LINK_ELEMENT *list = iobj->link.prev;
+
+ while (list) {
+ if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
+ return list;
+ }
+ list = list->prev;
+ }
+ return 0;
+}
+
+static int
+iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcallopt)
+{
+ INSN *iobj = (INSN *)list;
+ again:
+ if (iobj->insn_id == BIN(jump)) {
+ INSN *niobj, *diobj, *piobj;
+ /*
+ * useless jump elimination:
+ * jump LABEL1
+ * ...
+ * LABEL1:
+ * jump LABEL2
+ *
+ * => in this case, first jump instruction should jump to
+ * LABEL2 directly
+ */
+ diobj = (INSN *)get_destination_insn(iobj);
+ niobj = (INSN *)get_next_insn(iobj);
+
+ if (diobj == niobj) {
+ /*
+ * jump LABEL
+ * LABEL:
+ * =>
+ * LABEL:
+ */
+ REMOVE_ELEM(&iobj->link);
+ }
+ else if (iobj != diobj && diobj->insn_id == BIN(jump)) {
+ if (OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0)) {
+ OPERAND_AT(iobj, 0) = OPERAND_AT(diobj, 0);
+ goto again;
+ }
+ }
+ else if (diobj->insn_id == BIN(leave)) {
+ /*
+ * jump LABEL
+ * ...
+ * LABEL:
+ * leave
+ * =>
+ * leave
+ * ...
+ * LABEL:
+ * leave
+ */
+ INSN *eiobj = new_insn_core(iseq, iobj->line_no, BIN(leave),
+ diobj->operand_size, diobj->operands);
+ INSN *popiobj = new_insn_core(iseq, iobj->line_no,
+ BIN(pop), 0, 0);
+ /* replace */
+ REPLACE_ELEM((LINK_ELEMENT *)iobj, (LINK_ELEMENT *)eiobj);
+ INSERT_ELEM_NEXT((LINK_ELEMENT *)eiobj, (LINK_ELEMENT *)popiobj);
+ iobj = popiobj;
+ }
+ /*
+ * useless jump elimination (if/unless destination):
+ * if L1
+ * jump L2
+ * L1:
+ * ...
+ * L2:
+ *
+ * ==>
+ * unless L2
+ * L1:
+ * ...
+ * L2:
+ */
+ else if ((piobj = (INSN *)get_prev_insn(iobj)) != 0 &&
+ (piobj->insn_id == BIN(branchif) ||
+ piobj->insn_id == BIN(branchunless))) {
+ if (niobj == (INSN *)get_destination_insn(piobj)) {
+ piobj->insn_id = (piobj->insn_id == BIN(branchif))
+ ? BIN(branchunless) : BIN(branchif);
+ OPERAND_AT(piobj, 0) = OPERAND_AT(iobj, 0);
+ REMOVE_ELEM(&iobj->link);
+ }
+ }
+ }
+
+ if (iobj->insn_id == BIN(branchif) ||
+ iobj->insn_id == BIN(branchunless)) {
+ /*
+ * if L1
+ * ...
+ * L1:
+ * jump L2
+ * =>
+ * if L2
+ */
+ INSN *nobj = (INSN *)get_destination_insn(iobj);
+ if (nobj->insn_id == BIN(jump)) {
+ OPERAND_AT(iobj, 0) = OPERAND_AT(nobj, 0);
+ }
+ }
+
+ if (do_tailcallopt && iobj->insn_id == BIN(leave)) {
+ /*
+ * send ...
+ * leave
+ * =>
+ * send ..., ... | VM_CALL_TAILCALL, ...
+ * leave # unreachable
+ */
+ INSN *piobj = (INSN *)get_prev_insn((INSN *)list);
+
+ if (piobj->insn_id == BIN(send) || piobj->insn_id == BIN(opt_send_simple)) {
+ rb_call_info_t *ci = (rb_call_info_t *)piobj->operands[0];
+ if (ci->blockiseq == 0) {
+ ci->flag |= VM_CALL_TAILCALL;
+ }
+ }
+ }
+ return COMPILE_OK;
+}
+
+static int
+insn_set_specialized_instruction(rb_iseq_t *iseq, INSN *iobj, int insn_id)
+{
+ int old_opsize = iobj->operand_size;
+ iobj->insn_id = insn_id;
+ iobj->operand_size = insn_len(insn_id) - 1;
+
+ if (iobj->operand_size > old_opsize) {
+ VALUE *old_operands = iobj->operands;
+ if (insn_id != BIN(opt_neq)) {
+ rb_bug("insn_set_specialized_instruction: unknown insn: %d", insn_id);
+ }
+ iobj->operands = (VALUE *)compile_data_alloc(iseq, iobj->operand_size * sizeof(VALUE));
+ iobj->operands[0] = old_operands[0];
+ iobj->operands[1] = (VALUE)new_callinfo(iseq, idEq, 1, 0, 0);
+ }
+
+ return COMPILE_OK;
+}
+
+static int
+iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
+{
+ if (iobj->insn_id == BIN(send)) {
+ rb_call_info_t *ci = (rb_call_info_t *)OPERAND_AT(iobj, 0);
+
+#define SP_INSN(opt) insn_set_specialized_instruction(iseq, iobj, BIN(opt_##opt))
+ if (ci->blockiseq == 0 && (ci->flag & ~VM_CALL_ARGS_SKIP_SETUP) == 0) {
+ switch (ci->orig_argc) {
+ case 0:
+ switch (ci->mid) {
+ case idLength: SP_INSN(length); return COMPILE_OK;
+ case idSize: SP_INSN(size); return COMPILE_OK;
+ case idEmptyP: SP_INSN(empty_p);return COMPILE_OK;
+ case idSucc: SP_INSN(succ); return COMPILE_OK;
+ case idNot: SP_INSN(not); return COMPILE_OK;
+ }
+ break;
+ case 1:
+ switch (ci->mid) {
+ case idPLUS: SP_INSN(plus); return COMPILE_OK;
+ case idMINUS: SP_INSN(minus); return COMPILE_OK;
+ case idMULT: SP_INSN(mult); return COMPILE_OK;
+ case idDIV: SP_INSN(div); return COMPILE_OK;
+ case idMOD: SP_INSN(mod); return COMPILE_OK;
+ case idEq: SP_INSN(eq); return COMPILE_OK;
+ case idNeq: SP_INSN(neq); return COMPILE_OK;
+ case idLT: SP_INSN(lt); return COMPILE_OK;
+ case idLE: SP_INSN(le); return COMPILE_OK;
+ case idGT: SP_INSN(gt); return COMPILE_OK;
+ case idGE: SP_INSN(ge); return COMPILE_OK;
+ case idLTLT: SP_INSN(ltlt); return COMPILE_OK;
+ case idAREF: SP_INSN(aref); return COMPILE_OK;
+ }
+ break;
+ }
+ }
+ if (ci->flag & VM_CALL_ARGS_SKIP_SETUP) {
+ iobj->insn_id = BIN(opt_send_simple);
+ }
+ }
+#undef SP_INSN
+
+ return COMPILE_OK;
+}
+
+static int
+iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
+{
+ LINK_ELEMENT *list;
+ const int do_peepholeopt = iseq->compile_data->option->peephole_optimization;
+ const int do_tailcallopt = iseq->compile_data->option->tailcall_optimization;
+ const int do_si = iseq->compile_data->option->specialized_instruction;
+ const int do_ou = iseq->compile_data->option->operands_unification;
+ list = FIRST_ELEMENT(anchor);
+
+ while (list) {
+ if (list->type == ISEQ_ELEMENT_INSN) {
+ if (do_peepholeopt) {
+ iseq_peephole_optimize(iseq, list, do_tailcallopt);
+ }
+ if (do_si) {
+ iseq_specialized_instruction(iseq, (INSN *)list);
+ }
+ if (do_ou) {
+ insn_operands_unification((INSN *)list);
+ }
+ }
+ list = list->next;
+ }
+ return COMPILE_OK;
+}
+
+#if OPT_INSTRUCTIONS_UNIFICATION
+static INSN *
+new_unified_insn(rb_iseq_t *iseq,
+ int insn_id, int size, LINK_ELEMENT *seq_list)
+{
+ INSN *iobj = 0;
+ LINK_ELEMENT *list = seq_list;
+ int i, argc = 0;
+ VALUE *operands = 0, *ptr = 0;
+
+
+ /* count argc */
+ for (i = 0; i < size; i++) {
+ iobj = (INSN *)list;
+ argc += iobj->operand_size;
+ list = list->next;
+ }
+
+ if (argc > 0) {
+ ptr = operands =
+ (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * argc);
+ }
+
+ /* copy operands */
+ list = seq_list;
+ for (i = 0; i < size; i++) {
+ iobj = (INSN *)list;
+ MEMCPY(ptr, iobj->operands, VALUE, iobj->operand_size);
+ ptr += iobj->operand_size;
+ list = list->next;
+ }
+
+ return new_insn_core(iseq, iobj->line_no, insn_id, argc, operands);
+}
+#endif
+
+/*
+ * This scheme can get more performance if do this optimize with
+ * label address resolving.
+ * It's future work (if compile time was bottle neck).
+ */
+static int
+iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
+{
+#if OPT_INSTRUCTIONS_UNIFICATION
+ LINK_ELEMENT *list;
+ INSN *iobj, *niobj;
+ int id, k;
+ intptr_t j;
+
+ list = FIRST_ELEMENT(anchor);
+ while (list) {
+ if (list->type == ISEQ_ELEMENT_INSN) {
+ iobj = (INSN *)list;
+ id = iobj->insn_id;
+ if (unified_insns_data[id] != 0) {
+ const int *const *entry = unified_insns_data[id];
+ for (j = 1; j < (intptr_t)entry[0]; j++) {
+ const int *unified = entry[j];
+ LINK_ELEMENT *li = list->next;
+ for (k = 2; k < unified[1]; k++) {
+ if (li->type != ISEQ_ELEMENT_INSN ||
+ ((INSN *)li)->insn_id != unified[k]) {
+ goto miss;
+ }
+ li = li->next;
+ }
+ /* matched */
+ niobj =
+ new_unified_insn(iseq, unified[0], unified[1] - 1,
+ list);
+
+ /* insert to list */
+ niobj->link.prev = (LINK_ELEMENT *)iobj->link.prev;
+ niobj->link.next = li;
+ if (li) {
+ li->prev = (LINK_ELEMENT *)niobj;
+ }
+
+ list->prev->next = (LINK_ELEMENT *)niobj;
+ list = (LINK_ELEMENT *)niobj;
+ break;
+ miss:;
+ }
+ }
+ }
+ list = list->next;
+ }
+#endif
+ return COMPILE_OK;
+}
+
+#if OPT_STACK_CACHING
+
+#define SC_INSN(insn, stat) sc_insn_info[(insn)][(stat)]
+#define SC_NEXT(insn) sc_insn_next[(insn)]
+
+#include "opt_sc.inc"
+
+static int
+insn_set_sc_state(rb_iseq_t *iseq, INSN *iobj, int state)
+{
+ int nstate;
+ int insn_id;
+
+ insn_id = iobj->insn_id;
+ iobj->insn_id = SC_INSN(insn_id, state);
+ nstate = SC_NEXT(iobj->insn_id);
+
+ if (insn_id == BIN(jump) ||
+ insn_id == BIN(branchif) || insn_id == BIN(branchunless)) {
+ LABEL *lobj = (LABEL *)OPERAND_AT(iobj, 0);
+
+ if (lobj->sc_state != 0) {
+ if (lobj->sc_state != nstate) {
+ dump_disasm_list((LINK_ELEMENT *)iobj);
+ dump_disasm_list((LINK_ELEMENT *)lobj);
+ printf("\n-- %d, %d\n", lobj->sc_state, nstate);
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "insn_set_sc_state error\n");
+ return 0;
+ }
+ }
+ else {
+ lobj->sc_state = nstate;
+ }
+ if (insn_id == BIN(jump)) {
+ nstate = SCS_XX;
+ }
+ }
+ else if (insn_id == BIN(leave)) {
+ nstate = SCS_XX;
+ }
+
+ return nstate;
+}
+
+static int
+label_set_sc_state(LABEL *lobj, int state)
+{
+ if (lobj->sc_state != 0) {
+ if (lobj->sc_state != state) {
+ state = lobj->sc_state;
+ }
+ }
+ else {
+ lobj->sc_state = state;
+ }
+
+ return state;
+}
+
+
+#endif
+
+static int
+iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
+{
+#if OPT_STACK_CACHING
+ LINK_ELEMENT *list;
+ int state, insn_id;
+
+ /* initialize */
+ state = SCS_XX;
+ list = FIRST_ELEMENT(anchor);
+ /* dump_disasm_list(list); */
+
+ /* for each list element */
+ while (list) {
+ redo_point:
+ switch (list->type) {
+ case ISEQ_ELEMENT_INSN:
+ {
+ INSN *iobj = (INSN *)list;
+ insn_id = iobj->insn_id;
+
+ /* dump_disasm_list(list); */
+
+ switch (insn_id) {
+ case BIN(nop):
+ {
+ /* exception merge point */
+ if (state != SCS_AX) {
+ INSN *rpobj =
+ new_insn_body(iseq, 0, BIN(reput), 0);
+
+ /* replace this insn */
+ REPLACE_ELEM(list, (LINK_ELEMENT *)rpobj);
+ list = (LINK_ELEMENT *)rpobj;
+ goto redo_point;
+ }
+ break;
+ }
+ case BIN(swap):
+ {
+ if (state == SCS_AB || state == SCS_BA) {
+ state = (state == SCS_AB ? SCS_BA : SCS_AB);
+
+ REMOVE_ELEM(list);
+ list = list->next;
+ goto redo_point;
+ }
+ break;
+ }
+ case BIN(pop):
+ {
+ switch (state) {
+ case SCS_AX:
+ case SCS_BX:
+ state = SCS_XX;
+ break;
+ case SCS_AB:
+ state = SCS_AX;
+ break;
+ case SCS_BA:
+ state = SCS_BX;
+ break;
+ case SCS_XX:
+ goto normal_insn;
+ default:
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "unreachable");
+ }
+ /* remove useless pop */
+ REMOVE_ELEM(list);
+ list = list->next;
+ goto redo_point;
+ }
+ default:;
+ /* none */
+ } /* end of switch */
+ normal_insn:
+ state = insn_set_sc_state(iseq, iobj, state);
+ break;
+ }
+ case ISEQ_ELEMENT_LABEL:
+ {
+ LABEL *lobj;
+ lobj = (LABEL *)list;
+
+ state = label_set_sc_state(lobj, state);
+ }
+ default:
+ break;
+ }
+ list = list->next;
+ }
+#endif
+ return COMPILE_OK;
+}
+
+static int
+compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int *cntp)
+{
+ NODE *list = node->nd_next;
+ VALUE lit = node->nd_lit;
+ int cnt = 0;
+
+ debugp_param("nd_lit", lit);
+ if (!NIL_P(lit)) {
+ hide_obj(lit);
+ cnt++;
+ ADD_INSN1(ret, nd_line(node), putobject, lit);
+ }
+
+ while (list) {
+ node = list->nd_head;
+ if (nd_type(node) == NODE_STR) {
+ hide_obj(node->nd_lit);
+ ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
+ }
+ else {
+ COMPILE(ret, "each string", node);
+ }
+ cnt++;
+ list = list->nd_next;
+ }
+ *cntp = cnt;
+
+ return COMPILE_OK;
+}
+
+static int
+compile_dstr(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node)
+{
+ int cnt;
+ compile_dstr_fragments(iseq, ret, node, &cnt);
+ ADD_INSN1(ret, nd_line(node), concatstrings, INT2FIX(cnt));
+ return COMPILE_OK;
+}
+
+static int
+compile_dregx(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node)
+{
+ int cnt;
+ compile_dstr_fragments(iseq, ret, node, &cnt);
+ ADD_INSN2(ret, nd_line(node), toregexp, INT2FIX(node->nd_cflag), INT2FIX(cnt));
+ return COMPILE_OK;
+}
+
+static int
+compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * cond,
+ LABEL *then_label, LABEL *else_label)
+{
+ switch (nd_type(cond)) {
+ case NODE_AND:
+ {
+ LABEL *label = NEW_LABEL(nd_line(cond));
+ compile_branch_condition(iseq, ret, cond->nd_1st, label,
+ else_label);
+ ADD_LABEL(ret, label);
+ compile_branch_condition(iseq, ret, cond->nd_2nd, then_label,
+ else_label);
+ break;
+ }
+ case NODE_OR:
+ {
+ LABEL *label = NEW_LABEL(nd_line(cond));
+ compile_branch_condition(iseq, ret, cond->nd_1st, then_label,
+ label);
+ ADD_LABEL(ret, label);
+ compile_branch_condition(iseq, ret, cond->nd_2nd, then_label,
+ else_label);
+ break;
+ }
+ case NODE_LIT: /* NODE_LIT is always not true */
+ case NODE_TRUE:
+ case NODE_STR:
+ /* printf("useless condition eliminate (%s)\n", ruby_node_name(nd_type(cond))); */
+ ADD_INSNL(ret, nd_line(cond), jump, then_label);
+ break;
+ case NODE_FALSE:
+ case NODE_NIL:
+ /* printf("useless condition eliminate (%s)\n", ruby_node_name(nd_type(cond))); */
+ ADD_INSNL(ret, nd_line(cond), jump, else_label);
+ break;
+ default:
+ COMPILE(ret, "branch condition", cond);
+ ADD_INSNL(ret, nd_line(cond), branchunless, else_label);
+ ADD_INSNL(ret, nd_line(cond), jump, then_label);
+ break;
+ }
+ return COMPILE_OK;
+}
+
+enum compile_array_type_t {
+ COMPILE_ARRAY_TYPE_ARRAY,
+ COMPILE_ARRAY_TYPE_HASH,
+ COMPILE_ARRAY_TYPE_ARGS
+};
+
+static int
+compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
+ enum compile_array_type_t type, int poped)
+{
+ NODE *node = node_root;
+ int line = (int)nd_line(node);
+ int len = 0;
+
+ if (nd_type(node) == NODE_ZARRAY) {
+ if (!poped) {
+ switch (type) {
+ case COMPILE_ARRAY_TYPE_ARRAY: ADD_INSN1(ret, line, newarray, INT2FIX(0)); break;
+ case COMPILE_ARRAY_TYPE_HASH: ADD_INSN1(ret, line, newhash, INT2FIX(0)); break;
+ case COMPILE_ARRAY_TYPE_ARGS: /* do nothing */ break;
+ }
+ }
+ }
+ else {
+ int opt_p = 1;
+ int first = 1, i;
+
+ while (node) {
+ NODE *start_node = node, *end_node;
+ NODE *kw = 0;
+ const int max = 0x100;
+ DECL_ANCHOR(anchor);
+ INIT_ANCHOR(anchor);
+
+ for (i=0; i<max && node; i++, len++, node = node->nd_next) {
+ if (CPDEBUG > 0 && nd_type(node) != NODE_ARRAY) {
+ rb_bug("compile_array: This node is not NODE_ARRAY, but %s", ruby_node_name(nd_type(node)));
+ }
+
+ if (type == COMPILE_ARRAY_TYPE_HASH && !node->nd_head) {
+ opt_p = 0;
+ kw = node->nd_next;
+ node = kw->nd_next;
+ kw = kw->nd_head;
+ break;
+ }
+ if (opt_p && nd_type(node->nd_head) != NODE_LIT) {
+ opt_p = 0;
+ }
+
+ COMPILE_(anchor, "array element", node->nd_head, poped);
+ }
+
+ if (opt_p && type != COMPILE_ARRAY_TYPE_ARGS) {
+ if (!poped) {
+ VALUE ary = rb_ary_tmp_new(i);
+
+ end_node = node;
+ node = start_node;
+
+ while (node != end_node) {
+ rb_ary_push(ary, node->nd_head->nd_lit);
+ node = node->nd_next;
+ }
+ while (node && nd_type(node->nd_head) == NODE_LIT &&
+ node->nd_next && nd_type(node->nd_next->nd_head) == NODE_LIT) {
+ rb_ary_push(ary, node->nd_head->nd_lit);
+ node = node->nd_next;
+ rb_ary_push(ary, node->nd_head->nd_lit);
+ node = node->nd_next;
+ len++;
+ }
+
+ OBJ_FREEZE(ary);
+
+ iseq_add_mark_object_compile_time(iseq, ary);
+
+ if (first) {
+ first = 0;
+ if (type == COMPILE_ARRAY_TYPE_ARRAY) {
+ ADD_INSN1(ret, line, duparray, ary);
+ }
+ else { /* COMPILE_ARRAY_TYPE_HASH */
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, line, putobject, ary);
+ ADD_SEND(ret, line, ID2SYM(id_core_hash_from_ary), INT2FIX(1));
+ }
+ }
+ else {
+ if (type == COMPILE_ARRAY_TYPE_ARRAY) {
+ ADD_INSN1(ret, line, putobject, ary);
+ ADD_INSN(ret, line, concatarray);
+ }
+ else {
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, line, putobject, ary);
+ ADD_SEND(ret, line, ID2SYM(id_core_hash_merge_ary), INT2FIX(1));
+ }
+ }
+ }
+ }
+ else {
+ if (!poped) {
+ switch (type) {
+ case COMPILE_ARRAY_TYPE_ARRAY:
+ ADD_INSN1(anchor, line, newarray, INT2FIX(i));
+
+ if (first) {
+ first = 0;
+ }
+ else {
+ ADD_INSN(anchor, line, concatarray);
+ }
+ APPEND_LIST(ret, anchor);
+ break;
+ case COMPILE_ARRAY_TYPE_HASH:
+ if (first) {
+ first = 0;
+ ADD_INSN1(anchor, line, newhash, INT2FIX(i));
+ APPEND_LIST(ret, anchor);
+ }
+ else if (i > 0) {
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN(ret, line, swap);
+ APPEND_LIST(ret, anchor);
+ ADD_SEND(ret, line, ID2SYM(id_core_hash_merge_ptr), INT2FIX(i + 1));
+ }
+ if (kw) {
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN(ret, line, swap);
+ COMPILE(ret, "keyword splat", kw);
+ ADD_SEND(ret, line, ID2SYM(id_core_hash_merge_kwd), INT2FIX(2));
+ }
+ break;
+ case COMPILE_ARRAY_TYPE_ARGS:
+ APPEND_LIST(ret, anchor);
+ break;
+ }
+ }
+ }
+ }
+ }
+ return len;
+}
+
+static VALUE
+compile_array(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root, enum compile_array_type_t type)
+{
+ return compile_array_(iseq, ret, node_root, type, 0);
+}
+
+static VALUE
+case_when_optimizable_literal(NODE * node)
+{
+ switch (nd_type(node)) {
+ case NODE_LIT: {
+ VALUE v = node->nd_lit;
+ double ival;
+ if (RB_TYPE_P(v, T_FLOAT) &&
+ modf(RFLOAT_VALUE(v), &ival) == 0.0) {
+ return FIXABLE(ival) ? LONG2FIX((long)ival) : rb_dbl2big(ival);
+ }
+ if (SYMBOL_P(v) || rb_obj_is_kind_of(v, rb_cNumeric)) {
+ return v;
+ }
+ break;
+ }
+ case NODE_STR:
+ return node->nd_lit;
+ }
+ return Qundef;
+}
+
+static int
+when_vals(rb_iseq_t *iseq, LINK_ANCHOR *cond_seq, NODE *vals, LABEL *l1, int only_special_literals, VALUE literals)
+{
+ while (vals) {
+ NODE* val = vals->nd_head;
+ VALUE lit = case_when_optimizable_literal(val);
+
+ if (lit == Qundef) {
+ only_special_literals = 0;
+ }
+ else {
+ if (rb_hash_lookup(literals, lit) != Qnil) {
+ rb_compile_warning(RSTRING_PTR(iseq->location.path), nd_line(val), "duplicated when clause is ignored");
+ }
+ else {
+ rb_hash_aset(literals, lit, (VALUE)(l1) | 1);
+ }
+ }
+
+ ADD_INSN(cond_seq, nd_line(val), dup); /* dup target */
+
+ if (nd_type(val) == NODE_STR) {
+ debugp_param("nd_lit", val->nd_lit);
+ OBJ_FREEZE(val->nd_lit);
+ ADD_INSN1(cond_seq, nd_line(val), putobject, val->nd_lit);
+ }
+ else {
+ COMPILE(cond_seq, "when cond", val);
+ }
+
+ ADD_INSN1(cond_seq, nd_line(vals), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE));
+ ADD_INSNL(cond_seq, nd_line(val), branchif, l1);
+ vals = vals->nd_next;
+ }
+ return only_special_literals;
+}
+
+static int
+compile_massign_lhs(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node)
+{
+ switch (nd_type(node)) {
+ case NODE_ATTRASGN: {
+ INSN *iobj;
+ rb_call_info_t *ci;
+ VALUE dupidx;
+
+ COMPILE_POPED(ret, "masgn lhs (NODE_ATTRASGN)", node);
+
+ POP_ELEMENT(ret); /* pop pop insn */
+ iobj = (INSN *)POP_ELEMENT(ret); /* pop send insn */
+ ci = (rb_call_info_t *)iobj->operands[0];
+ ci->orig_argc += 1; ci->argc = ci->orig_argc;
+ dupidx = INT2FIX(ci->orig_argc);
+
+ ADD_INSN1(ret, nd_line(node), topn, dupidx);
+ ADD_ELEM(ret, (LINK_ELEMENT *)iobj);
+ ADD_INSN(ret, nd_line(node), pop); /* result */
+ ADD_INSN(ret, nd_line(node), pop); /* rhs */
+ break;
+ }
+ case NODE_MASGN: {
+ DECL_ANCHOR(anchor);
+ INIT_ANCHOR(anchor);
+ COMPILE_POPED(anchor, "nest masgn lhs", node);
+ REMOVE_ELEM(FIRST_ELEMENT(anchor));
+ ADD_SEQ(ret, anchor);
+ break;
+ }
+ default: {
+ DECL_ANCHOR(anchor);
+ INIT_ANCHOR(anchor);
+ COMPILE_POPED(anchor, "masgn lhs", node);
+ REMOVE_ELEM(FIRST_ELEMENT(anchor));
+ ADD_SEQ(ret, anchor);
+ }
+ }
+
+ return COMPILE_OK;
+}
+
+static void
+compile_massign_opt_lhs(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *lhsn)
+{
+ if (lhsn) {
+ compile_massign_opt_lhs(iseq, ret, lhsn->nd_next);
+ compile_massign_lhs(iseq, ret, lhsn->nd_head);
+ }
+}
+
+static int
+compile_massign_opt(rb_iseq_t *iseq, LINK_ANCHOR *ret,
+ NODE *rhsn, NODE *orig_lhsn)
+{
+ VALUE mem[64];
+ const int memsize = numberof(mem);
+ int memindex = 0;
+ int llen = 0, rlen = 0;
+ int i;
+ NODE *lhsn = orig_lhsn;
+
+#define MEMORY(v) { \
+ int i; \
+ if (memindex == memsize) return 0; \
+ for (i=0; i<memindex; i++) { \
+ if (mem[i] == (v)) return 0; \
+ } \
+ mem[memindex++] = (v); \
+}
+
+ if (rhsn == 0 || nd_type(rhsn) != NODE_ARRAY) {
+ return 0;
+ }
+
+ while (lhsn) {
+ NODE *ln = lhsn->nd_head;
+ switch (nd_type(ln)) {
+ case NODE_LASGN:
+ MEMORY(ln->nd_vid);
+ break;
+ case NODE_DASGN:
+ case NODE_DASGN_CURR:
+ case NODE_IASGN:
+ case NODE_IASGN2:
+ case NODE_CVASGN:
+ MEMORY(ln->nd_vid);
+ break;
+ default:
+ return 0;
+ }
+ lhsn = lhsn->nd_next;
+ llen++;
+ }
+
+ while (rhsn) {
+ if (llen <= rlen) {
+ COMPILE_POPED(ret, "masgn val (popped)", rhsn->nd_head);
+ }
+ else {
+ COMPILE(ret, "masgn val", rhsn->nd_head);
+ }
+ rhsn = rhsn->nd_next;
+ rlen++;
+ }
+
+ if (llen > rlen) {
+ for (i=0; i<llen-rlen; i++) {
+ ADD_INSN(ret, nd_line(orig_lhsn), putnil);
+ }
+ }
+
+ compile_massign_opt_lhs(iseq, ret, orig_lhsn);
+ return 1;
+}
+
+static int
+compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int poped)
+{
+ NODE *rhsn = node->nd_value;
+ NODE *splatn = node->nd_args;
+ NODE *lhsn = node->nd_head;
+ int lhs_splat = (splatn && (VALUE)splatn != (VALUE)-1) ? 1 : 0;
+
+ if (!poped || splatn || !compile_massign_opt(iseq, ret, rhsn, lhsn)) {
+ int llen = 0;
+ DECL_ANCHOR(lhsseq);
+
+ INIT_ANCHOR(lhsseq);
+
+ while (lhsn) {
+ compile_massign_lhs(iseq, lhsseq, lhsn->nd_head);
+ llen += 1;
+ lhsn = lhsn->nd_next;
+ }
+
+ COMPILE(ret, "normal masgn rhs", rhsn);
+
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), dup);
+ }
+
+ ADD_INSN2(ret, nd_line(node), expandarray,
+ INT2FIX(llen), INT2FIX(lhs_splat));
+ ADD_SEQ(ret, lhsseq);
+
+ if (lhs_splat) {
+ if (nd_type(splatn) == NODE_POSTARG) {
+ /*a, b, *r, p1, p2 */
+ NODE *postn = splatn->nd_2nd;
+ NODE *restn = splatn->nd_1st;
+ int num = (int)postn->nd_alen;
+ int flag = 0x02 | (((VALUE)restn == (VALUE)-1) ? 0x00 : 0x01);
+
+ ADD_INSN2(ret, nd_line(splatn), expandarray,
+ INT2FIX(num), INT2FIX(flag));
+
+ if ((VALUE)restn != (VALUE)-1) {
+ compile_massign_lhs(iseq, ret, restn);
+ }
+ while (postn) {
+ compile_massign_lhs(iseq, ret, postn->nd_head);
+ postn = postn->nd_next;
+ }
+ }
+ else {
+ /* a, b, *r */
+ compile_massign_lhs(iseq, ret, splatn);
+ }
+ }
+ }
+ return COMPILE_OK;
+}
+
+static int
+compile_colon2(rb_iseq_t *iseq, NODE * node,
+ LINK_ANCHOR *pref, LINK_ANCHOR *body)
+{
+ switch (nd_type(node)) {
+ case NODE_CONST:
+ debugi("compile_colon2 - colon", node->nd_vid);
+ ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_vid));
+ break;
+ case NODE_COLON3:
+ debugi("compile_colon2 - colon3", node->nd_mid);
+ ADD_INSN(body, nd_line(node), pop);
+ ADD_INSN1(body, nd_line(node), putobject, rb_cObject);
+ ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_mid));
+ break;
+ case NODE_COLON2:
+ compile_colon2(iseq, node->nd_head, pref, body);
+ debugi("compile_colon2 - colon2", node->nd_mid);
+ ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_mid));
+ break;
+ default:
+ COMPILE(pref, "const colon2 prefix", node);
+ break;
+ }
+ return COMPILE_OK;
+}
+
+static VALUE
+compile_cpath(LINK_ANCHOR *ret, rb_iseq_t *iseq, NODE *cpath)
+{
+ if (nd_type(cpath) == NODE_COLON3) {
+ /* toplevel class ::Foo */
+ ADD_INSN1(ret, nd_line(cpath), putobject, rb_cObject);
+ return Qfalse;
+ }
+ else if (cpath->nd_head) {
+ /* Bar::Foo */
+ COMPILE(ret, "nd_else->nd_head", cpath->nd_head);
+ return Qfalse;
+ }
+ else {
+ /* class at cbase Foo */
+ ADD_INSN1(ret, nd_line(cpath), putspecialobject,
+ INT2FIX(VM_SPECIAL_OBJECT_CONST_BASE));
+ return Qtrue;
+ }
+}
+
+#define defined_expr defined_expr0
+static int
+defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
+ NODE *node, LABEL **lfinish, VALUE needstr)
+{
+ enum defined_type expr_type = 0;
+ enum node_type type;
+
+ switch (type = nd_type(node)) {
+
+ /* easy literals */
+ case NODE_NIL:
+ expr_type = DEFINED_NIL;
+ break;
+ case NODE_SELF:
+ expr_type = DEFINED_SELF;
+ break;
+ case NODE_TRUE:
+ expr_type = DEFINED_TRUE;
+ break;
+ case NODE_FALSE:
+ expr_type = DEFINED_FALSE;
+ break;
+
+ case NODE_ARRAY:{
+ NODE *vals = node;
+
+ do {
+ defined_expr(iseq, ret, vals->nd_head, lfinish, Qfalse);
+
+ if (!lfinish[1]) {
+ lfinish[1] = NEW_LABEL(nd_line(node));
+ }
+ ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
+ } while ((vals = vals->nd_next) != NULL);
+ }
+ case NODE_STR:
+ case NODE_LIT:
+ case NODE_ZARRAY:
+ case NODE_AND:
+ case NODE_OR:
+ default:
+ expr_type = DEFINED_EXPR;
+ break;
+
+ /* variables */
+ case NODE_LVAR:
+ case NODE_DVAR:
+ expr_type = DEFINED_LVAR;
+ break;
+
+ case NODE_IVAR:
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_IVAR),
+ ID2SYM(node->nd_vid), needstr);
+ return 1;
+
+ case NODE_GVAR:
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_GVAR),
+ ID2SYM(node->nd_entry->id), needstr);
+ return 1;
+
+ case NODE_CVAR:
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_CVAR),
+ ID2SYM(node->nd_vid), needstr);
+ return 1;
+
+ case NODE_CONST:
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_CONST),
+ ID2SYM(node->nd_vid), needstr);
+ return 1;
+ case NODE_COLON2:
+ if (!lfinish[1]) {
+ lfinish[1] = NEW_LABEL(nd_line(node));
+ }
+ defined_expr(iseq, ret, node->nd_head, lfinish, Qfalse);
+ ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
+
+ if (rb_is_const_id(node->nd_mid)) {
+ COMPILE(ret, "defined/colon2#nd_head", node->nd_head);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_CONST),
+ ID2SYM(node->nd_mid), needstr);
+ }
+ else {
+ COMPILE(ret, "defined/colon2#nd_head", node->nd_head);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_METHOD),
+ ID2SYM(node->nd_mid), needstr);
+ }
+ return 1;
+ case NODE_COLON3:
+ ADD_INSN1(ret, nd_line(node), putobject, rb_cObject);
+ ADD_INSN3(ret, nd_line(node), defined,
+ INT2FIX(DEFINED_CONST), ID2SYM(node->nd_mid), needstr);
+ return 1;
+
+ /* method dispatch */
+ case NODE_CALL:
+ case NODE_VCALL:
+ case NODE_FCALL:
+ case NODE_ATTRASGN:{
+ int self = TRUE;
+
+ switch (type) {
+ case NODE_ATTRASGN:
+ if (node->nd_recv == (NODE *)1) break;
+ case NODE_CALL:
+ self = FALSE;
+ break;
+ default:
+ /* through */;
+ }
+ if (!lfinish[1]) {
+ lfinish[1] = NEW_LABEL(nd_line(node));
+ }
+ if (node->nd_args) {
+ defined_expr(iseq, ret, node->nd_args, lfinish, Qfalse);
+ ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
+ }
+ if (!self) {
+ defined_expr(iseq, ret, node->nd_recv, lfinish, Qfalse);
+ ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
+ COMPILE(ret, "defined/recv", node->nd_recv);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_METHOD),
+ ID2SYM(node->nd_mid), needstr);
+ }
+ else {
+ ADD_INSN(ret, nd_line(node), putself);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_FUNC),
+ ID2SYM(node->nd_mid), needstr);
+ }
+ return 1;
+ }
+
+ case NODE_YIELD:
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_YIELD), 0,
+ needstr);
+ return 1;
+
+ case NODE_BACK_REF:
+ case NODE_NTH_REF:
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_REF),
+ INT2FIX((node->nd_nth << 1) | (type == NODE_BACK_REF)),
+ needstr);
+ return 1;
+
+ case NODE_SUPER:
+ case NODE_ZSUPER:
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_ZSUPER), 0,
+ needstr);
+ return 1;
+
+ case NODE_OP_ASGN1:
+ case NODE_OP_ASGN2:
+ case NODE_OP_ASGN_OR:
+ case NODE_OP_ASGN_AND:
+ case NODE_MASGN:
+ case NODE_LASGN:
+ case NODE_DASGN:
+ case NODE_DASGN_CURR:
+ case NODE_GASGN:
+ case NODE_IASGN:
+ case NODE_CDECL:
+ case NODE_CVDECL:
+ case NODE_CVASGN:
+ expr_type = DEFINED_ASGN;
+ break;
+ }
+
+ if (expr_type) {
+ if (needstr != Qfalse) {
+ VALUE str = rb_iseq_defined_string(expr_type);
+ ADD_INSN1(ret, nd_line(node), putobject, str);
+ }
+ else {
+ ADD_INSN1(ret, nd_line(node), putobject, Qtrue);
+ }
+ return 1;
+ }
+ return 0;
+}
+#undef defined_expr
+
+static int
+defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
+ NODE *node, LABEL **lfinish, VALUE needstr)
+{
+ LINK_ELEMENT *lcur = ret->last;
+ int done = defined_expr0(iseq, ret, node, lfinish, needstr);
+ if (lfinish[1]) {
+ int line = nd_line(node);
+ LABEL *lstart = NEW_LABEL(line);
+ LABEL *lend = NEW_LABEL(line);
+ VALUE rescue = NEW_CHILD_ISEQVAL(NEW_NIL(),
+ rb_str_concat(rb_str_new2
+ ("defined guard in "),
+ iseq->location.label),
+ ISEQ_TYPE_DEFINED_GUARD, 0);
+ APPEND_LABEL(ret, lcur, lstart);
+ ADD_LABEL(ret, lend);
+ ADD_CATCH_ENTRY(CATCH_TYPE_RESCUE, lstart, lend, rescue, lfinish[1]);
+ }
+ return done;
+}
+
+#define BUFSIZE 0x100
+
+static VALUE
+make_name_for_block(rb_iseq_t *iseq)
+{
+ int level = 1;
+ rb_iseq_t *ip = iseq;
+
+ if (iseq->parent_iseq != 0) {
+ while (ip->local_iseq != ip) {
+ if (ip->type == ISEQ_TYPE_BLOCK) {
+ level++;
+ }
+ ip = ip->parent_iseq;
+ }
+ }
+
+ if (level == 1) {
+ return rb_sprintf("block in %s", RSTRING_PTR(ip->location.label));
+ }
+ else {
+ return rb_sprintf("block (%d levels) in %s", level, RSTRING_PTR(ip->location.label));
+ }
+}
+
+static void
+push_ensure_entry(rb_iseq_t *iseq,
+ struct iseq_compile_data_ensure_node_stack *enl,
+ struct ensure_range *er, NODE *node)
+{
+ enl->ensure_node = node;
+ enl->prev = iseq->compile_data->ensure_node_stack; /* prev */
+ enl->erange = er;
+ iseq->compile_data->ensure_node_stack = enl;
+}
+
+static void
+add_ensure_range(rb_iseq_t *iseq, struct ensure_range *erange,
+ LABEL *lstart, LABEL *lend)
+{
+ struct ensure_range *ne =
+ compile_data_alloc(iseq, sizeof(struct ensure_range));
+
+ while (erange->next != 0) {
+ erange = erange->next;
+ }
+ ne->next = 0;
+ ne->begin = lend;
+ ne->end = erange->end;
+ erange->end = lstart;
+
+ erange->next = ne;
+}
+
+static void
+add_ensure_iseq(LINK_ANCHOR *ret, rb_iseq_t *iseq, int is_return)
+{
+ struct iseq_compile_data_ensure_node_stack *enlp =
+ iseq->compile_data->ensure_node_stack;
+ struct iseq_compile_data_ensure_node_stack *prev_enlp = enlp;
+ DECL_ANCHOR(ensure);
+
+ INIT_ANCHOR(ensure);
+ while (enlp) {
+ if (enlp->erange != 0) {
+ DECL_ANCHOR(ensure_part);
+ LABEL *lstart = NEW_LABEL(0);
+ LABEL *lend = NEW_LABEL(0);
+ INIT_ANCHOR(ensure_part);
+
+ add_ensure_range(iseq, enlp->erange, lstart, lend);
+
+ iseq->compile_data->ensure_node_stack = enlp->prev;
+ ADD_LABEL(ensure_part, lstart);
+ COMPILE_POPED(ensure_part, "ensure part", enlp->ensure_node);
+ ADD_LABEL(ensure_part, lend);
+ ADD_SEQ(ensure, ensure_part);
+ }
+ else {
+ if (!is_return) {
+ break;
+ }
+ }
+ enlp = enlp->prev;
+ }
+ iseq->compile_data->ensure_node_stack = prev_enlp;
+ ADD_SEQ(ret, ensure);
+}
+
+static VALUE
+setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, VALUE *flag)
+{
+ VALUE argc = INT2FIX(0);
+ int nsplat = 0;
+ DECL_ANCHOR(arg_block);
+ DECL_ANCHOR(args_splat);
+
+ INIT_ANCHOR(arg_block);
+ INIT_ANCHOR(args_splat);
+ if (argn && nd_type(argn) == NODE_BLOCK_PASS) {
+ COMPILE(arg_block, "block", argn->nd_body);
+ *flag |= VM_CALL_ARGS_BLOCKARG;
+ argn = argn->nd_head;
+ }
+
+ setup_argn:
+ if (argn) {
+ switch (nd_type(argn)) {
+ case NODE_SPLAT: {
+ COMPILE(args, "args (splat)", argn->nd_head);
+ argc = INT2FIX(1);
+ nsplat++;
+ *flag |= VM_CALL_ARGS_SPLAT;
+ break;
+ }
+ case NODE_ARGSCAT:
+ case NODE_ARGSPUSH: {
+ int next_is_array = (nd_type(argn->nd_head) == NODE_ARRAY);
+ DECL_ANCHOR(tmp);
+
+ INIT_ANCHOR(tmp);
+ COMPILE(tmp, "args (cat: splat)", argn->nd_body);
+ if (next_is_array && nsplat == 0) {
+ /* none */
+ }
+ else {
+ if (nd_type(argn) == NODE_ARGSCAT) {
+ ADD_INSN1(tmp, nd_line(argn), splatarray, Qfalse);
+ }
+ else {
+ ADD_INSN1(tmp, nd_line(argn), newarray, INT2FIX(1));
+ }
+ }
+ INSERT_LIST(args_splat, tmp);
+ nsplat++;
+ *flag |= VM_CALL_ARGS_SPLAT;
+
+ if (next_is_array) {
+ argc = INT2FIX(compile_array(iseq, args, argn->nd_head, COMPILE_ARRAY_TYPE_ARGS) + 1);
+ }
+ else {
+ argn = argn->nd_head;
+ goto setup_argn;
+ }
+ break;
+ }
+ case NODE_ARRAY: {
+ argc = INT2FIX(compile_array(iseq, args, argn, COMPILE_ARRAY_TYPE_ARGS));
+ break;
+ }
+ default: {
+ rb_bug("setup_arg: unknown node: %s\n", ruby_node_name(nd_type(argn)));
+ }
+ }
+ }
+
+ if (nsplat > 1) {
+ int i;
+ for (i=1; i<nsplat; i++) {
+ ADD_INSN(args_splat, nd_line(args), concatarray);
+ }
+ }
+
+ if (!LIST_SIZE_ZERO(args_splat)) {
+ ADD_SEQ(args, args_splat);
+ }
+
+ if (*flag & VM_CALL_ARGS_BLOCKARG) {
+ ADD_SEQ(args, arg_block);
+ }
+ return argc;
+}
+
+
+/**
+ compile each node
+
+ self: InstructionSequence
+ node: Ruby compiled node
+ poped: This node will be poped
+ */
+static int
+iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
+{
+ enum node_type type;
+
+ if (node == 0) {
+ if (!poped) {
+ debugs("node: NODE_NIL(implicit)\n");
+ ADD_INSN(ret, iseq->compile_data->last_line, putnil);
+ }
+ return COMPILE_OK;
+ }
+
+ iseq->compile_data->last_line = (int)nd_line(node);
+ debug_node_start(node);
+
+ type = nd_type(node);
+
+ if (node->flags & NODE_FL_NEWLINE) {
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_LINE);
+ }
+
+ switch (type) {
+ case NODE_BLOCK:{
+ while (node && nd_type(node) == NODE_BLOCK) {
+ COMPILE_(ret, "BLOCK body", node->nd_head,
+ (node->nd_next == 0 && poped == 0) ? 0 : 1);
+ node = node->nd_next;
+ }
+ if (node) {
+ COMPILE_(ret, "BLOCK next", node->nd_next, poped);
+ }
+ break;
+ }
+ case NODE_IF:{
+ DECL_ANCHOR(cond_seq);
+ DECL_ANCHOR(then_seq);
+ DECL_ANCHOR(else_seq);
+ LABEL *then_label, *else_label, *end_label;
+
+ INIT_ANCHOR(cond_seq);
+ INIT_ANCHOR(then_seq);
+ INIT_ANCHOR(else_seq);
+ then_label = NEW_LABEL(nd_line(node));
+ else_label = NEW_LABEL(nd_line(node));
+ end_label = NEW_LABEL(nd_line(node));
+
+ compile_branch_condition(iseq, cond_seq, node->nd_cond,
+ then_label, else_label);
+ COMPILE_(then_seq, "then", node->nd_body, poped);
+ COMPILE_(else_seq, "else", node->nd_else, poped);
+
+ ADD_SEQ(ret, cond_seq);
+
+ ADD_LABEL(ret, then_label);
+ ADD_SEQ(ret, then_seq);
+ ADD_INSNL(ret, nd_line(node), jump, end_label);
+
+ ADD_LABEL(ret, else_label);
+ ADD_SEQ(ret, else_seq);
+
+ ADD_LABEL(ret, end_label);
+
+ break;
+ }
+ case NODE_CASE:{
+ NODE *vals;
+ NODE *tempnode = node;
+ LABEL *endlabel, *elselabel;
+ DECL_ANCHOR(head);
+ DECL_ANCHOR(body_seq);
+ DECL_ANCHOR(cond_seq);
+ int only_special_literals = 1;
+ VALUE literals = rb_hash_new();
+
+ INIT_ANCHOR(head);
+ INIT_ANCHOR(body_seq);
+ INIT_ANCHOR(cond_seq);
+
+ RHASH_TBL(literals)->type = &cdhash_type;
+
+ if (node->nd_head == 0) {
+ COMPILE_(ret, "when", node->nd_body, poped);
+ break;
+ }
+ COMPILE(head, "case base", node->nd_head);
+
+ node = node->nd_body;
+ type = nd_type(node);
+
+ if (type != NODE_WHEN) {
+ COMPILE_ERROR((ERROR_ARGS "NODE_CASE: unexpected node. must be NODE_WHEN, but %s", ruby_node_name(type)));
+ }
+
+ endlabel = NEW_LABEL(nd_line(node));
+ elselabel = NEW_LABEL(nd_line(node));
+
+ ADD_SEQ(ret, head); /* case VAL */
+
+ while (type == NODE_WHEN) {
+ LABEL *l1;
+
+ l1 = NEW_LABEL(nd_line(node));
+ ADD_LABEL(body_seq, l1);
+ ADD_INSN(body_seq, nd_line(node), pop);
+ COMPILE_(body_seq, "when body", node->nd_body, poped);
+ ADD_INSNL(body_seq, nd_line(node), jump, endlabel);
+
+ vals = node->nd_head;
+ if (vals) {
+ switch (nd_type(vals)) {
+ case NODE_ARRAY:
+ only_special_literals = when_vals(iseq, cond_seq, vals, l1, only_special_literals, literals);
+ break;
+ case NODE_SPLAT:
+ case NODE_ARGSCAT:
+ case NODE_ARGSPUSH:
+ only_special_literals = 0;
+ ADD_INSN (cond_seq, nd_line(vals), dup);
+ COMPILE(cond_seq, "when/cond splat", vals);
+ ADD_INSN1(cond_seq, nd_line(vals), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE | VM_CHECKMATCH_ARRAY));
+ ADD_INSNL(cond_seq, nd_line(vals), branchif, l1);
+ break;
+ default:
+ rb_bug("NODE_CASE: unknown node (%s)",
+ ruby_node_name(nd_type(vals)));
+ }
+ }
+ else {
+ rb_bug("NODE_CASE: must be NODE_ARRAY, but 0");
+ }
+
+ node = node->nd_next;
+ if (!node) {
+ break;
+ }
+ type = nd_type(node);
+ }
+ /* else */
+ if (node) {
+ ADD_LABEL(cond_seq, elselabel);
+ ADD_INSN(cond_seq, nd_line(node), pop);
+ COMPILE_(cond_seq, "else", node, poped);
+ ADD_INSNL(cond_seq, nd_line(node), jump, endlabel);
+ }
+ else {
+ debugs("== else (implicit)\n");
+ ADD_LABEL(cond_seq, elselabel);
+ ADD_INSN(cond_seq, nd_line(tempnode), pop);
+ if (!poped) {
+ ADD_INSN(cond_seq, nd_line(tempnode), putnil);
+ }
+ ADD_INSNL(cond_seq, nd_line(tempnode), jump, endlabel);
+ }
+
+ if (only_special_literals) {
+ iseq_add_mark_object(iseq, literals);
+
+ ADD_INSN(ret, nd_line(tempnode), dup);
+ ADD_INSN2(ret, nd_line(tempnode), opt_case_dispatch, literals, elselabel);
+ }
+
+ ADD_SEQ(ret, cond_seq);
+ ADD_SEQ(ret, body_seq);
+ ADD_LABEL(ret, endlabel);
+ break;
+ }
+ case NODE_WHEN:{
+ NODE *vals;
+ NODE *val;
+ NODE *orig_node = node;
+ LABEL *endlabel;
+ DECL_ANCHOR(body_seq);
+
+ INIT_ANCHOR(body_seq);
+ endlabel = NEW_LABEL(nd_line(node));
+
+ while (node && nd_type(node) == NODE_WHEN) {
+ LABEL *l1 = NEW_LABEL(nd_line(node));
+ ADD_LABEL(body_seq, l1);
+ COMPILE_(body_seq, "when", node->nd_body, poped);
+ ADD_INSNL(body_seq, nd_line(node), jump, endlabel);
+
+ vals = node->nd_head;
+ if (!vals) {
+ rb_bug("NODE_WHEN: must be NODE_ARRAY, but 0");
+ }
+ switch (nd_type(vals)) {
+ case NODE_ARRAY:
+ while (vals) {
+ val = vals->nd_head;
+ COMPILE(ret, "when2", val);
+ ADD_INSNL(ret, nd_line(val), branchif, l1);
+ vals = vals->nd_next;
+ }
+ break;
+ case NODE_SPLAT:
+ case NODE_ARGSCAT:
+ case NODE_ARGSPUSH:
+ ADD_INSN(ret, nd_line(vals), putnil);
+ COMPILE(ret, "when2/cond splat", vals);
+ ADD_INSN1(ret, nd_line(vals), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_WHEN | VM_CHECKMATCH_ARRAY));
+ ADD_INSNL(ret, nd_line(vals), branchif, l1);
+ break;
+ default:
+ rb_bug("NODE_WHEN: unknown node (%s)",
+ ruby_node_name(nd_type(vals)));
+ }
+ node = node->nd_next;
+ }
+ /* else */
+ COMPILE_(ret, "else", node, poped);
+ ADD_INSNL(ret, nd_line(orig_node), jump, endlabel);
+
+ ADD_SEQ(ret, body_seq);
+ ADD_LABEL(ret, endlabel);
+
+ break;
+ }
+ case NODE_OPT_N:
+ case NODE_WHILE:
+ case NODE_UNTIL:{
+ LABEL *prev_start_label = iseq->compile_data->start_label;
+ LABEL *prev_end_label = iseq->compile_data->end_label;
+ LABEL *prev_redo_label = iseq->compile_data->redo_label;
+ int prev_loopval_popped = iseq->compile_data->loopval_popped;
+
+ struct iseq_compile_data_ensure_node_stack enl;
+
+ LABEL *next_label = iseq->compile_data->start_label = NEW_LABEL(nd_line(node)); /* next */
+ LABEL *redo_label = iseq->compile_data->redo_label = NEW_LABEL(nd_line(node)); /* redo */
+ LABEL *break_label = iseq->compile_data->end_label = NEW_LABEL(nd_line(node)); /* break */
+ LABEL *end_label = NEW_LABEL(nd_line(node));
+
+ LABEL *next_catch_label = NEW_LABEL(nd_line(node));
+ LABEL *tmp_label = NULL;
+
+ iseq->compile_data->loopval_popped = 0;
+ push_ensure_entry(iseq, &enl, 0, 0);
+
+ if (type == NODE_OPT_N || node->nd_state == 1) {
+ ADD_INSNL(ret, nd_line(node), jump, next_label);
+ }
+ else {
+ tmp_label = NEW_LABEL(nd_line(node));
+ ADD_INSNL(ret, nd_line(node), jump, tmp_label);
+ }
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_LABEL(ret, next_catch_label);
+ ADD_INSN(ret, nd_line(node), pop);
+ ADD_INSNL(ret, nd_line(node), jump, next_label);
+ if (tmp_label) ADD_LABEL(ret, tmp_label);
+
+ ADD_LABEL(ret, redo_label);
+ COMPILE_POPED(ret, "while body", node->nd_body);
+ ADD_LABEL(ret, next_label); /* next */
+
+ if (type == NODE_WHILE) {
+ compile_branch_condition(iseq, ret, node->nd_cond,
+ redo_label, end_label);
+ }
+ else if (type == NODE_UNTIL) {
+ /* untile */
+ compile_branch_condition(iseq, ret, node->nd_cond,
+ end_label, redo_label);
+ }
+ else {
+ ADD_CALL_RECEIVER(ret, nd_line(node));
+ ADD_CALL(ret, nd_line(node), ID2SYM(idGets), INT2FIX(0));
+ ADD_INSNL(ret, nd_line(node), branchif, redo_label);
+ /* opt_n */
+ }
+
+ ADD_LABEL(ret, end_label);
+
+ if (node->nd_state == Qundef) {
+ /* ADD_INSN(ret, nd_line(node), putundef); */
+ rb_bug("unsupported: putundef");
+ }
+ else {
+ ADD_INSN(ret, nd_line(node), putnil);
+ }
+
+ ADD_LABEL(ret, break_label); /* break */
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+
+ ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, redo_label, break_label,
+ 0, break_label);
+ ADD_CATCH_ENTRY(CATCH_TYPE_NEXT, redo_label, break_label, 0,
+ next_catch_label);
+ ADD_CATCH_ENTRY(CATCH_TYPE_REDO, redo_label, break_label, 0,
+ iseq->compile_data->redo_label);
+
+ iseq->compile_data->start_label = prev_start_label;
+ iseq->compile_data->end_label = prev_end_label;
+ iseq->compile_data->redo_label = prev_redo_label;
+ iseq->compile_data->loopval_popped = prev_loopval_popped;
+ iseq->compile_data->ensure_node_stack = iseq->compile_data->ensure_node_stack->prev;
+ break;
+ }
+ case NODE_ITER:
+ case NODE_FOR:{
+ VALUE prevblock = iseq->compile_data->current_block;
+ LABEL *retry_label = NEW_LABEL(nd_line(node));
+ LABEL *retry_end_l = NEW_LABEL(nd_line(node));
+
+ ADD_LABEL(ret, retry_label);
+ if (nd_type(node) == NODE_FOR) {
+ COMPILE(ret, "iter caller (for)", node->nd_iter);
+
+ iseq->compile_data->current_block =
+ NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),
+ ISEQ_TYPE_BLOCK, nd_line(node));
+
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(idEach), INT2FIX(0),
+ iseq->compile_data->current_block, INT2FIX(0));
+ }
+ else {
+ iseq->compile_data->current_block =
+ NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),
+ ISEQ_TYPE_BLOCK, nd_line(node));
+ COMPILE(ret, "iter caller", node->nd_iter);
+ }
+ ADD_LABEL(ret, retry_end_l);
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+
+ iseq->compile_data->current_block = prevblock;
+
+ ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, retry_label, retry_end_l, 0, retry_end_l);
+
+ break;
+ }
+ case NODE_BREAK:{
+ unsigned long level = 0;
+
+ if (iseq->compile_data->redo_label != 0) {
+ /* while/until */
+ LABEL *splabel = NEW_LABEL(0);
+ ADD_LABEL(ret, splabel);
+ ADD_ADJUST(ret, nd_line(node), iseq->compile_data->redo_label);
+ COMPILE_(ret, "break val (while/until)", node->nd_stts, iseq->compile_data->loopval_popped);
+ add_ensure_iseq(ret, iseq, 0);
+ ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->end_label);
+ ADD_ADJUST_RESTORE(ret, splabel);
+
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), putnil);
+ }
+ }
+ else if (iseq->type == ISEQ_TYPE_BLOCK) {
+ break_by_insn:
+ /* escape from block */
+ COMPILE(ret, "break val (block)", node->nd_stts);
+ ADD_INSN1(ret, nd_line(node), throw, INT2FIX(level | 0x02) /* TAG_BREAK */ );
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ }
+ else if (iseq->type == ISEQ_TYPE_EVAL) {
+ break_in_eval:
+ COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with break"));
+ }
+ else {
+ rb_iseq_t *ip = iseq->parent_iseq;
+ while (ip) {
+ if (!ip->compile_data) {
+ ip = 0;
+ break;
+ }
+
+ level++;
+ if (ip->compile_data->redo_label != 0) {
+ level = 0x8000;
+ if (ip->compile_data->loopval_popped == 0) {
+ /* need value */
+ level |= 0x4000;
+ }
+ goto break_by_insn;
+ }
+ else if (ip->type == ISEQ_TYPE_BLOCK) {
+ level <<= 16;
+ goto break_by_insn;
+ }
+ else if (ip->type == ISEQ_TYPE_EVAL) {
+ goto break_in_eval;
+ }
+
+ ip = ip->parent_iseq;
+ }
+ COMPILE_ERROR((ERROR_ARGS "Invalid break"));
+ }
+ break;
+ }
+ case NODE_NEXT:{
+ unsigned long level = 0;
+
+ if (iseq->compile_data->redo_label != 0) {
+ LABEL *splabel = NEW_LABEL(0);
+ debugs("next in while loop\n");
+ ADD_LABEL(ret, splabel);
+ COMPILE(ret, "next val/valid syntax?", node->nd_stts);
+ add_ensure_iseq(ret, iseq, 0);
+ ADD_ADJUST(ret, nd_line(node), iseq->compile_data->redo_label);
+ ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->start_label);
+ ADD_ADJUST_RESTORE(ret, splabel);
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), putnil);
+ }
+ }
+ else if (iseq->compile_data->end_label) {
+ LABEL *splabel = NEW_LABEL(0);
+ debugs("next in block\n");
+ ADD_LABEL(ret, splabel);
+ ADD_ADJUST(ret, nd_line(node), iseq->compile_data->start_label);
+ COMPILE(ret, "next val", node->nd_stts);
+ add_ensure_iseq(ret, iseq, 0);
+ ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->end_label);
+ ADD_ADJUST_RESTORE(ret, splabel);
+
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), putnil);
+ }
+ }
+ else if (iseq->type == ISEQ_TYPE_EVAL) {
+ next_in_eval:
+ COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with next"));
+ }
+ else {
+ rb_iseq_t *ip;
+ ip = iseq;
+ while (ip) {
+ if (!ip->compile_data) {
+ ip = 0;
+ break;
+ }
+
+ level = 0x8000 | 0x4000;
+ if (ip->compile_data->redo_label != 0) {
+ /* while loop */
+ break;
+ }
+ else if (ip->type == ISEQ_TYPE_BLOCK) {
+ break;
+ }
+ else if (ip->type == ISEQ_TYPE_EVAL) {
+ goto next_in_eval;
+ }
+
+ ip = ip->parent_iseq;
+ }
+ if (ip != 0) {
+ COMPILE(ret, "next val", node->nd_stts);
+ ADD_INSN1(ret, nd_line(node), throw, INT2FIX(level | 0x03) /* TAG_NEXT */ );
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ }
+ else {
+ COMPILE_ERROR((ERROR_ARGS "Invalid next"));
+ }
+ }
+ break;
+ }
+ case NODE_REDO:{
+ if (iseq->compile_data->redo_label) {
+ LABEL *splabel = NEW_LABEL(0);
+ debugs("redo in while");
+ ADD_LABEL(ret, splabel);
+ ADD_ADJUST(ret, nd_line(node), iseq->compile_data->redo_label);
+ add_ensure_iseq(ret, iseq, 0);
+ ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->redo_label);
+ ADD_ADJUST_RESTORE(ret, splabel);
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), putnil);
+ }
+ }
+ else if (iseq->type == ISEQ_TYPE_EVAL) {
+ redo_in_eval:
+ COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with redo"));
+ }
+ else if (iseq->compile_data->start_label) {
+ LABEL *splabel = NEW_LABEL(0);
+
+ debugs("redo in block");
+ ADD_LABEL(ret, splabel);
+ add_ensure_iseq(ret, iseq, 0);
+ ADD_ADJUST(ret, nd_line(node), iseq->compile_data->start_label);
+ ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->start_label);
+ ADD_ADJUST_RESTORE(ret, splabel);
+
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), putnil);
+ }
+ }
+ else {
+ rb_iseq_t *ip;
+ unsigned long level;
+ level = 0x8000 | 0x4000;
+ ip = iseq;
+ while (ip) {
+ if (!ip->compile_data) {
+ ip = 0;
+ break;
+ }
+
+ if (ip->compile_data->redo_label != 0) {
+ break;
+ }
+ else if (ip->type == ISEQ_TYPE_BLOCK) {
+ break;
+ }
+ else if (ip->type == ISEQ_TYPE_EVAL) {
+ goto redo_in_eval;
+ }
+
+ ip = ip->parent_iseq;
+ }
+ if (ip != 0) {
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN1(ret, nd_line(node), throw, INT2FIX(level | 0x05) /* TAG_REDO */ );
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ }
+ else {
+ COMPILE_ERROR((ERROR_ARGS "Invalid redo"));
+ }
+ }
+ break;
+ }
+ case NODE_RETRY:{
+ if (iseq->type == ISEQ_TYPE_RESCUE) {
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN1(ret, nd_line(node), throw, INT2FIX(0x04) /* TAG_RETRY */ );
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ }
+ else {
+ COMPILE_ERROR((ERROR_ARGS "Invalid retry"));
+ }
+ break;
+ }
+ case NODE_BEGIN:{
+ COMPILE_(ret, "NODE_BEGIN", node->nd_body, poped);
+ break;
+ }
+ case NODE_RESCUE:{
+ LABEL *lstart = NEW_LABEL(nd_line(node));
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ LABEL *lcont = NEW_LABEL(nd_line(node));
+ VALUE rescue = NEW_CHILD_ISEQVAL(
+ node->nd_resq,
+ rb_str_concat(rb_str_new2("rescue in "), iseq->location.label),
+ ISEQ_TYPE_RESCUE, nd_line(node));
+
+ ADD_LABEL(ret, lstart);
+ COMPILE(ret, "rescue head", node->nd_head);
+ ADD_LABEL(ret, lend);
+ if (node->nd_else) {
+ ADD_INSN(ret, nd_line(node), pop);
+ COMPILE(ret, "rescue else", node->nd_else);
+ }
+ ADD_INSN(ret, nd_line(node), nop);
+ ADD_LABEL(ret, lcont);
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+
+ /* register catch entry */
+ ADD_CATCH_ENTRY(CATCH_TYPE_RESCUE, lstart, lend, rescue, lcont);
+ ADD_CATCH_ENTRY(CATCH_TYPE_RETRY, lend, lcont, 0, lstart);
+ break;
+ }
+ case NODE_RESBODY:{
+ NODE *resq = node;
+ NODE *narg;
+ LABEL *label_miss, *label_hit;
+
+ while (resq) {
+ label_miss = NEW_LABEL(nd_line(node));
+ label_hit = NEW_LABEL(nd_line(node));
+
+ narg = resq->nd_args;
+ if (narg) {
+ switch (nd_type(narg)) {
+ case NODE_ARRAY:
+ while (narg) {
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(0));
+ COMPILE(ret, "rescue arg", narg->nd_head);
+ ADD_INSN1(ret, nd_line(node), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE));
+ ADD_INSNL(ret, nd_line(node), branchif, label_hit);
+ narg = narg->nd_next;
+ }
+ break;
+ case NODE_SPLAT:
+ case NODE_ARGSCAT:
+ case NODE_ARGSPUSH:
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(0));
+ COMPILE(ret, "rescue/cond splat", narg);
+ ADD_INSN1(ret, nd_line(node), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE | VM_CHECKMATCH_ARRAY));
+ ADD_INSNL(ret, nd_line(node), branchif, label_hit);
+ break;
+ default:
+ rb_bug("NODE_RESBODY: unknown node (%s)",
+ ruby_node_name(nd_type(narg)));
+ }
+ }
+ else {
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(0));
+ ADD_INSN1(ret, nd_line(node), putobject, rb_eStandardError);
+ ADD_INSN1(ret, nd_line(node), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE));
+ ADD_INSNL(ret, nd_line(node), branchif, label_hit);
+ }
+ ADD_INSNL(ret, nd_line(node), jump, label_miss);
+ ADD_LABEL(ret, label_hit);
+ COMPILE(ret, "resbody body", resq->nd_body);
+ if (iseq->compile_data->option->tailcall_optimization) {
+ ADD_INSN(ret, nd_line(node), nop);
+ }
+ ADD_INSN(ret, nd_line(node), leave);
+ ADD_LABEL(ret, label_miss);
+ resq = resq->nd_head;
+ }
+ break;
+ }
+ case NODE_ENSURE:{
+ DECL_ANCHOR(ensr);
+ VALUE ensure = NEW_CHILD_ISEQVAL(node->nd_ensr,
+ rb_str_concat(rb_str_new2
+ ("ensure in "),
+ iseq->location.label),
+ ISEQ_TYPE_ENSURE, nd_line(node));
+ LABEL *lstart = NEW_LABEL(nd_line(node));
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ LABEL *lcont = NEW_LABEL(nd_line(node));
+ struct ensure_range er;
+ struct iseq_compile_data_ensure_node_stack enl;
+ struct ensure_range *erange;
+
+ INIT_ANCHOR(ensr);
+ COMPILE_POPED(ensr, "ensure ensr", node->nd_ensr);
+
+ er.begin = lstart;
+ er.end = lend;
+ er.next = 0;
+ push_ensure_entry(iseq, &enl, &er, node->nd_ensr);
+
+ ADD_LABEL(ret, lstart);
+ COMPILE_(ret, "ensure head", node->nd_head, poped);
+ ADD_LABEL(ret, lend);
+ if (ensr->anchor.next == 0) {
+ ADD_INSN(ret, nd_line(node), nop);
+ }
+ else {
+ ADD_SEQ(ret, ensr);
+ }
+ ADD_LABEL(ret, lcont);
+
+ erange = iseq->compile_data->ensure_node_stack->erange;
+ while (erange) {
+ ADD_CATCH_ENTRY(CATCH_TYPE_ENSURE, erange->begin, erange->end,
+ ensure, lcont);
+ erange = erange->next;
+ }
+
+ iseq->compile_data->ensure_node_stack = enl.prev;
+ break;
+ }
+
+ case NODE_AND:
+ case NODE_OR:{
+ LABEL *end_label = NEW_LABEL(nd_line(node));
+ COMPILE(ret, "nd_1st", node->nd_1st);
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), dup);
+ }
+ if (type == NODE_AND) {
+ ADD_INSNL(ret, nd_line(node), branchunless, end_label);
+ }
+ else {
+ ADD_INSNL(ret, nd_line(node), branchif, end_label);
+ }
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ COMPILE_(ret, "nd_2nd", node->nd_2nd, poped);
+ ADD_LABEL(ret, end_label);
+ break;
+ }
+
+ case NODE_MASGN:{
+ compile_massign(iseq, ret, node, poped);
+ break;
+ }
+
+ case NODE_LASGN:{
+ ID id = node->nd_vid;
+ int idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
+
+ debugs("lvar: %s idx: %d\n", rb_id2name(id), idx);
+ COMPILE(ret, "rvalue", node->nd_value);
+
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), dup);
+ }
+ ADD_INSN2(ret, nd_line(node), setlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
+
+ break;
+ }
+ case NODE_DASGN:
+ case NODE_DASGN_CURR:{
+ int idx, lv, ls;
+ COMPILE(ret, "dvalue", node->nd_value);
+ debugp_param("dassn id", rb_str_new2(rb_id2name(node->nd_vid) ? rb_id2name(node->nd_vid) : "*"));
+
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), dup);
+ }
+
+ idx = get_dyna_var_idx(iseq, node->nd_vid, &lv, &ls);
+
+ if (idx < 0) {
+ rb_bug("NODE_DASGN(_CURR): unknown id (%s)", rb_id2name(node->nd_vid));
+ }
+
+ ADD_INSN2(ret, nd_line(node), setlocal, INT2FIX(ls - idx), INT2FIX(lv));
+ break;
+ }
+ case NODE_GASGN:{
+ COMPILE(ret, "lvalue", node->nd_value);
+
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), dup);
+ }
+ ADD_INSN1(ret, nd_line(node), setglobal,
+ ((VALUE)node->nd_entry | 1));
+ break;
+ }
+ case NODE_IASGN:
+ case NODE_IASGN2:{
+ COMPILE(ret, "lvalue", node->nd_value);
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), dup);
+ }
+ ADD_INSN2(ret, nd_line(node), setinstancevariable,
+ ID2SYM(node->nd_vid), INT2FIX(iseq->ic_size++));
+ break;
+ }
+ case NODE_CDECL:{
+ COMPILE(ret, "lvalue", node->nd_value);
+
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), dup);
+ }
+
+ if (node->nd_vid) {
+ ADD_INSN1(ret, nd_line(node), putspecialobject,
+ INT2FIX(VM_SPECIAL_OBJECT_CONST_BASE));
+ ADD_INSN1(ret, nd_line(node), setconstant, ID2SYM(node->nd_vid));
+ }
+ else {
+ compile_cpath(ret, iseq, node->nd_else);
+ ADD_INSN1(ret, nd_line(node), setconstant, ID2SYM(node->nd_else->nd_mid));
+ }
+ break;
+ }
+ case NODE_CVASGN:{
+ COMPILE(ret, "cvasgn val", node->nd_value);
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), dup);
+ }
+ ADD_INSN1(ret, nd_line(node), setclassvariable,
+ ID2SYM(node->nd_vid));
+ break;
+ }
+ case NODE_OP_ASGN1: {
+ DECL_ANCHOR(args);
+ VALUE argc;
+ VALUE flag = 0;
+ ID id = node->nd_mid;
+ int boff = 0;
+
+ /*
+ * a[x] (op)= y
+ *
+ * nil # nil
+ * eval a # nil a
+ * eval x # nil a x
+ * dupn 2 # nil a x a x
+ * send :[] # nil a x a[x]
+ * eval y # nil a x a[x] y
+ * send op # nil a x ret
+ * setn 3 # ret a x ret
+ * send []= # ret ?
+ * pop # ret
+ */
+
+ /*
+ * nd_recv[nd_args->nd_body] (nd_mid)= nd_args->nd_head;
+ * NODE_OP_ASGN nd_recv
+ * nd_args->nd_head
+ * nd_args->nd_body
+ * nd_mid
+ */
+
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), putnil);
+ }
+ COMPILE(ret, "NODE_OP_ASGN1 recv", node->nd_recv);
+ switch (nd_type(node->nd_args->nd_head)) {
+ case NODE_ZARRAY:
+ argc = INT2FIX(0);
+ break;
+ case NODE_BLOCK_PASS:
+ boff = 1;
+ default:
+ INIT_ANCHOR(args);
+ argc = setup_args(iseq, args, node->nd_args->nd_head, &flag);
+ ADD_SEQ(ret, args);
+ }
+ ADD_INSN1(ret, nd_line(node), dupn, FIXNUM_INC(argc, 1 + boff));
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(idAREF), argc, Qfalse, LONG2FIX(flag));
+
+ if (id == 0 || id == 1) {
+ /* 0: or, 1: and
+ a[x] ||= y
+
+ unless/if a[x]
+ a[x]= y
+ else
+ nil
+ end
+ */
+ LABEL *label = NEW_LABEL(nd_line(node));
+ LABEL *lfin = NEW_LABEL(nd_line(node));
+
+ ADD_INSN(ret, nd_line(node), dup);
+ if (id == 0) {
+ /* or */
+ ADD_INSNL(ret, nd_line(node), branchif, label);
+ }
+ else {
+ /* and */
+ ADD_INSNL(ret, nd_line(node), branchunless, label);
+ }
+ ADD_INSN(ret, nd_line(node), pop);
+
+ COMPILE(ret, "NODE_OP_ASGN1 args->body: ", node->nd_args->nd_body);
+ if (!poped) {
+ ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 2+boff));
+ }
+ if (flag & VM_CALL_ARGS_SPLAT) {
+ ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(1));
+ if (boff > 0) {
+ ADD_INSN1(ret, nd_line(node), dupn, INT2FIX(3));
+ ADD_INSN(ret, nd_line(node), swap);
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ ADD_INSN(ret, nd_line(node), concatarray);
+ if (boff > 0) {
+ ADD_INSN1(ret, nd_line(node), setn, INT2FIX(3));
+ ADD_INSN(ret, nd_line(node), pop);
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(idASET),
+ argc, Qfalse, LONG2FIX(flag));
+ }
+ else {
+ if (boff > 0)
+ ADD_INSN(ret, nd_line(node), swap);
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(idASET),
+ FIXNUM_INC(argc, 1), Qfalse, LONG2FIX(flag));
+ }
+ ADD_INSN(ret, nd_line(node), pop);
+ ADD_INSNL(ret, nd_line(node), jump, lfin);
+ ADD_LABEL(ret, label);
+ if (!poped) {
+ ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 2+boff));
+ }
+ ADD_INSN1(ret, nd_line(node), adjuststack, FIXNUM_INC(argc, 2+boff));
+ ADD_LABEL(ret, lfin);
+ }
+ else {
+ COMPILE(ret, "NODE_OP_ASGN1 args->body: ", node->nd_args->nd_body);
+ ADD_SEND(ret, nd_line(node), ID2SYM(id), INT2FIX(1));
+ if (!poped) {
+ ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 2+boff));
+ }
+ if (flag & VM_CALL_ARGS_SPLAT) {
+ ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(1));
+ if (boff > 0) {
+ ADD_INSN1(ret, nd_line(node), dupn, INT2FIX(3));
+ ADD_INSN(ret, nd_line(node), swap);
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ ADD_INSN(ret, nd_line(node), concatarray);
+ if (boff > 0) {
+ ADD_INSN1(ret, nd_line(node), setn, INT2FIX(3));
+ ADD_INSN(ret, nd_line(node), pop);
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(idASET),
+ argc, Qfalse, LONG2FIX(flag));
+ }
+ else {
+ if (boff > 0)
+ ADD_INSN(ret, nd_line(node), swap);
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(idASET),
+ FIXNUM_INC(argc, 1), Qfalse, LONG2FIX(flag));
+ }
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+
+ break;
+ }
+ case NODE_OP_ASGN2:{
+ ID atype = node->nd_next->nd_mid;
+ LABEL *lfin = NEW_LABEL(nd_line(node));
+ LABEL *lcfin = NEW_LABEL(nd_line(node));
+ /*
+ class C; attr_accessor :c; end
+ r = C.new
+ r.a &&= v # asgn2
+
+ eval r # r
+ dup # r r
+ eval r.a # r o
+
+ # or
+ dup # r o o
+ if lcfin # r o
+ pop # r
+ eval v # r v
+ swap # v r
+ topn 1 # v r v
+ send a= # v ?
+ jump lfin # v ?
+
+ lcfin: # r o
+ swap # o r
+
+ lfin: # o ?
+ pop # o
+
+ # and
+ dup # r o o
+ unless lcfin
+ pop # r
+ eval v # r v
+ swap # v r
+ topn 1 # v r v
+ send a= # v ?
+ jump lfin # v ?
+
+ # others
+ eval v # r o v
+ send ?? # r w
+ send a= # w
+
+ */
+
+ COMPILE(ret, "NODE_OP_ASGN2#recv", node->nd_recv);
+ ADD_INSN(ret, nd_line(node), dup);
+ ADD_SEND(ret, nd_line(node), ID2SYM(node->nd_next->nd_vid),
+ INT2FIX(0));
+
+ if (atype == 0 || atype == 1) { /* 0: OR or 1: AND */
+ ADD_INSN(ret, nd_line(node), dup);
+ if (atype == 0) {
+ ADD_INSNL(ret, nd_line(node), branchif, lcfin);
+ }
+ else {
+ ADD_INSNL(ret, nd_line(node), branchunless, lcfin);
+ }
+ ADD_INSN(ret, nd_line(node), pop);
+ COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value);
+ ADD_INSN(ret, nd_line(node), swap);
+ ADD_INSN1(ret, nd_line(node), topn, INT2FIX(1));
+ ADD_SEND(ret, nd_line(node), ID2SYM(node->nd_next->nd_aid),
+ INT2FIX(1));
+ ADD_INSNL(ret, nd_line(node), jump, lfin);
+
+ ADD_LABEL(ret, lcfin);
+ ADD_INSN(ret, nd_line(node), swap);
+
+ ADD_LABEL(ret, lfin);
+ ADD_INSN(ret, nd_line(node), pop);
+ if (poped) {
+ /* we can apply more optimize */
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ }
+ else {
+ COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value);
+ ADD_SEND(ret, nd_line(node), ID2SYM(node->nd_next->nd_mid),
+ INT2FIX(1));
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), swap);
+ ADD_INSN1(ret, nd_line(node), topn, INT2FIX(1));
+ }
+ ADD_SEND(ret, nd_line(node), ID2SYM(node->nd_next->nd_aid),
+ INT2FIX(1));
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_OP_CDECL: {
+ LABEL *lfin = 0;
+ LABEL *lassign = 0;
+ ID mid;
+
+ switch (nd_type(node->nd_head)) {
+ case NODE_COLON3:
+ ADD_INSN1(ret, nd_line(node), putobject, rb_cObject);
+ break;
+ case NODE_COLON2:
+ COMPILE(ret, "NODE_OP_CDECL/colon2#nd_head", node->nd_head->nd_head);
+ break;
+ default:
+ do {
+ COMPILE_ERROR((ERROR_ARGS "%s: invalid node in NODE_OP_CDECL",
+ ruby_node_name(nd_type(node->nd_head))));
+ } while (0);
+ return COMPILE_NG;
+ }
+ mid = node->nd_head->nd_mid;
+ /* cref */
+ if (node->nd_aid == 0) {
+ lassign = NEW_LABEL(nd_line(node));
+ ADD_INSN(ret, nd_line(node), dup); /* cref cref */
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_CONST),
+ ID2SYM(mid), Qfalse); /* cref bool */
+ ADD_INSNL(ret, nd_line(node), branchunless, lassign); /* cref */
+ }
+ ADD_INSN(ret, nd_line(node), dup); /* cref cref */
+ ADD_INSN1(ret, nd_line(node), getconstant, ID2SYM(mid)); /* cref obj */
+
+ if (node->nd_aid == 0 || node->nd_aid == 1) {
+ lfin = NEW_LABEL(nd_line(node));
+ if (!poped) ADD_INSN(ret, nd_line(node), dup); /* cref [obj] obj */
+ if (node->nd_aid == 0)
+ ADD_INSNL(ret, nd_line(node), branchif, lfin);
+ else
+ ADD_INSNL(ret, nd_line(node), branchunless, lfin);
+ /* cref [obj] */
+ if (!poped) ADD_INSN(ret, nd_line(node), pop); /* cref */
+ if (lassign) ADD_LABEL(ret, lassign);
+ COMPILE(ret, "NODE_OP_CDECL#nd_value", node->nd_value);
+ /* cref value */
+ if (poped)
+ ADD_INSN1(ret, nd_line(node), topn, INT2FIX(1)); /* cref value cref */
+ else {
+ ADD_INSN1(ret, nd_line(node), dupn, INT2FIX(2)); /* cref value cref value */
+ ADD_INSN(ret, nd_line(node), swap); /* cref value value cref */
+ }
+ ADD_INSN1(ret, nd_line(node), setconstant, ID2SYM(mid)); /* cref [value] */
+ ADD_LABEL(ret, lfin); /* cref [value] */
+ if (!poped) ADD_INSN(ret, nd_line(node), swap); /* [value] cref */
+ ADD_INSN(ret, nd_line(node), pop); /* [value] */
+ }
+ else {
+ COMPILE(ret, "NODE_OP_CDECL#nd_value", node->nd_value);
+ /* cref obj value */
+ ADD_CALL(ret, nd_line(node), ID2SYM(node->nd_aid), INT2FIX(1));
+ /* cref value */
+ ADD_INSN(ret, nd_line(node), swap); /* value cref */
+ if (!poped) {
+ ADD_INSN1(ret, nd_line(node), topn, INT2FIX(1)); /* value cref value */
+ ADD_INSN(ret, nd_line(node), swap); /* value value cref */
+ }
+ ADD_INSN1(ret, nd_line(node), setconstant, ID2SYM(mid));
+ }
+ break;
+ }
+ case NODE_OP_ASGN_AND:
+ case NODE_OP_ASGN_OR:{
+ LABEL *lfin = NEW_LABEL(nd_line(node));
+ LABEL *lassign;
+
+ if (nd_type(node) == NODE_OP_ASGN_OR) {
+ LABEL *lfinish[2];
+ lfinish[0] = lfin;
+ lfinish[1] = 0;
+ defined_expr(iseq, ret, node->nd_head, lfinish, Qfalse);
+ lassign = lfinish[1];
+ if (!lassign) {
+ lassign = NEW_LABEL(nd_line(node));
+ }
+ ADD_INSNL(ret, nd_line(node), branchunless, lassign);
+ }
+ else {
+ lassign = NEW_LABEL(nd_line(node));
+ }
+
+ COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_head", node->nd_head);
+ ADD_INSN(ret, nd_line(node), dup);
+
+ if (nd_type(node) == NODE_OP_ASGN_AND) {
+ ADD_INSNL(ret, nd_line(node), branchunless, lfin);
+ }
+ else {
+ ADD_INSNL(ret, nd_line(node), branchif, lfin);
+ }
+
+ ADD_INSN(ret, nd_line(node), pop);
+ ADD_LABEL(ret, lassign);
+ COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_value", node->nd_value);
+ ADD_LABEL(ret, lfin);
+
+ if (poped) {
+ /* we can apply more optimize */
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_CALL:
+ case NODE_FCALL:
+ case NODE_VCALL:{ /* VCALL: variable or call */
+ /*
+ call: obj.method(...)
+ fcall: func(...)
+ vcall: func
+ */
+ DECL_ANCHOR(recv);
+ DECL_ANCHOR(args);
+ ID mid = node->nd_mid;
+ VALUE argc;
+ VALUE flag = 0;
+ VALUE parent_block = iseq->compile_data->current_block;
+ iseq->compile_data->current_block = Qfalse;
+
+ INIT_ANCHOR(recv);
+ INIT_ANCHOR(args);
+#if SUPPORT_JOKE
+ if (nd_type(node) == NODE_VCALL) {
+ ID id_bitblt;
+ ID id_answer;
+
+ CONST_ID(id_bitblt, "bitblt");
+ CONST_ID(id_answer, "the_answer_to_life_the_universe_and_everything");
+
+ if (mid == id_bitblt) {
+ ADD_INSN(ret, nd_line(node), bitblt);
+ break;
+ }
+ else if (mid == id_answer) {
+ ADD_INSN(ret, nd_line(node), answer);
+ break;
+ }
+ }
+ /* only joke */
+ {
+ ID goto_id;
+ ID label_id;
+
+ CONST_ID(goto_id, "__goto__");
+ CONST_ID(label_id, "__label__");
+
+ if (nd_type(node) == NODE_FCALL &&
+ (mid == goto_id || mid == label_id)) {
+ LABEL *label;
+ st_data_t data;
+ st_table *labels_table = iseq->compile_data->labels_table;
+ ID label_name;
+
+ if (!labels_table) {
+ labels_table = st_init_numtable();
+ iseq->compile_data->labels_table = labels_table;
+ }
+ if (nd_type(node->nd_args->nd_head) == NODE_LIT &&
+ SYMBOL_P(node->nd_args->nd_head->nd_lit)) {
+
+ label_name = SYM2ID(node->nd_args->nd_head->nd_lit);
+ if (!st_lookup(labels_table, (st_data_t)label_name, &data)) {
+ label = NEW_LABEL(nd_line(node));
+ label->position = nd_line(node);
+ st_insert(labels_table, (st_data_t)label_name, (st_data_t)label);
+ }
+ else {
+ label = (LABEL *)data;
+ }
+ }
+ else {
+ COMPILE_ERROR((ERROR_ARGS "invalid goto/label format"));
+ }
+
+
+ if (mid == goto_id) {
+ ADD_INSNL(ret, nd_line(node), jump, label);
+ }
+ else {
+ ADD_LABEL(ret, label);
+ }
+ break;
+ }
+ }
+#endif
+ /* receiver */
+ if (type == NODE_CALL) {
+ COMPILE(recv, "recv", node->nd_recv);
+ }
+ else if (type == NODE_FCALL || type == NODE_VCALL) {
+ ADD_CALL_RECEIVER(recv, nd_line(node));
+ }
+
+ /* args */
+ if (nd_type(node) != NODE_VCALL) {
+ argc = setup_args(iseq, args, node->nd_args, &flag);
+ }
+ else {
+ argc = INT2FIX(0);
+ }
+
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, args);
+
+ debugp_param("call args argc", argc);
+ debugp_param("call method", ID2SYM(mid));
+
+ switch (nd_type(node)) {
+ case NODE_VCALL:
+ flag |= VM_CALL_VCALL;
+ /* VCALL is funcall, so fall through */
+ case NODE_FCALL:
+ flag |= VM_CALL_FCALL;
+ }
+
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(mid),
+ argc, parent_block, LONG2FIX(flag));
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_SUPER:
+ case NODE_ZSUPER:{
+ DECL_ANCHOR(args);
+ VALUE argc;
+ VALUE flag = 0;
+ VALUE parent_block = iseq->compile_data->current_block;
+
+ INIT_ANCHOR(args);
+ iseq->compile_data->current_block = Qfalse;
+ if (nd_type(node) == NODE_SUPER) {
+ argc = setup_args(iseq, args, node->nd_args, &flag);
+ }
+ else {
+ /* NODE_ZSUPER */
+ int i;
+ rb_iseq_t *liseq = iseq->local_iseq;
+ int lvar_level = get_lvar_level(iseq);
+
+ argc = INT2FIX(liseq->argc);
+
+ /* normal arguments */
+ for (i = 0; i < liseq->argc; i++) {
+ int idx = liseq->local_size - i;
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ }
+
+ if (!liseq->arg_simple) {
+ if (liseq->arg_opts) {
+ /* optional arguments */
+ int j;
+ for (j = 0; j < liseq->arg_opts - 1; j++) {
+ int idx = liseq->local_size - (i + j);
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ }
+ i += j;
+ argc = INT2FIX(i);
+ }
+
+ if (liseq->arg_rest != -1) {
+ /* rest argument */
+ int idx = liseq->local_size - liseq->arg_rest;
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ argc = INT2FIX(liseq->arg_rest + 1);
+ flag |= VM_CALL_ARGS_SPLAT;
+ }
+
+ if (liseq->arg_post_len) {
+ /* post arguments */
+ int post_len = liseq->arg_post_len;
+ int post_start = liseq->arg_post_start;
+
+ if (liseq->arg_rest != -1) {
+ int j;
+ for (j=0; j<post_len; j++) {
+ int idx = liseq->local_size - (post_start + j);
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ }
+ ADD_INSN1(args, nd_line(node), newarray, INT2FIX(j));
+ ADD_INSN (args, nd_line(node), concatarray);
+ /* argc is setteled at above */
+ }
+ else {
+ int j;
+ for (j=0; j<post_len; j++) {
+ int idx = liseq->local_size - (post_start + j);
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ }
+ argc = INT2FIX(post_len + post_start);
+ }
+ }
+ }
+ }
+
+ /* dummy receiver */
+ ADD_INSN1(ret, nd_line(node), putobject, nd_type(node) == NODE_ZSUPER ? Qfalse : Qtrue);
+ ADD_SEQ(ret, args);
+ ADD_INSN1(ret, nd_line(node), invokesuper, new_callinfo(iseq, 0, FIX2INT(argc), parent_block,
+ flag | VM_CALL_SUPER | VM_CALL_FCALL));
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_ARRAY:{
+ compile_array_(iseq, ret, node, COMPILE_ARRAY_TYPE_ARRAY, poped);
+ break;
+ }
+ case NODE_ZARRAY:{
+ if (!poped) {
+ ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(0));
+ }
+ break;
+ }
+ case NODE_VALUES:{
+ NODE *n = node;
+ while (n) {
+ COMPILE(ret, "values item", n->nd_head);
+ n = n->nd_next;
+ }
+ ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(node->nd_alen));
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_HASH:{
+ DECL_ANCHOR(list);
+ int type = node->nd_head ? nd_type(node->nd_head) : NODE_ZARRAY;
+
+ INIT_ANCHOR(list);
+ switch (type) {
+ case NODE_ARRAY:
+ compile_array(iseq, list, node->nd_head, COMPILE_ARRAY_TYPE_HASH);
+ ADD_SEQ(ret, list);
+ break;
+
+ case NODE_ZARRAY:
+ ADD_INSN1(ret, nd_line(node), newhash, INT2FIX(0));
+ break;
+
+ default:
+ rb_bug("can't make hash with this node: %s", ruby_node_name(type));
+ }
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_RETURN:{
+ rb_iseq_t *is = iseq;
+
+ if (is) {
+ if (is->type == ISEQ_TYPE_TOP) {
+ COMPILE_ERROR((ERROR_ARGS "Invalid return"));
+ }
+ else {
+ LABEL *splabel = 0;
+
+ if (is->type == ISEQ_TYPE_METHOD) {
+ splabel = NEW_LABEL(0);
+ ADD_LABEL(ret, splabel);
+ ADD_ADJUST(ret, nd_line(node), 0);
+ }
+
+ COMPILE(ret, "return nd_stts (return val)", node->nd_stts);
+
+ if (is->type == ISEQ_TYPE_METHOD) {
+ add_ensure_iseq(ret, iseq, 1);
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_RETURN);
+ ADD_INSN(ret, nd_line(node), leave);
+ ADD_ADJUST_RESTORE(ret, splabel);
+
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), putnil);
+ }
+ }
+ else {
+ ADD_INSN1(ret, nd_line(node), throw, INT2FIX(0x01) /* TAG_RETURN */ );
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ }
+ }
+ }
+ break;
+ }
+ case NODE_YIELD:{
+ DECL_ANCHOR(args);
+ VALUE argc;
+ VALUE flag = 0;
+
+ INIT_ANCHOR(args);
+ if (iseq->type == ISEQ_TYPE_TOP) {
+ COMPILE_ERROR((ERROR_ARGS "Invalid yield"));
+ }
+
+ if (node->nd_head) {
+ argc = setup_args(iseq, args, node->nd_head, &flag);
+ }
+ else {
+ argc = INT2FIX(0);
+ }
+
+ ADD_SEQ(ret, args);
+ ADD_INSN1(ret, nd_line(node), invokeblock, new_callinfo(iseq, 0, FIX2INT(argc), 0, flag));
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_LVAR:{
+ if (!poped) {
+ ID id = node->nd_vid;
+ int idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
+
+ debugs("id: %s idx: %d\n", rb_id2name(id), idx);
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
+ }
+ break;
+ }
+ case NODE_DVAR:{
+ int lv, idx, ls;
+ debugi("nd_vid", node->nd_vid);
+ if (!poped) {
+ idx = get_dyna_var_idx(iseq, node->nd_vid, &lv, &ls);
+ if (idx < 0) {
+ rb_bug("unknown dvar (%s)", rb_id2name(node->nd_vid));
+ }
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(ls - idx), INT2FIX(lv));
+ }
+ break;
+ }
+ case NODE_GVAR:{
+ ADD_INSN1(ret, nd_line(node), getglobal,
+ ((VALUE)node->nd_entry | 1));
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_IVAR:{
+ debugi("nd_vid", node->nd_vid);
+ if (!poped) {
+ ADD_INSN2(ret, nd_line(node), getinstancevariable,
+ ID2SYM(node->nd_vid), INT2FIX(iseq->ic_size++));
+ }
+ break;
+ }
+ case NODE_CONST:{
+ debugi("nd_vid", node->nd_vid);
+
+ if (iseq->compile_data->option->inline_const_cache) {
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ int ic_index = iseq->ic_size++;
+
+ ADD_INSN2(ret, nd_line(node), getinlinecache, lend, INT2FIX(ic_index));
+ ADD_INSN1(ret, nd_line(node), getconstant, ID2SYM(node->nd_vid));
+ ADD_INSN1(ret, nd_line(node), setinlinecache, INT2FIX(ic_index));
+ ADD_LABEL(ret, lend);
+ }
+ else {
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN1(ret, nd_line(node), getconstant, ID2SYM(node->nd_vid));
+ }
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_CVAR:{
+ if (!poped) {
+ ADD_INSN1(ret, nd_line(node), getclassvariable,
+ ID2SYM(node->nd_vid));
+ }
+ break;
+ }
+ case NODE_NTH_REF:{
+ if (!poped) {
+ ADD_INSN2(ret, nd_line(node), getspecial, INT2FIX(1) /* '~' */,
+ INT2FIX(node->nd_nth << 1));
+ }
+ break;
+ }
+ case NODE_BACK_REF:{
+ if (!poped) {
+ ADD_INSN2(ret, nd_line(node), getspecial, INT2FIX(1) /* '~' */,
+ INT2FIX(0x01 | (node->nd_nth << 1)));
+ }
+ break;
+ }
+ case NODE_MATCH:
+ case NODE_MATCH2:
+ case NODE_MATCH3:{
+ DECL_ANCHOR(recv);
+ DECL_ANCHOR(val);
+
+ INIT_ANCHOR(recv);
+ INIT_ANCHOR(val);
+ switch (nd_type(node)) {
+ case NODE_MATCH:
+ ADD_INSN1(recv, nd_line(node), putobject, node->nd_lit);
+ ADD_INSN2(val, nd_line(node), getspecial, INT2FIX(0),
+ INT2FIX(0));
+ break;
+ case NODE_MATCH2:
+ COMPILE(recv, "receiver", node->nd_recv);
+ COMPILE(val, "value", node->nd_value);
+ break;
+ case NODE_MATCH3:
+ COMPILE(recv, "receiver", node->nd_value);
+ COMPILE(val, "value", node->nd_recv);
+ break;
+ }
+
+ if (iseq->compile_data->option->specialized_instruction) {
+ /* TODO: detect by node */
+ if (recv->last == recv->anchor.next &&
+ INSN_OF(recv->last) == BIN(putobject) &&
+ nd_type(node) == NODE_MATCH2) {
+ ADD_SEQ(ret, val);
+ ADD_INSN1(ret, nd_line(node), opt_regexpmatch1,
+ OPERAND_AT(recv->last, 0));
+ }
+ else {
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, val);
+ ADD_INSN(ret, nd_line(node), opt_regexpmatch2);
+ }
+ }
+ else {
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, val);
+ ADD_SEND(ret, nd_line(node), ID2SYM(idEqTilde), INT2FIX(1));
+ }
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_LIT:{
+ debugp_param("lit", node->nd_lit);
+ if (!poped) {
+ ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
+ }
+ break;
+ }
+ case NODE_STR:{
+ debugp_param("nd_lit", node->nd_lit);
+ if (!poped) {
+ OBJ_FREEZE(node->nd_lit);
+ ADD_INSN1(ret, nd_line(node), putstring, node->nd_lit);
+ }
+ break;
+ }
+ case NODE_DSTR:{
+ compile_dstr(iseq, ret, node);
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_XSTR:{
+ OBJ_FREEZE(node->nd_lit);
+ ADD_CALL_RECEIVER(ret, nd_line(node));
+ ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
+ ADD_CALL(ret, nd_line(node), ID2SYM(idBackquote), INT2FIX(1));
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_DXSTR:{
+ ADD_CALL_RECEIVER(ret, nd_line(node));
+ compile_dstr(iseq, ret, node);
+ ADD_CALL(ret, nd_line(node), ID2SYM(idBackquote), INT2FIX(1));
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_EVSTR:{
+ COMPILE(ret, "nd_body", node->nd_body);
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ else {
+ ADD_INSN(ret, nd_line(node), tostring);
+ }
+ break;
+ }
+ case NODE_DREGX:{
+ compile_dregx(iseq, ret, node);
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_DREGX_ONCE:{
+ /* TODO: once? */
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ int ic_index = iseq->ic_size++;
+
+ ADD_INSN2(ret, nd_line(node), onceinlinecache, lend, INT2FIX(ic_index));
+ ADD_INSN(ret, nd_line(node), pop);
+
+ compile_dregx(iseq, ret, node);
+
+ ADD_INSN1(ret, nd_line(node), setinlinecache, INT2FIX(ic_index));
+ ADD_LABEL(ret, lend);
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_ARGSCAT:{
+ if (poped) {
+ COMPILE(ret, "argscat head", node->nd_head);
+ ADD_INSN1(ret, nd_line(node), splatarray, Qfalse);
+ ADD_INSN(ret, nd_line(node), pop);
+ COMPILE(ret, "argscat body", node->nd_body);
+ ADD_INSN1(ret, nd_line(node), splatarray, Qfalse);
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ else {
+ COMPILE(ret, "argscat head", node->nd_head);
+ COMPILE(ret, "argscat body", node->nd_body);
+ ADD_INSN(ret, nd_line(node), concatarray);
+ }
+ break;
+ }
+ case NODE_ARGSPUSH:{
+ if (poped) {
+ COMPILE(ret, "arsgpush head", node->nd_head);
+ ADD_INSN1(ret, nd_line(node), splatarray, Qfalse);
+ ADD_INSN(ret, nd_line(node), pop);
+ COMPILE_(ret, "argspush body", node->nd_body, poped);
+ }
+ else {
+ COMPILE(ret, "arsgpush head", node->nd_head);
+ COMPILE_(ret, "argspush body", node->nd_body, poped);
+ ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(1));
+ ADD_INSN(ret, nd_line(node), concatarray);
+ }
+ break;
+ }
+ case NODE_SPLAT:{
+ COMPILE(ret, "splat", node->nd_head);
+ ADD_INSN1(ret, nd_line(node), splatarray, Qtrue);
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_DEFN:{
+ VALUE iseqval = NEW_ISEQVAL(node->nd_defn,
+ rb_str_dup(rb_id2str(node->nd_mid)),
+ ISEQ_TYPE_METHOD, nd_line(node));
+
+ debugp_param("defn/iseq", iseqval);
+
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
+ ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->nd_mid));
+ ADD_INSN1(ret, nd_line(node), putiseq, iseqval);
+ ADD_SEND (ret, nd_line(node), ID2SYM(id_core_define_method), INT2FIX(3));
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+
+ debugp_param("defn", iseqval);
+ break;
+ }
+ case NODE_DEFS:{
+ VALUE iseqval = NEW_ISEQVAL(node->nd_defn,
+ rb_str_dup(rb_id2str(node->nd_mid)),
+ ISEQ_TYPE_METHOD, nd_line(node));
+
+ debugp_param("defs/iseq", iseqval);
+
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ COMPILE(ret, "defs: recv", node->nd_recv);
+ ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->nd_mid));
+ ADD_INSN1(ret, nd_line(node), putiseq, iseqval);
+ ADD_SEND (ret, nd_line(node), ID2SYM(id_core_define_singleton_method), INT2FIX(3));
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_ALIAS:{
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
+ COMPILE(ret, "alias arg1", node->u1.node);
+ COMPILE(ret, "alias arg2", node->u2.node);
+ ADD_SEND(ret, nd_line(node), ID2SYM(id_core_set_method_alias), INT2FIX(3));
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_VALIAS:{
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->u1.id));
+ ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->u2.id));
+ ADD_SEND(ret, nd_line(node), ID2SYM(id_core_set_variable_alias), INT2FIX(2));
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_UNDEF:{
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
+ COMPILE(ret, "undef arg", node->u2.node);
+ ADD_SEND(ret, nd_line(node), ID2SYM(id_core_undef_method), INT2FIX(2));
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_CLASS:{
+ VALUE iseqval =
+ NEW_CHILD_ISEQVAL(
+ node->nd_body,
+ rb_sprintf("<class:%s>", rb_id2name(node->nd_cpath->nd_mid)),
+ ISEQ_TYPE_CLASS, nd_line(node));
+ VALUE noscope = compile_cpath(ret, iseq, node->nd_cpath);
+ int flags = VM_DEFINECLASS_TYPE_CLASS;
+ if (!noscope) flags |= VM_DEFINECLASS_FLAG_SCOPED;
+ if (node->nd_super) flags |= VM_DEFINECLASS_FLAG_HAS_SUPERCLASS;
+ COMPILE(ret, "super", node->nd_super);
+ ADD_INSN3(ret, nd_line(node), defineclass,
+ ID2SYM(node->nd_cpath->nd_mid), iseqval, INT2FIX(flags));
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_MODULE:{
+ VALUE iseqval = NEW_CHILD_ISEQVAL(
+ node->nd_body,
+ rb_sprintf("<module:%s>", rb_id2name(node->nd_cpath->nd_mid)),
+ ISEQ_TYPE_CLASS, nd_line(node));
+
+ VALUE noscope = compile_cpath(ret, iseq, node->nd_cpath);
+ int flags = VM_DEFINECLASS_TYPE_MODULE;
+ if (!noscope) flags |= VM_DEFINECLASS_FLAG_SCOPED;
+ ADD_INSN (ret, nd_line(node), putnil); /* dummy */
+ ADD_INSN3(ret, nd_line(node), defineclass,
+ ID2SYM(node->nd_cpath->nd_mid), iseqval, INT2FIX(flags));
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_SCLASS:{
+ ID singletonclass;
+ VALUE iseqval =
+ NEW_ISEQVAL(node->nd_body, rb_str_new2("singleton class"),
+ ISEQ_TYPE_CLASS, nd_line(node));
+
+ COMPILE(ret, "sclass#recv", node->nd_recv);
+ ADD_INSN (ret, nd_line(node), putnil);
+ CONST_ID(singletonclass, "singletonclass");
+ ADD_INSN3(ret, nd_line(node), defineclass,
+ ID2SYM(singletonclass), iseqval,
+ INT2FIX(VM_DEFINECLASS_TYPE_SINGLETON_CLASS));
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_COLON2:{
+ if (rb_is_const_id(node->nd_mid)) {
+ /* constant */
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ int ic_index = iseq->ic_size++;
+
+ DECL_ANCHOR(pref);
+ DECL_ANCHOR(body);
+
+ INIT_ANCHOR(pref);
+ INIT_ANCHOR(body);
+ compile_colon2(iseq, node, pref, body);
+ if (LIST_SIZE_ZERO(pref)) {
+ if (iseq->compile_data->option->inline_const_cache) {
+ ADD_INSN2(ret, nd_line(node), getinlinecache, lend, INT2FIX(ic_index));
+ }
+ else {
+ ADD_INSN(ret, nd_line(node), putnil);
+ }
+
+ ADD_SEQ(ret, body);
+
+ if (iseq->compile_data->option->inline_const_cache) {
+ ADD_INSN1(ret, nd_line(node), setinlinecache, INT2FIX(ic_index));
+ ADD_LABEL(ret, lend);
+ }
+ }
+ else {
+ ADD_SEQ(ret, pref);
+ ADD_SEQ(ret, body);
+ }
+ }
+ else {
+ /* function call */
+ ADD_CALL_RECEIVER(ret, nd_line(node));
+ COMPILE(ret, "colon2#nd_head", node->nd_head);
+ ADD_CALL(ret, nd_line(node), ID2SYM(node->nd_mid),
+ INT2FIX(1));
+ }
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_COLON3:{
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ int ic_index = iseq->ic_size++;
+
+ debugi("colon3#nd_mid", node->nd_mid);
+
+ /* add cache insn */
+ if (iseq->compile_data->option->inline_const_cache) {
+ ADD_INSN2(ret, nd_line(node), getinlinecache, lend, INT2FIX(ic_index));
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+
+ ADD_INSN1(ret, nd_line(node), putobject, rb_cObject);
+ ADD_INSN1(ret, nd_line(node), getconstant, ID2SYM(node->nd_mid));
+
+ if (iseq->compile_data->option->inline_const_cache) {
+ ADD_INSN1(ret, nd_line(node), setinlinecache, INT2FIX(ic_index));
+ ADD_LABEL(ret, lend);
+ }
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_DOT2:
+ case NODE_DOT3:{
+ VALUE flag = type == NODE_DOT2 ? INT2FIX(0) : INT2FIX(1);
+ COMPILE(ret, "min", (NODE *) node->nd_beg);
+ COMPILE(ret, "max", (NODE *) node->nd_end);
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ else {
+ ADD_INSN1(ret, nd_line(node), newrange, flag);
+ }
+ break;
+ }
+ case NODE_FLIP2:
+ case NODE_FLIP3:{
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ LABEL *lfin = NEW_LABEL(nd_line(node));
+ LABEL *ltrue = NEW_LABEL(nd_line(node));
+ struct iseq_compile_data *data = iseq->local_iseq->compile_data;
+ rb_num_t cnt;
+ VALUE key;
+
+ if (!data) data = iseq->compile_data;
+ cnt = data->flip_cnt++ + DEFAULT_SPECIAL_VAR_COUNT;
+ key = INT2FIX(cnt);
+
+ ADD_INSN2(ret, nd_line(node), getspecial, key, INT2FIX(0));
+ ADD_INSNL(ret, nd_line(node), branchif, lend);
+
+ /* *flip == 0 */
+ COMPILE(ret, "flip2 beg", node->nd_beg);
+ ADD_INSN(ret, nd_line(node), dup);
+ ADD_INSNL(ret, nd_line(node), branchunless, lfin);
+ if (nd_type(node) == NODE_FLIP3) {
+ ADD_INSN(ret, nd_line(node), dup);
+ ADD_INSN1(ret, nd_line(node), setspecial, key);
+ ADD_INSNL(ret, nd_line(node), jump, lfin);
+ }
+ else {
+ ADD_INSN1(ret, nd_line(node), setspecial, key);
+ }
+
+ /* *flip == 1 */
+ ADD_LABEL(ret, lend);
+ COMPILE(ret, "flip2 end", node->nd_end);
+ ADD_INSNL(ret, nd_line(node), branchunless, ltrue);
+ ADD_INSN1(ret, nd_line(node), putobject, Qfalse);
+ ADD_INSN1(ret, nd_line(node), setspecial, key);
+
+ ADD_LABEL(ret, ltrue);
+ ADD_INSN1(ret, nd_line(node), putobject, Qtrue);
+
+ ADD_LABEL(ret, lfin);
+ break;
+ }
+ case NODE_SELF:{
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), putself);
+ }
+ break;
+ }
+ case NODE_NIL:{
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), putnil);
+ }
+ break;
+ }
+ case NODE_TRUE:{
+ if (!poped) {
+ ADD_INSN1(ret, nd_line(node), putobject, Qtrue);
+ }
+ break;
+ }
+ case NODE_FALSE:{
+ if (!poped) {
+ ADD_INSN1(ret, nd_line(node), putobject, Qfalse);
+ }
+ break;
+ }
+ case NODE_ERRINFO:{
+ if (!poped) {
+ if (iseq->type == ISEQ_TYPE_RESCUE) {
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(0));
+ }
+ else {
+ rb_iseq_t *ip = iseq;
+ int level = 0;
+ while (ip) {
+ if (ip->type == ISEQ_TYPE_RESCUE) {
+ break;
+ }
+ ip = ip->parent_iseq;
+ level++;
+ }
+ if (ip) {
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(level));
+ }
+ else {
+ ADD_INSN(ret, nd_line(node), putnil);
+ }
+ }
+ }
+ break;
+ }
+ case NODE_DEFINED:{
+ if (!poped) {
+ LABEL *lfinish[2];
+ lfinish[0] = NEW_LABEL(nd_line(node));
+ lfinish[1] = 0;
+ ADD_INSN(ret, nd_line(node), putnil);
+ defined_expr(iseq, ret, node->nd_head, lfinish, Qtrue);
+ ADD_INSN(ret, nd_line(node), swap);
+ ADD_INSN(ret, nd_line(node), pop);
+ if (lfinish[1]) {
+ ADD_LABEL(ret, lfinish[1]);
+ }
+ ADD_LABEL(ret, lfinish[0]);
+ }
+ break;
+ }
+ case NODE_POSTEXE:{
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ VALUE block = NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, nd_line(node));
+ int ic_index = iseq->ic_size++;
+
+ ADD_INSN2(ret, nd_line(node), onceinlinecache, lend, INT2FIX(ic_index));
+ ADD_INSN(ret, nd_line(node), pop);
+
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, nd_line(node), putiseq, block);
+ ADD_SEND (ret, nd_line(node), ID2SYM(id_core_set_postexe), INT2FIX(1));
+
+ ADD_INSN1(ret, nd_line(node), setinlinecache, INT2FIX(ic_index));
+ ADD_LABEL(ret, lend);
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_KW_ARG:{
+ LABEL *default_label = NEW_LABEL(nd_line(node));
+ LABEL *end_label = NEW_LABEL(nd_line(node));
+ int idx, lv, ls;
+ ID id = node->nd_body->nd_vid;
+
+ ADD_INSN(ret, nd_line(node), dup);
+ ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(id));
+ ADD_SEND(ret, nd_line(node), ID2SYM(rb_intern("key?")), INT2FIX(1));
+ ADD_INSNL(ret, nd_line(node), branchunless, default_label);
+ ADD_INSN(ret, nd_line(node), dup);
+ ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(id));
+ ADD_SEND(ret, nd_line(node), ID2SYM(rb_intern("delete")), INT2FIX(1));
+ switch (nd_type(node->nd_body)) {
+ case NODE_LASGN:
+ idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
+ ADD_INSN2(ret, nd_line(node), setlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
+ break;
+ case NODE_DASGN:
+ case NODE_DASGN_CURR:
+ idx = get_dyna_var_idx(iseq, id, &lv, &ls);
+ ADD_INSN2(ret, nd_line(node), setlocal, INT2FIX(ls - idx), INT2FIX(lv));
+ break;
+ default:
+ rb_bug("iseq_compile_each (NODE_KW_ARG): unknown node: %s", ruby_node_name(nd_type(node->nd_body)));
+ }
+ ADD_INSNL(ret, nd_line(node), jump, end_label);
+ ADD_LABEL(ret, default_label);
+ COMPILE_POPED(ret, "keyword default argument", node->nd_body);
+ ADD_LABEL(ret, end_label);
+ break;
+ }
+ case NODE_DSYM:{
+ compile_dstr(iseq, ret, node);
+ if (!poped) {
+ ADD_SEND(ret, nd_line(node), ID2SYM(idIntern), INT2FIX(0));
+ }
+ else {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ case NODE_ATTRASGN:{
+ DECL_ANCHOR(recv);
+ DECL_ANCHOR(args);
+ VALUE flag = 0;
+ VALUE argc;
+
+ INIT_ANCHOR(recv);
+ INIT_ANCHOR(args);
+ argc = setup_args(iseq, args, node->nd_args, &flag);
+
+ if (node->nd_recv == (NODE *) 1) {
+ flag |= VM_CALL_FCALL;
+ ADD_INSN(recv, nd_line(node), putself);
+ }
+ else {
+ COMPILE(recv, "recv", node->nd_recv);
+ }
+
+ debugp_param("argc", argc);
+ debugp_param("nd_mid", ID2SYM(node->nd_mid));
+
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, args);
+
+ if (flag & VM_CALL_ARGS_BLOCKARG) {
+ ADD_INSN1(ret, nd_line(node), topn, INT2FIX(1));
+ if (flag & VM_CALL_ARGS_SPLAT) {
+ ADD_INSN1(ret, nd_line(node), putobject, INT2FIX(-1));
+ ADD_SEND(ret, nd_line(node), ID2SYM(idAREF), INT2FIX(1));
+ }
+ ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 3));
+ ADD_INSN (ret, nd_line(node), pop);
+ }
+ else if (flag & VM_CALL_ARGS_SPLAT) {
+ ADD_INSN(ret, nd_line(node), dup);
+ ADD_INSN1(ret, nd_line(node), putobject, INT2FIX(-1));
+ ADD_SEND(ret, nd_line(node), ID2SYM(idAREF), INT2FIX(1));
+ ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 2));
+ ADD_INSN (ret, nd_line(node), pop);
+ }
+ else {
+ ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 1));
+ }
+ }
+ else {
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, args);
+ }
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(node->nd_mid), argc, 0, LONG2FIX(flag));
+ ADD_INSN(ret, nd_line(node), pop);
+
+ break;
+ }
+ case NODE_PRELUDE:{
+ COMPILE_POPED(ret, "prelude", node->nd_head);
+ COMPILE_(ret, "body", node->nd_body, poped);
+ break;
+ }
+ case NODE_LAMBDA:{
+ /* compile same as lambda{...} */
+ VALUE block = NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, nd_line(node));
+ VALUE argc = INT2FIX(0);
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_CALL_WITH_BLOCK(ret, nd_line(node), ID2SYM(idLambda), argc, block);
+
+ if (poped) {
+ ADD_INSN(ret, nd_line(node), pop);
+ }
+ break;
+ }
+ default:
+ rb_bug("iseq_compile_each: unknown node: %s", ruby_node_name(type));
+ return COMPILE_NG;
+ }
+
+ debug_node_end();
+ return COMPILE_OK;
+}
+
+/***************************/
+/* instruction information */
+/***************************/
+
+static int
+insn_data_length(INSN *iobj)
+{
+ return insn_len(iobj->insn_id);
+}
+
+static int
+calc_sp_depth(int depth, INSN *insn)
+{
+ return insn_stack_increase(depth, insn->insn_id, insn->operands);
+}
+
+static int
+insn_data_line_no(INSN *iobj)
+{
+ return insn_len(iobj->line_no);
+}
+
+static VALUE
+insn_data_to_s_detail(INSN *iobj)
+{
+ VALUE str = rb_sprintf("%-16s", insn_name(iobj->insn_id));
+
+ if (iobj->operands) {
+ const char *types = insn_op_types(iobj->insn_id);
+ int j;
+
+ for (j = 0; types[j]; j++) {
+ char type = types[j];
+ printf("str: %"PRIxVALUE", type: %c\n", str, type);
+
+ switch (type) {
+ case TS_OFFSET: /* label(destination position) */
+ {
+ LABEL *lobj = (LABEL *)OPERAND_AT(iobj, j);
+ rb_str_catf(str, "<L%03d>", lobj->label_no);
+ break;
+ }
+ break;
+ case TS_ISEQ: /* iseq */
+ {
+ rb_iseq_t *iseq = (rb_iseq_t *)OPERAND_AT(iobj, j);
+ VALUE val = Qnil;
+ if (0 && iseq) { /* TODO: invalidate now */
+ val = iseq->self;
+ }
+ rb_str_concat(str, rb_inspect(val));
+ }
+ break;
+ case TS_LINDEX:
+ case TS_NUM: /* ulong */
+ case TS_VALUE: /* VALUE */
+ {
+ VALUE v = OPERAND_AT(iobj, j);
+ rb_str_concat(str, rb_inspect(v));
+ break;
+ }
+ case TS_ID: /* ID */
+ rb_str_concat(str, rb_inspect(OPERAND_AT(iobj, j)));
+ break;
+ case TS_GENTRY:
+ {
+ struct rb_global_entry *entry = (struct rb_global_entry *)
+ (OPERAND_AT(iobj, j) & (~1));
+ rb_str_cat2(str, rb_id2name(entry->id));
+ break;
+ }
+ case TS_IC: /* inline cache */
+ rb_str_catf(str, "<ic:%d>", FIX2INT(OPERAND_AT(iobj, j)));
+ break;
+ case TS_CALLINFO: /* call info */
+ {
+ rb_call_info_t *ci = (rb_call_info_t *)OPERAND_AT(iobj, j);
+ rb_str_catf(str, "<callinfo:%s, %d>", ci->mid ? rb_id2name(ci->mid) : "", ci->orig_argc);
+ break;
+ }
+ case TS_CDHASH: /* case/when condition cache */
+ rb_str_cat2(str, "<ch>");
+ break;
+ default:{
+ rb_raise(rb_eSyntaxError, "unknown operand type: %c", type);
+ }
+ }
+ if (types[j + 1]) {
+ rb_str_cat2(str, ", ");
+ }
+ }
+ }
+ return str;
+}
+
+static void
+dump_disasm_list(struct iseq_link_element *link)
+{
+ int pos = 0;
+ INSN *iobj;
+ LABEL *lobj;
+ VALUE str;
+
+ printf("-- raw disasm--------\n");
+
+ while (link) {
+ switch (link->type) {
+ case ISEQ_ELEMENT_INSN:
+ {
+ iobj = (INSN *)link;
+ str = insn_data_to_s_detail(iobj);
+ printf("%04d %-65s(%4d)\n", pos, StringValueCStr(str), insn_data_line_no(iobj));
+ pos += insn_data_length(iobj);
+ break;
+ }
+ case ISEQ_ELEMENT_LABEL:
+ {
+ lobj = (LABEL *)link;
+ printf("<L%03d>\n", lobj->label_no);
+ break;
+ }
+ case ISEQ_ELEMENT_NONE:
+ {
+ printf("[none]\n");
+ break;
+ }
+ case ISEQ_ELEMENT_ADJUST:
+ {
+ ADJUST *adjust = (ADJUST *)link;
+ printf("adjust: [label: %d]\n", adjust->label->label_no);
+ break;
+ }
+ default:
+ /* ignore */
+ rb_raise(rb_eSyntaxError, "dump_disasm_list error: %ld\n", FIX2LONG(link->type));
+ }
+ link = link->next;
+ }
+ printf("---------------------\n");
+}
+
+const char *
+rb_insns_name(int i)
+{
+ return insn_name_info[i];
+}
+
+VALUE
+rb_insns_name_array(void)
+{
+ VALUE ary = rb_ary_new();
+ int i;
+ for (i = 0; i < numberof(insn_name_info); i++) {
+ rb_ary_push(ary, rb_obj_freeze(rb_str_new2(insn_name_info[i])));
+ }
+ return rb_obj_freeze(ary);
+}
+
+static LABEL *
+register_label(rb_iseq_t *iseq, struct st_table *labels_table, VALUE obj)
+{
+ LABEL *label = 0;
+ st_data_t tmp;
+ obj = rb_convert_type(obj, T_SYMBOL, "Symbol", "to_sym");
+
+ if (st_lookup(labels_table, obj, &tmp) == 0) {
+ label = NEW_LABEL(0);
+ st_insert(labels_table, obj, (st_data_t)label);
+ }
+ else {
+ label = (LABEL *)tmp;
+ }
+ return label;
+}
+
+static VALUE
+get_exception_sym2type(VALUE sym)
+{
+#undef rb_intern
+#define rb_intern(str) rb_intern_const(str)
+ VALUE sym_inspect;
+ static VALUE symRescue, symEnsure, symRetry;
+ static VALUE symBreak, symRedo, symNext;
+
+ if (symRescue == 0) {
+ symRescue = ID2SYM(rb_intern("rescue"));
+ symEnsure = ID2SYM(rb_intern("ensure"));
+ symRetry = ID2SYM(rb_intern("retry"));
+ symBreak = ID2SYM(rb_intern("break"));
+ symRedo = ID2SYM(rb_intern("redo"));
+ symNext = ID2SYM(rb_intern("next"));
+ }
+
+ if (sym == symRescue) return CATCH_TYPE_RESCUE;
+ if (sym == symEnsure) return CATCH_TYPE_ENSURE;
+ if (sym == symRetry) return CATCH_TYPE_RETRY;
+ if (sym == symBreak) return CATCH_TYPE_BREAK;
+ if (sym == symRedo) return CATCH_TYPE_REDO;
+ if (sym == symNext) return CATCH_TYPE_NEXT;
+ sym_inspect = rb_inspect(sym);
+ rb_raise(rb_eSyntaxError, "invalid exception symbol: %s",
+ StringValuePtr(sym_inspect));
+ return 0;
+}
+
+static int
+iseq_build_from_ary_exception(rb_iseq_t *iseq, struct st_table *labels_table,
+ VALUE exception)
+{
+ int i;
+
+ for (i=0; i<RARRAY_LEN(exception); i++) {
+ VALUE v, type, *ptr, eiseqval;
+ LABEL *lstart, *lend, *lcont;
+ int sp;
+
+ RB_GC_GUARD(v) = rb_convert_type(RARRAY_PTR(exception)[i], T_ARRAY,
+ "Array", "to_ary");
+ if (RARRAY_LEN(v) != 6) {
+ rb_raise(rb_eSyntaxError, "wrong exception entry");
+ }
+ ptr = RARRAY_PTR(v);
+ type = get_exception_sym2type(ptr[0]);
+ if (ptr[1] == Qnil) {
+ eiseqval = 0;
+ }
+ else {
+ eiseqval = rb_iseq_load(ptr[1], iseq->self, Qnil);
+ }
+
+ lstart = register_label(iseq, labels_table, ptr[2]);
+ lend = register_label(iseq, labels_table, ptr[3]);
+ lcont = register_label(iseq, labels_table, ptr[4]);
+ sp = NUM2INT(ptr[5]);
+
+ (void)sp;
+
+ ADD_CATCH_ENTRY(type, lstart, lend, eiseqval, lcont);
+ }
+ return COMPILE_OK;
+}
+
+static struct st_table *
+insn_make_insn_table(void)
+{
+ struct st_table *table;
+ int i;
+ table = st_init_numtable();
+
+ for (i=0; i<VM_INSTRUCTION_SIZE; i++) {
+ st_insert(table, ID2SYM(rb_intern(insn_name(i))), i);
+ }
+
+ return table;
+}
+
+static VALUE
+iseq_build_load_iseq(rb_iseq_t *iseq, VALUE op)
+{
+ VALUE iseqval;
+ if (RB_TYPE_P(op, T_ARRAY)) {
+ iseqval = rb_iseq_load(op, iseq->self, Qnil);
+ }
+ else if (CLASS_OF(op) == rb_cISeq) {
+ iseqval = op;
+ }
+ else {
+ rb_raise(rb_eSyntaxError, "ISEQ is required");
+ }
+ iseq_add_mark_object(iseq, iseqval);
+ return iseqval;
+}
+
+static int
+iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
+ VALUE body, struct st_table *labels_table)
+{
+ /* TODO: body should be frozen */
+ VALUE *ptr = RARRAY_PTR(body);
+ long i, len = RARRAY_LEN(body);
+ int j;
+ int line_no = 0;
+
+ /*
+ * index -> LABEL *label
+ */
+ static struct st_table *insn_table;
+
+ if (insn_table == 0) {
+ insn_table = insn_make_insn_table();
+ }
+
+ for (i=0; i<len; i++) {
+ VALUE obj = ptr[i];
+
+ if (SYMBOL_P(obj)) {
+ LABEL *label = register_label(iseq, labels_table, obj);
+ ADD_LABEL(anchor, label);
+ }
+ else if (FIXNUM_P(obj)) {
+ line_no = NUM2INT(obj);
+ }
+ else if (RB_TYPE_P(obj, T_ARRAY)) {
+ VALUE *argv = 0;
+ int argc = RARRAY_LENINT(obj) - 1;
+ st_data_t insn_id;
+ VALUE insn;
+
+ insn = (argc < 0) ? Qnil : RARRAY_PTR(obj)[0];
+ if (st_lookup(insn_table, (st_data_t)insn, &insn_id) == 0) {
+ /* TODO: exception */
+ RB_GC_GUARD(insn) = rb_inspect(insn);
+ rb_compile_error(RSTRING_PTR(iseq->location.path), line_no,
+ "unknown instruction: %s", RSTRING_PTR(insn));
+ }
+
+ if (argc != insn_len((VALUE)insn_id)-1) {
+ rb_compile_error(RSTRING_PTR(iseq->location.path), line_no,
+ "operand size mismatch");
+ }
+
+ if (argc > 0) {
+ argv = compile_data_alloc(iseq, sizeof(VALUE) * argc);
+ for (j=0; j<argc; j++) {
+ VALUE op = rb_ary_entry(obj, j+1);
+ switch (insn_op_type((VALUE)insn_id, j)) {
+ case TS_OFFSET: {
+ LABEL *label = register_label(iseq, labels_table, op);
+ argv[j] = (VALUE)label;
+ break;
+ }
+ case TS_LINDEX:
+ case TS_NUM:
+ (void)NUM2INT(op);
+ argv[j] = op;
+ break;
+ case TS_VALUE:
+ argv[j] = op;
+ iseq_add_mark_object(iseq, op);
+ break;
+ case TS_ISEQ:
+ {
+ if (op != Qnil) {
+ argv[j] = iseq_build_load_iseq(iseq, op);
+ }
+ else {
+ argv[j] = 0;
+ }
+ }
+ break;
+ case TS_GENTRY:
+ op = rb_convert_type(op, T_SYMBOL, "Symbol", "to_sym");
+ argv[j] = (VALUE)rb_global_entry(SYM2ID(op));
+ break;
+ case TS_IC:
+ argv[j] = op;
+ if (NUM2INT(op) >= iseq->ic_size) {
+ iseq->ic_size = NUM2INT(op) + 1;
+ }
+ break;
+ case TS_CALLINFO:
+ {
+ ID mid = 0;
+ int orig_argc = 0;
+ VALUE block = 0;
+ unsigned long flag = 0;
+
+ if (!NIL_P(op)) {
+ VALUE vmid = rb_hash_aref(op, ID2SYM(rb_intern("mid")));
+ VALUE vflag = rb_hash_aref(op, ID2SYM(rb_intern("flag")));
+ VALUE vorig_argc = rb_hash_aref(op, ID2SYM(rb_intern("orig_argc")));
+ VALUE vblock = rb_hash_aref(op, ID2SYM(rb_intern("block")));
+
+ if (!NIL_P(vmid)) mid = SYM2ID(vmid);
+ if (!NIL_P(vflag)) flag = NUM2ULONG(vflag);
+ if (!NIL_P(vorig_argc)) orig_argc = FIX2INT(vorig_argc);
+ if (!NIL_P(vblock)) block = iseq_build_load_iseq(iseq, vblock);
+ }
+ argv[j] = (VALUE)new_callinfo(iseq, mid, orig_argc, block, flag);
+ }
+ break;
+ case TS_ID:
+ argv[j] = rb_convert_type(op, T_SYMBOL,
+ "Symbol", "to_sym");
+ break;
+ case TS_CDHASH:
+ {
+ int i;
+ op = rb_convert_type(op, T_ARRAY, "Array", "to_ary");
+ op = rb_ary_dup(op);
+ for (i=0; i<RARRAY_LEN(op); i+=2) {
+ VALUE sym = rb_ary_entry(op, i+1);
+ LABEL *label =
+ register_label(iseq, labels_table, sym);
+ rb_ary_store(op, i+1, (VALUE)label | 1);
+ }
+ argv[j] = op;
+ iseq_add_mark_object_compile_time(iseq, op);
+ }
+ break;
+ default:
+ rb_raise(rb_eSyntaxError, "unknown operand: %c", insn_op_type((VALUE)insn_id, j));
+ }
+ }
+ }
+ ADD_ELEM(anchor,
+ (LINK_ELEMENT*)new_insn_core(iseq, line_no,
+ (enum ruby_vminsn_type)insn_id, argc, argv));
+ }
+ else {
+ rb_raise(rb_eTypeError, "unexpected object for instruction");
+ }
+ }
+ validate_labels(iseq, labels_table);
+ st_free_table(labels_table);
+ iseq_setup(iseq, anchor);
+ return COMPILE_OK;
+}
+
+#define CHECK_ARRAY(v) rb_convert_type((v), T_ARRAY, "Array", "to_ary")
+#define CHECK_STRING(v) rb_convert_type((v), T_STRING, "String", "to_str")
+#define CHECK_SYMBOL(v) rb_convert_type((v), T_SYMBOL, "Symbol", "to_sym")
+static inline VALUE CHECK_INTEGER(VALUE v) {(void)NUM2LONG(v); return v;}
+
+VALUE
+rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
+ VALUE exception, VALUE body)
+{
+ int i;
+ ID *tbl;
+ struct st_table *labels_table = st_init_numtable();
+ DECL_ANCHOR(anchor);
+ INIT_ANCHOR(anchor);
+
+ iseq->local_table_size = RARRAY_LENINT(locals);
+ iseq->local_table = tbl = (ID *)ALLOC_N(ID, iseq->local_table_size);
+ iseq->local_size = iseq->local_table_size + 1;
+
+ for (i=0; i<RARRAY_LEN(locals); i++) {
+ VALUE lv = RARRAY_PTR(locals)[i];
+ tbl[i] = FIXNUM_P(lv) ? (ID)FIX2LONG(lv) : SYM2ID(CHECK_SYMBOL(lv));
+ }
+
+ /* args */
+ if (FIXNUM_P(args)) {
+ iseq->arg_size = iseq->argc = FIX2INT(args);
+ iseq->arg_simple = 1;
+ }
+ else {
+ int i = 0;
+ VALUE argc = CHECK_INTEGER(rb_ary_entry(args, i++));
+ VALUE arg_opt_labels = CHECK_ARRAY(rb_ary_entry(args, i++));
+ VALUE arg_post_len = CHECK_INTEGER(rb_ary_entry(args, i++));
+ VALUE arg_post_start = CHECK_INTEGER(rb_ary_entry(args, i++));
+ VALUE arg_rest = CHECK_INTEGER(rb_ary_entry(args, i++));
+ VALUE arg_block = CHECK_INTEGER(rb_ary_entry(args, i++));
+ VALUE arg_simple = CHECK_INTEGER(rb_ary_entry(args, i++));
+
+ iseq->argc = FIX2INT(argc);
+ iseq->arg_rest = FIX2INT(arg_rest);
+ iseq->arg_post_len = FIX2INT(arg_post_len);
+ iseq->arg_post_start = FIX2INT(arg_post_start);
+ iseq->arg_block = FIX2INT(arg_block);
+ iseq->arg_opts = RARRAY_LENINT(arg_opt_labels);
+ iseq->arg_opt_table = (VALUE *)ALLOC_N(VALUE, iseq->arg_opts);
+
+ if (iseq->arg_block != -1) {
+ iseq->arg_size = iseq->arg_block + 1;
+ }
+ else if (iseq->arg_post_len) {
+ iseq->arg_size = iseq->arg_post_start + iseq->arg_post_len;
+ }
+ else if (iseq->arg_rest != -1) {
+ iseq->arg_size = iseq->arg_rest + 1;
+ }
+ else {
+ iseq->arg_size = iseq->argc + (iseq->arg_opts ? iseq->arg_opts - 1 : 0);
+ }
+
+ for (i=0; i<RARRAY_LEN(arg_opt_labels); i++) {
+ iseq->arg_opt_table[i] =
+ (VALUE)register_label(iseq, labels_table,
+ rb_ary_entry(arg_opt_labels, i));
+ }
+
+ iseq->arg_simple = NUM2INT(arg_simple);
+ }
+
+ /* exception */
+ iseq_build_from_ary_exception(iseq, labels_table, exception);
+
+ /* body */
+ iseq_build_from_ary_body(iseq, anchor, body, labels_table);
+ return iseq->self;
+}
+
+/* for parser */
+
+int
+rb_dvar_defined(ID id)
+{
+ rb_thread_t *th = GET_THREAD();
+ rb_iseq_t *iseq;
+ if (th->base_block && (iseq = th->base_block->iseq)) {
+ while (iseq->type == ISEQ_TYPE_BLOCK ||
+ iseq->type == ISEQ_TYPE_RESCUE ||
+ iseq->type == ISEQ_TYPE_ENSURE ||
+ iseq->type == ISEQ_TYPE_EVAL ||
+ iseq->type == ISEQ_TYPE_MAIN
+ ) {
+ int i;
+
+ for (i = 0; i < iseq->local_table_size; i++) {
+ if (iseq->local_table[i] == id) {
+ return 1;
+ }
+ }
+ iseq = iseq->parent_iseq;
+ }
+ }
+ return 0;
+}
+
+int
+rb_local_defined(ID id)
+{
+ rb_thread_t *th = GET_THREAD();
+ rb_iseq_t *iseq;
+
+ if (th->base_block && th->base_block->iseq) {
+ int i;
+ iseq = th->base_block->iseq->local_iseq;
+
+ for (i=0; i<iseq->local_table_size; i++) {
+ if (iseq->local_table[i] == id) {
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+int
+rb_parse_in_eval(void)
+{
+ return GET_THREAD()->parse_in_eval > 0;
+}
+
+int
+rb_parse_in_main(void)
+{
+ return GET_THREAD()->parse_in_eval < 0;
+}
diff --git a/complex.c b/complex.c
new file mode 100644
index 0000000000..2efe6a4676
--- /dev/null
+++ b/complex.c
@@ -0,0 +1,2252 @@
+/*
+ complex.c: Coded by Tadayoshi Funaba 2008-2012
+
+ This implementation is based on Keiju Ishitsuka's Complex library
+ which is written in ruby.
+*/
+
+#include "ruby.h"
+#include "internal.h"
+#include <math.h>
+
+#define NDEBUG
+#include <assert.h>
+
+#define ZERO INT2FIX(0)
+#define ONE INT2FIX(1)
+#define TWO INT2FIX(2)
+
+VALUE rb_cComplex;
+
+static ID id_abs, id_abs2, id_arg, id_cmp, id_conj, id_convert,
+ id_denominator, id_divmod, id_eqeq_p, id_expt, id_fdiv, id_floor,
+ id_idiv, id_imag, id_inspect, id_negate, id_numerator, id_quo,
+ id_real, id_real_p, id_to_f, id_to_i, id_to_r, id_to_s,
+ id_i_real, id_i_imag;
+
+#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
+
+#define binop(n,op) \
+inline static VALUE \
+f_##n(VALUE x, VALUE y)\
+{\
+ return rb_funcall(x, (op), 1, y);\
+}
+
+#define fun1(n) \
+inline static VALUE \
+f_##n(VALUE x)\
+{\
+ return rb_funcall(x, id_##n, 0);\
+}
+
+#define fun2(n) \
+inline static VALUE \
+f_##n(VALUE x, VALUE y)\
+{\
+ return rb_funcall(x, id_##n, 1, y);\
+}
+
+#define math1(n) \
+inline static VALUE \
+m_##n(VALUE x)\
+{\
+ return rb_funcall(rb_mMath, id_##n, 1, x);\
+}
+
+#define math2(n) \
+inline static VALUE \
+m_##n(VALUE x, VALUE y)\
+{\
+ return rb_funcall(rb_mMath, id_##n, 2, x, y);\
+}
+
+#define PRESERVE_SIGNEDZERO
+
+inline static VALUE
+f_add(VALUE x, VALUE y)
+{
+#ifndef PRESERVE_SIGNEDZERO
+ if (FIXNUM_P(y) && FIX2LONG(y) == 0)
+ return x;
+ else if (FIXNUM_P(x) && FIX2LONG(x) == 0)
+ return y;
+#endif
+ return rb_funcall(x, '+', 1, y);
+}
+
+inline static VALUE
+f_cmp(VALUE x, VALUE y)
+{
+ if (FIXNUM_P(x) && FIXNUM_P(y)) {
+ long c = FIX2LONG(x) - FIX2LONG(y);
+ if (c > 0)
+ c = 1;
+ else if (c < 0)
+ c = -1;
+ return INT2FIX(c);
+ }
+ return rb_funcall(x, id_cmp, 1, y);
+}
+
+inline static VALUE
+f_div(VALUE x, VALUE y)
+{
+ if (FIXNUM_P(y) && FIX2LONG(y) == 1)
+ return x;
+ return rb_funcall(x, '/', 1, y);
+}
+
+inline static VALUE
+f_gt_p(VALUE x, VALUE y)
+{
+ if (FIXNUM_P(x) && FIXNUM_P(y))
+ return f_boolcast(FIX2LONG(x) > FIX2LONG(y));
+ return rb_funcall(x, '>', 1, y);
+}
+
+inline static VALUE
+f_lt_p(VALUE x, VALUE y)
+{
+ if (FIXNUM_P(x) && FIXNUM_P(y))
+ return f_boolcast(FIX2LONG(x) < FIX2LONG(y));
+ return rb_funcall(x, '<', 1, y);
+}
+
+binop(mod, '%')
+
+inline static VALUE
+f_mul(VALUE x, VALUE y)
+{
+#ifndef PRESERVE_SIGNEDZERO
+ if (FIXNUM_P(y)) {
+ long iy = FIX2LONG(y);
+ if (iy == 0) {
+ if (FIXNUM_P(x) || RB_TYPE_P(x, T_BIGNUM))
+ return ZERO;
+ }
+ else if (iy == 1)
+ return x;
+ }
+ else if (FIXNUM_P(x)) {
+ long ix = FIX2LONG(x);
+ if (ix == 0) {
+ if (FIXNUM_P(y) || RB_TYPE_P(y, T_BIGNUM))
+ return ZERO;
+ }
+ else if (ix == 1)
+ return y;
+ }
+#endif
+ return rb_funcall(x, '*', 1, y);
+}
+
+inline static VALUE
+f_sub(VALUE x, VALUE y)
+{
+#ifndef PRESERVE_SIGNEDZERO
+ if (FIXNUM_P(y) && FIX2LONG(y) == 0)
+ return x;
+#endif
+ return rb_funcall(x, '-', 1, y);
+}
+
+fun1(abs)
+fun1(abs2)
+fun1(arg)
+fun1(conj)
+fun1(denominator)
+fun1(floor)
+fun1(imag)
+fun1(inspect)
+fun1(negate)
+fun1(numerator)
+fun1(real)
+fun1(real_p)
+
+inline static VALUE
+f_to_i(VALUE x)
+{
+ if (RB_TYPE_P(x, T_STRING))
+ return rb_str_to_inum(x, 10, 0);
+ return rb_funcall(x, id_to_i, 0);
+}
+inline static VALUE
+f_to_f(VALUE x)
+{
+ if (RB_TYPE_P(x, T_STRING))
+ return DBL2NUM(rb_str_to_dbl(x, 0));
+ return rb_funcall(x, id_to_f, 0);
+}
+
+fun1(to_r)
+fun1(to_s)
+
+fun2(divmod)
+
+inline static VALUE
+f_eqeq_p(VALUE x, VALUE y)
+{
+ if (FIXNUM_P(x) && FIXNUM_P(y))
+ return f_boolcast(FIX2LONG(x) == FIX2LONG(y));
+ return rb_funcall(x, id_eqeq_p, 1, y);
+}
+
+fun2(expt)
+fun2(fdiv)
+fun2(idiv)
+fun2(quo)
+
+inline static VALUE
+f_negative_p(VALUE x)
+{
+ if (FIXNUM_P(x))
+ return f_boolcast(FIX2LONG(x) < 0);
+ return rb_funcall(x, '<', 1, ZERO);
+}
+
+#define f_positive_p(x) (!f_negative_p(x))
+
+inline static VALUE
+f_zero_p(VALUE x)
+{
+ switch (TYPE(x)) {
+ case T_FIXNUM:
+ return f_boolcast(FIX2LONG(x) == 0);
+ case T_BIGNUM:
+ return Qfalse;
+ case T_RATIONAL:
+ {
+ VALUE num = RRATIONAL(x)->num;
+
+ return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 0);
+ }
+ }
+ return rb_funcall(x, id_eqeq_p, 1, ZERO);
+}
+
+#define f_nonzero_p(x) (!f_zero_p(x))
+
+inline static VALUE
+f_one_p(VALUE x)
+{
+ switch (TYPE(x)) {
+ case T_FIXNUM:
+ return f_boolcast(FIX2LONG(x) == 1);
+ case T_BIGNUM:
+ return Qfalse;
+ case T_RATIONAL:
+ {
+ VALUE num = RRATIONAL(x)->num;
+ VALUE den = RRATIONAL(x)->den;
+
+ return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 1 &&
+ FIXNUM_P(den) && FIX2LONG(den) == 1);
+ }
+ }
+ return rb_funcall(x, id_eqeq_p, 1, ONE);
+}
+
+inline static VALUE
+f_kind_of_p(VALUE x, VALUE c)
+{
+ return rb_obj_is_kind_of(x, c);
+}
+
+inline static VALUE
+k_numeric_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cNumeric);
+}
+
+inline static VALUE
+k_integer_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cInteger);
+}
+
+inline static VALUE
+k_fixnum_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cFixnum);
+}
+
+inline static VALUE
+k_bignum_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cBignum);
+}
+
+inline static VALUE
+k_float_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cFloat);
+}
+
+inline static VALUE
+k_rational_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cRational);
+}
+
+inline static VALUE
+k_complex_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cComplex);
+}
+
+#define k_exact_p(x) (!k_float_p(x))
+#define k_inexact_p(x) k_float_p(x)
+
+#define k_exact_zero_p(x) (k_exact_p(x) && f_zero_p(x))
+#define k_exact_one_p(x) (k_exact_p(x) && f_one_p(x))
+
+#define get_dat1(x) \
+ struct RComplex *dat;\
+ dat = ((struct RComplex *)(x))
+
+#define get_dat2(x,y) \
+ struct RComplex *adat, *bdat;\
+ adat = ((struct RComplex *)(x));\
+ bdat = ((struct RComplex *)(y))
+
+inline static VALUE
+nucomp_s_new_internal(VALUE klass, VALUE real, VALUE imag)
+{
+ NEWOBJ_OF(obj, struct RComplex, klass, T_COMPLEX);
+
+ obj->real = real;
+ obj->imag = imag;
+
+ return (VALUE)obj;
+}
+
+static VALUE
+nucomp_s_alloc(VALUE klass)
+{
+ return nucomp_s_new_internal(klass, ZERO, ZERO);
+}
+
+#if 0
+static VALUE
+nucomp_s_new_bang(int argc, VALUE *argv, VALUE klass)
+{
+ VALUE real, imag;
+
+ switch (rb_scan_args(argc, argv, "11", &real, &imag)) {
+ case 1:
+ if (!k_numeric_p(real))
+ real = f_to_i(real);
+ imag = ZERO;
+ break;
+ default:
+ if (!k_numeric_p(real))
+ real = f_to_i(real);
+ if (!k_numeric_p(imag))
+ imag = f_to_i(imag);
+ break;
+ }
+
+ return nucomp_s_new_internal(klass, real, imag);
+}
+#endif
+
+inline static VALUE
+f_complex_new_bang1(VALUE klass, VALUE x)
+{
+ assert(!k_complex_p(x));
+ return nucomp_s_new_internal(klass, x, ZERO);
+}
+
+inline static VALUE
+f_complex_new_bang2(VALUE klass, VALUE x, VALUE y)
+{
+ assert(!k_complex_p(x));
+ assert(!k_complex_p(y));
+ return nucomp_s_new_internal(klass, x, y);
+}
+
+#ifdef CANONICALIZATION_FOR_MATHN
+#define CANON
+#endif
+
+#ifdef CANON
+static int canonicalization = 0;
+
+RUBY_FUNC_EXPORTED void
+nucomp_canonicalization(int f)
+{
+ canonicalization = f;
+}
+#endif
+
+inline static void
+nucomp_real_check(VALUE num)
+{
+ switch (TYPE(num)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ case T_FLOAT:
+ case T_RATIONAL:
+ break;
+ default:
+ if (!k_numeric_p(num) || !f_real_p(num))
+ rb_raise(rb_eTypeError, "not a real");
+ }
+}
+
+inline static VALUE
+nucomp_s_canonicalize_internal(VALUE klass, VALUE real, VALUE imag)
+{
+#ifdef CANON
+#define CL_CANON
+#ifdef CL_CANON
+ if (k_exact_zero_p(imag) && canonicalization)
+ return real;
+#else
+ if (f_zero_p(imag) && canonicalization)
+ return real;
+#endif
+#endif
+ if (f_real_p(real) && f_real_p(imag))
+ return nucomp_s_new_internal(klass, real, imag);
+ else if (f_real_p(real)) {
+ get_dat1(imag);
+
+ return nucomp_s_new_internal(klass,
+ f_sub(real, dat->imag),
+ f_add(ZERO, dat->real));
+ }
+ else if (f_real_p(imag)) {
+ get_dat1(real);
+
+ return nucomp_s_new_internal(klass,
+ dat->real,
+ f_add(dat->imag, imag));
+ }
+ else {
+ get_dat2(real, imag);
+
+ return nucomp_s_new_internal(klass,
+ f_sub(adat->real, bdat->imag),
+ f_add(adat->imag, bdat->real));
+ }
+}
+
+/*
+ * call-seq:
+ * Complex.rect(real[, imag]) -> complex
+ * Complex.rectangular(real[, imag]) -> complex
+ *
+ * Returns a complex object which denotes the given rectangular form.
+ *
+ * Complex.rectangular(1, 2) #=> (1+2i)
+ */
+static VALUE
+nucomp_s_new(int argc, VALUE *argv, VALUE klass)
+{
+ VALUE real, imag;
+
+ switch (rb_scan_args(argc, argv, "11", &real, &imag)) {
+ case 1:
+ nucomp_real_check(real);
+ imag = ZERO;
+ break;
+ default:
+ nucomp_real_check(real);
+ nucomp_real_check(imag);
+ break;
+ }
+
+ return nucomp_s_canonicalize_internal(klass, real, imag);
+}
+
+inline static VALUE
+f_complex_new1(VALUE klass, VALUE x)
+{
+ assert(!k_complex_p(x));
+ return nucomp_s_canonicalize_internal(klass, x, ZERO);
+}
+
+inline static VALUE
+f_complex_new2(VALUE klass, VALUE x, VALUE y)
+{
+ assert(!k_complex_p(x));
+ return nucomp_s_canonicalize_internal(klass, x, y);
+}
+
+/*
+ * call-seq:
+ * Complex(x[, y]) -> numeric
+ *
+ * Returns x+i*y;
+ *
+ * Complex(1, 2) #=> (1+2i)
+ * Complex('1+2i') #=> (1+2i)
+ */
+static VALUE
+nucomp_f_complex(int argc, VALUE *argv, VALUE klass)
+{
+ return rb_funcall2(rb_cComplex, id_convert, argc, argv);
+}
+
+#define imp1(n) \
+inline static VALUE \
+m_##n##_bang(VALUE x)\
+{\
+ return rb_math_##n(x);\
+}
+
+#define imp2(n) \
+inline static VALUE \
+m_##n##_bang(VALUE x, VALUE y)\
+{\
+ return rb_math_##n(x, y);\
+}
+
+imp2(atan2)
+imp1(cos)
+imp1(cosh)
+imp1(exp)
+imp2(hypot)
+
+#define m_hypot(x,y) m_hypot_bang((x),(y))
+
+static VALUE
+m_log_bang(VALUE x)
+{
+ return rb_math_log(1, &x);
+}
+
+imp1(sin)
+imp1(sinh)
+imp1(sqrt)
+
+static VALUE
+m_cos(VALUE x)
+{
+ if (f_real_p(x))
+ return m_cos_bang(x);
+ {
+ get_dat1(x);
+ return f_complex_new2(rb_cComplex,
+ f_mul(m_cos_bang(dat->real),
+ m_cosh_bang(dat->imag)),
+ f_mul(f_negate(m_sin_bang(dat->real)),
+ m_sinh_bang(dat->imag)));
+ }
+}
+
+static VALUE
+m_sin(VALUE x)
+{
+ if (f_real_p(x))
+ return m_sin_bang(x);
+ {
+ get_dat1(x);
+ return f_complex_new2(rb_cComplex,
+ f_mul(m_sin_bang(dat->real),
+ m_cosh_bang(dat->imag)),
+ f_mul(m_cos_bang(dat->real),
+ m_sinh_bang(dat->imag)));
+ }
+}
+
+#if 0
+static VALUE
+m_sqrt(VALUE x)
+{
+ if (f_real_p(x)) {
+ if (f_positive_p(x))
+ return m_sqrt_bang(x);
+ return f_complex_new2(rb_cComplex, ZERO, m_sqrt_bang(f_negate(x)));
+ }
+ else {
+ get_dat1(x);
+
+ if (f_negative_p(dat->imag))
+ return f_conj(m_sqrt(f_conj(x)));
+ else {
+ VALUE a = f_abs(x);
+ return f_complex_new2(rb_cComplex,
+ m_sqrt_bang(f_div(f_add(a, dat->real), TWO)),
+ m_sqrt_bang(f_div(f_sub(a, dat->real), TWO)));
+ }
+ }
+}
+#endif
+
+inline static VALUE
+f_complex_polar(VALUE klass, VALUE x, VALUE y)
+{
+ assert(!k_complex_p(x));
+ assert(!k_complex_p(y));
+ return nucomp_s_canonicalize_internal(klass,
+ f_mul(x, m_cos(y)),
+ f_mul(x, m_sin(y)));
+}
+
+/*
+ * call-seq:
+ * Complex.polar(abs[, arg]) -> complex
+ *
+ * Returns a complex object which denotes the given polar form.
+ *
+ * Complex.polar(3, 0) #=> (3.0+0.0i)
+ * Complex.polar(3, Math::PI/2) #=> (1.836909530733566e-16+3.0i)
+ * Complex.polar(3, Math::PI) #=> (-3.0+3.673819061467132e-16i)
+ * Complex.polar(3, -Math::PI/2) #=> (1.836909530733566e-16-3.0i)
+ */
+static VALUE
+nucomp_s_polar(int argc, VALUE *argv, VALUE klass)
+{
+ VALUE abs, arg;
+
+ switch (rb_scan_args(argc, argv, "11", &abs, &arg)) {
+ case 1:
+ nucomp_real_check(abs);
+ arg = ZERO;
+ break;
+ default:
+ nucomp_real_check(abs);
+ nucomp_real_check(arg);
+ break;
+ }
+ return f_complex_polar(klass, abs, arg);
+}
+
+/*
+ * call-seq:
+ * cmp.real -> real
+ *
+ * Returns the real part.
+ *
+ * Complex(7).real #=> 7
+ * Complex(9, -4).real #=> 9
+ */
+static VALUE
+nucomp_real(VALUE self)
+{
+ get_dat1(self);
+ return dat->real;
+}
+
+/*
+ * call-seq:
+ * cmp.imag -> real
+ * cmp.imaginary -> real
+ *
+ * Returns the imaginary part.
+ *
+ * Complex(7).imaginary #=> 0
+ * Complex(9, -4).imaginary #=> -4
+ */
+static VALUE
+nucomp_imag(VALUE self)
+{
+ get_dat1(self);
+ return dat->imag;
+}
+
+/*
+ * call-seq:
+ * -cmp -> complex
+ *
+ * Returns negation of the value.
+ *
+ * -Complex(1, 2) #=> (-1-2i)
+ */
+static VALUE
+nucomp_negate(VALUE self)
+{
+ get_dat1(self);
+ return f_complex_new2(CLASS_OF(self),
+ f_negate(dat->real), f_negate(dat->imag));
+}
+
+inline static VALUE
+f_addsub(VALUE self, VALUE other,
+ VALUE (*func)(VALUE, VALUE), ID id)
+{
+ if (k_complex_p(other)) {
+ VALUE real, imag;
+
+ get_dat2(self, other);
+
+ real = (*func)(adat->real, bdat->real);
+ imag = (*func)(adat->imag, bdat->imag);
+
+ return f_complex_new2(CLASS_OF(self), real, imag);
+ }
+ if (k_numeric_p(other) && f_real_p(other)) {
+ get_dat1(self);
+
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(dat->real, other), dat->imag);
+ }
+ return rb_num_coerce_bin(self, other, id);
+}
+
+/*
+ * call-seq:
+ * cmp + numeric -> complex
+ *
+ * Performs addition.
+ *
+ * Complex(2, 3) + Complex(2, 3) #=> (4+6i)
+ * Complex(900) + Complex(1) #=> (901+0i)
+ * Complex(-2, 9) + Complex(-9, 2) #=> (-11+11i)
+ * Complex(9, 8) + 4 #=> (13+8i)
+ * Complex(20, 9) + 9.8 #=> (29.8+9i)
+ */
+static VALUE
+nucomp_add(VALUE self, VALUE other)
+{
+ return f_addsub(self, other, f_add, '+');
+}
+
+/*
+ * call-seq:
+ * cmp - numeric -> complex
+ *
+ * Performs subtraction.
+ *
+ * Complex(2, 3) - Complex(2, 3) #=> (0+0i)
+ * Complex(900) - Complex(1) #=> (899+0i)
+ * Complex(-2, 9) - Complex(-9, 2) #=> (7+7i)
+ * Complex(9, 8) - 4 #=> (5+8i)
+ * Complex(20, 9) - 9.8 #=> (10.2+9i)
+ */
+static VALUE
+nucomp_sub(VALUE self, VALUE other)
+{
+ return f_addsub(self, other, f_sub, '-');
+}
+
+/*
+ * call-seq:
+ * cmp * numeric -> complex
+ *
+ * Performs multiplication.
+ *
+ * Complex(2, 3) * Complex(2, 3) #=> (-5+12i)
+ * Complex(900) * Complex(1) #=> (900+0i)
+ * Complex(-2, 9) * Complex(-9, 2) #=> (0-85i)
+ * Complex(9, 8) * 4 #=> (36+32i)
+ * Complex(20, 9) * 9.8 #=> (196.0+88.2i)
+ */
+static VALUE
+nucomp_mul(VALUE self, VALUE other)
+{
+ if (k_complex_p(other)) {
+ VALUE real, imag;
+
+ get_dat2(self, other);
+
+ real = f_sub(f_mul(adat->real, bdat->real),
+ f_mul(adat->imag, bdat->imag));
+ imag = f_add(f_mul(adat->real, bdat->imag),
+ f_mul(adat->imag, bdat->real));
+
+ return f_complex_new2(CLASS_OF(self), real, imag);
+ }
+ if (k_numeric_p(other) && f_real_p(other)) {
+ get_dat1(self);
+
+ return f_complex_new2(CLASS_OF(self),
+ f_mul(dat->real, other),
+ f_mul(dat->imag, other));
+ }
+ return rb_num_coerce_bin(self, other, '*');
+}
+
+inline static VALUE
+f_divide(VALUE self, VALUE other,
+ VALUE (*func)(VALUE, VALUE), ID id)
+{
+ if (k_complex_p(other)) {
+ int flo;
+ get_dat2(self, other);
+
+ flo = (k_float_p(adat->real) || k_float_p(adat->imag) ||
+ k_float_p(bdat->real) || k_float_p(bdat->imag));
+
+ if (f_gt_p(f_abs(bdat->real), f_abs(bdat->imag))) {
+ VALUE r, n;
+
+ r = (*func)(bdat->imag, bdat->real);
+ n = f_mul(bdat->real, f_add(ONE, f_mul(r, r)));
+ if (flo)
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(self, n),
+ (*func)(f_negate(f_mul(self, r)), n));
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(f_add(adat->real,
+ f_mul(adat->imag, r)), n),
+ (*func)(f_sub(adat->imag,
+ f_mul(adat->real, r)), n));
+ }
+ else {
+ VALUE r, n;
+
+ r = (*func)(bdat->real, bdat->imag);
+ n = f_mul(bdat->imag, f_add(ONE, f_mul(r, r)));
+ if (flo)
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(f_mul(self, r), n),
+ (*func)(f_negate(self), n));
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(f_add(f_mul(adat->real, r),
+ adat->imag), n),
+ (*func)(f_sub(f_mul(adat->imag, r),
+ adat->real), n));
+ }
+ }
+ if (k_numeric_p(other) && f_real_p(other)) {
+ get_dat1(self);
+
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(dat->real, other),
+ (*func)(dat->imag, other));
+ }
+ return rb_num_coerce_bin(self, other, id);
+}
+
+#define rb_raise_zerodiv() rb_raise(rb_eZeroDivError, "divided by 0")
+
+/*
+ * call-seq:
+ * cmp / numeric -> complex
+ * cmp.quo(numeric) -> complex
+ *
+ * Performs division.
+ *
+ * Complex(2, 3) / Complex(2, 3) #=> ((1/1)+(0/1)*i)
+ * Complex(900) / Complex(1) #=> ((900/1)+(0/1)*i)
+ * Complex(-2, 9) / Complex(-9, 2) #=> ((36/85)-(77/85)*i)
+ * Complex(9, 8) / 4 #=> ((9/4)+(2/1)*i)
+ * Complex(20, 9) / 9.8 #=> (2.0408163265306123+0.9183673469387754i)
+ */
+static VALUE
+nucomp_div(VALUE self, VALUE other)
+{
+ return f_divide(self, other, f_quo, id_quo);
+}
+
+#define nucomp_quo nucomp_div
+
+/*
+ * call-seq:
+ * cmp.fdiv(numeric) -> complex
+ *
+ * Performs division as each part is a float, never returns a float.
+ *
+ * Complex(11, 22).fdiv(3) #=> (3.6666666666666665+7.333333333333333i)
+ */
+static VALUE
+nucomp_fdiv(VALUE self, VALUE other)
+{
+ return f_divide(self, other, f_fdiv, id_fdiv);
+}
+
+inline static VALUE
+f_reciprocal(VALUE x)
+{
+ return f_quo(ONE, x);
+}
+
+/*
+ * call-seq:
+ * cmp ** numeric -> complex
+ *
+ * Performs exponentiation.
+ *
+ * Complex('i') ** 2 #=> (-1+0i)
+ * Complex(-8) ** Rational(1, 3) #=> (1.0000000000000002+1.7320508075688772i)
+ */
+static VALUE
+nucomp_expt(VALUE self, VALUE other)
+{
+ if (k_numeric_p(other) && k_exact_zero_p(other))
+ return f_complex_new_bang1(CLASS_OF(self), ONE);
+
+ if (k_rational_p(other) && f_one_p(f_denominator(other)))
+ other = f_numerator(other); /* c14n */
+
+ if (k_complex_p(other)) {
+ get_dat1(other);
+
+ if (k_exact_zero_p(dat->imag))
+ other = dat->real; /* c14n */
+ }
+
+ if (k_complex_p(other)) {
+ VALUE r, theta, nr, ntheta;
+
+ get_dat1(other);
+
+ r = f_abs(self);
+ theta = f_arg(self);
+
+ nr = m_exp_bang(f_sub(f_mul(dat->real, m_log_bang(r)),
+ f_mul(dat->imag, theta)));
+ ntheta = f_add(f_mul(theta, dat->real),
+ f_mul(dat->imag, m_log_bang(r)));
+ return f_complex_polar(CLASS_OF(self), nr, ntheta);
+ }
+ if (k_fixnum_p(other)) {
+ if (f_gt_p(other, ZERO)) {
+ VALUE x, z;
+ long n;
+
+ x = self;
+ z = x;
+ n = FIX2LONG(other) - 1;
+
+ while (n) {
+ long q, r;
+
+ while (1) {
+ get_dat1(x);
+
+ q = n / 2;
+ r = n % 2;
+
+ if (r)
+ break;
+
+ x = nucomp_s_new_internal(CLASS_OF(self),
+ f_sub(f_mul(dat->real, dat->real),
+ f_mul(dat->imag, dat->imag)),
+ f_mul(f_mul(TWO, dat->real), dat->imag));
+ n = q;
+ }
+ z = f_mul(z, x);
+ n--;
+ }
+ return z;
+ }
+ return f_expt(f_reciprocal(self), f_negate(other));
+ }
+ if (k_numeric_p(other) && f_real_p(other)) {
+ VALUE r, theta;
+
+ if (k_bignum_p(other))
+ rb_warn("in a**b, b may be too big");
+
+ r = f_abs(self);
+ theta = f_arg(self);
+
+ return f_complex_polar(CLASS_OF(self), f_expt(r, other),
+ f_mul(theta, other));
+ }
+ return rb_num_coerce_bin(self, other, id_expt);
+}
+
+/*
+ * call-seq:
+ * cmp == object -> true or false
+ *
+ * Returns true if cmp equals object numerically.
+ *
+ * Complex(2, 3) == Complex(2, 3) #=> true
+ * Complex(5) == 5 #=> true
+ * Complex(0) == 0.0 #=> true
+ * Complex('1/3') == 0.33 #=> false
+ * Complex('1/2') == '1/2' #=> false
+ */
+static VALUE
+nucomp_eqeq_p(VALUE self, VALUE other)
+{
+ if (k_complex_p(other)) {
+ get_dat2(self, other);
+
+ return f_boolcast(f_eqeq_p(adat->real, bdat->real) &&
+ f_eqeq_p(adat->imag, bdat->imag));
+ }
+ if (k_numeric_p(other) && f_real_p(other)) {
+ get_dat1(self);
+
+ return f_boolcast(f_eqeq_p(dat->real, other) && f_zero_p(dat->imag));
+ }
+ return f_eqeq_p(other, self);
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_coerce(VALUE self, VALUE other)
+{
+ if (k_numeric_p(other) && f_real_p(other))
+ return rb_assoc_new(f_complex_new_bang1(CLASS_OF(self), other), self);
+ if (RB_TYPE_P(other, T_COMPLEX))
+ return rb_assoc_new(other, self);
+
+ rb_raise(rb_eTypeError, "%s can't be coerced into %s",
+ rb_obj_classname(other), rb_obj_classname(self));
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * cmp.abs -> real
+ * cmp.magnitude -> real
+ *
+ * Returns the absolute part of its polar form.
+ *
+ * Complex(-1).abs #=> 1
+ * Complex(3.0, -4.0).abs #=> 5.0
+ */
+static VALUE
+nucomp_abs(VALUE self)
+{
+ get_dat1(self);
+
+ if (f_zero_p(dat->real)) {
+ VALUE a = f_abs(dat->imag);
+ if (k_float_p(dat->real) && !k_float_p(dat->imag))
+ a = f_to_f(a);
+ return a;
+ }
+ if (f_zero_p(dat->imag)) {
+ VALUE a = f_abs(dat->real);
+ if (!k_float_p(dat->real) && k_float_p(dat->imag))
+ a = f_to_f(a);
+ return a;
+ }
+ return m_hypot(dat->real, dat->imag);
+}
+
+/*
+ * call-seq:
+ * cmp.abs2 -> real
+ *
+ * Returns square of the absolute value.
+ *
+ * Complex(-1).abs2 #=> 1
+ * Complex(3.0, -4.0).abs2 #=> 25.0
+ */
+static VALUE
+nucomp_abs2(VALUE self)
+{
+ get_dat1(self);
+ return f_add(f_mul(dat->real, dat->real),
+ f_mul(dat->imag, dat->imag));
+}
+
+/*
+ * call-seq:
+ * cmp.arg -> float
+ * cmp.angle -> float
+ * cmp.phase -> float
+ *
+ * Returns the angle part of its polar form.
+ *
+ * Complex.polar(3, Math::PI/2).arg #=> 1.5707963267948966
+ */
+static VALUE
+nucomp_arg(VALUE self)
+{
+ get_dat1(self);
+ return m_atan2_bang(dat->imag, dat->real);
+}
+
+/*
+ * call-seq:
+ * cmp.rect -> array
+ * cmp.rectangular -> array
+ *
+ * Returns an array; [cmp.real, cmp.imag].
+ *
+ * Complex(1, 2).rectangular #=> [1, 2]
+ */
+static VALUE
+nucomp_rect(VALUE self)
+{
+ get_dat1(self);
+ return rb_assoc_new(dat->real, dat->imag);
+}
+
+/*
+ * call-seq:
+ * cmp.polar -> array
+ *
+ * Returns an array; [cmp.abs, cmp.arg].
+ *
+ * Complex(1, 2).polar #=> [2.23606797749979, 1.1071487177940904]
+ */
+static VALUE
+nucomp_polar(VALUE self)
+{
+ return rb_assoc_new(f_abs(self), f_arg(self));
+}
+
+/*
+ * call-seq:
+ * cmp.conj -> complex
+ * cmp.conjugate -> complex
+ *
+ * Returns the complex conjugate.
+ *
+ * Complex(1, 2).conjugate #=> (1-2i)
+ */
+static VALUE
+nucomp_conj(VALUE self)
+{
+ get_dat1(self);
+ return f_complex_new2(CLASS_OF(self), dat->real, f_negate(dat->imag));
+}
+
+#if 0
+/* :nodoc: */
+static VALUE
+nucomp_true(VALUE self)
+{
+ return Qtrue;
+}
+#endif
+
+/*
+ * call-seq:
+ * cmp.real? -> false
+ *
+ * Returns false.
+ */
+static VALUE
+nucomp_false(VALUE self)
+{
+ return Qfalse;
+}
+
+#if 0
+/* :nodoc: */
+static VALUE
+nucomp_exact_p(VALUE self)
+{
+ get_dat1(self);
+ return f_boolcast(k_exact_p(dat->real) && k_exact_p(dat->imag));
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_inexact_p(VALUE self)
+{
+ return f_boolcast(!nucomp_exact_p(self));
+}
+#endif
+
+/*
+ * call-seq:
+ * cmp.denominator -> integer
+ *
+ * Returns the denominator (lcm of both denominator - real and imag).
+ *
+ * See numerator.
+ */
+static VALUE
+nucomp_denominator(VALUE self)
+{
+ get_dat1(self);
+ return rb_lcm(f_denominator(dat->real), f_denominator(dat->imag));
+}
+
+/*
+ * call-seq:
+ * cmp.numerator -> numeric
+ *
+ * Returns the numerator.
+ *
+ * 1 2 3+4i <- numerator
+ * - + -i -> ----
+ * 2 3 6 <- denominator
+ *
+ * c = Complex('1/2+2/3i') #=> ((1/2)+(2/3)*i)
+ * n = c.numerator #=> (3+4i)
+ * d = c.denominator #=> 6
+ * n / d #=> ((1/2)+(2/3)*i)
+ * Complex(Rational(n.real, d), Rational(n.imag, d))
+ * #=> ((1/2)+(2/3)*i)
+ * See denominator.
+ */
+static VALUE
+nucomp_numerator(VALUE self)
+{
+ VALUE cd;
+
+ get_dat1(self);
+
+ cd = f_denominator(self);
+ return f_complex_new2(CLASS_OF(self),
+ f_mul(f_numerator(dat->real),
+ f_div(cd, f_denominator(dat->real))),
+ f_mul(f_numerator(dat->imag),
+ f_div(cd, f_denominator(dat->imag))));
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_hash(VALUE self)
+{
+ st_index_t v, h[2];
+ VALUE n;
+
+ get_dat1(self);
+ n = rb_hash(dat->real);
+ h[0] = NUM2LONG(n);
+ n = rb_hash(dat->imag);
+ h[1] = NUM2LONG(n);
+ v = rb_memhash(h, sizeof(h));
+ return LONG2FIX(v);
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_eql_p(VALUE self, VALUE other)
+{
+ if (k_complex_p(other)) {
+ get_dat2(self, other);
+
+ return f_boolcast((CLASS_OF(adat->real) == CLASS_OF(bdat->real)) &&
+ (CLASS_OF(adat->imag) == CLASS_OF(bdat->imag)) &&
+ f_eqeq_p(self, other));
+
+ }
+ return Qfalse;
+}
+
+inline static VALUE
+f_signbit(VALUE x)
+{
+#if defined(HAVE_SIGNBIT) && defined(__GNUC__) && defined(__sun) && \
+ !defined(signbit)
+ extern int signbit(double);
+#endif
+ switch (TYPE(x)) {
+ case T_FLOAT: {
+ double f = RFLOAT_VALUE(x);
+ return f_boolcast(!isnan(f) && signbit(f));
+ }
+ }
+ return f_negative_p(x);
+}
+
+inline static VALUE
+f_tpositive_p(VALUE x)
+{
+ return f_boolcast(!f_signbit(x));
+}
+
+static VALUE
+f_format(VALUE self, VALUE (*func)(VALUE))
+{
+ VALUE s, impos;
+
+ get_dat1(self);
+
+ impos = f_tpositive_p(dat->imag);
+
+ s = (*func)(dat->real);
+ rb_str_cat2(s, !impos ? "-" : "+");
+
+ rb_str_concat(s, (*func)(f_abs(dat->imag)));
+ if (!rb_isdigit(RSTRING_PTR(s)[RSTRING_LEN(s) - 1]))
+ rb_str_cat2(s, "*");
+ rb_str_cat2(s, "i");
+
+ return s;
+}
+
+/*
+ * call-seq:
+ * cmp.to_s -> string
+ *
+ * Returns the value as a string.
+ *
+ * Complex(2).to_s #=> "2+0i"
+ * Complex('-8/6').to_s #=> "-4/3+0i"
+ * Complex('1/2i').to_s #=> "0+1/2i"
+ * Complex(0, Float::INFINITY).to_s #=> "0+Infinity*i"
+ * Complex(Float::NAN, Float::NAN).to_s #=> "NaN+NaN*i"
+ */
+static VALUE
+nucomp_to_s(VALUE self)
+{
+ return f_format(self, f_to_s);
+}
+
+/*
+ * call-seq:
+ * cmp.inspect -> string
+ *
+ * Returns the value as a string for inspection.
+ *
+ * Complex(2).inspect #=> "(2+0i)"
+ * Complex('-8/6').inspect #=> "((-4/3)+0i)"
+ * Complex('1/2i').inspect #=> "(0+(1/2)*i)"
+ * Complex(0, Float::INFINITY).inspect #=> "(0+Infinity*i)"
+ * Complex(Float::NAN, Float::NAN).inspect #=> "(NaN+NaN*i)"
+ */
+static VALUE
+nucomp_inspect(VALUE self)
+{
+ VALUE s;
+
+ s = rb_usascii_str_new2("(");
+ rb_str_concat(s, f_format(self, f_inspect));
+ rb_str_cat2(s, ")");
+
+ return s;
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_dumper(VALUE self)
+{
+ return self;
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_loader(VALUE self, VALUE a)
+{
+ get_dat1(self);
+
+ dat->real = rb_ivar_get(a, id_i_real);
+ dat->imag = rb_ivar_get(a, id_i_imag);
+
+ return self;
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_marshal_dump(VALUE self)
+{
+ VALUE a;
+ get_dat1(self);
+
+ a = rb_assoc_new(dat->real, dat->imag);
+ return a;
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_marshal_load(VALUE self, VALUE a)
+{
+ Check_Type(a, T_ARRAY);
+ if (RARRAY_LEN(a) != 2)
+ rb_raise(rb_eArgError, "marshaled complex must have an array whose length is 2 but %ld", RARRAY_LEN(a));
+ rb_ivar_set(self, id_i_real, RARRAY_PTR(a)[0]);
+ rb_ivar_set(self, id_i_imag, RARRAY_PTR(a)[1]);
+ return self;
+}
+
+/* --- */
+
+VALUE
+rb_complex_raw(VALUE x, VALUE y)
+{
+ return nucomp_s_new_internal(rb_cComplex, x, y);
+}
+
+VALUE
+rb_complex_new(VALUE x, VALUE y)
+{
+ return nucomp_s_canonicalize_internal(rb_cComplex, x, y);
+}
+
+VALUE
+rb_complex_polar(VALUE x, VALUE y)
+{
+ return f_complex_polar(rb_cComplex, x, y);
+}
+
+static VALUE nucomp_s_convert(int argc, VALUE *argv, VALUE klass);
+
+VALUE
+rb_Complex(VALUE x, VALUE y)
+{
+ VALUE a[2];
+ a[0] = x;
+ a[1] = y;
+ return nucomp_s_convert(2, a, rb_cComplex);
+}
+
+/*
+ * call-seq:
+ * cmp.to_i -> integer
+ *
+ * Returns the value as an integer if possible (the imaginary part
+ * should be exactly zero).
+ *
+ * Complex(1, 0).to_i #=> 1
+ * Complex(1, 0.0).to_i # RangeError
+ * Complex(1, 2).to_i # RangeError
+ */
+static VALUE
+nucomp_to_i(VALUE self)
+{
+ get_dat1(self);
+
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ VALUE s = f_to_s(self);
+ rb_raise(rb_eRangeError, "can't convert %s into Integer",
+ StringValuePtr(s));
+ }
+ return f_to_i(dat->real);
+}
+
+/*
+ * call-seq:
+ * cmp.to_f -> float
+ *
+ * Returns the value as a float if possible (the imaginary part should
+ * be exactly zero).
+ *
+ * Complex(1, 0).to_f #=> 1.0
+ * Complex(1, 0.0).to_f # RangeError
+ * Complex(1, 2).to_f # RangeError
+ */
+static VALUE
+nucomp_to_f(VALUE self)
+{
+ get_dat1(self);
+
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ VALUE s = f_to_s(self);
+ rb_raise(rb_eRangeError, "can't convert %s into Float",
+ StringValuePtr(s));
+ }
+ return f_to_f(dat->real);
+}
+
+/*
+ * call-seq:
+ * cmp.to_r -> rational
+ *
+ * Returns the value as a rational if possible (the imaginary part
+ * should be exactly zero).
+ *
+ * Complex(1, 0).to_r #=> (1/1)
+ * Complex(1, 0.0).to_r # RangeError
+ * Complex(1, 2).to_r # RangeError
+ *
+ * See rationalize.
+ */
+static VALUE
+nucomp_to_r(VALUE self)
+{
+ get_dat1(self);
+
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ VALUE s = f_to_s(self);
+ rb_raise(rb_eRangeError, "can't convert %s into Rational",
+ StringValuePtr(s));
+ }
+ return f_to_r(dat->real);
+}
+
+/*
+ * call-seq:
+ * cmp.rationalize([eps]) -> rational
+ *
+ * Returns the value as a rational if possible (the imaginary part
+ * should be exactly zero).
+ *
+ * Complex(1.0/3, 0).rationalize #=> (1/3)
+ * Complex(1, 0.0).rationalize # RangeError
+ * Complex(1, 2).rationalize # RangeError
+ *
+ * See to_r.
+ */
+static VALUE
+nucomp_rationalize(int argc, VALUE *argv, VALUE self)
+{
+ get_dat1(self);
+
+ rb_scan_args(argc, argv, "01", NULL);
+
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ VALUE s = f_to_s(self);
+ rb_raise(rb_eRangeError, "can't convert %s into Rational",
+ StringValuePtr(s));
+ }
+ return rb_funcall2(dat->real, rb_intern("rationalize"), argc, argv);
+}
+
+/*
+ * call-seq:
+ * complex.to_c -> self
+ *
+ * Returns self.
+ *
+ * Complex(2).to_c #=> (2+0i)
+ * Complex(-8, 6).to_c #=> (-8+6i)
+ */
+static VALUE
+nucomp_to_c(VALUE self)
+{
+ return self;
+}
+
+/*
+ * call-seq:
+ * nil.to_c -> (0+0i)
+ *
+ * Returns zero as a complex.
+ */
+static VALUE
+nilclass_to_c(VALUE self)
+{
+ return rb_complex_new1(INT2FIX(0));
+}
+
+/*
+ * call-seq:
+ * num.to_c -> complex
+ *
+ * Returns the value as a complex.
+ */
+static VALUE
+numeric_to_c(VALUE self)
+{
+ return rb_complex_new1(self);
+}
+
+#include <ctype.h>
+
+inline static int
+issign(int c)
+{
+ return (c == '-' || c == '+');
+}
+
+static int
+read_sign(const char **s,
+ char **b)
+{
+ int sign = '?';
+
+ if (issign(**s)) {
+ sign = **b = **s;
+ (*s)++;
+ (*b)++;
+ }
+ return sign;
+}
+
+inline static int
+isdecimal(int c)
+{
+ return isdigit((unsigned char)c);
+}
+
+static int
+read_digits(const char **s, int strict,
+ char **b)
+{
+ int us = 1;
+
+ if (!isdecimal(**s))
+ return 0;
+
+ while (isdecimal(**s) || **s == '_') {
+ if (**s == '_') {
+ if (strict) {
+ if (us)
+ return 0;
+ }
+ us = 1;
+ }
+ else {
+ **b = **s;
+ (*b)++;
+ us = 0;
+ }
+ (*s)++;
+ }
+ if (us)
+ do {
+ (*s)--;
+ } while (**s == '_');
+ return 1;
+}
+
+inline static int
+islettere(int c)
+{
+ return (c == 'e' || c == 'E');
+}
+
+static int
+read_num(const char **s, int strict,
+ char **b)
+{
+ if (**s != '.') {
+ if (!read_digits(s, strict, b))
+ return 0;
+ }
+
+ if (**s == '.') {
+ **b = **s;
+ (*s)++;
+ (*b)++;
+ if (!read_digits(s, strict, b)) {
+ (*b)--;
+ return 0;
+ }
+ }
+
+ if (islettere(**s)) {
+ **b = **s;
+ (*s)++;
+ (*b)++;
+ read_sign(s, b);
+ if (!read_digits(s, strict, b)) {
+ (*b)--;
+ return 0;
+ }
+ }
+ return 1;
+}
+
+inline static int
+read_den(const char **s, int strict,
+ char **b)
+{
+ if (!read_digits(s, strict, b))
+ return 0;
+ return 1;
+}
+
+static int
+read_rat_nos(const char **s, int strict,
+ char **b)
+{
+ if (!read_num(s, strict, b))
+ return 0;
+ if (**s == '/') {
+ **b = **s;
+ (*s)++;
+ (*b)++;
+ if (!read_den(s, strict, b)) {
+ (*b)--;
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int
+read_rat(const char **s, int strict,
+ char **b)
+{
+ read_sign(s, b);
+ if (!read_rat_nos(s, strict, b))
+ return 0;
+ return 1;
+}
+
+inline static int
+isimagunit(int c)
+{
+ return (c == 'i' || c == 'I' ||
+ c == 'j' || c == 'J');
+}
+
+VALUE rb_cstr_to_rat(const char *, int);
+
+static VALUE
+str2num(char *s)
+{
+ if (strchr(s, '/'))
+ return rb_cstr_to_rat(s, 0);
+ if (strpbrk(s, ".eE"))
+ return DBL2NUM(rb_cstr_to_dbl(s, 0));
+ return rb_cstr_to_inum(s, 10, 0);
+}
+
+static int
+read_comp(const char **s, int strict,
+ VALUE *ret, char **b)
+{
+ char *bb;
+ int sign;
+ VALUE num, num2;
+
+ bb = *b;
+
+ sign = read_sign(s, b);
+
+ if (isimagunit(**s)) {
+ (*s)++;
+ num = INT2FIX((sign == '-') ? -1 : + 1);
+ *ret = rb_complex_new2(ZERO, num);
+ return 1; /* e.g. "i" */
+ }
+
+ if (!read_rat_nos(s, strict, b)) {
+ **b = '\0';
+ num = str2num(bb);
+ *ret = rb_complex_new2(num, ZERO);
+ return 0; /* e.g. "-" */
+ }
+ **b = '\0';
+ num = str2num(bb);
+
+ if (isimagunit(**s)) {
+ (*s)++;
+ *ret = rb_complex_new2(ZERO, num);
+ return 1; /* e.g. "3i" */
+ }
+
+ if (**s == '@') {
+ int st;
+
+ (*s)++;
+ bb = *b;
+ st = read_rat(s, strict, b);
+ **b = '\0';
+ if (strlen(bb) < 1 ||
+ !isdecimal(*(bb + strlen(bb) - 1))) {
+ *ret = rb_complex_new2(num, ZERO);
+ return 0; /* e.g. "1@-" */
+ }
+ num2 = str2num(bb);
+ *ret = rb_complex_polar(num, num2);
+ if (!st)
+ return 0; /* e.g. "1@2." */
+ else
+ return 1; /* e.g. "1@2" */
+ }
+
+ if (issign(**s)) {
+ bb = *b;
+ sign = read_sign(s, b);
+ if (isimagunit(**s))
+ num2 = INT2FIX((sign == '-') ? -1 : + 1);
+ else {
+ if (!read_rat_nos(s, strict, b)) {
+ *ret = rb_complex_new2(num, ZERO);
+ return 0; /* e.g. "1+xi" */
+ }
+ **b = '\0';
+ num2 = str2num(bb);
+ }
+ if (!isimagunit(**s)) {
+ *ret = rb_complex_new2(num, ZERO);
+ return 0; /* e.g. "1+3x" */
+ }
+ (*s)++;
+ *ret = rb_complex_new2(num, num2);
+ return 1; /* e.g. "1+2i" */
+ }
+ /* !(@, - or +) */
+ {
+ *ret = rb_complex_new2(num, ZERO);
+ return 1; /* e.g. "3" */
+ }
+}
+
+inline static void
+skip_ws(const char **s)
+{
+ while (isspace((unsigned char)**s))
+ (*s)++;
+}
+
+static int
+parse_comp(const char *s, int strict,
+ VALUE *num)
+{
+ char *buf, *b;
+
+ buf = ALLOCA_N(char, strlen(s) + 1);
+ b = buf;
+
+ skip_ws(&s);
+ if (!read_comp(&s, strict, num, &b))
+ return 0;
+ skip_ws(&s);
+
+ if (strict)
+ if (*s != '\0')
+ return 0;
+ return 1;
+}
+
+static VALUE
+string_to_c_strict(VALUE self)
+{
+ char *s;
+ VALUE num;
+
+ rb_must_asciicompat(self);
+
+ s = RSTRING_PTR(self);
+
+ if (!s || memchr(s, '\0', RSTRING_LEN(self)))
+ rb_raise(rb_eArgError, "string contains null byte");
+
+ if (s && s[RSTRING_LEN(self)]) {
+ rb_str_modify(self);
+ s = RSTRING_PTR(self);
+ s[RSTRING_LEN(self)] = '\0';
+ }
+
+ if (!s)
+ s = (char *)"";
+
+ if (!parse_comp(s, 1, &num)) {
+ VALUE ins = f_inspect(self);
+ rb_raise(rb_eArgError, "invalid value for convert(): %s",
+ StringValuePtr(ins));
+ }
+
+ return num;
+}
+
+/*
+ * call-seq:
+ * str.to_c -> complex
+ *
+ * Returns a complex which denotes the string form. The parser
+ * ignores leading whitespaces and trailing garbage. Any digit
+ * sequences can be separated by an underscore. Returns zero for null
+ * or garbage string.
+ *
+ * '9'.to_c #=> (9+0i)
+ * '2.5'.to_c #=> (2.5+0i)
+ * '2.5/1'.to_c #=> ((5/2)+0i)
+ * '-3/2'.to_c #=> ((-3/2)+0i)
+ * '-i'.to_c #=> (0-1i)
+ * '45i'.to_c #=> (0+45i)
+ * '3-4i'.to_c #=> (3-4i)
+ * '-4e2-4e-2i'.to_c #=> (-400.0-0.04i)
+ * '-0.0-0.0i'.to_c #=> (-0.0-0.0i)
+ * '1/2+3/4i'.to_c #=> ((1/2)+(3/4)*i)
+ * 'ruby'.to_c #=> (0+0i)
+ */
+static VALUE
+string_to_c(VALUE self)
+{
+ char *s;
+ VALUE num;
+
+ rb_must_asciicompat(self);
+
+ s = RSTRING_PTR(self);
+
+ if (s && s[RSTRING_LEN(self)]) {
+ rb_str_modify(self);
+ s = RSTRING_PTR(self);
+ s[RSTRING_LEN(self)] = '\0';
+ }
+
+ if (!s)
+ s = (char *)"";
+
+ (void)parse_comp(s, 0, &num);
+
+ return num;
+}
+
+static VALUE
+nucomp_s_convert(int argc, VALUE *argv, VALUE klass)
+{
+ VALUE a1, a2, backref;
+
+ rb_scan_args(argc, argv, "11", &a1, &a2);
+
+ if (NIL_P(a1) || (argc == 2 && NIL_P(a2)))
+ rb_raise(rb_eTypeError, "can't convert nil into Complex");
+
+ backref = rb_backref_get();
+ rb_match_busy(backref);
+
+ switch (TYPE(a1)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ case T_FLOAT:
+ break;
+ case T_STRING:
+ a1 = string_to_c_strict(a1);
+ break;
+ }
+
+ switch (TYPE(a2)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ case T_FLOAT:
+ break;
+ case T_STRING:
+ a2 = string_to_c_strict(a2);
+ break;
+ }
+
+ rb_backref_set(backref);
+
+ switch (TYPE(a1)) {
+ case T_COMPLEX:
+ {
+ get_dat1(a1);
+
+ if (k_exact_zero_p(dat->imag))
+ a1 = dat->real;
+ }
+ }
+
+ switch (TYPE(a2)) {
+ case T_COMPLEX:
+ {
+ get_dat1(a2);
+
+ if (k_exact_zero_p(dat->imag))
+ a2 = dat->real;
+ }
+ }
+
+ switch (TYPE(a1)) {
+ case T_COMPLEX:
+ if (argc == 1 || (k_exact_zero_p(a2)))
+ return a1;
+ }
+
+ if (argc == 1) {
+ if (k_numeric_p(a1) && !f_real_p(a1))
+ return a1;
+ /* should raise exception for consistency */
+ if (!k_numeric_p(a1))
+ return rb_convert_type(a1, T_COMPLEX, "Complex", "to_c");
+ }
+ else {
+ if ((k_numeric_p(a1) && k_numeric_p(a2)) &&
+ (!f_real_p(a1) || !f_real_p(a2)))
+ return f_add(a1,
+ f_mul(a2,
+ f_complex_new_bang2(rb_cComplex, ZERO, ONE)));
+ }
+
+ {
+ VALUE argv2[2];
+ argv2[0] = a1;
+ argv2[1] = a2;
+ return nucomp_s_new(argc, argv2, klass);
+ }
+}
+
+/* --- */
+
+/*
+ * call-seq:
+ * num.real -> self
+ *
+ * Returns self.
+ */
+static VALUE
+numeric_real(VALUE self)
+{
+ return self;
+}
+
+/*
+ * call-seq:
+ * num.imag -> 0
+ * num.imaginary -> 0
+ *
+ * Returns zero.
+ */
+static VALUE
+numeric_imag(VALUE self)
+{
+ return INT2FIX(0);
+}
+
+/*
+ * call-seq:
+ * num.abs2 -> real
+ *
+ * Returns square of self.
+ */
+static VALUE
+numeric_abs2(VALUE self)
+{
+ return f_mul(self, self);
+}
+
+#define id_PI rb_intern("PI")
+
+/*
+ * call-seq:
+ * num.arg -> 0 or float
+ * num.angle -> 0 or float
+ * num.phase -> 0 or float
+ *
+ * Returns 0 if the value is positive, pi otherwise.
+ */
+static VALUE
+numeric_arg(VALUE self)
+{
+ if (f_positive_p(self))
+ return INT2FIX(0);
+ return rb_const_get(rb_mMath, id_PI);
+}
+
+/*
+ * call-seq:
+ * num.rect -> array
+ *
+ * Returns an array; [num, 0].
+ */
+static VALUE
+numeric_rect(VALUE self)
+{
+ return rb_assoc_new(self, INT2FIX(0));
+}
+
+/*
+ * call-seq:
+ * num.polar -> array
+ *
+ * Returns an array; [num.abs, num.arg].
+ */
+static VALUE
+numeric_polar(VALUE self)
+{
+ return rb_assoc_new(f_abs(self), f_arg(self));
+}
+
+/*
+ * call-seq:
+ * num.conj -> self
+ * num.conjugate -> self
+ *
+ * Returns self.
+ */
+static VALUE
+numeric_conj(VALUE self)
+{
+ return self;
+}
+
+/*
+ * call-seq:
+ * flo.arg -> 0 or float
+ * flo.angle -> 0 or float
+ * flo.phase -> 0 or float
+ *
+ * Returns 0 if the value is positive, pi otherwise.
+ */
+static VALUE
+float_arg(VALUE self)
+{
+ if (isnan(RFLOAT_VALUE(self)))
+ return self;
+ if (f_tpositive_p(self))
+ return INT2FIX(0);
+ return rb_const_get(rb_mMath, id_PI);
+}
+
+/*
+ * A complex number can be represented as a paired real number with
+ * imaginary unit; a+bi. Where a is real part, b is imaginary part
+ * and i is imaginary unit. Real a equals complex a+0i
+ * mathematically.
+ *
+ * In ruby, you can create complex object with Complex, Complex::rect,
+ * Complex::polar or to_c method.
+ *
+ * Complex(1) #=> (1+0i)
+ * Complex(2, 3) #=> (2+3i)
+ * Complex.polar(2, 3) #=> (-1.9799849932008908+0.2822400161197344i)
+ * 3.to_c #=> (3+0i)
+ *
+ * You can also create complex object from floating-point numbers or
+ * strings.
+ *
+ * Complex(0.3) #=> (0.3+0i)
+ * Complex('0.3-0.5i') #=> (0.3-0.5i)
+ * Complex('2/3+3/4i') #=> ((2/3)+(3/4)*i)
+ * Complex('1@2') #=> (-0.4161468365471424+0.9092974268256817i)
+ *
+ * 0.3.to_c #=> (0.3+0i)
+ * '0.3-0.5i'.to_c #=> (0.3-0.5i)
+ * '2/3+3/4i'.to_c #=> ((2/3)+(3/4)*i)
+ * '1@2'.to_c #=> (-0.4161468365471424+0.9092974268256817i)
+ *
+ * A complex object is either an exact or an inexact number.
+ *
+ * Complex(1, 1) / 2 #=> ((1/2)+(1/2)*i)
+ * Complex(1, 1) / 2.0 #=> (0.5+0.5i)
+ */
+void
+Init_Complex(void)
+{
+ VALUE compat;
+#undef rb_intern
+#define rb_intern(str) rb_intern_const(str)
+
+ assert(fprintf(stderr, "assert() is now active\n"));
+
+ id_abs = rb_intern("abs");
+ id_abs2 = rb_intern("abs2");
+ id_arg = rb_intern("arg");
+ id_cmp = rb_intern("<=>");
+ id_conj = rb_intern("conj");
+ id_convert = rb_intern("convert");
+ id_denominator = rb_intern("denominator");
+ id_divmod = rb_intern("divmod");
+ id_eqeq_p = rb_intern("==");
+ id_expt = rb_intern("**");
+ id_fdiv = rb_intern("fdiv");
+ id_floor = rb_intern("floor");
+ id_idiv = rb_intern("div");
+ id_imag = rb_intern("imag");
+ id_inspect = rb_intern("inspect");
+ id_negate = rb_intern("-@");
+ id_numerator = rb_intern("numerator");
+ id_quo = rb_intern("quo");
+ id_real = rb_intern("real");
+ id_real_p = rb_intern("real?");
+ id_to_f = rb_intern("to_f");
+ id_to_i = rb_intern("to_i");
+ id_to_r = rb_intern("to_r");
+ id_to_s = rb_intern("to_s");
+ id_i_real = rb_intern("@real");
+ id_i_imag = rb_intern("@image"); /* @image, not @imag */
+
+ rb_cComplex = rb_define_class("Complex", rb_cNumeric);
+
+ rb_define_alloc_func(rb_cComplex, nucomp_s_alloc);
+ rb_undef_method(CLASS_OF(rb_cComplex), "allocate");
+
+#if 0
+ rb_define_private_method(CLASS_OF(rb_cComplex), "new!", nucomp_s_new_bang, -1);
+ rb_define_private_method(CLASS_OF(rb_cComplex), "new", nucomp_s_new, -1);
+#else
+ rb_undef_method(CLASS_OF(rb_cComplex), "new");
+#endif
+
+ rb_define_singleton_method(rb_cComplex, "rectangular", nucomp_s_new, -1);
+ rb_define_singleton_method(rb_cComplex, "rect", nucomp_s_new, -1);
+ rb_define_singleton_method(rb_cComplex, "polar", nucomp_s_polar, -1);
+
+ rb_define_global_function("Complex", nucomp_f_complex, -1);
+
+ rb_undef_method(rb_cComplex, "%");
+ rb_undef_method(rb_cComplex, "<");
+ rb_undef_method(rb_cComplex, "<=");
+ rb_undef_method(rb_cComplex, "<=>");
+ rb_undef_method(rb_cComplex, ">");
+ rb_undef_method(rb_cComplex, ">=");
+ rb_undef_method(rb_cComplex, "between?");
+ rb_undef_method(rb_cComplex, "div");
+ rb_undef_method(rb_cComplex, "divmod");
+ rb_undef_method(rb_cComplex, "floor");
+ rb_undef_method(rb_cComplex, "ceil");
+ rb_undef_method(rb_cComplex, "modulo");
+ rb_undef_method(rb_cComplex, "remainder");
+ rb_undef_method(rb_cComplex, "round");
+ rb_undef_method(rb_cComplex, "step");
+ rb_undef_method(rb_cComplex, "truncate");
+ rb_undef_method(rb_cComplex, "i");
+
+#if 0 /* NUBY */
+ rb_undef_method(rb_cComplex, "//");
+#endif
+
+ rb_define_method(rb_cComplex, "real", nucomp_real, 0);
+ rb_define_method(rb_cComplex, "imaginary", nucomp_imag, 0);
+ rb_define_method(rb_cComplex, "imag", nucomp_imag, 0);
+
+ rb_define_method(rb_cComplex, "-@", nucomp_negate, 0);
+ rb_define_method(rb_cComplex, "+", nucomp_add, 1);
+ rb_define_method(rb_cComplex, "-", nucomp_sub, 1);
+ rb_define_method(rb_cComplex, "*", nucomp_mul, 1);
+ rb_define_method(rb_cComplex, "/", nucomp_div, 1);
+ rb_define_method(rb_cComplex, "quo", nucomp_quo, 1);
+ rb_define_method(rb_cComplex, "fdiv", nucomp_fdiv, 1);
+ rb_define_method(rb_cComplex, "**", nucomp_expt, 1);
+
+ rb_define_method(rb_cComplex, "==", nucomp_eqeq_p, 1);
+ rb_define_method(rb_cComplex, "coerce", nucomp_coerce, 1);
+
+ rb_define_method(rb_cComplex, "abs", nucomp_abs, 0);
+ rb_define_method(rb_cComplex, "magnitude", nucomp_abs, 0);
+ rb_define_method(rb_cComplex, "abs2", nucomp_abs2, 0);
+ rb_define_method(rb_cComplex, "arg", nucomp_arg, 0);
+ rb_define_method(rb_cComplex, "angle", nucomp_arg, 0);
+ rb_define_method(rb_cComplex, "phase", nucomp_arg, 0);
+ rb_define_method(rb_cComplex, "rectangular", nucomp_rect, 0);
+ rb_define_method(rb_cComplex, "rect", nucomp_rect, 0);
+ rb_define_method(rb_cComplex, "polar", nucomp_polar, 0);
+ rb_define_method(rb_cComplex, "conjugate", nucomp_conj, 0);
+ rb_define_method(rb_cComplex, "conj", nucomp_conj, 0);
+#if 0
+ rb_define_method(rb_cComplex, "~", nucomp_conj, 0); /* gcc */
+#endif
+
+ rb_define_method(rb_cComplex, "real?", nucomp_false, 0);
+#if 0
+ rb_define_method(rb_cComplex, "complex?", nucomp_true, 0);
+ rb_define_method(rb_cComplex, "exact?", nucomp_exact_p, 0);
+ rb_define_method(rb_cComplex, "inexact?", nucomp_inexact_p, 0);
+#endif
+
+ rb_define_method(rb_cComplex, "numerator", nucomp_numerator, 0);
+ rb_define_method(rb_cComplex, "denominator", nucomp_denominator, 0);
+
+ rb_define_method(rb_cComplex, "hash", nucomp_hash, 0);
+ rb_define_method(rb_cComplex, "eql?", nucomp_eql_p, 1);
+
+ rb_define_method(rb_cComplex, "to_s", nucomp_to_s, 0);
+ rb_define_method(rb_cComplex, "inspect", nucomp_inspect, 0);
+
+ rb_define_private_method(rb_cComplex, "marshal_dump", nucomp_marshal_dump, 0);
+ compat = rb_define_class_under(rb_cComplex, "compatible", rb_cObject);
+ rb_define_private_method(compat, "marshal_load", nucomp_marshal_load, 1);
+ rb_marshal_define_compat(rb_cComplex, compat, nucomp_dumper, nucomp_loader);
+
+ /* --- */
+
+ rb_define_method(rb_cComplex, "to_i", nucomp_to_i, 0);
+ rb_define_method(rb_cComplex, "to_f", nucomp_to_f, 0);
+ rb_define_method(rb_cComplex, "to_r", nucomp_to_r, 0);
+ rb_define_method(rb_cComplex, "rationalize", nucomp_rationalize, -1);
+ rb_define_method(rb_cComplex, "to_c", nucomp_to_c, 0);
+ rb_define_method(rb_cNilClass, "to_c", nilclass_to_c, 0);
+ rb_define_method(rb_cNumeric, "to_c", numeric_to_c, 0);
+
+ rb_define_method(rb_cString, "to_c", string_to_c, 0);
+
+ rb_define_private_method(CLASS_OF(rb_cComplex), "convert", nucomp_s_convert, -1);
+
+ /* --- */
+
+ rb_define_method(rb_cNumeric, "real", numeric_real, 0);
+ rb_define_method(rb_cNumeric, "imaginary", numeric_imag, 0);
+ rb_define_method(rb_cNumeric, "imag", numeric_imag, 0);
+ rb_define_method(rb_cNumeric, "abs2", numeric_abs2, 0);
+ rb_define_method(rb_cNumeric, "arg", numeric_arg, 0);
+ rb_define_method(rb_cNumeric, "angle", numeric_arg, 0);
+ rb_define_method(rb_cNumeric, "phase", numeric_arg, 0);
+ rb_define_method(rb_cNumeric, "rectangular", numeric_rect, 0);
+ rb_define_method(rb_cNumeric, "rect", numeric_rect, 0);
+ rb_define_method(rb_cNumeric, "polar", numeric_polar, 0);
+ rb_define_method(rb_cNumeric, "conjugate", numeric_conj, 0);
+ rb_define_method(rb_cNumeric, "conj", numeric_conj, 0);
+
+ rb_define_method(rb_cFloat, "arg", float_arg, 0);
+ rb_define_method(rb_cFloat, "angle", float_arg, 0);
+ rb_define_method(rb_cFloat, "phase", float_arg, 0);
+
+ /*
+ * The imaginary unit.
+ */
+ rb_define_const(rb_cComplex, "I",
+ f_complex_new_bang2(rb_cComplex, ZERO, ONE));
+}
+
+/*
+Local variables:
+c-file-style: "ruby"
+End:
+*/
diff --git a/config.guess b/config.guess
deleted file mode 100644
index dd1688b7b5..0000000000
--- a/config.guess
+++ /dev/null
@@ -1,1459 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-timestamp='2004-06-11'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
- --version | -v )
- echo "$version" ; exit 0 ;;
- --help | --h* | -h )
- echo "$usage"; exit 0 ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit 0 ;;
- amd64:OpenBSD:*:*)
- echo x86_64-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- cats:OpenBSD:*:*)
- echo arm-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- luna88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- macppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvmeppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mipseb-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- *:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit 0 ;;
- macppc:MirBSD:*:*)
- echo powerppc-unknown-mirbsd${UNAME_RELEASE}
- exit 0 ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit 0 ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit 0 ;;
- Alpha*:OpenVMS:*:*)
- echo alpha-hp-vms
- exit 0 ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit 0 ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit 0 ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit 0;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit 0 ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit 0 ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit 0 ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit 0 ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit 0;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit 0 ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit 0 ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit 0 ;;
- DRS?6000:UNIX_SV:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7 && exit 0 ;;
- esac ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit 0 ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit 0 ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit 0 ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit 0 ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit 0 ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit 0 ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c \
- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && exit 0
- echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit 0 ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit 0 ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit 0 ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit 0 ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit 0 ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit 0 ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit 0 ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit 0 ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit 0 ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit 0 ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit 0 ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit 0 ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit 0 ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo rs6000-ibm-aix3.2.5
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit 0 ;;
- *:AIX:*:[45])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit 0 ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit 0 ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit 0 ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit 0 ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit 0 ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit 0 ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- # avoid double evaluation of $set_cc_for_build
- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit 0 ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo unknown-hitachi-hiuxwe2
- exit 0 ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit 0 ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit 0 ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit 0 ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit 0 ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit 0 ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit 0 ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit 0 ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit 0 ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit 0 ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit 0 ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit 0 ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- *:UNICOS/mp:*:*)
- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:FreeBSD:*:*)
- # Determine whether the default compiler uses glibc.
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #if __GLIBC__ >= 2
- LIBC=gnu
- #else
- LIBC=
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
- # FreeBSD's kernel, but not the complete OS.
- case ${LIBC} in gnu) kernel_only='k' ;; esac
- echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
- exit 0 ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit 0 ;;
- i*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit 0 ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit 0 ;;
- x86:Interix*:[34]*)
- echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
- exit 0 ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit 0 ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit 0 ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit 0 ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit 0 ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit 0 ;;
- arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- cris:Linux:*:*)
- echo cris-axis-linux-gnu
- exit 0 ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
- ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit 0 ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit 0 ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit 0 ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
- esac
- exit 0 ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit 0 ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit 0 ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
- exit 0 ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit 0 ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit 0 ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #ifdef __INTEL_COMPILER
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
- ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit 0 ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit 0 ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit 0 ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit 0 ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit 0 ;;
- i*86:*:5:[78]*)
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit 0 ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit 0 ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit 0 ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit 0 ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit 0 ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit 0 ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit 0 ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit 0 ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit 0 ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit 0 ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit 0 ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit 0 ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit 0 ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit 0 ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit 0 ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit 0 ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit 0 ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit 0 ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit 0 ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Darwin:*:*)
- case `uname -p` in
- *86) UNAME_PROCESSOR=i686 ;;
- powerpc) UNAME_PROCESSOR=powerpc ;;
- esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit 0 ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit 0 ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit 0 ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit 0 ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit 0 ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit 0 ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit 0 ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit 0 ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit 0 ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit 0 ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit 0 ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit 0 ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit 0 ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit 0 ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit 0 ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit 0 ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- c34*)
- echo c34-convex-bsd
- exit 0 ;;
- c38*)
- echo c38-convex-bsd
- exit 0 ;;
- c4*)
- echo c4-convex-bsd
- exit 0 ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- ftp://ftp.gnu.org/pub/gnu/config/
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/config.sub b/config.sub
deleted file mode 100644
index 506d3ab77f..0000000000
--- a/config.sub
+++ /dev/null
@@ -1,1537 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-timestamp='2004-06-11'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
- --version | -v )
- echo "$version" ; exit 0 ;;
- --help | --h* | -h )
- echo "$usage"; exit 0 ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit 0;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
- kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | m32r | m68000 | m68k | m88k | mcore \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64vr | mips64vrel \
- | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | msp430 \
- | ns16k | ns32k \
- | openrisc | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
- | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
- | we32k \
- | x86 | xscale | xstormy16 | xtensa \
- | z8k)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* \
- | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | m32r-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | mcore-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | msp430-* \
- | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
- | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tron-* \
- | v850-* | v850e-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
- | xtensa-* \
- | ymp-* \
- | z8k-*)
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- mmix*)
- basic_machine=mmix-knuth
- os=-mmixware
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- nv1)
- basic_machine=nv1-cray
- os=-unicosmp
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- or32 | or32-*)
- basic_machine=or32-unknown
- os=-coff
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparc | sparcv9 | sparcv9b)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=-linux
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -kaos*)
- os=-kaos
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-ibm)
- os=-aix
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/configure.in b/configure.in
index 47edc9bb9b..b87b325248 100644
--- a/configure.in
+++ b/configure.in
@@ -1,11 +1,36 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT()
-
-AC_PREREQ(2.58)
+{
+AC_CONFIG_AUX_DIR(tool)
+
+AC_PREREQ(2.60)
+
+AC_DEFUN([RUBY_PREREQ_AC],
+ [m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]), [$1]), [-1],
+ AC_MSG_ERROR([Autoconf version ]$1[ or higher is required]$2))])
+
+{ # environment section
+
+AC_ARG_WITH(baseruby,
+ AS_HELP_STRING([--with-baseruby=RUBY], [use RUBY as baseruby; RUBY is the pathname of ruby]),
+ [
+ AS_CASE(["$withval"],[*ruby*],[BASERUBY=$withval],[AC_MSG_ERROR(need ruby)])
+ ],
+ [
+ BASERUBY="ruby"
+ ])
+if test "`RUBYOPT=- $BASERUBY -e 'p 42' 2>/dev/null`" = 42; then
+ if test "`RUBYOPT=- $BASERUBY --disable=gems -e 'p 42' 2>/dev/null`" = 42; then
+ BASERUBY="$BASERUBY --disable=gems"
+ fi
+else
+ BASERUBY="echo executable host ruby is required. use --with-baseruby option.; false"
+fi
+AC_SUBST(BASERUBY)
AC_DEFUN([RUBY_MINGW32],
-[case "$host_os" in
-cygwin*)
+[AS_CASE(["$host_os"],
+[cygwin*], [
AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
[AC_TRY_CPP([
#ifndef __MINGW32__
@@ -13,16 +38,106 @@ AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
#endif
], rb_cv_mingw32=yes,rb_cv_mingw32=no)
rm -f conftest*])
-test "$rb_cv_mingw32" = yes && target_os="mingw32"
- ;;
-esac])
+if test "$rb_cv_mingw32" = yes; then
+ target_os="mingw32"
+ : ${ac_tool_prefix:="`expr "$CC" : ['\(.*-\)g\?cc[^/]*$']`"}
+fi
+])
+AS_CASE(["$target_os"], [mingw*msvc], [
+target_os="`echo ${target_os} | sed 's/msvc$//'`"
+])
+AS_CASE(["$target_cpu-$target_os"], [x86_64-mingw*], [
+target_cpu=x64
+])
+])
+
+AC_DEFUN([RUBY_NACL],
+[
+ AS_CASE(["${host_os}"],
+[nacl], [
+ ac_cv_exeext=.nexe
+ host_vendor=chromium
+ ac_cv_host=chromium
+ AC_MSG_CHECKING([wheather \$NACL_SDK_ROOT is set])
+ if test x"${NACL_SDK_ROOT}" = x; then
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([You need to set \$NACL_SDK_ROOT environment variable to build for NativeClient])
+ fi
+ AC_MSG_RESULT([yes])
+
+ nacl_cv_build_variant=glibc
+ AC_ARG_WITH(newlib,
+ AS_HELP_STRING([--with-newlib], [uses newlib version of NativeClient SDK]),
+ [AS_CASE([$withval],
+ [no], [nacl_cv_build_variant=glibc],
+ [yes], [nacl_cv_build_variant=newlib])])
+
+ AS_CASE(["$build_cpu"],
+ [x86_64|i?86], [nacl_cv_cpu_nick=x86], [nacl_cv_cpu_nick=$build_cpu])
+ AS_CASE(["$build_os"],
+ [linux*], [nacl_cv_os_nick=linux],
+ [darwin*], [nacl_cv_os_nick=mac],
+ [cygwin*|mingw*], [nacl_cv_os_nick=win],
+ [nacl_cv_os_nick=$build_os])
+
+ host="$host_cpu-chromium-$host_os-"
+ ac_tool_prefix="$host_cpu-nacl-"
+
+ AC_MSG_CHECKING([NativeClient toolchain])
+ if test -d \
+ "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"; then
+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"
+ else
+ AS_CASE(
+ ["${nacl_cv_build_variant}"],
+ [glibc], [if test \
+ -d "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_newlib" \
+ -a -d "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}"; then
+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}"
+ fi],
+ [newlib], [ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}" ])
+ fi
+ if test ! -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/${ac_tool_prefix}gcc"; then
+ if test "${build_cpu}" = i686 -a -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/nacl-gcc"; then
+ ac_tool_prefix=nacl-
+ fi
+ if test "${build_cpu}" = x86_64 -a -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/nacl-gcc"; then
+ ac_tool_prefix=nacl64-
+ fi
+ fi
+ if test -z "${NACL_TOOLCHAIN}"; then
+ AC_MSG_ERROR([Unrecognized --host and --build combination or NaCl SDK is not installed])
+ fi
+ AC_MSG_RESULT(${NACL_TOOLCHAIN})
+
+ AC_MSG_CHECKING([path to SDK])
+ if ! echo -- "${PATH}" | grep -F "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin" > /dev/null; then
+ PATH="${PATH}:${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin"
+ fi
+
+ AC_SUBST(NACL_TOOLCHAIN)
+ AC_SUBST(NACL_SDK_ROOT)
+ AC_SUBST(NACL_SDK_VARIANT, nacl_cv_build_variant)
+])])
+
+AC_DEFUN([RUBY_NACL_CHECK_PEPPER_TYPES],
+[AS_CASE(["${host_os}"],
+[nacl], [
+ AC_CHECK_TYPES([struct PPB_Core, struct PPB_Messaging, struct PPB_Var,
+ struct PPB_URLLoader, struct PPB_URLRequestInfo,
+ struct PPB_URLResponseInfo, struct PPB_FileRef,
+ struct PPP_Instance])
+])
+])
AC_DEFUN([RUBY_CPPOUTFILE],
[AC_CACHE_CHECK(whether ${CPP} accepts -o, rb_cv_cppoutfile,
-[cppflags=$CPPFLAGS
-CPPFLAGS='-o conftest.i'
-AC_TRY_CPP([], rb_cv_cppoutfile=yes, rb_cv_cppoutfile=no)
-CPPFLAGS=$cppflags
+[save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS='-o conftest-1.i'
+rb_cv_cppoutfile=no
+AC_TRY_CPP([test-for-cppout],
+ [grep test-for-cppout conftest-1.i > /dev/null && rb_cv_cppoutfile=yes])
+CPPFLAGS="$save_CPPFLAGS"
rm -f conftest*])
if test "$rb_cv_cppoutfile" = yes; then
CPPOUTFILE='-o conftest.i'
@@ -44,123 +159,248 @@ fi
GNU_LD=$rb_cv_prog_gnu_ld
AC_SUBST(GNU_LD)])
-rb_version=`grep RUBY_VERSION $srcdir/version.h`
-MAJOR=`expr "$rb_version" : '#define RUBY_VERSION "\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*"'`
-MINOR=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*"'`
-TEENY=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)"'`
+eval `sed -n 's/^#define RUBY_API_VERSION_\([A-Z][A-Z_0-9]*\) \([0-9][0-9]*\)/\1=\2/p' $srcdir/include/ruby/version.h`
+for v in MAJOR MINOR TEENY; do
+ if eval "test \"\$$v\" = ''"; then
+ AC_MSG_ERROR(could not determine $v number from version.h)
+ fi
+done
AC_SUBST(MAJOR)
AC_SUBST(MINOR)
AC_SUBST(TEENY)
+RUBY_PROGRAM_VERSION=`sed -n 's/^#define RUBY_VERSION "\(.*\)"/\1/p' $srcdir/version.h`
+AC_SUBST(RUBY_PROGRAM_VERSION)
+RUBY_RELEASE_DATE=`sed -n 's/^#define RUBY_RELEASE_DATE "\(.*\)"/\1/p' $srcdir/version.h`
+AC_SUBST(RUBY_RELEASE_DATE)
+AC_DEFINE(CANONICALIZATION_FOR_MATHN)
dnl checks for alternative programs
-AC_ARG_WITH(gcc, [ --without-gcc never use gcc], [
- case $withval in
- no) : ${CC=cc}
- ;;
- yes) : ${CC=gcc}
- ;;
- *) CC=$withval
- ;;
- esac])
+AC_CANONICAL_BUILD
+AC_ARG_WITH(gcc,
+ AS_HELP_STRING([--without-gcc], [never use gcc]),
+ [
+ AS_CASE([$withval],
+ [no], [: ${CC=cc}],
+ [yes], [: ${CC=gcc}],
+ [CC=$withval])])
dnl If the user switches compilers, we can't believe the cache
if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
then
AC_MSG_ERROR(cached CC is different -- throw away $cache_file
(it is also a good idea to do 'make clean' before compiling))
fi
+AS_CASE(["$build_os"],
+ [darwin11.*], [
+ AS_CASE(["x$CC"],
+ [xgcc-4.2|x/usr/bin/gcc-4.2], [: ${CXX=g++-4.2}],
+ [xgcc|x/usr/bin/gcc], [: ${CXX=g++}],
+ [xcc|x/usr/bin/cc], [: ${CXX=c++}],
+ [xclang|x/usr/bin/clang], [: ${CXX=clang++}])
+ ])
+test -z "$CC" || ac_cv_prog_CC="$CC"
if test "$program_prefix" = NONE; then
program_prefix=
fi
+RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"`
+RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"`
+AC_SUBST(RUBY_BASE_NAME)
+AC_SUBST(RUBYW_BASE_NAME)
+
AC_CANONICAL_TARGET
target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
ac_install_sh='' # unusable for extension libraries.
-dnl checks for fat-binary
-AC_ARG_ENABLE(fat-binary,
- [ --enable-fat-binary=ARCHS
- build an Apple/NeXT Multi Architecture Binary (MAB);
+AC_DEFUN([RUBY_APPEND_OPTION],
+ [# RUBY_APPEND_OPTION($1, $2)
+ AS_CASE([" [$]{$1-} "],
+ [*' $2 '*], [], [' '], [ $1="$2"], [ $1="[$]$1 $2"])])
+AC_DEFUN([RUBY_APPEND_OPTIONS],
+ [{ for rb_opt in $2; do # RUBY_APPEND_OPTIONS($1, $2)
+ AS_CASE([" [$]{$1-} "],
+ [*" [$]{rb_opt} "*], [], [' '], [ $1="[$]{rb_opt}"], [ $1="[$]$1 [$]{rb_opt}"])
+ done; }])
+AC_DEFUN([RUBY_PREPEND_OPTION],
+ [# RUBY_PREPEND_OPTION($1, $2)
+ AS_CASE([" [$]{$1-} "],
+ [*' $2 '*], [], [' '], [ $1="$2"], [ $1="$2 [$]$1"])])
+AC_DEFUN([RUBY_PREPEND_OPTIONS],
+ [{ unset rb_opts; for rb_opt in $2; do # RUBY_PREPEND_OPTIONS($1, $2)
+ AS_CASE([" [$]{rb_opts} [$]{$1-} "],
+ [*" [$]{rb_opt} "*], [], [' '], [ $1="[$]{rb_opt}"], [ rb_opts="[$]{rb_opts}[$]{rb_opt} "])
+ done
+ $1="[$]{rb_opts}[$]$1"; }])
+
+AC_ARG_WITH(arch,
+ AS_HELP_STRING([--with-arch=ARCHS],
+ [build an Apple/NeXT Multi Architecture Binary (MAB);
ARCHS is a comma-delimited list of architectures for
- which to build; if ARCHS is omitted, then the package
- will be built for all architectures supported by the
- platform ("ppc" for MacOS/X and Darwin; "ppc,i386"
- for Rhapsody; "m68k,i386,sparc" for OpenStep;
- "m68k,i386,sparc,hppa" for NextStep); if this option
- is disabled or omitted entirely, then the package
- will be built only for the target platform],
- [fat_binary=$enableval], [fat_binary=no])
-if test "$fat_binary" != no; then
+ which to build; if this option is disabled or omitted
+ entirely, then the package will be built only for the
+ target platform]),
+ [target_archs="$withval"], [unset target_archs])
+
+AC_DEFUN([RUBY_DEFAULT_ARCH], [
+AC_MSG_CHECKING([arch option])
+AS_CASE([$1],
+ [*64], [ARCH_FLAG=-m64],
+ [[i[3-6]86]], [ARCH_FLAG=-m32],
+ [AC_MSG_ERROR(unknown target architecture: $target_archs)]
+ )
+AC_MSG_RESULT([$ARCH_FLAG])
+])
+AC_DEFUN([RUBY_UNIVERSAL_ARCH], [
+# RUBY_UNIVERSAL_ARCH begin
+ARCH_FLAG=`expr " $CFLAGS " : ['.* \(-m[0-9][0-9]*\) ']`
+test ${CFLAGS+set} && CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g'`
+test ${LDFLAGS+set} && LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g'`
+unset universal_binary universal_archnames
+if test ${target_archs+set}; then
AC_MSG_CHECKING([target architectures])
-
- # Respect TARGET_ARCHS setting from environment if available.
- if test -z "$TARGET_ARCHS"; then
- # Respect ARCH given to --enable-fat-binary if present.
- if test "$fat_binary" != yes; then
- TARGET_ARCHS=`echo "$fat_binary" | tr ',' ' '`
- else
- # Choose a default set of architectures based upon platform.
- case "$target_os" in
- darwin*)
- TARGET_ARCHS="ppc"
- ;;
- rhapsody*)
- TARGET_ARCHS="ppc i386"
- ;;
- openstep*)
- TARGET_ARCHS="m68k i386 sparc"
- ;;
- nextstep*)
- TARGET_ARCHS="m68k i386 sparc hppa"
- ;;
- *)
- TARGET_ARCHS=`arch`
- esac
- fi
- fi
-
- AC_MSG_RESULT([$TARGET_ARCHS])
-
+ target_archs=`echo $target_archs | tr , ' '`
# /usr/lib/arch_tool -archify_list $TARGET_ARCHS
- ARCH_FLAG=
- for archs in $TARGET_ARCHS
+ for archs in $target_archs
do
- ARCH_FLAG="$ARCH_FLAG -arch $archs"
+ AS_CASE([",$universal_binary,"],[*",$archs,"*], [],[
+ cpu=`$SHELL "$ac_aux_dir/config.sub" "${archs}-${target_os}" 2>&1` || {
+ AC_MSG_RESULT([failed])
+ AC_MSG_ERROR([$cpu])
+ }
+ cpu=`echo $cpu | sed 's/-.*-.*//'`
+ universal_binary="${universal_binary+$universal_binary,}$cpu"
+ universal_archnames="${universal_archnames} ${archs}=${cpu}"
+ ARCH_FLAG="${ARCH_FLAG+$ARCH_FLAG }-arch $archs"
+ ])
done
- AC_DEFINE(NEXT_FAT_BINARY)
+ target_archs="$universal_binary"
+ unset universal_binary
+ AS_CASE(["$target_archs"],
+ [*,*], [universal_binary=yes],
+ [unset universal_archnames])
+ AC_MSG_RESULT([$target_archs])
+
+ target=`echo $target | sed "s/^$target_cpu-/-/"`
+ target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"`
+ if test "${universal_binary-no}" = yes; then
+ RUBY_PREREQ_AC(2.63, [ to compile universal binary])
+ AC_SUBST(try_header,try_compile)
+ target_cpu=universal
+ real_cross_compiling=$cross_compiling
+ else
+ if test x"$target_cpu" != x"${target_archs}"; then
+ echo 'int main(){return 0;}' > conftest.c
+ if $CC $CFLAGS $ARCH_FLAG -o conftest conftest.c > /dev/null 2>&1; then
+ rm -fr conftest.*
+ else
+ RUBY_DEFAULT_ARCH("$target_archs")
+ fi
+ fi
+ target_cpu=${target_archs}
+ fi
+ AS_CASE(["$target"], [-*], [ target="$target_cpu${target}"])
+ AS_CASE(["$target_alias"], [-*], [ target_alias="$target_cpu${target_alias}"])
+else
+ if test x"$target_alias" = x; then
+ AS_CASE(["$target_os"],
+ [darwin*], [
+ AC_MSG_CHECKING([for real target cpu])
+ target=`echo $target | sed "s/^$target_cpu-/-/"`
+ target_cpu=`$CC -E - 2>/dev/null <<EOF |
+#ifdef __x86_64__
+"processor-name=x86_64"
+#endif
+#ifdef __i386__
+"processor-name=i386"
+#endif
+#ifdef __ppc__
+"processor-name=powerpc"
+#endif
+#ifdef __ppc64__
+"processor-name=powerpc64"
+#endif
+EOF
+ sed -n 's/^"processor-name=\(.*\)"/\1/p'`
+ target="$target_cpu${target}"
+ AC_MSG_RESULT([$target_cpu])
+ ])
+ fi
+ target_archs="$target_cpu"
fi
-
-case $target_cpu in
- i?86) frame_address=yes;;
- *) frame_address=no;;
-esac
-AC_ARG_ENABLE(frame-address,
- [ --enable-frame-address use GCC __builtin_frame_address(). ],
- [frame_address=$enableval])
-if test $frame_address = yes; then
- AC_DEFINE(USE_BUILTIN_FRAME_ADDRESS)
+if test "${target_archs}" != "${rb_cv_target_archs-${target_archs}}"; then
+ AC_MSG_ERROR([target arch(s) has changed from ${rb_cv_target_archs-nothing} to ${target_archs}])
+else
+ rb_cv_target_archs=${target_archs}
+fi
+if test "x${ARCH_FLAG}" != x; then
+ CFLAGS="$CFLAGS ${ARCH_FLAG}"
+ LDFLAGS="${LDFLAGS+$LDFLAGS }${ARCH_FLAG}"
fi
+# RUBY_UNIVERSAL_ARCH end
+])
+
+AC_ARG_ENABLE(load-relative,
+ AS_HELP_STRING([--enable-load-relative], [resolve load paths at run time]),
+ [load_relative=$enableval])
AC_ARG_PROGRAM
dnl Checks for programs.
+cflagspat=
+test -z "$optflags" ||
+ cflagspat="$cflagspat;s|"`eval echo '"'"${optflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
+test -z "$debugflags" ||
+ cflagspat="$cflagspat;s|"`eval echo '"'"${debugflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
+test -z "warnflags" ||
+ cflagspat="$cflagspat;s|"`eval echo '"'"${warnflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
+if test -z "${CFLAGS+set}"; then
+ cflags=`echo " $cflags " | sed "$cflagspat;s/^ *//;s/ *$//"`
+ orig_cflags="$cflags"
+ cflags="$cflags "'${optflags} ${debugflags} ${warnflags}'
+fi
+if test -z "${CXXFLAGS+set}"; then
+ cxxflags=`echo " $cxxflags " | sed "$cflagspat;s/^ *//;s/ *$//"`
+ orig_cxxflags="$cxxflags"
+ cxxflags="$cxxflags "'${optflags} ${debugflags} ${warnflags}'
+fi
+
+RUBY_NACL
+AS_CASE(["$host_os:$build_os"],
+[darwin*:darwin*], [
+ AC_CHECK_TOOLS(CC, [gcc-4.2 clang gcc cc])
+])
if test x"${build}" != x"${host}"; then
AC_CHECK_TOOL(CC, gcc)
fi
+
AC_PROG_CC
+AC_PROG_CXX
+RUBY_MINGW32
AC_PROG_GCC_TRADITIONAL
+AC_SUBST(GCC)
+AS_CASE(["$target_os"],
+[solaris*], [AC_PATH_TOOL([LD], [ld], [/usr/ccs/bin/ld], [/usr/ccs/bin:$PATH])],
+[AC_CHECK_TOOL([LD], [ld], [ld])])
+AC_SUBST(LD)
+if test "$GCC" = yes; then
+ linker_flag=-Wl,
+ : ${optflags=-O3}
+ RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"])
+else
+ linker_flag=
+fi
RUBY_PROG_GNU_LD
RUBY_CPPOUTFILE
: ${OUTFLAG='-o '}
+: ${COUTFLAG=${OUTFLAG}}
AC_SUBST(OUTFLAG)
+AC_SUBST(COUTFLAG)
-RUBY_MINGW32
-
-AC_PROG_YACC
-if test "$YACC" = "yacc"; then
- AC_DEFINE([OLD_YACC])
+RUBY_UNIVERSAL_ARCH
+if test "$target_cpu" != "$host_cpu" -a "$GCC" = yes -a "$cross_compiling" = no -a "$universal_binary" = no; then
+ RUBY_DEFAULT_ARCH("$target_cpu")
fi
AC_CHECK_TOOL(RANLIB, ranlib, :)
@@ -173,81 +413,512 @@ AC_CHECK_TOOL(AS, as)
ASFLAGS=$ASFLAGS
AC_SUBST(ASFLAGS)
-case "$target_os" in
-cygwin*|mingw*)
- AC_CHECK_TOOL(NM, nm)
+AS_CASE(["$target_os"],[cygwin*|mingw*], [ac_cv_prog_ac_ct_OBJCOPY=":"])
+
+# BSD's ports and MacPorts prefix GNU binutils with 'g'
+AC_CHECK_TOOLS(OBJDUMP, [objdump gobjdump])
+AC_CHECK_TOOLS(OBJCOPY, [objcopy gobjcopy])
+
+AS_CASE(["$target_os"],
+[cygwin*|mingw*], [
AC_CHECK_TOOL(WINDRES, windres)
AC_CHECK_TOOL(DLLWRAP, dllwrap)
+ target=`echo $target | sed "s/^$target_cpu-/-/"`
+ target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"`
target_cpu=`echo $target_cpu | sed s/i.86/i386/`
- case "$target_os" in
- mingw*)
+ AS_CASE(["$target"], [-*], [ target="$target_cpu${target}"])
+ AS_CASE(["$target_alias"], [-*], [ target_alias="$target_cpu${target_alias}"])
+ AS_CASE(["$target_os"],
+ [mingw*], [
test "$rb_cv_msvcrt" = "" && unset rb_cv_msvcrt
- AC_CHECK_TOOL(OBJDUMP, objdump)
AC_CACHE_CHECK(for mingw32 runtime DLL, rb_cv_msvcrt, [
- AC_TRY_LINK([#include <stdio.h>],
+ AC_TRY_LINK([@%:@include <stdio.h>],
[FILE* volatile f = stdin; return 0;],
[rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext |
tr A-Z a-z |
sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
[rb_cv_msvcrt=msvcrt])
test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt])
- AC_ARG_WITH(winsock2,
- [ --with-winsock2 link winsock2 (MinGW only)], [
- case $withval in
- yes) with_winsock2=yes;;
- *) with_winsock2=no;;
- esac], [with_winsock2=no])
- if test "$with_winsock2" = yes; then
- AC_DEFINE(USE_WINSOCK2)
- fi
- esac
+ RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]`
+ test "$RT_VER" = "" && RT_VER=60
+ AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER)
+ ])
: ${enable_shared=yes}
- ;;
-aix*)
- AC_CHECK_TOOL(NM, nm, /usr/ccs/bin/nm, /usr/ccs/bin:$PATH)
- ;;
-hiuxmpp*)
- # by TOYODA Eizi <toyoda@npd.kishou.go.jp>
- AC_DEFINE(__HIUX_MPP__)
- ;;
-esac
+ ],
+[aix*], [AC_CHECK_TOOL(NM, nm, /usr/ccs/bin/nm, /usr/ccs/bin:$PATH)],
+[hiuxmpp*], [AC_DEFINE(__HIUX_MPP__)]) # by TOYODA Eizi <toyoda@npd.kishou.go.jp>
+AC_CHECK_TOOL(NM, nm)
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_INSTALL
+AC_PROG_MKDIR_P
+if test "x$MKDIR_P" = "x -d"; then
+ if test x"$as_mkdir_p" != xfalse; then
+ MKDIR_P='mkdir -p'
+ echo "use 'mkdir -p' as MKDIR_P"
+ else
+ AC_MSG_ERROR([mkdir -p is required])
+ fi
+fi
+MAKEDIRS="$MKDIR_P"
+AC_SUBST(MAKEDIRS)
+
+AC_DEFUN([RUBY_DTRACE_AVAILABLE],
+[AC_CACHE_CHECK(whether dtrace USDT is available, rb_cv_dtrace_available,
+[
+ echo "provider conftest{ probe fire(); };" > conftest_provider.d
+ if $DTRACE -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null; then
+ # DTrace is available on the system
+ rb_cv_dtrace_available=yes
+ else
+ # DTrace is not available while dtrace command exists
+ # for example FreeBSD 8 or FreeBSD 9 without DTrace build option
+ rb_cv_dtrace_available=no
+ fi
+ rm -f conftest.[co] conftest_provider.[dho]
+])
+])
+
+AC_DEFUN([RUBY_DTRACE_POSTPROCESS],
+[AC_CACHE_CHECK(whether $DTRACE needs post processing, rb_cv_prog_dtrace_g,
+[
+ echo "int main(void){ return 0; }" > conftest.c
+ echo "provider conftest{};" > conftest_provider.d
+ $CC $CFLAGS -c -o conftest.o conftest.c
+ if $DTRACE -G -s conftest_provider.d conftest.o 2>/dev/null; then
+ rb_cv_prog_dtrace_g=yes
+ else
+ rb_cv_prog_dtrace_g=no
+ fi
+ rm -f conftest.o conftest.c conftest_provider.d conftest_provider.o
+])
+])
+
+AC_CHECK_PROG([DTRACE], [${ac_tool_prefix}dtrace], [${ac_tool_prefix}dtrace])
+if test "$cross_compiling:$ac_cv_prog_DTRACE" = no: -a -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG([DTRACE], [dtrace], [dtrace])
+fi
+
+AC_CHECK_PROGS(DOT, dot)
+AC_CHECK_PROGS(DOXYGEN, doxygen)
+AS_CASE(["${host_os}"], [nacl], [AC_PATH_PROG(PYTHON, python)])
+
+AC_CHECK_PROG(PKG_CONFIG, pkg-config, [pkg-config], [], [],
+ [`"$as_dir/$ac_word$ac_exec_ext" --print-errors --version > /dev/null 2>&1 || echo "$as_dir/$ac_word$ac_exec_ext"`])
# checks for UNIX variants that set C preprocessor variables
-AC_AIX
-AC_MINIX
+AC_USE_SYSTEM_EXTENSIONS
AC_SUBST(RM, ['rm -f'])
AC_SUBST(CP, ['cp'])
-if $as_mkdir_p; then
- AC_SUBST(MAKEDIRS, ['mkdir -p'])
+RMDIRS='$(top_srcdir)/tool/rmdirs'
+RMDIR=rmdir
+mkdir "rmdirs_$$_test" "rmdirs_$$_test/a"
+rmdir --ignore-fail-on-non-empty "rmdirs_$$_test" 2>/dev/null &&
+RMDIR='rmdir --ignore-fail-on-non-empty'
+$RMDIR -p "rmdirs_$$_test/a" 2>/dev/null &&
+{ test -d "rmdirs_$$_test" || RMDIRS="$RMDIR -p"; }
+rmdir "rmdirs_$$_test/a" "rmdirs_$$_test" 2>/dev/null
+AC_SUBST(RMDIR)
+AC_SUBST(RMDIRS)
+AC_SUBST(RMALL, ['rm -fr'])
+
+AC_MSG_CHECKING([for cd using physical directory])
+rm -fr conf$$.dir
+mkdir conf$$.dir &&
+(cd conf$$.dir && mkdir src build && cd src &&
+$as_ln_s ../build . > /dev/null 2>&1 && cd build &&
+for chdir in 'cd -P' 'PWD= cd'; do
+ /bin/sh -c "$chdir ../src && echo '$chdir' > cdcmd" 2> /dev/null && break
+done)
+if test -f conf$$.dir/src/cdcmd; then
+ read CHDIR < conf$$.dir/src/cdcmd 2> /dev/null
else
- AC_SUBST(MAKEDIRS, ['install -d'])
+ CHDIR=cd
fi
+rm -fr conf$$.dir
+AC_MSG_RESULT([$CHDIR])
+AC_SUBST(CHDIR)
+
+}
+{ # compiler section
+
+AC_DEFUN([RUBY_WERROR_FLAG], [dnl
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $rb_cv_warnflags"
+if test "${ac_c_werror_flag+set}"; then
+ rb_c_werror_flag="$ac_c_werror_flag"
+else
+ unset rb_c_werror_flag
+fi
+ac_c_werror_flag=yes
+$1
+CFLAGS="$save_CFLAGS"
+save_CFLAGS=
+if test "${rb_c_werror_flag+set}"; then
+ ac_c_werror_flag="$rb_c_werror_flag"
+else
+ unset ac_c_werror_flag
+fi])
+
+AC_DEFUN(RUBY_TRY_CFLAGS, [
+ AC_MSG_CHECKING([whether ]$1[ is accepted as CFLAGS])
+ RUBY_WERROR_FLAG([
+ CFLAGS="[$]CFLAGS $1"
+ AC_TRY_COMPILE([$4], [$5],
+ [$2
+ AC_MSG_RESULT(yes)],
+ [$3
+ AC_MSG_RESULT(no)])
+ ])
+])
+
+AC_DEFUN(RUBY_TRY_LDFLAGS, [
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="[$]LDFLAGS $1"
+ AC_MSG_CHECKING([whether $1 is accepted as LDFLAGS])
+ RUBY_WERROR_FLAG([
+ AC_TRY_LINK([$4], [$5],
+ [$2
+ AC_MSG_RESULT(yes)],
+ [$3
+ AC_MSG_RESULT(no)])
+ ])
+ LDFLAGS="$save_LDFLAGS"
+ save_LDFLAGS=
+])
+
+rb_cv_warnflags="$warnflags"
+if test "$GCC:${warnflags+set}:no" = yes::no; then
+ particular_werror_flags=yes
+ for wflag in -Wno-unused-parameter -Wno-parentheses -Wno-long-long \
+ -Wno-missing-field-initializers \
+ -Wunused-variable \
+ -Werror=pointer-arith \
+ -Werror=write-strings \
+ -Werror=declaration-after-statement \
+ -Werror=shorten-64-to-32 \
+ -Werror-implicit-function-declaration \
+ ; do
+ if test "$particular_werror_flags" = yes; then
+ wflag=`echo x$wflag | sed 's/^x-Werror-/-Werror=/;s/^x//'`
+ else
+ wflag=`echo x$wflag | sed 's/^x-Werror=/-W/;s/^x//'`
+ fi
+ ok=no
+ RUBY_TRY_CFLAGS($wflag, [
+ RUBY_APPEND_OPTIONS(warnflags, $wflag)
+ ok=yes
+ ])
+ AS_CASE([$ok:$wflag], [no:-Werror=*], [
+ wflag=`echo x$wflag | sed 's/^x-Werror=/-W/'`
+ RUBY_TRY_CFLAGS($wflag, [
+ RUBY_APPEND_OPTIONS(warnflags, $wflag)
+ particular_werror_flags=no
+ ])
+ ])
+ done
+ AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag="-Wall -Wextra"],
+ [wflag=-Wall])
+ RUBY_TRY_CFLAGS($wflag, [warnflags="$wflag${warnflags+ $warnflags}"])
+ # Disable warnflags while conftest. -Werror=* flags might make bad OS capability guess.
+ rb_cv_warnflags="$warnflags"
+ warnflags=
+fi
+if test "$GCC" = yes; then
+ test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb3, [debugflags=-ggdb3])}
+ test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb, [debugflags=-ggdb])}
+ test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-g3, [debugflags=-g3])}
+
+ # -D_FORTIFY_SOURCE
+ RUBY_TRY_CFLAGS(-D_FORTIFY_SOURCE=2, [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)])
+
+ # -fstack-protector
+ AS_CASE(["$target_os"],
+ [mingw*|nacl|haiku], [
+ stack_protector=no
+ ],
+ [
+ RUBY_TRY_CFLAGS(-fstack-protector, [stack_protector=yes], [stack_protector=no])
+ if test "x$stack_protector" = xyes; then
+ RUBY_TRY_LDFLAGS(-fstack-protector, [], [stack_protector=broken])
+ fi
+ ])
+ if test "x$stack_protector" = xyes; then
+ RUBY_APPEND_OPTION(XCFLAGS, -fstack-protector)
+ RUBY_APPEND_OPTION(XLDFLAGS, -fstack-protector)
+ RUBY_APPEND_OPTION(LDFLAGS, -fstack-protector)
+ fi
+
+ AS_CASE(["$target_os"],[mingw*], [
+ # On Windows platforms, system provided headers are VC++
+ # optimized. That is, C++ habits are often contaminated into
+ # various headers. Most frequent situation is the use of //
+ # comments. We bypass ANSI C mode for them. Otherwise
+ # extension libs cannot include those headers.
+ ],
+ [cygwin*|darwin*|netbsd*], [
+ # need lgamma_r(), finite()
+ ],
+ [haiku], [
+ # Haiku R1/alpha3 uses gcc-4.4.4 which can not handle anonymous union
+ # with ANSI standard flags. Anonumous union is required to compile
+ # socket extension where <net/if.h> uses anonymous union.
+ ],
+ [
+ # ANSI (no XCFLAGS because this is C only)
+ RUBY_TRY_CFLAGS(-ansi -std=iso9899:199409, [
+ RUBY_APPEND_OPTION(warnflags, -ansi -std=iso9899:199409)
+ RUBY_APPEND_OPTION(strict_warnflags, -ansi -std=iso9899:199409)
+ ])
+ ])
+
+ # suppress annoying -Wstrict-overflow warnings
+ RUBY_TRY_CFLAGS(-fno-strict-overflow, [RUBY_APPEND_OPTION(XCFLAGS, -fno-strict-overflow)])
+fi
+test $ac_cv_prog_cc_g = yes && : ${debugflags=-g}
+
+if test "$GCC" = ""; then
+ AS_CASE(["$target_os"],[aix*],[warnflags="$warnflags -qinfo=por" rb_cv_warnflags="$rb_cv_warnflags -qinfo=por"])
+fi
+if test "$GCC" = yes; then
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+ @%:@if !(defined __GNUC__ && __GNUC__ >= 4)
+ @%:@error not GCC 4 or later
+ >>>not GCC 4 or later<<<
+ @%:@endif])],
+ [visibility_option=yes], [visibility_option=no])
+ if test "$visibility_option" = yes; then
+ RUBY_TRY_CFLAGS(-fvisibility=hidden, [visibility_option=yes], [visibility_option=no])
+ fi
+ AC_SUBST(WERRORFLAG, "-Werror")
+ if test "$visibility_option" = yes; then
+ RUBY_APPEND_OPTION(XCFLAGS, -fvisibility=hidden)
+ else
+ RUBY_TRY_LDFLAGS([-Wl,-unexported_symbol,_Init_*], [visibility_option=ld], [visibility_option=no])
+ fi
+ test "$visibility_option" = no -o "$host_os" = nacl || OBJCOPY=:
+fi
+
+if test "$GCC" = yes; then
+ # optflags
+
+ AS_CASE(["$target_os"], [mingw*], [
+ RUBY_TRY_CFLAGS(-fno-omit-frame-pointer, [optflags="${optflags+$optflags }-fno-omit-frame-pointer"])
+ ])
+
+ # disable fast-math
+ for oflag in -fno-fast-math; do
+ RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(optflags, $oflag)])
+ done
+fi
+
+test -z "${ac_env_CFLAGS_set}" -a -n "${cflags+set}" && eval CFLAGS="\"$cflags $ARCH_FLAG\""
+test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cxxflags $ARCH_FLAG\""
dnl check for large file stuff
+mv confdefs.h confdefs1.h
+: > confdefs.h
AC_SYS_LARGEFILE
+mv confdefs.h largefile.h
+mv confdefs1.h confdefs.h
+cat largefile.h >> confdefs.h
+
+AS_CASE(["$target_os"],[mingw*], [ac_cv_type_off_t=yes;ac_cv_sizeof_off_t=8])
+
+AC_C_BIGENDIAN
+AC_C_CONST
+AC_C_CHAR_UNSIGNED
+AC_C_INLINE
+AC_C_VOLATILE
+
+AS_CASE(":$ac_cv_c_const:$ac_cv_c_volatile:",
+ [*:no:*], [AC_MSG_ERROR(ANSI C-conforming const and volatile are mandatory)])
AC_CHECK_TYPES([long long, off_t])
-AC_CHECK_SIZEOF(int, 4)
-AC_CHECK_SIZEOF(short, 2)
-AC_CHECK_SIZEOF(long, 4)
-AC_CHECK_SIZEOF(long long, 0)
-AC_CHECK_SIZEOF(__int64, 0)
-AC_CHECK_SIZEOF(off_t, 0)
-AC_CHECK_SIZEOF(void*, 4)
-AC_CHECK_SIZEOF(float, 4)
-AC_CHECK_SIZEOF(double, 8)
-AC_CHECK_SIZEOF(time_t, 0)
-
-for id in pid_t gid_t uid_t; do
- AC_CHECK_TYPE($id, [typ=$id], [typ=int])
- AC_DEFINE_UNQUOTED(rb_$id, $typ)
-done
+AC_CACHE_CHECK([char bit], [rb_cv_char_bit],
+ [test "$universal_binary" = yes && cross_compiling=yes
+ AC_COMPUTE_INT([rb_cv_char_bit], [CHAR_BIT],
+ [AC_INCLUDES_DEFAULT([@%:@include <limits.h>])], [rb_cv_char_bit=8])
+ test "$universal_binary" = yes && cross_compiling=$real_cross_compiling])
+
+dnl RUBY_CHECK_SIZEOF [typename], [maybe same size types], [macros], [include]
+AC_DEFUN([RUBY_CHECK_SIZEOF],
+[m4_bmatch([$1], [\.], [], [if test "$universal_binary" = yes; then])
+AC_CACHE_CHECK([size of $1], [AS_TR_SH([ac_cv_sizeof_$1])], [
+ unset AS_TR_SH(ac_cv_sizeof_$1)
+ rbcv_var="
+typedef m4_bpatsubst([$1], [\..*]) ac__type_sizeof_;
+static ac__type_sizeof_ *rbcv_ptr;
+@%:@define AS_TR_CPP(SIZEOF_$1) sizeof((*rbcv_ptr)[]m4_bmatch([$1], [\.], .m4_bpatsubst([$1], [^[^.]*\.])))
+"
+ m4_ifval([$2], [test -z "${AS_TR_SH(ac_cv_sizeof_$1)+set}" && {
+ for t in $2; do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY(AC_INCLUDES_DEFAULT([$4]
+ [$rbcv_var]),
+ [AS_TR_CPP(SIZEOF_$1) == sizeof($t)])], [
+ AS_TR_SH(ac_cv_sizeof_$1)=AS_TR_CPP([SIZEOF_]$t)
+ break])
+ done
+ }])
+ unset cond
+ m4_ifval([$3], [test -z "${AS_TR_SH(ac_cv_sizeof_$1)+set}" && {
+ for s in 32 64 128; do
+ for t in $3; do
+ cond="${cond}
+@%:@${cond+el}if defined(__${t}${s}__) || defined(__${t}${s}) || defined(_${t}${s}) || defined(${t}${s})"
+ hdr="AC_INCLUDES_DEFAULT([$4
+@%:@if defined(__${t}${s}__) || defined(__${t}${s}) || defined(_${t}${s}) || defined(${t}${s})
+@%:@ define AS_TR_CPP(HAVE_$1) 1
+@%:@else
+@%:@ define AS_TR_CPP(HAVE_$1) 0
+@%:@endif])"
+ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$hdr], [!AS_TR_CPP(HAVE_$1)])], [continue])
+ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$hdr]
+ [$rbcv_var],
+ [AS_TR_CPP(HAVE_$1) == (AS_TR_CPP(SIZEOF_$1) == ([$[s / rb_cv_char_bit]]))])],
+ [AS_TR_SH(ac_cv_sizeof_$1)="${AS_TR_SH(ac_cv_sizeof_$1)+${AS_TR_SH(ac_cv_sizeof_$1)-} }${t}${s}"])
+ done
+ done
+ }])
+ m4_ifval([$2][$3],
+ [test "${AS_TR_SH(ac_cv_sizeof_$1)@%:@SIZEOF_}" = "${AS_TR_SH(ac_cv_sizeof_$1)}" && ]){
+ test "$universal_binary" = yes && cross_compiling=yes
+ AC_COMPUTE_INT([t], AS_TR_CPP(SIZEOF_$1), [AC_INCLUDES_DEFAULT([$4])]
+[${cond+$cond
+@%:@else}
+$rbcv_var
+${cond+@%:@endif}
+@%:@ifndef AS_TR_CPP(SIZEOF_$1)
+@%:@define AS_TR_CPP(SIZEOF_$1) 0
+@%:@endif], [t=0])
+ test "$universal_binary" = yes && cross_compiling=$real_cross_compiling
+ if test ${t-0} != 0; then
+ AS_TR_SH(ac_cv_sizeof_$1)="${AS_TR_SH(ac_cv_sizeof_$1)+${AS_TR_SH(ac_cv_sizeof_$1)-} }${t}"
+ fi
+ }
+ : ${AS_TR_SH(ac_cv_sizeof_$1)=0}
+])
+{
+ unset cond
+ for t in ${AS_TR_SH(ac_cv_sizeof_$1)-}; do
+ AS_CASE(["$t"],
+ [[[0-9]*|SIZEOF_*]], [
+ ${cond+echo "@%:@else"}
+ echo "[@%:@define ]AS_TR_CPP(SIZEOF_$1) [$t]"
+ break
+ ],
+ [
+ s=`expr $t : ['.*[^0-9]\([0-9][0-9]*\)$']`
+ echo "@%:@${cond+el}if defined(__${t}__) || defined(__${t}) || defined(_${t}) || defined($t)"
+ echo "@%:@define AS_TR_CPP(SIZEOF_$1) [$[s / rb_cv_char_bit]]"
+ cond=1
+ ])
+ done
+ ${cond+echo "@%:@endif"}
+} >> confdefs.h
+m4_bmatch([$1], [\.], [], [else
+AC_CHECK_SIZEOF([$1], 0, [$4])
+fi])
+])
+
+RUBY_CHECK_SIZEOF(int, [], [ILP])
+RUBY_CHECK_SIZEOF(short)
+RUBY_CHECK_SIZEOF(long, [int], [ILP LP])
+RUBY_CHECK_SIZEOF(long long)
+RUBY_CHECK_SIZEOF(__int64)
+RUBY_CHECK_SIZEOF(off_t)
+RUBY_CHECK_SIZEOF(void*, [int long "long long"], [ILP LP LLP])
+RUBY_CHECK_SIZEOF(float)
+RUBY_CHECK_SIZEOF(double)
+RUBY_CHECK_SIZEOF(time_t, [long "long long"], [], [@%:@include <time.h>])
+
+AC_DEFUN([RUBY_CHECK_PRINTF_PREFIX], [
+AC_CACHE_CHECK([for printf prefix for $1], [rb_cv_pri_prefix_]AS_TR_SH($1),[
+ [rb_cv_pri_prefix_]AS_TR_SH($1)=[NONE]
+ RUBY_WERROR_FLAG(for pri in $2; do
+ AC_TRY_COMPILE(
+ [@%:@include <stdio.h>
+ @%:@include <stddef.h>
+ @%:@ifdef __GNUC__
+ @%:@define PRINTF_ARGS(decl, string_index, first_to_check) \
+ decl __attribute__((format(printf, string_index, first_to_check)))
+ @%:@else
+ @%:@define PRINTF_ARGS(decl, string_index, first_to_check) decl
+ @%:@endif
+ PRINTF_ARGS(void test_sprintf(const char*, ...), 1, 2);],
+ [printf("%]${pri}[d", (]$1[)42);
+ test_sprintf("%]${pri}[d", (]$1[)42);],
+ [rb_cv_pri_prefix_]AS_TR_SH($1)[=[$pri]; break])
+ done)])
+if test "[$rb_cv_pri_prefix_]AS_TR_SH($1)" != NONE; then
+ AC_DEFINE_UNQUOTED([PRI_]m4_ifval($3,$3,AS_TR_CPP(m4_bpatsubst([$1],[_t$])))[_PREFIX],
+ "[$rb_cv_pri_prefix_]AS_TR_SH($1)")
+fi
+])
+
+if test "x$ac_cv_type_long_long" = xyes; then
+ RUBY_CHECK_PRINTF_PREFIX(long long, ll I64, LL)
+elif test "x$ac_cv_type___int64" = xyes; then
+ RUBY_CHECK_PRINTF_PREFIX(__int64, ll I64, LL)
+fi
+
+dnl RUBY_REPLACE_TYPE [typename] [default type] [macro type] [included]
+AC_DEFUN([RUBY_REPLACE_TYPE], [dnl
+ AC_CHECK_TYPE([$1],
+ [n="patsubst([$1],["],[\\"])"],
+ [n="patsubst([$2],["],[\\"])"],
+ [$4])
+ AC_CACHE_CHECK([for convertible type of [$1]], rb_cv_[$1]_convertible, [
+ u= t=
+ AS_CASE(["$n "],
+ [*" signed "*], [ ],
+ [*" unsigned "*], [
+ u=U],
+ [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([$4])], [($n)-1 > 0])],
+ [u=U])])
+ if test x"$t" = x; then
+ for t in "long long" long int short; do
+ test -n "$u" && t="unsigned $t"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([$4])]
+ [typedef $n rbcv_conftest_target_type;
+ typedef $t rbcv_conftest_replace_type;
+ extern rbcv_conftest_target_type rbcv_conftest_var;
+ extern rbcv_conftest_replace_type rbcv_conftest_var;
+ extern rbcv_conftest_target_type rbcv_conftest_func(void);
+ extern rbcv_conftest_replace_type rbcv_conftest_func(void);
+ ], [sizeof(rbcv_conftest_target_type) == sizeof(rbcv_conftest_replace_type)])],
+ [n="$t"; break])
+ done
+ fi
+ AS_CASE([" $n "],
+ [*" long long "*], [
+ t=LL],
+ [*" long "*], [
+ t=LONG],
+ [
+ t=INT])
+ rb_cv_[$1]_convertible=${u}${t}])
+ test "${AS_TR_SH(ac_cv_type_[$1])}" = "yes" && n="$1"
+ AC_DEFINE_UNQUOTED(rb_[$1], $n)
+ AC_DEFINE_UNQUOTED([$3]2NUM[(v)], [${rb_cv_[$1]_convertible}2NUM(v)])
+ AC_DEFINE_UNQUOTED(NUM2[$3][(v)], [NUM2${rb_cv_[$1]_convertible}(v)])
+ AC_DEFINE_UNQUOTED(PRI_[$3]_PREFIX,
+ [PRI_`echo ${rb_cv_[$1]_convertible} | sed ['s/^U//']`_PREFIX])
+])
+RUBY_REPLACE_TYPE(pid_t, int, PIDT)
+RUBY_REPLACE_TYPE(uid_t, int, UIDT)
+RUBY_REPLACE_TYPE(gid_t, int, GIDT)
+RUBY_REPLACE_TYPE(time_t, [], TIMET, [@%:@include <time.h>])
+RUBY_REPLACE_TYPE(dev_t, [int long "long long"], DEVT)
+RUBY_REPLACE_TYPE(mode_t, ["unsigned int" long], MODET, [@%:@include <sys/stat.h>])
+RUBY_REPLACE_TYPE(rlim_t, [int long "long long"], RLIM, [@%:@include <sys/resource.h>])
AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
[AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
@@ -258,16 +929,51 @@ if test "$rb_cv_have_prototypes" = yes; then
fi
AC_CACHE_CHECK(token paste string, rb_cv_tokenpaste,
- [AC_TRY_COMPILE([#define paste(a,b) a##b],
+ [AC_TRY_COMPILE([@%:@define paste(a,b) a@%:@@%:@b],
[int xy = 1; return paste(x,y);],
rb_cv_tokenpaste=ansi,
rb_cv_tokenpaste=knr)])
if test "$rb_cv_tokenpaste" = ansi; then
- AC_DEFINE(TOKEN_PASTE(x,y),[x##y])
+ AC_DEFINE(TOKEN_PASTE(x,y),[x@%:@@%:@y])
else
AC_DEFINE(TOKEN_PASTE(x,y),[x/**/y])
fi
+AC_CACHE_CHECK(stringization, rb_cv_stringization, [
+ rb_cv_stringization=no
+ for string in "#expr" '"expr"'; do
+ AC_COMPILE_IFELSE([
+ AC_LANG_BOOL_COMPILE_TRY([
+#define STRINGIZE0(expr) $string
+#define STRINGIZE(expr) STRINGIZE0(expr)
+#undef real_test_for_stringization
+#define test_for_stringization -.real_test_for_stringization.-
+const char stringized[[]] = STRINGIZE(test_for_stringization);
+], [sizeof(stringized) == 32])],
+ [rb_cv_stringization="$string"; break],
+ [rb_cv_stringization=no])
+ done]
+)
+AC_DEFINE(STRINGIZE(expr),STRINGIZE0(expr))
+if test x"$rb_cv_stringization" != xno -a "$rb_cv_stringization" != "#expr"; then
+ AC_DEFINE_UNQUOTED(STRINGIZE0(expr),$rb_cv_stringization)
+ AC_DEFINE(OLD_FASHIONED_STRINGIZATION,1)
+fi
+
+AC_CACHE_CHECK([string literal concatenation],
+ rb_cv_string_literal_concatenation, [
+ AC_COMPILE_IFELSE([
+ AC_LANG_BOOL_COMPILE_TRY([
+const char concatenated_literal[[]] = "literals" "to"
+ "be" "concatenated.";
+], [sizeof(concatenated_literal) == 26])],
+ [rb_cv_string_literal_concatenation=yes],
+ [rb_cv_string_literal_concatenation=no])]
+)
+if test "$rb_cv_string_literal_concatenation" = no; then
+ AC_DEFINE(NO_STRING_LITERAL_CONCATENATION,1)
+fi
+
AC_CACHE_CHECK(for variable length prototypes and stdarg.h, rb_cv_stdarg,
[AC_TRY_COMPILE([
#include <stdarg.h>
@@ -286,67 +992,254 @@ if test "$rb_cv_stdarg" = yes; then
AC_DEFINE(HAVE_STDARG_PROTOTYPES)
fi
-AC_CACHE_CHECK([for noreturn], rb_cv_noreturn,
-[rb_cv_noreturn=x
-for mac in "x __attribute__ ((noreturn))" "__declspec(noreturn) x" x; do
- AC_TRY_COMPILE(
- [#define NORETURN(x) $mac
-NORETURN(void exit(int x));],
- [],
- [rb_cv_noreturn="$mac"; break])
-done])
-AC_DEFINE_UNQUOTED([NORETURN(x)], $rb_cv_noreturn)
+AC_CACHE_CHECK(for variable length macro, rb_cv_va_args_macro,
+ [AC_TRY_COMPILE([
+int foo(int x, ...);
+@%:@define FOO(a, ...) foo(a, @%:@@%:@__VA_ARGS__)
+], [FOO(1);FOO(1,2);FOO(1,2,3);],
+ rb_cv_va_args_macro=yes,
+ rb_cv_va_args_macro=no)])
+if test "$rb_cv_va_args_macro" = yes; then
+ AC_DEFINE(HAVE_VA_ARGS_MACRO)
+fi
-AC_CACHE_CHECK([for RUBY_EXTERN], rb_cv_ruby_extern,
-[rb_cv_ruby_extern=no
-for mac in "__attribute__((dllimport))" "__declspec(dllimport)"; do
+AC_DEFUN([RUBY_DEFINE_IF], [dnl
+ m4_ifval([$1], [AS_LITERAL_IF([$1], [], [test "X$1" = X || ])cat <<EOH >> confdefs.h
+@%:@if $1
+EOH
+])dnl
+AC_DEFINE_UNQUOTED($2, $3)dnl
+ m4_ifval([$1], [AS_LITERAL_IF([$1], [], [test "X$1" = X || ])cat <<EOH >> confdefs.h
+@%:@endif /* $1 */
+EOH
+])dnl
+])dnl
+
+dnl RUBY_FUNC_ATTRIBUTE(attrib, macroname, cachevar, condition)
+AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl
+m4_ifval([$2], dnl
+ [AS_VAR_PUSHDEF([attrib],[$2])], dnl
+ [AS_VAR_PUSHDEF([attrib],[FUNC_]AS_TR_CPP($1))] dnl
+)dnl
+m4_ifval([$3], dnl
+ [AS_VAR_PUSHDEF([rbcv],[$3])], dnl
+ [AS_VAR_PUSHDEF([rbcv],[rb_cv_func_][$1])]dnl
+)dnl
+m4_ifval([$4], [rbcv_cond=["$4"]; test "$rbcv_cond" || unset rbcv_cond])
+AC_CACHE_CHECK(for [$1] function attribute, rbcv,
+[rbcv=x
+RUBY_WERROR_FLAG([
+for mac in "__attribute__ (($1)) x" "x __attribute__ (($1))" "__declspec($1) x" x; do
+ m4_ifval([$4],mac="$mac"${rbcv_cond+" /* only if $rbcv_cond */"})
AC_TRY_COMPILE(
- [extern $mac void conftest(void);],
- [rb_cv_ruby_extern="extern $mac"; break])
-done])
-test "x$rb_cv_ruby_extern" = xno || AC_DEFINE_UNQUOTED(RUBY_EXTERN, $rb_cv_ruby_extern)
+ m4_ifval([$4],${rbcv_cond+[@%:@if ]$rbcv_cond})
+[@%:@define ]attrib[(x) $mac]
+m4_ifval([$4],${rbcv_cond+[@%:@else]}
+${rbcv_cond+[@%:@define ]attrib[(x) x]}
+${rbcv_cond+[@%:@endif]})
+ attrib[(void conftest_attribute_check(void));], [],
+ [rbcv="$mac"; break])
+done
+])])
+if test "$rbcv" != x; then
+ RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[(x)], $rbcv)
+fi
+m4_ifval([$4], [unset rbcv_cond])dnl
+AS_VAR_POPDEF([attrib])dnl
+AS_VAR_POPDEF([rbcv])dnl
+])
+
+RUBY_FUNC_ATTRIBUTE(noreturn, NORETURN)
+RUBY_FUNC_ATTRIBUTE(deprecated, DEPRECATED)
+RUBY_FUNC_ATTRIBUTE(noinline, NOINLINE)
+
+if_i386=${universal_binary+[defined __i386__]}
+RUBY_FUNC_ATTRIBUTE(stdcall, [], [], ${if_i386})
+RUBY_FUNC_ATTRIBUTE(cdecl, [], [], ${if_i386})
+RUBY_FUNC_ATTRIBUTE(fastcall, [], [], ${if_i386})
+
+if test "$GCC" = yes; then
+ AC_CACHE_CHECK([for function alias], [rb_cv_gcc_function_alias],
+ [rb_cv_gcc_function_alias=no
+ for a in alias weak,alias; do
+ AC_TRY_LINK([void foo(void) {}
+ void bar(void) __attribute__(($a("foo")));], [bar()],
+ [rb_cv_gcc_function_alias=$a; break])
+ done])
+ if test "$rb_cv_gcc_function_alias" != no; then
+ AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args)],
+ [type prot __attribute__(($rb_cv_gcc_function_alias(@%:@name)));])
+ AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_VOID(prot, name, args)],
+ [RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)])
+ fi
+ AC_CACHE_CHECK([for atomic builtins], [rb_cv_gcc_atomic_builtins], [
+ AC_TRY_LINK([unsigned char atomic_var;],
+ [
+ __sync_lock_test_and_set(&atomic_var, 0);
+ __sync_lock_test_and_set(&atomic_var, 1);
+ __sync_fetch_and_add(&atomic_var, 1);
+ __sync_fetch_and_sub(&atomic_var, 1);
+ ],
+ [rb_cv_gcc_atomic_builtins=yes],
+ [rb_cv_gcc_atomic_builtins=no])])
+ if test "$rb_cv_gcc_atomic_builtins" = yes; then
+ AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS)
+ fi
-XCFLAGS="$XCFLAGS -DRUBY_EXPORT"
+ AC_CACHE_CHECK(for __builtin_unreachable, rb_cv_func___builtin_unreachable,
+ [RUBY_WERROR_FLAG(
+ [AC_TRY_LINK([@%:@include <stdlib.h>],
+ [exit(0); __builtin_unreachable();],
+ [rb_cv_func___builtin_unreachable=yes],
+ [rb_cv_func___builtin_unreachable=no])
+ ])
+ ])
+ if test "$rb_cv_func___builtin_unreachable" = yes; then
+ AC_DEFINE_UNQUOTED(UNREACHABLE, [__builtin_unreachable()])
+ fi
+fi
+
+AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [
+rb_cv_func_exported=no
+RUBY_WERROR_FLAG([
+for mac in '__attribute__ ((visibility("default")))' '__declspec(dllexport)'; do
+ AC_TRY_COMPILE([@%:@define RUBY_FUNC_EXPORTED $mac extern
+ RUBY_FUNC_EXPORTED void conftest_attribute_check(void);], [],
+ [rb_cv_func_exported="$mac"; break])
+done
+])])
+if test "$rb_cv_func_exported" != no; then
+ AC_DEFINE_UNQUOTED(RUBY_FUNC_EXPORTED, [$rb_cv_func_exported extern])
+fi
+
+RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_EXPORT)
+
+}
+{ # header and library section
dnl Check whether we need to define sys_nerr locally
AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
-#include <errno.h>])
+@%:@include <errno.h>])
+
+AC_ARG_WITH(winnt-ver,
+ AS_HELP_STRING([--with-winnt-ver=0xXXXX], [target Windows NT version (default to 0x0501)]),
+ [with_winnt_ver="$withval"], [with_winnt_ver="0x0501"])
+AS_CASE(["$target_os"],
+[mingw*], [
+ RUBY_APPEND_OPTION(CPPFLAGS, -D_WIN32_WINNT=$with_winnt_ver)
+])
-dnl whether link libc_r or not
-AC_ARG_WITH(libc_r,
- [ --with-libc_r link libc_r if possible (FreeBSD only)], [
- case $withval in
- yes) with_libc_r=yes;;
- *) with_libc_r=no;;
- esac], [with_libc_r=no])
+AS_CASE(["$target_os"],
+[freebsd*], [
+ AC_CACHE_CHECK([whether pthread should be enabled by default],
+ rb_cv_enable_pthread_default,
+ [AC_TRY_CPP([
+#include <osreldate.h>
+#if __FreeBSD_version < 502102
+#error pthread should be disabled on this platform
+#endif
+ ],
+ rb_cv_enable_pthread_default=yes,
+ rb_cv_enable_pthread_default=no)])
+ enable_pthread=$rb_cv_enable_pthread_default
+ ],
+[mingw*], [
+ enable_pthread=no
+ ],
+[
+ enable_pthread=yes
+ ])
AC_ARG_ENABLE(pthread,
- [ --enable-pthread use pthread library.],
- [enable_pthread=$enableval], [enable_pthread=no])
+ AS_HELP_STRING([--enable-pthread], [obsolete, and ignored]))
dnl Checks for libraries.
-case "$target_os" in
-nextstep*) ;;
-openstep*) ;;
-rhapsody*) ;;
-darwin*) LIBS="-lobjc $LIBS";;
-hpux*) LIBS="-lm $LIBS"
- ac_cv_c_inline=no;;
-human*) ac_cv_func_getpgrp_void=yes
- ac_cv_func_setitimer=no
- ;;
-beos*) ac_cv_func_link=no;;
-cygwin*) rb_cv_have_daylight=no
- ac_cv_var_tzname=no
- ac_cv_func__setjmp=no
- ac_cv_func_setitimer=no
- ;;
-mingw*) if test "$with_winsock2" = yes; then
- LIBS="-lws2_32 $LIBS"
+AS_CASE(["$target_os"],[*bsd*|dragonfly*],[],[ac_cv_func_daemon=no])
+
+POSTLINK=:
+AC_SUBST(POSTLINK)
+AS_CASE(["$target_os"],
+[nextstep*], [ ],
+[openstep*], [ ],
+[rhapsody*], [ ],
+[darwin*], [ RUBY_PREPEND_OPTION(LIBS, -lobjc)
+ RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT)
+ AC_MSG_CHECKING(whether Mac OS X 10.5 or later)
+ AC_TRY_CPP([#include <AvailabilityMacros.h>
+ #if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040
+ #error pre OS X 10.4
+ [!<===== pre OS X 10.4 =====>]
+ #endif
+ ],
+ [macosx_10_5=yes], [macosx_10_5=no])
+ AC_MSG_RESULT($macosx_10_5)
+ if test $macosx_10_5 = yes; then
+ ac_cv_header_ucontext_h=no
else
- LIBS="-lwsock32 $LIBS"
+ AC_DEFINE(BROKEN_SETREUID, 1)
+ AC_DEFINE(BROKEN_SETREGID, 1)
+ fi
+ ac_cv_type_getgroups=gid_t # getgroups() on Rosetta fills garbage
+ ac_cv_lib_crypt_crypt=no
+ ac_cv_func_fdatasync=no # Mac OS X wrongly reports it has fdatasync()
+ AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_crypt,
+ [AC_TRY_RUN([
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+
+int
+main()
+{
+ int i;
+ for (i = 0; i < 128*128; i++) {
+ char salt[2], buf[256], *s;
+ salt[0] = 0x80 | (i & 0x7f);
+ salt[1] = 0x80 | (i >> 7);
+ strcpy(buf, crypt("", salt));
+ if (strcmp(buf, s = crypt("", salt))) {
+#if 0
+ printf("%.2x%.2x: %s -> %s\n", (unsigned char)salt[0], (unsigned char)salt[1],
+ buf+2, s+2);
+#endif
+ return 1;
+ }
+ }
+ return 0;
+}
+],
+ rb_cv_broken_crypt=no,
+ rb_cv_broken_crypt=yes,
+ rb_cv_broken_crypt=yes)])
+ if test "$rb_cv_broken_crypt" = yes; then
+ AC_DEFINE(BROKEN_CRYPT, 1)
+ fi
+ AC_CHECK_PROGS(codesign, codesign)
+ if test -n "$codesign"; then
+ POSTLINK="test -z '\$(RUBY_CODESIGN)' || $codesign -s '\$(RUBY_CODESIGN)' -f \$@"
+ LINK_SO="$LINK_SO
+$POSTLINK"
fi
- LIBS="-lshell32 $LIBS"
+ AC_CHECK_HEADERS(crt_externs.h, [], [], [
+ #include <crt_externs.h>
+ ])
+ ],
+[hpux*], [ LIBS="-lm $LIBS"
+ ac_cv_c_inline=no],
+[beos*|haiku*], [
+ ac_cv_func_link=no
+ ac_cv_func_sched_yield=no
+ ac_cv_func_pthread_attr_setinheritsched=no
+ AS_CASE(["$target_os"],
+ [beos*], [ ac_cv_header_net_socket_h=yes],
+ [haiku*], [ ac_cv_func_shutdown=no])
+ LIBS="$LIBS" # m lib is include in root under BeOS/Haiku
+ ],
+[cygwin*], [ ac_cv_header_langinfo_h=yes
+ AC_CHECK_FUNCS(cygwin_conv_path)
+ AC_LIBOBJ([langinfo])
+ ],
+[mingw*], [ LIBS="-lshell32 -lws2_32 -limagehlp -lshlwapi $LIBS"
ac_cv_header_a_out_h=no
ac_cv_header_pwd_h=no
ac_cv_header_utime_h=no
@@ -356,145 +1249,392 @@ mingw*) if test "$with_winsock2" = yes; then
ac_cv_header_sys_select_h=no
ac_cv_header_sys_time_h=no
ac_cv_header_sys_times_h=no
+ ac_cv_header_sys_socket_h=no
ac_cv_func_times=yes
ac_cv_func_waitpid=yes
ac_cv_func_fsync=yes
- ac_cv_func_vsnprintf=yes
ac_cv_func_seekdir=yes
ac_cv_func_telldir=yes
ac_cv_func_isinf=yes
ac_cv_func_isnan=yes
ac_cv_func_finite=yes
ac_cv_func_link=yes
+ ac_cv_func_fseeko=yes
ac_cv_lib_crypt_crypt=no
ac_cv_func_getpgrp_void=no
- ac_cv_func_setpgrp_void=yes
ac_cv_func_memcmp_working=yes
ac_cv_lib_dl_dlopen=no
rb_cv_binary_elf=no
rb_cv_negative_time_t=no
- enable_pthread=no
- ;;
-os2-emx*) LIBS="-lm $LIBS"
- ac_cv_lib_dir_opendir=no;;
-msdosdjgpp*) LIBS="-lm $LIBS"
- ac_cv_func_getpgrp_void=yes
- ac_cv_func_setitimer=no
- ac_cv_sizeof_rlim_t=4
- ;;
-bsdi*) LIBS="-lm $LIBS"
- ac_cv_sizeof_rlim_t=8;;
-freebsd*) LIBS="-lm $LIBS"
- AC_CACHE_CHECK([whether -lxpg4 has to be linked],
- rb_cv_lib_xpg4_needed,
- [AC_TRY_CPP([
-#include <osreldate.h>
-#if __FreeBSD_version < 400020 || \
- (__FreeBSD_version >= 500000 && __FreeBSD_version < 500005)
-#error needs libxpg4
-#endif
- ],
- rb_cv_lib_xpg4_needed=no,
- rb_cv_lib_xpg4_needed=yes,
- rb_cv_lib_xpg4_needed=yes)])
- if test "$rb_cv_lib_xpg4_needed" = yes; then
- AC_CHECK_LIB(xpg4, setlocale)
- fi
- if test "$with_libc_r" = yes; then
- AC_CACHE_CHECK([whether libc_r is supplementary to libc],
- rb_cv_supplementary_lib_c_r,
- [AC_TRY_CPP([
-#include <osreldate.h>
-#if 500016 <= __FreeBSD_version
-#error libc_r is supplementary to libc
-#endif
- ],
- rb_cv_supplementary_lib_c_r=no,
- rb_cv_supplementary_lib_c_r=yes,
- rb_cv_supplementary_lib_c_r=yes)])
- if test "$rb_cv_supplementary_lib_c_r" = yes; then
- MAINLIBS="-lc_r $MAINLIBS"
- fi
- fi
- ;;
-dragonfly*) LIBS="-lm $LIBS"
- ;;
-bow) ac_cv_func_setitimer=no
- ;;
-superux*) ac_cv_func_setitimer=no
- ;;
-solaris*2.1*) if test -z "$GCC"; then
- ac_cv_func_isinf=yes
- fi
- LIBS="-lm $LIBS"
- ;;
-*) LIBS="-lm $LIBS";;
-esac
+ ac_cv_func_fcntl=yes
+ ac_cv_func_flock=yes
+ ac_cv_func_gmtime_r=yes
+ rb_cv_large_fd_select=yes
+ AC_LIBOBJ([langinfo])
+ ],
+[os2-emx*], [ LIBS="-lm $LIBS"
+ ac_cv_lib_dir_opendir=no],
+[bsdi*], [ LIBS="-lm $LIBS"
+ AC_DEFINE(BROKEN_SETREUID, 1)
+ AC_DEFINE(BROKEN_SETREGID, 1)
+ ac_cv_sizeof_rlim_t=8],
+[freebsd*], [ LIBS="-lm $LIBS"
+ ac_cv_func_getpeername=no
+ ac_cv_func_getsockname=no
+ ac_cv_func_shutdown=no
+ ac_cv_func_close=no
+ ],
+[dragonfly*], [ LIBS="-lm $LIBS"
+ # isinf() and isnan() are macros on DragonFly.
+ ac_cv_func_isinf=yes
+ ac_cv_func_isnan=yes
+ ],
+[bow], [ ac_cv_func_setitimer=no
+ ],
+[superux*], [ ac_cv_func_setitimer=no
+ ],
+[nacl], [
+ LIBS="-lm $LIBS"
+ if test "${nacl_cv_build_variant}" = "newlib"; then
+ RUBY_APPEND_OPTION(CPPFLAGS, -DNACL_NEWLIB)
+ RUBY_APPEND_OPTION(LIBS, '-lnosys')
+ else
+ RUBY_APPEND_OPTION(XCFLAGS, -fPIC)
+ fi
+ ac_cv_func_shutdown=no
+ ac_cv_func_fcntl=no
+ ],
+[ LIBS="-lm $LIBS"])
AC_CHECK_LIB(crypt, crypt)
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
-
-case "$target_cpu" in
-alpha*) case "$target_os"::"$GCC" in
- *::yes) CFLAGS="-mieee $CFLAGS" ;; # gcc
- osf*) CFLAGS="-ieee $CFLAGS" ;; # ccc
- esac ;;
-esac
+AC_CHECK_LIB(socket, socketpair) # SunOS/Solaris
+AC_CHECK_LIB(rt, clock_gettime) # GNU/Linux
+
+AS_CASE(["$target_cpu"],
+[alpha*|sh4|sh4el|sh4eb], [AS_CASE(["$target_os"::"$GCC"],
+ [*::yes], # gcc
+ [CFLAGS="-mieee $CFLAGS"],
+ [osf*], # ccc
+ [CFLAGS="-ieee $CFLAGS"],
+ )],
+[sparc*], [AC_LIBOBJ([sparc])])
+
+ac_cv_header_net_socket_h=${ac_cv_header_net_socket_h=no}
+if test "$ac_cv_header_net_socket_h" = yes; then
+ ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=no}
+else
+ ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=yes}
+fi
dnl Checks for header files.
AC_HEADER_DIRENT
-AC_HEADER_STDC
+dnl AC_HEADER_STDC has been checked in AC_USE_SYSTEM_EXTENSIONS
+AC_HEADER_STDBOOL
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h sys/syscall.h\
+AC_CHECK_HEADERS(limits.h sys/file.h sys/ioctl.h sys/syscall.h\
fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
- syscall.h pwd.h grp.h a.out.h utime.h memory.h direct.h sys/resource.h \
- sys/mkdev.h sys/utime.h netinet/in_systm.h float.h ieeefp.h pthread.h \
- ucontext.h intrinsics.h)
-
-dnl Check additional types.
-AC_CHECK_SIZEOF(rlim_t, 0, [
- #ifdef HAVE_SYS_TYPES_H
- # include <sys/types.h>
- #endif
- #ifdef HAVE_SYS_TIME_H
- # include <sys/time.h>
- #endif
- #ifdef HAVE_SYS_RESOURCE_H
- # include <sys/resource.h>
- #endif
- #ifdef HAVE_UNISTD_H
- # include <unistd.h>
- #endif
- #include <stdio.h>
-])
+ syscall.h pwd.h grp.h a.out.h utime.h direct.h sys/resource.h \
+ sys/mkdev.h sys/utime.h xti.h netinet/in_systm.h float.h ieeefp.h \
+ ucontext.h intrinsics.h langinfo.h locale.h sys/sendfile.h time.h \
+ net/socket.h sys/socket.h process.h sys/prctl.h)
-dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
+RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include <sys/types.h>])
+RUBY_CHECK_SIZEOF(ptrdiff_t, size_t, [], [@%:@include <stddef.h>])
+RUBY_CHECK_PRINTF_PREFIX(size_t, z)
+RUBY_CHECK_PRINTF_PREFIX(ptrdiff_t, t)
AC_STRUCT_ST_BLKSIZE
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_RDEV
+RUBY_CHECK_SIZEOF([struct stat.st_size], [int long "long long"], [], [@%:@include <sys/stat.h>])
+if test "$ac_cv_member_struct_stat_st_blocks" = yes; then
+ RUBY_CHECK_SIZEOF([struct stat.st_blocks], [int long "long long"], [], [@%:@include <sys/stat.h>])
+fi
+AC_CHECK_MEMBERS([struct stat.st_atim])
+AC_CHECK_MEMBERS([struct stat.st_atimespec])
+AC_CHECK_MEMBERS([struct stat.st_atimensec])
+AC_CHECK_MEMBERS([struct stat.st_mtim])
+AC_CHECK_MEMBERS([struct stat.st_mtimespec])
+AC_CHECK_MEMBERS([struct stat.st_mtimensec])
+AC_CHECK_MEMBERS([struct stat.st_ctim])
+AC_CHECK_MEMBERS([struct stat.st_ctimespec])
+AC_CHECK_MEMBERS([struct stat.st_ctimensec])
+
+AC_CHECK_TYPES([struct timespec], [], [], [@%:@ifdef HAVE_TIME_H
+@%:@include <time.h>
+@%:@endif
+@%:@ifdef HAVE_SYS_TIME_H
+@%:@include <sys/time.h>
+@%:@endif])
+
+AC_CHECK_TYPES([struct timezone], [], [], [@%:@ifdef HAVE_TIME_H
+@%:@ include <time.h>
+@%:@endif
+@%:@ifdef HAVE_SYS_TIME_H
+@%:@ include <sys/time.h>
+@%:@endif])
+
+AC_CHECK_TYPES([clockid_t], [], [], [@%:@ifdef HAVE_TIME_H
+@%:@ include <time.h>
+@%:@endif
+@%:@ifdef HAVE_SYS_TIME_H
+@%:@ include <sys/time.h>
+@%:@endif])
+
+AC_CACHE_VAL([rb_cv_large_fd_select],
+ [AC_CHECK_TYPE(fd_mask, [rb_cv_large_fd_select=yes], [rb_cv_large_fd_select=no])])
+if test "$rb_cv_large_fd_select" = yes; then
+ AC_DEFINE(HAVE_RB_FD_INIT, 1)
+fi
+
+dnl RUBY_DEFINT TYPENAME, SIZE, [SIGNED-OR-UNSIGNED], [INCLUDES = DEFAULT-INCLUDES]
+AC_DEFUN([RUBY_DEFINT], [dnl
+AC_CACHE_CHECK([for $1], [rb_cv_type_$1],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])
+typedef $1 t; int s = sizeof(t) == 42;])],
+ [rb_cv_type_$1=yes],
+ [AS_CASE([m4_bmatch([$2], [^[1-9][0-9]*$], $2, [$ac_cv_sizeof_]AS_TR_SH($2))],
+ ["1"], [ rb_cv_type_$1="m4_if([$3], [], [signed ], [$3 ])char"],
+ ["$ac_cv_sizeof_short"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])short"],
+ ["$ac_cv_sizeof_int"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])int"],
+ ["$ac_cv_sizeof_long"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long"],
+ ["$ac_cv_sizeof_long_long"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long long"],
+ ["$ac_cv_sizeof___int64"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])__int64"],
+ [ rb_cv_type_$1=no])])])
+if test "${rb_cv_type_$1}" != no; then
+ AC_DEFINE([HAVE_]AS_TR_CPP($1), 1)
+ if test "${rb_cv_type_$1}" = yes; then
+ m4_bmatch([$2], [^[1-9][0-9]*$], [AC_CHECK_SIZEOF([$1], 0, [AC_INCLUDES_DEFAULT([$4])])],
+ [RUBY_CHECK_SIZEOF([$1], [$2], [], [AC_INCLUDES_DEFAULT([$4])])])
+ else
+ AC_DEFINE_UNQUOTED($1, [$rb_cv_type_$1])
+ AC_DEFINE_UNQUOTED([SIZEOF_]AS_TR_CPP($1), [SIZEOF_]AS_TR_CPP([$rb_cv_type_$1]))
+ fi
+fi
+])
+
+RUBY_DEFINT(int8_t, 1)
+RUBY_DEFINT(uint8_t, 1, unsigned)
+RUBY_DEFINT(int16_t, 2)
+RUBY_DEFINT(uint16_t, 2, unsigned)
+RUBY_DEFINT(int32_t, 4)
+RUBY_DEFINT(uint32_t, 4, unsigned)
+RUBY_DEFINT(int64_t, 8)
+RUBY_DEFINT(uint64_t, 8, unsigned)
+RUBY_DEFINT(int128_t, 16)
+RUBY_DEFINT(uint128_t, 16, unsigned)
+RUBY_DEFINT(intptr_t, void*)
+RUBY_DEFINT(uintptr_t, void*, unsigned)
+RUBY_DEFINT(ssize_t, size_t, [], [@%:@include <sys/types.h>]) dnl may differ from int, so not use AC_TYPE_SSIZE_T.
+
+RUBY_NACL_CHECK_PEPPER_TYPES
+
+AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address,
+[rb_cv_stack_end_address=no
+ AC_TRY_LINK(
+ [extern void *__libc_stack_end;],
+ [if (!__libc_stack_end) return 1;],
+ [rb_cv_stack_end_address="__libc_stack_end"])
+])
+if test $rb_cv_stack_end_address != no; then
+ AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address)
+fi
+
+AS_CASE(["$target_os"],
+[openbsd*], [
+ AC_CACHE_CHECK(for heap align log on openbsd, rb_cv_page_size_log,
+ [rb_cv_page_size_log=no
+ for page_log in 12 13; do
+ AC_TRY_RUN([
+#include <math.h>
+#include <unistd.h>
+
+int
+main() {
+ if ((int)log2((double)sysconf(_SC_PAGESIZE)) != $page_log) return 1;
+ return 0;
+}
+ ],
+ rb_cv_page_size_log="$page_log"; break)
+ done])
+ if test $rb_cv_page_size_log != no; then
+ AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, $rb_cv_page_size_log)
+ else
+ AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, 12)
+ fi
+])
dnl Checks for library functions.
AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL
-AC_FUNC_ALLOCA
+AS_CASE(["${target_cpu}-${target_os}:${target_archs}"],
+[powerpc-darwin*], [
+ AC_LIBSOURCES(alloca.c)
+ AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
+ AC_DEFINE(C_ALLOCA)
+ AC_DEFINE_UNQUOTED(alloca, alloca)
+ ],
+[universal-darwin*:*ppc*], [
+ AC_LIBSOURCES(alloca.c)
+ AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
+ RUBY_DEFINE_IF([defined __powerpc__], C_ALLOCA, 1)
+ RUBY_DEFINE_IF([defined __powerpc__], alloca, alloca)
+ ],
+[
+ AC_FUNC_ALLOCA
+ ])
+if test "x$ALLOCA" = "x"; then
+ AC_CACHE_CHECK([for dynamic size alloca], rb_cv_dynamic_alloca, [
+ for chk in ok __chkstk; do
+ AC_TRY_LINK([
+ @%:@ifdef HAVE_ALLOCA_H
+ @%:@include <alloca.h>
+ @%:@endif
+ void $chk() {}
+ int dynamic_alloca_test;
+ int dynamic_alloca_result;],
+ [dynamic_alloca_result = alloca(dynamic_alloca_test) != 0;],
+ [rb_cv_dynamic_alloca=$chk; break])
+ done])
+ if test "x$rb_cv_dynamic_alloca" = "x__chkstk"; then
+ AC_DEFINE_UNQUOTED(RUBY_ALLOCA_CHKSTK, _$rb_cv_dynamic_alloca)
+ AS_CASE("$target_cpu",
+ [x64|x86_64], [
+ AC_SUBST([ALLOCA], [\${LIBOBJDIR}x86_64-chkstk.${ac_objext}])
+ ],)
+ fi
+fi
AC_FUNC_MEMCMP
-AC_FUNC_FSEEKO
-AC_CHECK_FUNCS(ftello)
-AC_REPLACE_FUNCS(dup2 memmove strcasecmp strncasecmp strerror strftime\
- strchr strstr strtoul crypt flock vsnprintf\
- isnan finite isinf hypot acosh erf)
-AC_CHECK_FUNCS(fmod killpg wait4 waitpid syscall chroot fsync getcwd eaccess\
- truncate chsize times utimes fcntl lockf lstat symlink link\
- readlink setitimer setruid seteuid setreuid setresuid\
- setproctitle setrgid setegid setregid setresgid issetugid pause\
- lchown lchmod getpgrp setpgrp getpgid setpgid initgroups\
- getgroups setgroups getpriority getrlimit setrlimit sysconf\
- group_member dlopen sigprocmask\
- sigaction _setjmp setsid telldir seekdir fchmod mktime timegm\
- cosh sinh tanh round setuid setgid setenv unsetenv)
+
+# http://sources.redhat.com/ml/libc-hacker/2005-08/msg00008.html
+# Debian GNU/Linux Etch's libc6.1 2.3.6.ds1-13etch5 has this problem.
+# Debian GNU/Linux Lenny's libc6.1 2.7-10 has no problem.
+AC_CACHE_CHECK(for broken erfc of glibc-2.3.6 on IA64, rb_cv_broken_glibc_ia64_erfc,
+ [AC_TRY_RUN([
+#include <math.h>
+int
+main()
+{
+ erfc(10000.0);
+ return 0;
+}
+],
+ rb_cv_broken_glibc_ia64_erfc=no,
+ rb_cv_broken_glibc_ia64_erfc=yes,
+ rb_cv_broken_glibc_ia64_erfc=no)])
+AS_CASE([$rb_cv_broken_glibc_ia64_erfc],[yes],[ac_cv_func_erf=no])
+
+AS_CASE(["$target_os"],[freebsd*],[
+ AC_DEFINE(BROKEN_CLOSE)
+ AC_REPLACE_FUNCS(close)
+ ])
+AC_REPLACE_FUNCS(dup2 memmove strerror\
+ strchr strstr crypt flock\
+ isnan finite isinf hypot acosh erf tgamma lgamma_r cbrt \
+ strlcpy strlcat ffs setproctitle)
+
+# for missing/setproctitle.c
+AS_CASE(["$target_os"],
+[aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)],
+[hpux*], [AC_DEFINE(SPT_TYPE,SPT_PSTAT) ],
+[])
+
+
+AS_CASE(["$target_cpu-$target_os"], [[i[3-6]86*]], [
+ AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [
+ AC_TRY_LINK([unsigned long atomic_var;],
+ [
+ __sync_val_compare_and_swap(&atomic_var, 0, 1);
+ ],
+ [rb_cv_gcc_compiler_cas=yes],
+ [rb_cv_gcc_compiler_cas=no])])
+ if test "$rb_cv_gcc_compiler_cas" = no; then
+ ARCH_FLAG="-march=i486"
+ fi])
+
+AC_CACHE_CHECK(for signbit, rb_cv_have_signbit,
+ [AC_TRY_LINK([
+#include <math.h>
+], [int v = signbit(-0.0);],
+ rb_cv_have_signbit=yes,
+ rb_cv_have_signbit=no)])
+if test "$rb_cv_have_signbit" = yes; then
+ AC_DEFINE(HAVE_SIGNBIT)
+else
+ AC_LIBOBJ([signbit])
+fi
+AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall __syscall chroot getcwd eaccess\
+ truncate ftruncate ftello chsize times utimes utimensat fcntl lockf lstat\
+ truncate64 ftruncate64 ftello64 fseeko fseeko64 \
+ link symlink readlink readdir_r fsync fdatasync fchown posix_fadvise\
+ setitimer setruid seteuid setreuid setresuid socketpair\
+ setrgid setegid setregid setresgid issetugid pause lchown lchmod\
+ getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
+ getpriority getrlimit setrlimit sysconf close getpwnam_r getgrnam_r\
+ dlopen sigprocmask sigaction sigsetjmp _setjmp _longjmp\
+ getsid setsid telldir seekdir fchmod cosh sinh tanh log2 round llabs\
+ setuid setgid daemon select_large_fdset setenv unsetenv\
+ mktime timegm gmtime_r clock_gettime gettimeofday poll ppoll\
+ pread sendfile shutdown sigaltstack dl_iterate_phdr\
+ dup dup3 pipe2 posix_memalign memalign ioctl)
+
+AC_CACHE_CHECK(for unsetenv returns a value, rb_cv_unsetenv_return_value,
+ [AC_TRY_COMPILE([
+#include <stdlib.h>
+], [int v = unsetenv("foo");],
+ rb_cv_unsetenv_return_value=yes,
+ rb_cv_unsetenv_return_value=no)])
+if test "$rb_cv_unsetenv_return_value" = no; then
+ AC_DEFINE(VOID_UNSETENV)
+fi
+
+AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp,
+[AC_TRY_LINK([@%:@include <setjmp.h>
+ jmp_buf jb; void t(v) int v; {__builtin_longjmp(jb, v);}],
+ [__builtin_setjmp(jb);],
+ [ac_cv_func___builtin_setjmp=yes],
+ [ac_cv_func___builtin_setjmp=no])
+])
+
+test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
+
+AC_MSG_CHECKING(for setjmp type)
+AC_ARG_WITH(setjmp-type,
+ AS_HELP_STRING([--with-setjmp-type], [select setjmp type]),
+ [
+ AS_CASE([$withval],
+ [__builtin_setjmp], [ setjmp_prefix=__builtin_],
+ [_setjmp], [ setjmp_prefix=_],
+ [sigsetjmp], [ setjmp_prefix=sig],
+ [setjmp], [ setjmp_prefix=],
+ [''], [ unset setjmp_prefix],
+ [ AC_MSG_ERROR(invalid setjmp type: $withval)])], [unset setjmp_prefix])
+if test ${setjmp_prefix+set}; then
+ if test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp = no; then
+ AC_MSG_ERROR(${setjmp_prefix}setjmp is not available)
+ fi
+elif test "$ac_cv_func___builtin_setjmp" = yes; then
+ setjmp_prefix=__builtin_
+elif test "$ac_cv_func__setjmp" = yes; then
+ setjmp_prefix=_
+elif test "$ac_cv_func_sigsetjmp" = yes; then
+ AS_CASE([$target_os],[solaris*|cygwin*],[setjmp_prefix=],[setjmp_prefix=sig])
+else
+ setjmp_prefix=
+fi
+if test x$setjmp_prefix = xsig; then
+ setjmp_sigmask=yes
+else
+ unset setjmp_sigmask
+fi
+AC_MSG_RESULT(${setjmp_prefix}setjmp)
+AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp(env${setjmp_sigmask+,0})])
+AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp(env,val)])
+AC_DEFINE_UNQUOTED(RUBY_JMP_BUF, ${setjmp_sigmask+${setjmp_prefix}}jmp_buf)
+
AC_ARG_ENABLE(setreuid,
- [ --enable-setreuid use setreuid()/setregid() according to need even if obsolete.],
+ AS_HELP_STRING([--enable-setreuid], [use setreuid()/setregid() according to need even if obsolete]),
[use_setreuid=$enableval])
if test "$use_setreuid" = yes; then
AC_DEFINE(USE_SETREUID)
@@ -502,7 +1642,7 @@ if test "$use_setreuid" = yes; then
fi
AC_STRUCT_TIMEZONE
AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
- [AC_TRY_COMPILE([#include <time.h>],
+ [AC_TRY_COMPILE([@%:@include <time.h>],
[struct tm t; t.tm_gmtoff = 3600;],
[rb_cv_member_struct_tm_tm_gmtoff=yes],
[rb_cv_member_struct_tm_tm_gmtoff=no])])
@@ -512,14 +1652,57 @@ fi
AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
[AC_TRY_LINK([#include <time.h>
int i;],
- [i = daylight;],
+ [i = daylight;],
rb_cv_have_daylight=yes,
rb_cv_have_daylight=no)])
if test "$rb_cv_have_daylight" = yes; then
AC_DEFINE(HAVE_DAYLIGHT)
fi
+AC_DEFUN([RUBY_CHECK_VARTYPE], [dnl
+AC_CACHE_CHECK([for external $1], AS_TR_SH(rb_cv_var_$1),
+ [AS_TR_SH(rb_cv_var_$1)=no
+ AC_TRY_COMPILE([
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 1
+#endif
+$2
+;
+const volatile void *volatile t;],
+ [t = &(&$1)[0];],
+ [for t in $3; do
+ AC_TRY_COMPILE([
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 1
+#endif
+$2
+;
+extern $t $1;
+const volatile void *volatile t;],
+ [t = &(&$1)[0];],
+ [AS_TR_SH(rb_cv_var_$1)=$t; break])
+ done])])
+if test "${AS_TR_SH(rb_cv_var_$1)}" != no; then
+ AC_DEFINE(AS_TR_CPP(HAVE_VAR_$1))
+ AC_DEFINE_UNQUOTED(AS_TR_CPP(TYPEOF_VAR_$1), ${AS_TR_SH(rb_cv_var_$1)})
+fi])
+RUBY_CHECK_VARTYPE(timezone, [@%:@include <time.h>], [long int])
+RUBY_CHECK_VARTYPE(altzone, [@%:@include <time.h>], [long int])
+AC_CHECK_FUNCS(timezone)
+if test "$ac_cv_func_timezone" = yes; then
+ AC_CACHE_CHECK([whether timezone requires zero arguments], rb_cv_func_timezone_void,
+ [AC_TRY_COMPILE([@%:@include <time.h>],
+ [(void)timezone(0, 0);],
+ [rb_cv_func_timezone_void=no],
+ [rb_cv_func_timezone_void=yes])]
+ )
+ if test $rb_cv_func_timezone_void = yes; then
+ AC_DEFINE(TIMEZONE_VOID)
+ fi
+fi
+
AC_CACHE_CHECK(for negative time_t for gmtime(3), rb_cv_negative_time_t,
[AC_TRY_RUN([
+#include <stdlib.h>
#include <time.h>
void
@@ -556,9 +1739,53 @@ if test "$rb_cv_negative_time_t" = yes; then
AC_DEFINE(NEGATIVE_TIME_T)
fi
+# [ruby-dev:40910] overflow of time on FreeBSD
+# http://www.freebsd.org/cgi/query-pr.cgi?pr=145341
+AC_CACHE_CHECK(for localtime(3) overflow correctly, rb_cv_localtime_overflow,
+ [AC_TRY_RUN([
+#include <stdlib.h>
+#include <time.h>
+
+void
+check(time_t t1)
+{
+ struct tm *tm;
+ time_t t2;
+ tm = localtime(&t1);
+ if (!tm)
+ return; /* overflow detected. ok. */
+ t2 = mktime(tm);
+ if (t1 == t2)
+ return; /* round-trip. ok. */
+ exit(1);
+}
+
+int
+main()
+{
+ time_t t;
+ if (~(time_t)0 <= 0) {
+ t = (((time_t)1) << (sizeof(time_t) * 8 - 2));
+ t |= t - 1;
+ }
+ else {
+ t = ~(time_t)0;
+ }
+ check(t);
+ return 0;
+}
+],
+ rb_cv_localtime_overflow=yes,
+ rb_cv_localtime_overflow=no,
+ rb_cv_localtime_overflow=yes)])
+if test "$rb_cv_localtime_overflow" = no; then
+ AC_DEFINE(LOCALTIME_OVERFLOW_PROBLEM)
+fi
+
if test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = yes; then
AC_DEFINE(POSIX_SIGNAL)
else
+ AC_CHECK_FUNCS(sigsetmask)
AC_CACHE_CHECK(for BSD signal semantics, rb_cv_bsd_signal,
[AC_TRY_RUN([
#include <stdio.h>
@@ -581,43 +1808,49 @@ main()
],
rb_cv_bsd_signal=yes,
rb_cv_bsd_signal=no,
- rb_cv_bsd_signal=no)])
+ rb_cv_bsd_signal=$ac_cv_func_sigsetmask)])
if test "$rb_cv_bsd_signal" = yes; then
AC_DEFINE(BSD_SIGNAL)
fi
fi
+if test "$ac_cv_func_getpgid" = no; then
AC_FUNC_GETPGRP
-AC_FUNC_SETPGRP
+fi
+if test "$ac_cv_func_setpgid:$ac_cv_func_setpgrp" = no:yes; then
+AC_FUNC_SETPGRP
+fi
-AC_C_BIGENDIAN
-AC_C_CONST
-AC_C_CHAR_UNSIGNED
-AC_C_INLINE
-AC_C_VOLATILE
+if test x"$target_cpu" = xia64; then
+ AC_LIBOBJ([ia64])
+ AC_CACHE_CHECK(for __libc_ia64_register_backing_store_base,
+ rb_cv___libc_ia64_register_backing_store_base,
+ [rb_cv___libc_ia64_register_backing_store_base=no
+ AC_TRY_LINK(
+ [extern unsigned long __libc_ia64_register_backing_store_base;],
+ [unsigned long p = __libc_ia64_register_backing_store_base;
+ printf("%ld\n", p);],
+ [rb_cv___libc_ia64_register_backing_store_base=yes])])
+ if test $rb_cv___libc_ia64_register_backing_store_base = yes; then
+ AC_DEFINE(HAVE___LIBC_IA64_REGISTER_BACKING_STORE_BASE)
+ fi
+fi
AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign,
- [AC_TRY_RUN([
-int
-main()
-{
- if (-1==(-1>>1))
- return 0;
- return 1;
-}
-],
+ [AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([], [(-1==(-1>>1))])],
rb_cv_rshift_sign=yes,
- rb_cv_rshift_sign=no,
- rb_cv_rshift_sign=yes)])
+ rb_cv_rshift_sign=no)])
if test "$rb_cv_rshift_sign" = yes; then
- AC_DEFINE(RSHIFT(x,y), ((x)>>(int)y))
+ AC_DEFINE(RSHIFT(x,y), ((x)>>(int)(y)))
else
- AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>y) : (x)>>y))
+ AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>(int)(y)) : (x)>>(int)(y)))
fi
-AC_MSG_CHECKING(read count field in FILE structures)
-AC_CACHE_VAL(rb_cv_fcnt,
-[for fcnt in dnl
+# win32.c still use this. Don't remove it.
+test "$rb_cv_fcnt" = "not found" && rb_cv_fcnt="not found (OK if using GNU libc)"
+AC_CACHE_CHECK([read count field in FILE structures], rb_cv_fcnt,
+[rb_cv_fcnt="not found (OK if using GNU libc)"
+for fcnt in dnl
_cnt dnl
__cnt dnl
_r dnl
@@ -627,24 +1860,21 @@ AC_CACHE_VAL(rb_cv_fcnt,
AC_TRY_COMPILE([#include <stdio.h>
],
[FILE *f = stdin; f->$fcnt = 0;],
- rb_cv_fcnt="$fcnt"; break,
- rb_cv_fcnt="not found")
+ [rb_cv_fcnt="$fcnt"; break])
done])
-if test "$rb_cv_fcnt" = "not found"; then
- AC_MSG_RESULT([not found(OK if using GNU libc)])
-else
- AC_MSG_RESULT($rb_cv_fcnt)
- AC_DEFINE_UNQUOTED(FILE_COUNT, $rb_cv_fcnt)
-fi
+AS_CASE("$rb_cv_fcnt",
+ ["not found"*], [rb_cv_fcnt="not found"],
+ [AC_DEFINE_UNQUOTED(FILE_COUNT, $rb_cv_fcnt)])
-AC_MSG_CHECKING(read buffer ptr field in FILE structures)
-AC_CACHE_VAL(rb_cv_frptr,
+# win32.c still use this. Don't remove it.
+AC_CACHE_CHECK([read buffer ptr field in FILE structures], rb_cv_frptr,
[for frptr in dnl
_IO_read_ptr dnl
_ptr dnl
__ptr dnl
bufpos dnl
_p dnl
+ __bufpos dnl
; do
AC_TRY_COMPILE([#include <stdio.h>
],
@@ -652,107 +1882,60 @@ AC_CACHE_VAL(rb_cv_frptr,
rb_cv_frptr="$frptr"; break,
rb_cv_frptr="not found")
done])
-if test "$rb_cv_frptr" = "not found"; then
- AC_MSG_RESULT([not found])
-else
- AC_MSG_RESULT($rb_cv_frptr)
+if test "$rb_cv_frptr" != "not found"; then
AC_DEFINE_UNQUOTED(FILE_READPTR, $rb_cv_frptr)
if test "$rb_cv_fcnt" = "not found"; then
- AC_MSG_CHECKING(read buffer end field in FILE structures)
- AC_CACHE_VAL(rb_cv_frend,
+ AC_CACHE_CHECK([read buffer end field in FILE structures], rb_cv_frend,
[for frend in dnl
_IO_read_end dnl
bufread dnl
+ __bufread dnl
; do
AC_TRY_COMPILE([#include <stdio.h>
],
- [FILE *f = stdin; char buf[256]; f->$frend = buf;],
- rb_cv_frend="$frend"; break,
- rb_cv_frend="not found")
+ [FILE *f = stdin; char buf[256]; f->$frend = buf;],
+ rb_cv_frend="$frend"; break,
+ rb_cv_frend="not found")
done])
- if test "$rb_cv_frend" = "not found"; then
- AC_MSG_RESULT([not found])
- else
- AC_MSG_RESULT($rb_cv_frend)
+ if test "$rb_cv_frend" != "not found"; then
AC_DEFINE_UNQUOTED(FILE_READEND, $rb_cv_frend)
fi
fi
fi
-AC_DEFUN([RUBY_CHECK_IO_NEED],
-[AC_CACHE_CHECK(whether need to [$1], [$2],
- [AC_TRY_RUN([
-#include <stdio.h>
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-#ifndef SEEK_CUR
-#define SEEK_CUR 1
-#endif
-#define before_seek(f) ]ifelse(index($2,flush_before_seek),-1,[fflush(f)],[(f,0)])[
-#define reset_rw(f) ]ifelse(index($2,seek_between_rw),-1,[do_seek(f,SEEK_CUR)],[(f,0)])[
-#define do_seek(f, w) (before_seek(f), fseek(f,0,w))
-
-char *fn = "conftest.dat";
-char *wombat = "wombat\n";
-char *koara = "koara\n";
-char *kangaroo = "kangaroo\n";
-
-int main()
-{
- char buf[BUFSIZ];
- FILE *f;
- int r = 1;
-
- if (!(f = fopen(fn, "w+"))) return 1;
- fputs(wombat, f);
- do_seek(f, SEEK_SET);
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
- reset_rw(f);
- fputs(koara, f);
- fputs(kangaroo, f);
- do_seek(f, SEEK_SET);
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, koara)) goto fail;
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, kangaroo)) goto fail;
- do_seek(f, SEEK_SET);
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
- reset_rw(f);
- fputc('X', f);
- reset_rw(f);
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, koara+1)) goto fail;
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, kangaroo)) goto fail;
- do_seek(f, SEEK_SET);
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
- if (!fgets(buf, BUFSIZ, f) || buf[0] != 'X' || strcmp(buf+1, koara+1)) goto fail;
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, kangaroo)) goto fail;
- r = 0;
- fail:
- fclose(f);
- unlink(fn);
- return r;
-}
-], [$2]=no, [$2]=yes, [$2]=[$3])])])
-RUBY_CHECK_IO_NEED(seek between R/W, rb_cv_need_io_seek_between_rw, yes)
-if test "$rb_cv_need_io_seek_between_rw" = yes; then
- AC_DEFINE(NEED_IO_SEEK_BETWEEN_RW, 1)
-fi
-dnl RUBY_CHECK_IO_NEED(flush before seek, rb_cv_need_io_flush_before_seek, no)
-dnl if test "$rb_cv_need_io_flush_before_seek" = yes; then
-dnl AC_DEFINE(NEED_IO_FLUSH_BEFORE_SEEK, 1)
-dnl fi
-
-AC_CACHE_CHECK([whether st_ino is huge], rb_cv_huge_st_ino,
-[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([
-#include <sys/stat.h>
-struct stat test_stat;
-], [sizeof(test_stat.st_ino)>sizeof(long)])],
-rb_cv_huge_st_ino=yes,
-rb_cv_huge_st_ino=no)
-])
-if test $rb_cv_huge_st_ino = yes; then
- AC_DEFINE(HUGE_ST_INO)
+RUBY_CHECK_SIZEOF([struct stat.st_ino], [long "long long"], [], [@%:@include <sys/stat.h>])
+
+AC_CACHE_CHECK([whether struct dirent.d_name is too small], rb_cv_sizeof_struct_dirent_too_small,
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([
+@%:@if defined _WIN32
+@%:@ error <<<struct direct in win32/dir.h has variable length d_name>>>
+@%:@elif defined HAVE_DIRENT_H
+@%:@ include <dirent.h>
+@%:@elif defined HAVE_DIRECT_H
+@%:@ include <direct.h>
+@%:@else
+@%:@ define dirent direct
+@%:@ if HAVE_SYS_NDIR_H
+@%:@ include <sys/ndir.h>
+@%:@ endif
+@%:@ if HAVE_SYS_DIR_H
+@%:@ include <sys/dir.h>
+@%:@ endif
+@%:@ if HAVE_NDIR_H
+@%:@ include <ndir.h>
+@%:@ endif
+@%:@endif
+@%:@include <stddef.h>
+@%:@define numberof(array) [(int)(sizeof(array) / sizeof((array)[0]))]
+struct dirent d;
+])],
+ [offsetof(struct dirent, [d_name[numberof(d.d_name)]]) - offsetof(struct dirent, d_name) < 256])],
+ [rb_cv_sizeof_struct_dirent_too_small=yes],
+ [rb_cv_sizeof_struct_dirent_too_small=no])])
+if test "$rb_cv_sizeof_struct_dirent_too_small" = yes; then
+ AC_DEFINE(SIZEOF_STRUCT_DIRENT_TOO_SMALL, 1)
fi
if test "$ac_cv_func_sysconf" = yes; then
@@ -771,12 +1954,14 @@ if test "$ac_cv_func_sysconf" = yes; then
RUBY_CHECK_SYSCONF(CLK_TCK)
fi
-case "$target_cpu" in
-m68*|i?86|ia64|sparc*|alpha*) rb_cv_stack_grow_dir=-1;;
-hppa*) rb_cv_stack_grow_dir=+1;;
-esac
-AC_CACHE_CHECK(stack growing direction, rb_cv_stack_grow_dir,
- [AC_TRY_RUN([
+AC_DEFUN(RUBY_STACK_GROW_DIRECTION, [
+ AS_VAR_PUSHDEF([stack_grow_dir], [rb_cv_stack_grow_dir_$1])
+ AC_CACHE_CHECK(stack growing direction on $1, stack_grow_dir, [
+AS_CASE(["$1"],
+[m68*|x86*|x64|i?86|ia64|ppc*|sparc*|alpha*], [ $2=-1],
+[hppa*], [ $2=+1],
+[
+ AC_TRY_RUN([
/* recurse to get rid of inlining */
static int
stack_growup_p(addr, n)
@@ -793,12 +1978,45 @@ int main()
int x;
return stack_growup_p(&x, 10);
}
-], rb_cv_stack_grow_dir=-1, rb_cv_stack_grow_dir=+1, rb_cv_stack_grow_dir=0)])
-AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $rb_cv_stack_grow_dir)
+], $2=-1, $2=+1, $2=0)
+ ])
+eval stack_grow_dir=\$$2])
+eval $2=\$stack_grow_dir
+AS_VAR_POPDEF([stack_grow_dir])])
+if test "${universal_binary-no}" = yes ; then
+ archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
+ save_CFLAGS="$CFLAGS" new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
+ save_LDFLAGS="$LDFLAGS" new_ldflags=`echo "$LDFLAGS" | sed "s|$archflagpat"'||'`
+ stack_dir=
+ for archs in ${universal_archnames}; do
+ archs=`echo $archs | sed 's/=.*//'`
+ CFLAGS="$new_cflags -arch $archs"
+ LDFLAGS="$new_ldflags -arch $archs"
+ RUBY_STACK_GROW_DIRECTION($archs, dir)
+ if test x$stack_dir = x; then
+ stack_dir=$dir
+ elif test x$stack_dir != x$dir; then
+ stack_dir=no
+ fi
+ done
+ CFLAGS="$save_CFLAGS" LDFLAGS="$save_LDFLAGS"
+ if test x$stack_dir = xno; then
+ for archs in ${universal_archnames}; do
+ archs=`echo $archs | sed 's/=.*//'`
+ eval dir=\$[rb_cv_stack_grow_dir_]AS_TR_SH([$archs])
+ RUBY_DEFINE_IF([defined __${archs}__], STACK_GROW_DIRECTION, $dir)
+ done
+ else
+ AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $stack_dir)
+ fi
+else
+ RUBY_STACK_GROW_DIRECTION($target_cpu, dir)
+ AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $dir)
+fi
if test x"$enable_pthread" = xyes; then
- for pthread_lib in pthread pthreads c c_r; do
- AC_CHECK_LIB($pthread_lib, pthread_kill,
+ for pthread_lib in thr pthread pthreads c c_r root; do
+ AC_CHECK_LIB($pthread_lib, pthread_kill,
rb_with_pthread=yes, rb_with_pthread=no)
if test "$rb_with_pthread" = "yes"; then break; fi
done
@@ -806,89 +2024,141 @@ if test x"$enable_pthread" = xyes; then
AC_DEFINE(_REENTRANT)
AC_DEFINE(_THREAD_SAFE)
AC_DEFINE(HAVE_LIBPTHREAD)
- case $pthread_lib in
- c)
- ;;
- c_r)
- MAINLIBS="-pthread $MAINLIBS"
- ;;
- *)
- LIBS="-l$pthread_lib $LIBS"
- ;;
- esac
+ AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
+ AS_CASE([$pthread_lib],
+ [c], [],
+ [root], [],
+ [c_r], [MAINLIBS="-pthread $MAINLIBS"],
+ [AS_CASE(["$target_os"],
+ [openbsd*], [LIBS="-pthread $LIBS"],
+ [LIBS="-l$pthread_lib $LIBS"])])
else
AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled")
fi
- AC_CHECK_FUNCS(nanosleep)
- if test x"$ac_cv_func_nanosleep" = xno; then
- AC_CHECK_LIB(rt, nanosleep)
- if test x"$ac_cv_lib_rt_nanosleep" = xyes; then
- AC_DEFINE(HAVE_NANOSLEEP)
- fi
+ AC_CHECK_FUNCS(sched_yield pthread_attr_setinheritsched \
+ pthread_getattr_np pthread_attr_get_np pthread_attr_getstack\
+ pthread_get_stackaddr_np pthread_get_stacksize_np \
+ thr_stksegment pthread_stackseg_np pthread_getthrds_np \
+ pthread_cond_init pthread_condattr_setclock pthread_condattr_init \
+ pthread_sigmask)
+ if test "${host_os}" = "nacl"; then
+ ac_cv_func_pthread_attr_init=no
+ else
+ AC_CHECK_FUNCS(pthread_attr_init)
fi
fi
if test x"$ac_cv_header_ucontext_h" = xyes; then
- if test x"$target_cpu" = xia64 -o x"$rb_with_pthread" = xyes; then
+ if test x"$rb_with_pthread" = xyes; then
AC_CHECK_FUNCS(getcontext setcontext)
fi
fi
-dnl default value for $KANJI
-DEFAULT_KCODE="KCODE_NONE"
+if test "$ac_cv_func_fork" = "yes" -a "$rb_with_pthread" = "yes"; then
+ AC_CACHE_CHECK([if fork works with pthread], rb_cv_fork_with_pthread,
+ [AC_TRY_RUN([
+#include <stdlib.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <signal.h>
+#ifndef EXIT_SUCCESS
+#define EXIT_SUCCESS 0
+#endif
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 1
+#endif
+
+void *
+thread_func(void *dmy)
+{
+ return dmy;
+}
+
+int
+use_threads(void)
+{
+ pthread_t tid;
+ if (pthread_create(&tid, 0, thread_func, 0) != 0) {
+ return -1;
+ }
+ if (pthread_join(tid, 0) != 0) {
+ return -1;
+ }
+ return 0;
+}
+
+int
+main(int argc, char *argv[])
+{
+ pid_t pid;
+ if (use_threads()) return EXIT_FAILURE;
+ pid = fork();
+
+ if (pid) {
+ int loc;
+ sleep(1);
+ if (waitpid(pid, &loc, WNOHANG) == 0) {
+ kill(pid, SIGKILL);
+ return EXIT_FAILURE;
+ }
+ if (!WIFEXITED(loc) || WEXITSTATUS(loc) != EXIT_SUCCESS)
+ return EXIT_FAILURE;
+ }
+ else {
+ if (use_threads()) return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}],
+ rb_cv_fork_with_pthread=yes,
+ rb_cv_fork_with_pthread=no,
+ rb_cv_fork_with_pthread=yes)])
+ test x$rb_cv_fork_with_pthread = xyes || AC_DEFINE(CANNOT_FORK_WITH_PTHREAD)
+fi
+
-AC_ARG_WITH(default-kcode,
- [ --with-default-kcode=CODE specify default value for \$KCODE (utf8|euc|sjis|none)],
- [case $withval in
- utf8) DEFAULT_KCODE="KCODE_UTF8";;
- euc) DEFAULT_KCODE="KCODE_EUC";;
- sjis) DEFAULT_KCODE="KCODE_SJIS";;
- none) DEFAULT_KCODE="KCODE_NONE";;
- *) AC_MSG_WARN($withval is not valid kcode; ignored);;
- esac])
-AC_DEFINE_UNQUOTED(DEFAULT_KCODE, $DEFAULT_KCODE)
+}
+{ # runtime section
dnl wheather use dln_a_out or not
-AC_ARG_WITH(dln-a-out,
- [ --with-dln-a-out use dln_a_out if possible], [
- case $withval in
- yes) with_dln_a_out=yes;;
- *) with_dln_a_out=no;;
- esac], [with_dln_a_out=no])
+AC_ARG_WITH(dln-a-out,
+ AS_HELP_STRING([--with-dln-a-out], [use dln_a_out if possible]),
+ [
+ AS_CASE([$withval],
+ [yes], [
+ if test "$enable_shared" = yes; then
+ AC_MSG_ERROR(dln_a_out can not make shared library)
+ fi
+ with_dln_a_out=yes],
+ [
+ with_dln_a_out=no])], [with_dln_a_out=no])
AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
-[AC_TRY_RUN([
-/* Test for whether ELF binaries are produced */
-#include <fcntl.h>
-#include <stdlib.h>
-main() {
- char buffer[4];
- int i=open("conftest",O_RDONLY);
- if(i==-1)
- exit(1); /* fail */
- if(read(i,&buffer[0],4)<4)
- exit(1); /* fail */
- if(buffer[0] != 127 || buffer[1] != 'E' ||
- buffer[2] != 'L' || buffer[3] != 'F')
- exit(1); /* fail */
- exit(0); /* succeed (yes, it's ELF) */
-}
-],
-rb_cv_binary_elf=yes,
-rb_cv_binary_elf=no,
-rb_cv_binary_elf=yes)])
+[AC_TRY_LINK([],[], [
+AS_CASE(["`head -1 conftest$EXEEXT | cat -e`"],
+['^?ELF'*], [rb_cv_binary_elf=yes], [rb_cv_binary_elf=no])],
+rb_cv_binary_elf=no)])
if test "$rb_cv_binary_elf" = yes; then
AC_DEFINE(USE_ELF)
+ if test "$with_dln_a_out" = yes; then
+ AC_MSG_ERROR(dln_a_out does not work with ELF)
+ fi
+ AC_CHECK_HEADERS([elf.h elf_abi.h])
+ if test $ac_cv_header_elf_h = yes -o $ac_cv_header_elf_abi_h = yes; then
+ AC_LIBOBJ([addr2line])
+ fi
fi
-case "$target_os" in
-linux* | gnu* | k*bsd*-gnu | bsdi*)
+AS_CASE(["$target_os"],
+[linux* | gnu* | k*bsd*-gnu | bsdi* | kopensolaris*-gnu | nacl], [
if test "$rb_cv_binary_elf" = no; then
with_dln_a_out=yes
else
LDFLAGS="$LDFLAGS -rdynamic"
- fi;;
-esac
+ fi])
LIBEXT=a
AC_SUBST(DLDFLAGS)dnl
@@ -897,170 +2167,237 @@ AC_SUBST(ARCH_FLAG)dnl
AC_SUBST(STATIC)dnl
AC_SUBST(CCDLFLAGS)dnl
AC_SUBST(LDSHARED)dnl
+AC_SUBST(LDSHAREDXX)dnl
AC_SUBST(DLEXT)dnl
AC_SUBST(DLEXT2)dnl
AC_SUBST(LIBEXT)dnl
STATIC=
-: ${LIBPATHFLAG=' -L"%s"'}
: ${PATHFLAG=''}
if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=unknown
AC_MSG_CHECKING(whether OS depend dynamic link works)
if test "$GCC" = yes; then
- case "$target_os" in
- nextstep*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
- openstep*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
- rhapsody*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
- darwin*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
- human*|bsdi*|beos*|cygwin*|mingw*|aix*|interix*) ;;
- *) CCDLFLAGS="$CCDLFLAGS -fPIC";;
- esac
+ AS_CASE(["$target_os"],
+ [darwin*], [
+ # The -fno-common is needed if we wish to embed the Ruby interpreter
+ # into a plugin module of some project (as opposed to embedding it
+ # within the project's application). The -I/usr/local/include is
+ # needed because CPP as discovered by configure (cc -E -traditional)
+ # fails to consult /usr/local/include by default. This causes
+ # mkmf.rb's have_header() to fail if the desired resource happens to be
+ # installed in the /usr/local tree.
+ RUBY_APPEND_OPTION(CCDLFLAGS, -fno-common)],
+ [bsdi*|beos*|haiku*|cygwin*|mingw*|aix*|interix*], [ ],
+ [
+ RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC)])
else
- case "$target_os" in
- hpux*) CCDLFLAGS="$CCDLFLAGS +Z";;
- solaris*|irix*) CCDLFLAGS="$CCDLFLAGS -KPIC" ;;
- sunos*) CCDLFLAGS="$CCDLFLAGS -PIC" ;;
- esix*|uxpds*) CCDLFLAGS="$CCDLFLAGS -KPIC" ;;
- *) : ${CCDLFLAGS=""} ;;
- esac
+ AS_CASE(["$target_os"],
+ [hpux*], [CCDLFLAGS="$CCDLFLAGS +Z"],
+ [solaris*|irix*], [CCDLFLAGS="$CCDLFLAGS -KPIC"],
+ [sunos*], [CCDLFLAGS="$CCDLFLAGS -PIC"],
+ [esix*|uxpds*], [CCDLFLAGS="$CCDLFLAGS -KPIC"],
+ [: ${CCDLFLAGS=""}])
+ fi
+
+
+ AC_ARG_ENABLE(rpath,
+ AS_HELP_STRING([--enable-rpath], [embed run path into extension libraries.
+ enabled by default on ELF platforms]),
+ [enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
+ if test "$enable_rpath" = yes; then
+ RPATHFLAG=" ${linker_flag}-R%1\$-s"
fi
- case "$target_os" in
- hpux*) DLDFLAGS="$DLDFLAGS -E"
- : ${LDSHARED='ld -b'}
+ AS_CASE(["$target_os"],
+ [hpux*], [ DLDFLAGS="$DLDFLAGS -E"
+ : ${LDSHARED='$(LD) -b'}
XLDFLAGS="$XLDFLAGS -Wl,-E"
: ${LIBPATHENV=SHLIB_PATH}
- rb_cv_dlopen=yes;;
- solaris*) if test "$GCC" = yes; then
- : ${LDSHARED='$(CC) -shared'}
- if test "$rb_cv_prog_gnu_ld" = yes; then
- LDFLAGS="$LDFLAGS -Wl,-E"
- fi
+ if test "$rb_cv_prog_gnu_ld" = no; then
+ RPATHFLAG=' +b %1$-s'
+ fi
+ rb_cv_dlopen=yes],
+ [solaris*], [ if test "$GCC" = yes; then
+ : ${LDSHARED='$(CC) -shared'}
+ if test "$rb_cv_prog_gnu_ld" = yes; then
+ LDFLAGS="$LDFLAGS -Wl,-E"
+ fi
else
- : ${LDSHARED='ld -G'}
+ : ${LDSHARED='$(CC) -G'}
+ fi
+ if test "$ac_cv_sizeof_voidp" = 8; then
+ : ${LIBPATHENV=LD_LIBRARY_PATH_64}
fi
- rb_cv_dlopen=yes;;
- sunos*) : ${LDSHARED='ld -assert nodefinitions'}
- rb_cv_dlopen=yes;;
- irix*) : ${LDSHARED='ld -shared'}
- rb_cv_dlopen=yes;;
- sysv4*) : ${LDSHARED='ld -G'}
- rb_cv_dlopen=yes;;
- nto-qnx*) : ${LDSHARED="qcc -shared"}
- rb_cv_dlopen=yes ;;
- esix*|uxpds*) : ${LDSHARED="ld -G"}
- rb_cv_dlopen=yes ;;
- osf*) : ${LDSHARED="ld -shared -expect_unresolved \"*\""}
- rb_cv_dlopen=yes ;;
- bsdi3*) case "$CC" in
- *shlicc*) : ${LDSHARED="$CC -r"}
- rb_cv_dlopen=yes ;;
- esac ;;
- linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi*)
- : ${LDSHARED='${CC} -shared'}
+ rb_cv_dlopen=yes],
+ [sunos*], [ : ${LDSHARED='$(LD) -assert nodefinitions'}
+ rb_cv_dlopen=yes],
+ [irix*], [ : ${LDSHARED='$(LD) -shared'}
+ rb_cv_dlopen=yes],
+ [sysv4*], [ : ${LDSHARED='$(LD) -G'}
+ rb_cv_dlopen=yes],
+ [nto-qnx*], [ : ${LDSHARED='$(CC) -shared'}
+ rb_cv_dlopen=yes],
+ [esix*|uxpds*], [ : ${LDSHARED='$(LD) -G'}
+ rb_cv_dlopen=yes],
+ [osf*], [ : ${LDSHARED='$(LD) -shared -expect_unresolved "*"'}
+ rb_cv_dlopen=yes],
+ [bsdi3*], [ AS_CASE(["$CC"],
+ [*shlicc*], [ : ${LDSHARED='$(CC) -r'}
+ rb_cv_dlopen=yes])],
+ [linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi* | kopensolaris*-gnu], [
+ : ${LDSHARED='$(CC) -shared'}
if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
fi
- rb_cv_dlopen=yes ;;
- interix*) : ${LDSHARED="$CC -shared"}
+ rb_cv_dlopen=yes],
+ [interix*], [ : ${LDSHARED='$(CC) -shared'}
XLDFLAGS="$XLDFLAGS -Wl,-E"
- LIBPATHFLAG=" -L'%1\$-s'"
- rb_cv_dlopen=yes ;;
- freebsd*|dragonfly*) : ${LDSHARED="$CC -shared"}
+ LIBPATHFLAG=" -L%1\$-s"
+ rb_cv_dlopen=yes],
+ [freebsd*|dragonfly*], [
+ : ${LDSHARED='$(CC) -shared'}
if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="$LDFLAGS -rdynamic"
DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$(.TARGET)'
else
- test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED="ld -Bshareable"
+ test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
fi
- rb_cv_dlopen=yes ;;
- openbsd*) : ${LDSHARED="\$(CC) -shared ${CCDLFLAGS}"}
+ rb_cv_dlopen=yes],
+ [openbsd*], [ : ${LDSHARED='$(CC) -shared ${CCDLFLAGS}'}
if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="$LDFLAGS -Wl,-E"
fi
- rb_cv_dlopen=yes ;;
- nextstep*) : ${LDSHARED='cc -r -nostdlib'}
- LDFLAGS="$LDFLAGS -u libsys_s"
- rb_cv_dlopen=yes ;;
- openstep*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
- : ${LDFLAGS=""}
- rb_cv_dlopen=yes ;;
- rhapsody*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
- : ${LDFLAGS=""}
- rb_cv_dlopen=yes ;;
- darwin*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress -flat_namespace'}
+ rb_cv_dlopen=yes],
+ [darwin*], [ : ${LDSHARED='$(CC) -dynamic -bundle'}
+ : ${DLDFLAGS="${linker_flag}-undefined${linker_flag:+,}dynamic_lookup ${linker_flag}-multiply_defined${linker_flag:+,}suppress"}
: ${LDFLAGS=""}
: ${LIBPATHENV=DYLD_LIBRARY_PATH}
- rb_cv_dlopen=yes ;;
- aix*) if test "$GCC" = yes; then
- : ${LDSHARED='gcc -shared'}
- DLDFLAGS='-Wl,-G -eInit_$(TARGET)'
- LDFLAGS='-Wl,-brtl -Wl,-bE:ruby.imp'
- else
- : ${LDSHARED='/usr/ccs/bin/ld'}
- DLDFLAGS='-G -eInit_$(TARGET)'
- LDFLAGS="-brtl -bE:ruby.imp"
- fi
- : ${ARCHFILE="ruby.imp"}
+ # /usr/local/include is always searched for
+ # some reason, but /usr/local/lib is not.
+ hdr=`find /usr/local/include -name \*.h -type f | sed 's:^/usr/local/include/::;q'`
+ if test -n "$hdr" && $CC -E -include "$hdr" -xc /dev/null 2>/dev/null | fgrep -q "$hdr"; then
+ $CC -print-search-dirs | grep -q '^libraries:.*:/usr/local/lib/*' ||
+ echo " $LDFLAGS " | grep -q ' -L */usr/local/lib/* ' ||
+ LDFLAGS="${LDFLAGS:+$LDFLAGS }-L/usr/local/lib"
+ fi
+ rb_cv_dlopen=yes],
+ [aix*], [ : ${LDSHARED='$(CC)'}
+ LDSHARED="$LDSHARED ${linker_flag}-G"
+ EXTDLDFLAGS='-e$(TARGET_ENTRY)'
+ XLDFLAGS="${linker_flag}"'-bE:$(ARCHFILE)'" ${linker_flag}-brtl"
+ XLDFLAGS="$XLDFLAGS ${linker_flag}-blibpath:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}"
+ : ${ARCHFILE="ruby.imp"}
TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)'
TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)'
- : ${LIBPATHENV=SHLIB_PATH}
- rb_cv_dlopen=yes ;;
- human*) : ${DLDFLAGS=''}
- : ${LDSHARED=''}
- : ${LDFLAGS=''}
- : ${LINK_SO='ar cru $@ $(OBJS)'}
- rb_cv_dlopen=yes ;;
- beos*) case "$target_cpu" in
- powerpc*)
- : ${LDSHARED="ld -xms"}
- DLDFLAGS="$DLDFLAGS "'-export Init_$(TARGET) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
- ;;
- i586*)
- : ${LDSHARED="ld -shared"}
- DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -lbe -lroot"
- ;;
- esac
+ : ${LIBPATHENV=LIBPATH}
+ RPATHFLAG=" ${linker_flag}-blibpath:%1\$-s:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}"
+ rb_cv_dlopen=yes],
+ [beos*], [ AS_CASE(["$target_cpu"],
+ [powerpc*], [
+ : ${LDSHARED='$(LD) -xms'}
+ EXTDLDFLAGS='-export $(TARGET_ENTRY)'
+ DLDFLAGS="$DLDFLAGS -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o"
+ LDFLAGS="$LDFLAGS -L/boot/home/config/lib -lbe -lroot"
+ ],
+ [i586*], [
+ : ${LDSHARED='$(LD) -shared'}
+ DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -L/boot/home/config/lib \$(topdir)/_APP_ -lroot"
+ LDFLAGS="$LDFLAGS -L/boot/develop/lib/x86 -L/boot/home/config/lib -lroot"
+ ])
+ : ${LIBPATHENV=LIBRARY_PATH}
+ rb_cv_dlopen=yes],
+ [haiku*], [ AS_CASE(["$target_cpu"],
+ [powerpc*], [
+ : ${LDSHARED='$(LD) -xms'}
+ EXTDLDFLAGS='-export $(TARGET_ENTRY)'
+ DLDFLAGS="$DLDFLAGS -lroot glue-noinit.a init_term_dyn.o start_dyn.o"
+ ],
+ [i586*], [
+ : ${LDSHARED='$(LD) -shared'}
+ DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -lroot"
+ ])
: ${LIBPATHENV=LIBRARY_PATH}
- rb_cv_dlopen=yes ;;
- nto-qnx*) DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
- : ${LDSHARED='ld -Bshareable -x'}
+ rb_cv_dlopen=yes ],
+ [nto-qnx*], [ DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
+ : ${LDSHARED='$(LD) -Bshareable -x'}
LDFLAGS="$LDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
- rb_cv_dlopen=yes;;
- cygwin*|mingw*) : ${LDSHARED="${CC} -shared -s"}
- XLDFLAGS="$XLDFLAGS -Wl,--stack,0x02000000"
- DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-import,--export-all"
+ rb_cv_dlopen=yes],
+ [cygwin*|mingw*], [
+ : ${LDSHARED='$(CC) -shared $(if $(filter-out -g -g0,$(debugflags)),,-s)'}
+ XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000,--enable-auto-import"
+ DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import"
: ${LIBPATHENV=""}
- rb_cv_dlopen=yes ;;
- hiuxmpp) : ${LDSHARED='ld -r'} ;;
- atheos*) : ${LDSHARED="$CC -shared"}
- rb_cv_dlopen=yes ;;
- os2-emx*) LDFLAGS="$LDFLAGS -Zbsd-signals"
- ;;
- *) : ${LDSHARED='ld'} ;;
- esac
+ rb_cv_dlopen=yes],
+ [hiuxmpp], [ : ${LDSHARED='$(LD) -r'}],
+ [atheos*], [ : ${LDSHARED='$(CC) -shared'}
+ rb_cv_dlopen=yes],
+ [os2-emx*], [ LDFLAGS="$LDFLAGS -Zomf"
+ ],
+ [nacl], [ LDSHARED='$(CC) -shared' ],
+ [ : ${LDSHARED='$(LD)'}])
AC_MSG_RESULT($rb_cv_dlopen)
-
- AC_ARG_ENABLE(rpath,
- [ --disable-rpath embed run path into extension libraries.],
- [enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
- if test "$enable_rpath" = yes; then
- LIBPATHFLAG=" -L'%1\$-s'"
- if test "$GCC" = yes; then
- RPATHFLAG=" -Wl,-R'%1\$-s'"
- else
- RPATHFLAG=" -R'%1\$-s'"
- fi
- fi
fi
+if test "${LDSHAREDXX}" = ""; then
+ AS_CASE(["${LDSHARED}"],
+ [*'$(CC)'*], [
+ LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\$(CC)/$(CXX)/'`
+ ],
+ [*'${CC}'*], [
+ LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\${CC}/${CXX}/'`
+ ],
+ [*$CC*], [
+ LDSHAREDXX=`echo "${LDSHARED}" | sed "s|$CC|$CXX|"`
+ ],
+ [ld" "*], [
+ ])
+fi
+AS_CASE([${RPATHFLAG}],[*'%1$'*],[: ${LIBPATHFLAG=' -L%1$-s'}],[: ${LIBPATHFLAG=' -L%s'}])
+
AC_SUBST(LINK_SO)
AC_SUBST(LIBPATHFLAG)
AC_SUBST(RPATHFLAG)
AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
AC_SUBST(TRY_LINK)
+AC_ARG_WITH(opt-dir,
+ AS_HELP_STRING([--with-opt-dir=DIR-LIST],
+ [add optional headers and libraries directories separated by $PATH_SEPARATOR]),
+ [
+ val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -I\1/include|g;s/^ //"`
+ CPPFLAGS="$CPPFLAGS $val"
+ set -x
+ val=`IFS="$PATH_SEPARATOR"
+ for dir in $withval; do
+ echo x ${LIBPATHFLAG} ${RPATHFLAG} |
+ sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${dir}/lib${IFS}g;s${IFS}%s${IFS}${dir}/lib${IFS}g"
+ done | tr '\012' ' '`
+ set +x
+ LDFLAGS="$LDFLAGS${LDFLAGS:+ }$val"
+ DLDFLAGS="$DLDFLAGS${DLDFLAGS:+ }$val"
+ ])
+
+AS_CASE(["$target_cpu-$target_os"],
+[*-freebsd*|x86_64-netbsd*], [
+ AC_CHECK_HEADERS([execinfo.h])
+ if test "x$ac_cv_header_execinfo_h" = xyes; then
+ AC_CHECK_LIB([execinfo], [backtrace])
+ execinfo_frame_pointer=no
+ RUBY_TRY_CFLAGS(-fno-omit-frame-pointer, [execinfo_frame_pointer=yes])
+ if test "x$execinfo_frame_pointer" = xyes; then
+ optflags="${optflags+$optflags }-fno-omit-frame-pointer"
+ CFLAGS="$CFLAGS -fno-omit-frame-pointer"
+ fi
+ fi])
+AC_CHECK_FUNCS(backtrace)
+
+AC_ARG_WITH(valgrind,
+ AS_HELP_STRING([--without-valgrind],[disable valgrind memcheck support]),
+ [], with_valgrind=yes)
+AS_IF([test x$with_valgrind != xno],
+ [AC_CHECK_HEADERS(valgrind/memcheck.h)])
+
dln_a_out_works=no
if test "$ac_cv_header_a_out_h" = yes; then
if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
@@ -1070,7 +2407,7 @@ if test "$ac_cv_header_a_out_h" = yes; then
#define USE_DLN_A_OUT
#include "dln.c"
],
- [],
+ [],
rb_cv_dln_a_out=yes,
rb_cv_dln_a_out=no)])
if test "$rb_cv_dln_a_out" = yes; then
@@ -1087,122 +2424,88 @@ if test "$dln_a_out_works" = yes; then
STATIC=-Bstatic
fi
DLEXT=so
- AC_DEFINE(DLEXT, ".so")
CCDLFLAGS=
else
- case "$target_os" in
- hpux*) DLEXT=sl
- AC_DEFINE(DLEXT, ".sl");;
- nextstep*) DLEXT=bundle
- AC_DEFINE(DLEXT, ".bundle");;
- openstep*) DLEXT=bundle
- AC_DEFINE(DLEXT, ".bundle");;
- rhapsody*) DLEXT=bundle
- AC_DEFINE(DLEXT, ".bundle");;
- darwin*) DLEXT=bundle
- AC_DEFINE(DLEXT, ".bundle");;
- os2-emx*) DLEXT=dll
- AC_DEFINE(DLEXT, ".dll");;
- cygwin*|mingw*) DLEXT=so
- AC_DEFINE(DLEXT, ".so")
- DLEXT2=dll
- AC_DEFINE(DLEXT2, ".dll");;
- *) DLEXT=so
- AC_DEFINE(DLEXT, ".so");;
- esac
-fi
-
-AC_SUBST(STRIP)dnl
+ AS_CASE(["$target_os"],
+ [hpux*], [
+ DLEXT=sl],
+ [darwin*], [
+ RUBY_APPEND_OPTION(XLDFLAGS, [-Wl,-u,_objc_msgSend])
+ DLEXT=bundle],
+ [os2-emx*], [
+ LOAD_RELATIVE=1
+ DLEXT=dll],
+ [cygwin*|mingw*|*djgpp*], [
+ LOAD_RELATIVE=1
+ DLEXT=so],
+ [
+ DLEXT=so])
+fi
+if test "$rb_cv_dlopen:$load_relative" = yes:yes; then
+ AC_CHECK_FUNCS(dladdr)
+ if test "$ac_cv_func_dladdr" = yes; then
+ LOAD_RELATIVE=1
+ fi
+fi
+if test x"$LOAD_RELATIVE" = x1; then
+ load_relative=yes
+else
+ unset load_relative
+fi
+
+len=2 # .rb
+n=`expr "$DLEXT" : '.*'`; test "$n" -gt "$len" && len=$n
+n=`expr "$DLEXT2" : '.*'`; test "$n" -gt "$len" && len=$n
+AC_DEFINE_UNQUOTED(DLEXT_MAXLEN, `expr $len + 1`)
+test ".$DLEXT" = "." || AC_DEFINE_UNQUOTED(DLEXT, ".$DLEXT")
+test ".$DLEXT2" = "." || AC_DEFINE_UNQUOTED(DLEXT2, ".$DLEXT2")
+AC_SUBST(DLEXT)
+
if test "$with_dln_a_out" = yes; then
STRIP=true
else
- STRIP=strip
-fi
-
-case "$target_os" in
- linux* | gnu* | k*bsd*-gnu)
- STRIP='strip -S -x';;
- nextstep*)
- STRIP='strip -A -n';;
- openstep*)
- STRIP='strip -A -n';;
- rhapsody*)
- STRIP='strip -A -n';;
- darwin*)
- STRIP='strip -A -n';;
-esac
+ AC_CHECK_TOOL(STRIP, strip, :)dnl
+fi
+AS_CASE(["$target_os"],
+ [linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu], [
+ STRIP="$STRIP -S -x"],
+ [darwin*], [
+ STRIP="$STRIP -A -n"])
+
+AC_ARG_WITH(ext,
+ AC_HELP_STRING([--with-ext=EXTS],
+ [pass to --with-ext option of extmk.rb]))
+AC_ARG_WITH(out-ext,
+ AC_HELP_STRING([--with-out-ext=EXTS],
+ [pass to --without-ext option of extmk.rb]))
EXTSTATIC=
AC_SUBST(EXTSTATIC)dnl
AC_ARG_WITH(static-linked-ext,
- [ --with-static-linked-ext link external modules statically],
- [case $withval in
- yes) STATIC=
- EXTSTATIC=static;;
- *) ;;
- esac])
-
-case "$target_os" in
- human*)
- AC_CHECK_LIB(signal, _harderr)
- AC_CHECK_LIB(hmem, hmemset)
- AC_CHECK_FUNCS(select gettimeofday)
- AC_CACHE_CHECK(whether PD libc _dtos18 fail to convert big number,
- rb_cv_missing__dtos18,
- [AC_TRY_RUN(
-changequote(<<, >>)dnl
-<<
-#include <stdio.h>
-main ()
-{
- char buf[256];
- sprintf (buf, "%g", 1e+300);
- exit (strcmp (buf, "1e+300") ? 0 : 1);
-}
->>,
-changequote([, ])dnl
-rb_cv_missing__dtos18=yes, rb_cv_missing__dtos18=no, rb_cv_missing__dtos18=no)])
- if test "$rb_cv_missing__dtos18" = yes; then
- AC_DEFINE(MISSING__DTOS18)
- fi
- AC_CACHE_CHECK(whether PD libc fconvert fail to round,
- rb_cv_missing_fconvert,
- [AC_TRY_RUN(
-changequote(<<, >>)dnl
-<<
-#include <stdio.h>
-#include <math.h>
-main ()
-{
- char buf[256];
- sprintf (buf, "%f", log(exp(1.0)));
- exit (strcmp (buf, "1.000000") ? 0 : 1);
-}
->>,
-changequote([, ])dnl
-rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no, rb_cv_missing_fconvert=no)])
- if test "$rb_cv_missing_fconvert" = yes; then
- AC_DEFINE(MISSING_FCONVERT)
- fi
- AC_LIBOBJ([x68.o])
- CFLAGS="$CFLAGS -fansi-only"
- XCFLAGS="$XCFLAGS -cc1-stack=262144 -cpp-stack=2694144"
- EXEEXT=.x
- OBJEXT=o
- setup=Setup.x68
- ;;
+ AS_HELP_STRING([--with-static-linked-ext], [link external modules statically]),
+ [AS_CASE([$withval],[yes],[STATIC=;EXTSTATIC=static])])
+if test x"$EXTSTATIC" = xstatic; then
+ ENCOBJS='enc/encinit.$(OBJEXT) enc/libenc.$(LIBEXT) enc/libtrans.$(LIBEXT)'
+ EXTOBJS='ext/extinit.$(OBJEXT)'
+ AC_DEFINE_UNQUOTED(EXTSTATIC, 1)
+fi
+AC_SUBST(ENCOBJS)
+AC_SUBST(EXTOBJS)
+
+AS_CASE(["$target_os"],
dnl OS/2 environment w/ Autoconf 2.1x for EMX
- os2-emx)
- AC_LIBOBJ([os2])
+ [os2-emx], [
setup=Setup.emx
- ;;
- *djgpp*)
+ ],
+ [*djgpp*], [
setup=Setup.dj
- ;;
- *)
+ ],
+ [nacl], [
+ setup=Setup.nacl
+ ],
+ [
setup=Setup
- ;;
-esac
+ ])
AC_SUBST(setup)
@@ -1210,23 +2513,51 @@ if test "$prefix" = NONE; then
prefix=$ac_default_prefix
fi
-#if test "$fat_binary" != no ; then
-# CFLAGS="$CFLAGS $ARCH_FLAG"
-#fi
-
+BTESTRUBY='$(MINIRUBY)'
if test x"$cross_compiling" = xyes; then
- test x"$MINIRUBY" = x && MINIRUBY="${RUBY-ruby} -I`pwd` -rfake"
- PREP=fake.rb
+ test x"$MINIRUBY" = x && MINIRUBY="${RUBY-$BASERUBY} -I`$CHDIR .; pwd` "-r'$(arch)-fake'
+ XRUBY_LIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["libdir"]']`
+ XRUBY_RUBYLIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubylibdir"]']`
+ XRUBY_RUBYHDRDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubyhdrdir"]']`
+ AC_SUBST(XRUBY_LIBDIR)
+ AC_SUBST(XRUBY_RUBYLIBDIR)
+ AC_SUBST(XRUBY_RUBYHDRDIR)
+ PREP='$(arch)-fake.rb'
RUNRUBY='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
+ XRUBY='$(MINIRUBY)'
+ TEST_RUNNABLE=no
+ CROSS_COMPILING=yes
+
+ if test "$host_os" = "nacl"; then
+ if test "$build_cpu" = "$host_cpu" || test "${nacl_cv_cpu_nick}" = "x86" -a "$host_cpu" = "i686"; then
+ nacl_cv_sel_ldr='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb sel_ldr`'
+ nacl_cv_irt_core='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb irt_core`'
+ nacl_cv_runnable_ld='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb runnable_ld`'
+ nacl_cv_host_lib='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb host_lib`'
+ TEST_RUNNABLE=yes
+ BTESTRUBY="${nacl_cv_sel_ldr} -a -B ${nacl_cv_irt_core} -w 1:3 -w 2:4"
+ BTESTRUBY="$BTESTRUBY -- ${nacl_cv_runnable_ld} --library-path ${nacl_cv_host_lib}"
+ BTESTRUBY="$BTESTRUBY `pwd`/"'miniruby$(EXEEXT) -I`cd $(srcdir)/lib; pwd` -I.'
+ BTESTRUBY="$BTESTRUBY"' -I$(EXTOUT)/common 3>&1 4>&2 1>/dev/null 2>/dev/null '
+ fi
+ fi
else
- MINIRUBY='./miniruby$(EXEEXT)'
+ MINIRUBY='./miniruby$(EXEEXT) -I$(srcdir)/lib -I.'
+ MINIRUBY="$MINIRUBY"' -I$(EXTOUT)/common'
PREP='miniruby$(EXEEXT)'
- RUNRUBY='$(MINIRUBY) $(srcdir)/runruby.rb --extout=$(EXTOUT) --'
+ RUNRUBY='$(MINIRUBY) $(srcdir)/tool/runruby.rb --extout=$(EXTOUT)'
+ XRUBY='$(RUNRUBY)'
+ TEST_RUNNABLE=yes
+ CROSS_COMPILING=no
fi
+AC_SUBST(TEST_RUNNABLE)
+AC_SUBST(CROSS_COMPILING)
AC_SUBST(MINIRUBY)
+AC_SUBST(BTESTRUBY)
AC_SUBST(PREP)
AC_SUBST(RUNRUBY)
-AC_SUBST(EXTOUT, [${EXTOUT-.ext}])
+AC_SUBST(XRUBY)
+AC_SUBST(EXTOUT, [${EXTOUT=.ext}])
FIRSTMAKEFILE=""
LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a'
@@ -1235,16 +2566,18 @@ LIBRUBYARG_STATIC='-l$(RUBY_SO_NAME)-static'
LIBRUBYARG='$(LIBRUBYARG_STATIC)'
SOLIBS=
-case "$target_os" in
- cygwin*|mingw*|beos*|openstep*|nextstep*|rhapsody*|darwin*|os2-emx*)
+AS_CASE(["$target_os"],
+ [cygwin*|mingw*|beos*|haiku*|darwin*|os2-emx*], [
: ${DLDLIBS=""}
- ;;
- *)
+ ],
+ [
DLDLIBS="$DLDLIBS -lc"
- ;;
-esac
+ ])
+
+AC_ARG_WITH(soname,
+ AS_HELP_STRING([--with-soname=SONAME], [base name of shared library]),
+ [RUBY_SO_NAME=$withval], [RUBY_SO_NAME='$(RUBY_BASE_NAME)'])
-RUBY_SO_NAME='$(RUBY_INSTALL_NAME)'
LIBRUBY_LDSHARED=$LDSHARED
LIBRUBY_DLDFLAGS=$DLDFLAGS
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
@@ -1252,34 +2585,60 @@ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so'
ENABLE_SHARED=no
AC_ARG_ENABLE(shared,
- [ --enable-shared build a shared library for Ruby. ],
+ AS_HELP_STRING([--enable-shared], [build a shared library for Ruby]),
[enable_shared=$enableval])
-if test "$enable_shared" = 'yes'; then
+libprefix='$(libdir)'
+LIBRUBY_RELATIVE=${load_relative-no}
+AS_CASE("$enable_shared", [yes], [
LIBRUBY='$(LIBRUBY_SO)'
LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
LIBRUBYARG='$(LIBRUBYARG_SHARED)'
- CFLAGS="$CFLAGS $CCDLFLAGS"
+ LIBRUBY_RELATIVE=no
+ test -z "$CCDLFLAGS" || CFLAGS="$CFLAGS $CCDLFLAGS"
ENABLE_SHARED=yes
if test "$rb_cv_binary_elf" = yes; then
SOLIBS='$(LIBS)'
fi
- case "$target_os" in
- sunos4*)
+
+ # libdir can be overridden in config.site file (on OpenSUSE at least).
+ libdir_basename=lib
+ if test "$bindir" = '${exec_prefix}/bin'; then
+ AS_CASE(["$libdir"], ['${exec_prefix}/'*], [libdir_basename=`basename "$libdir"`])
+ fi
+ AC_DEFINE_UNQUOTED(LIBDIR_BASENAME, ["${libdir_basename}"])
+
+ AS_CASE(["$target_os"],
+ [freebsd*|dragonfly*], [],
+ [
+ if test "$GCC" = yes; then
+ RUBY_TRY_LDFLAGS([${linker_flag}--no-undefined], [no_undefined=yes], [no_undefined=no])
+ if test "no_undefined" = yes; then
+ RUBY_APPEND_OPTION(EXTLDFLAGS, [${linker_flag}--no-undefined])
+ fi
+ fi
+ ])
+
+ AS_CASE(["$target_os"],
+ [sunos4*], [
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
- ;;
- linux* | gnu* | k*bsd*-gnu | atheos*)
+ ],
+ [linux* | gnu* | k*bsd*-gnu | atheos* | kopensolaris*-gnu], [
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
- ;;
- freebsd*|dragonfly*)
+ if test "$load_relative" = yes; then
+ LIBRUBY_RPATHFLAGS="'-Wl,-rpath,\$\${ORIGIN}/../${libdir_basename}'"
+ LIBRUBY_RELATIVE=yes
+ fi
+ ],
+ [freebsd*|dragonfly*], [
SOLIBS='$(LIBS)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
if test "$rb_cv_binary_elf" != "yes" ; then
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
LIBRUBY_ALIASES=''
fi
- ;;
- netbsd*)
+ ],
+ [netbsd*], [
SOLIBS='$(LIBS)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
@@ -1288,184 +2647,449 @@ if test "$enable_shared" = 'yes'; then
else # a.out platforms
LIBRUBY_ALIASES=""
fi
- ;;
- openbsd*)
+ ],
+ [openbsd*], [
SOLIBS='$(LIBS)'
- LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}`
- ;;
- solaris*)
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}`
+ ],
+ [solaris*], [
SOLIBS='$(LIBS)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)'
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY) lib$(RUBY_SO_NAME).so'
if test "$GCC" = yes; then
LIBRUBY_DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(@F)'
+ else
+ LIBRUBY_DLDFLAGS="$DLDFLAGS "'-h $(@F)'
fi
XLDFLAGS="$XLDFLAGS "'-R${libdir}'
- ;;
- hpux*)
+ ],
+ [hpux*], [
XLDFLAGS="$XLDFLAGS "'-Wl,+s,+b,$(libdir)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)'
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).sl'
- ;;
- aix*)
- if test "$GCC" = yes; then
- LIBRUBY_LDSHARED='$(CC) -shared'
- LIBRUBY_DLDFLAGS='-Wl,-G -Wl,-bE:ruby.imp -Wl,-bnoentry'
- else
- LIBRUBY_LDSHARED='/usr/ccs/bin/ld'
- LIBRUBY_DLDFLAGS='-G -bE:ruby.imp -bnoentry'
- fi
- LIBRUBYARG_SHARED='-L${libdir} -lruby'
+ ],
+ [aix*], [
+ LIBRUBY_DLDFLAGS="${linker_flag}-bnoentry $XLDFLAGS"
+ LIBRUBYARG_SHARED='-L${libdir} -l${RUBY_SO_NAME}'
SOLIBS='-lm -lc'
- ;;
- beos*)
- case "$target_cpu" in
- powerpc*)
+ ],
+ [beos*], [
+ AS_CASE(["$target_cpu"],
+ [powerpc*], [
LIBRUBY_DLDFLAGS='-f ruby.exp -lnet -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
- ;;
- esac
- ;;
- darwin*)
- LIBRUBY_SO='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib'
- LIBRUBY_LDSHARED='cc -dynamiclib -undefined suppress -flat_namespace'
- LIBRUBY_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
- LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib'
- ;;
- interix*)
- LIBRUBYARG_SHARED='-L${libdir} -L. -l$(RUBY_SO_NAME)'
- ;;
- *)
- ;;
- esac
-fi
+ ])
+ ],
+ [darwin*], [
+ RUBY_SO_NAME="$RUBY_SO_NAME"'.$(MAJOR).$(MINOR).$(TEENY)'
+ LIBRUBY_LDSHARED='$(CC) -dynamiclib'
+ if test "$load_relative" = yes; then
+ libprefix="@executable_path/../${libdir_basename}"
+ LIBRUBY_RELATIVE=yes
+ fi
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-install_name '${libprefix}'/$(LIBRUBY_SO)'
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(MAJOR).$(MINOR).$(TEENY)'
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(ruby_version)'
+ if test "$visibility_option" = ld; then
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_Init_*'
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,*_threadptr_*'
+ fi
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "' $(XLDFLAGS)'
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).dylib'
+ LIBRUBY_ALIASES='lib$(RUBY_BASE_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_INSTALL_NAME).dylib'
+ ],
+ [interix*], [
+ LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)'
+ ],
+ [mingw*|cygwin*|mswin*], [
+ LIBRUBY_RELATIVE=yes
+ ])
+], [
+ LIBRUBYARG_SHARED=
+
+ # enable PIE if possible
+ pie=
+ AS_CASE(["$target_os"],
+ [haiku], [
+ # gcc supports PIE, but doesn't work correctly in Haiku
+ pie=no
+ ],
+ [nacl], [
+ # -pie implies -shared for NaCl.
+ pie=no
+ ])
+ if test "$GCC" = yes -a -z "$EXTSTATIC" -a "x$pie" != xno; then
+ RUBY_TRY_CFLAGS(-fPIE, [pie=yes], [pie=no])
+ if test "$pie" = yes; then
+ # Use -fPIE when testing -pie. RUBY_TRY_LDFLAGS sets
+ # $save_CFLAGS internally, so set other name here.
+ save_CFLAGS_before_pie="$CFLAGS"
+ CFLAGS="$CFLAGS -fPIE"
+
+ # gcc need -pie but clang need -Wl,-pie.
+ for pie in -pie -Wl,-pie; do
+ RUBY_TRY_LDFLAGS([$pie], [], [pie=])
+ if test "x$pie" != x; then
+ RUBY_APPEND_OPTION(XCFLAGS, -fPIE)
+ RUBY_APPEND_OPTION(XLDFLAGS, $pie)
+ break
+ fi
+ done
+ CFLAGS="$save_CFLAGS_before_pie"
+ fi
+ fi
+])
if test "$enable_rpath" = yes; then
- if test "$GCC" = yes; then
- LIBRUBYARG_SHARED='-Wl,-R -Wl,$(libdir) -L$(libdir) -L. '"$LIBRUBYARG_SHARED"
+ test -z "$LIBRUBY_RPATHFLAGS" || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS "
+ LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS${linker_flag}-R ${linker_flag}${libprefix} -L\$(libdir)"
+ LIBRUBYARG_SHARED="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_SHARED"
+ LIBRUBYARG_STATIC="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_STATIC"
+fi
+AC_SUBST(LIBRUBY_RELATIVE)
+
+LDFLAGS="-L. $LDFLAGS"
+AC_SUBST(ARCHFILE)
+
+if test "$EXEEXT" = .exe; then
+ EXECUTABLE_EXTS='".exe",".com",".cmd",".bat"'
+ AC_DEFINE_UNQUOTED(EXECUTABLE_EXTS, $EXECUTABLE_EXTS)
+ EXECUTABLE_EXTS=`echo $EXECUTABLE_EXTS | tr -d '"' | tr , ' '`
+ AC_SUBST(EXECUTABLE_EXTS)
+fi
+
+AC_ARG_ENABLE(dtrace,
+ AS_HELP_STRING([--enable-dtrace],
+ [enable DTrace for tracing inside ruby. enabled by default on systems having dtrace]),
+ [enable_dtrace=$enableval], [enable_dtrace=auto])
+
+if test "${enable_dtrace}" = "auto"; then
+ if test x"$DTRACE" != x -a x"$cross_compiling" != xyes; then
+ RUBY_DTRACE_AVAILABLE()
+ enable_dtrace=$rb_cv_dtrace_available
else
- LIBRUBYARG_SHARED='-R $(libdir) -L$(libdir) -L. '"$LIBRUBYARG_SHARED"
+ enable_dtrace=no
fi
fi
-XLDFLAGS="$XLDFLAGS -L."
-AC_SUBST(ARCHFILE)
+LIBRUBY_A_OBJS='$(OBJS)'
+if test "${enable_dtrace}" = "yes"; then
+ if test -z "$DTRACE"; then
+ AC_MSG_ERROR([dtrace(1) is missing])
+ elif test "$cross_compiling" = yes; then
+ AC_MSG_ERROR([--enable-dtrace, however, cross compiling])
+ else
+ RUBY_DTRACE_AVAILABLE()
+ enable_dtrace=$rb_cv_dtrace_available
+ if test "${enable_dtrace}" = "no"; then
+ AC_MSG_ERROR([--enable-dtrace, however, USDT is not available])
+ fi
+ RUBY_DTRACE_POSTPROCESS()
+ if test "$rb_cv_prog_dtrace_g" = 'yes'; then
+ DTRACE_OBJ='probes.$(OBJEXT)'
+ DTRACE_GLOMMED_OBJ='ruby-glommed.$(OBJEXT)'
+ LIBRUBY_A_OBJS='$(DTRACE_GLOMMED_OBJ)'
+ fi
+ AS_CASE("${target_os}", [freebsd*], [
+ # FreeBSD's dtrace requires libelf
+ LIBS="-lelf $LIBS"
+ ])
+ fi
+ DTRACE_EXT=d
+else
+ DTRACE_EXT=dmyh
+fi
+AC_SUBST(DTRACE_EXT)
+AC_SUBST(DTRACE_OBJ)
+AC_SUBST(DTRACE_GLOMMED_OBJ)
+AC_SUBST(LIBRUBY_A_OBJS)
+
+}
+{ # build section
dnl build rdoc index if requested
RDOCTARGET=""
+CAPITARGET=""
AC_ARG_ENABLE(install-doc,
- [ --enable-install-doc build and install rdoc indexes during install ],
- [install_doc=$enableval], [install_doc=no])
+ AS_HELP_STRING([--disable-install-doc], [do not install neither rdoc indexes nor C API documents during install]),
+ [install_doc=$enableval], [install_doc=yes])
+AC_ARG_ENABLE(install-rdoc,
+ AS_HELP_STRING([--disable-install-rdoc], [do not install rdoc indexes during install]),
+ [install_rdoc=$enableval], [install_rdoc=yes])
+AC_ARG_ENABLE(install-capi,
+ AS_HELP_STRING([--disable-install-capi], [do not install C API documents during install]),
+ [install_capi=$enableval], [install_capi=yes])
+
if test "$install_doc" != no; then
- RDOCTARGET="install-doc"
+ if test "$install_rdoc" != no; then
+ RDOCTARGET="rdoc"
+ else
+ RDOCTARGET="nodoc"
+ fi
+ if test "$install_capi" != no -a -n "$DOXYGEN"; then
+ CAPITARGET="capi"
+ else
+ CAPITARGET="nodoc"
+ fi
+else
+ RDOCTARGET="nodoc"
+ CAPITARGET="nodoc"
fi
+
AC_SUBST(RDOCTARGET)
+AC_SUBST(CAPITARGET)
-case "$target_os" in
- linux*)
- XCFLAGS="$XCFLAGS -D_GNU_SOURCE=1"
- ;;
- netbsd*)
- CFLAGS="$CFLAGS -pipe"
- ;;
- nextstep*|openstep*)
- # The -fno-common is needed if we wish to embed the Ruby interpreter
- # into a plugin module of some project (as opposed to embedding it
- # within the project's application). The -I/usr/local/include is
- # needed because CPP as discovered by configure (cc -E -traditional)
- # fails to consult /usr/local/include by default. This causes
- # mkmf.rb's have_header() to fail if the desired resource happens to be
- # installed in the /usr/local tree.
- CFLAGS="$CFLAGS -pipe -fno-common"
- CPPFLAGS="$CPPFLAGS -I/usr/local/include"
- ;;
- rhapsody*)
- CFLAGS="$CFLAGS -pipe -no-precomp -fno-common"
- ;;
- darwin*)
- CFLAGS="$CFLAGS -pipe -fno-common"
- ;;
- os2-emx)
- CFLAGS="$CFLAGS -DOS2 -Zmts"
+AS_CASE(["$RDOCTARGET:$CAPITARGET"],[nodoc:nodoc],[INSTALLDOC=nodoc],[INSTALLDOC=all])
+AC_SUBST(INSTALLDOC)
+
+if test "$rb_with_pthread" = "yes"; then
+ THREAD_MODEL=pthread
+fi
+AC_CACHE_CHECK([for prefix of external symbols], rb_cv_symbol_prefix, [
+ AC_TRY_COMPILE([extern void conftest_external(void) {}], [], [
+ rb_cv_symbol_prefix=`$NM conftest.$ac_objext |
+ sed -n ['/.*T[ ]\([^ ]*\)conftest_external.*/!d;s//\1/p;q']`
+ ],
+ [rb_cv_symbol_prefix=''])
+ test -n "$rb_cv_symbol_prefix" || rb_cv_symbol_prefix=NONE
+])
+SYMBOL_PREFIX="$rb_cv_symbol_prefix"
+test "x$SYMBOL_PREFIX" = xNONE && SYMBOL_PREFIX=''
+DLNOBJ=dln.o
+AC_ARG_ENABLE(dln,
+ AC_HELP_STRING([--disable-dln], [disable dynamic link feature]),
+ [test "$enableval" = yes || DLNOBJ=dmydln.o])
+AC_SUBST(DLNOBJ)
+MINIDLNOBJ=dmydln.o
+
+AS_CASE(["$target_os"],
+ [linux*], [
+ ],
+ [netbsd*], [
+ RUBY_APPEND_OPTION(CFLAGS, -pipe)
+ ],
+ [darwin*], [
+ RUBY_APPEND_OPTION(CFLAGS, -pipe)
+ ],
+ [os2-emx], [
+ AC_LIBOBJ([os2])
+ CFLAGS="$CFLAGS -DOS2"
LIBRUBY_A=`echo $LIBRUBY_A | sed 's/^lib//'`
LIBRUBY_SO=`echo $LIBRUBY_SO | sed 's/^lib//'`
LIBRUBY_ALIASES=`for i in $LIBRUBY_ALIASES; do echo "$i"; done | sed 's/^lib//'`
- ;;
- osf*)
+ ],
+ [osf*], [
if test "$GCC" != "yes" ; then
# compile something small: taint.c is fine for this.
# the main point is the '-v' flag of 'cc'.
- case "`cc -v -I. -c main.c -o /tmp/main.o 2>&1`" in
- */gemc_cc*) # we have the new DEC GEM CC
+ AS_CASE(["`cc -v -I. -c main.c -o /tmp/main.o 2>&1`"],
+ [*/gemc_cc*], [ # we have the new DEC GEM CC
CFLAGS="$CFLAGS -oldc"
- ;;
- *) # we have the old MIPS CC
- ;;
- esac
+ ],
+ [ # we have the old MIPS CC
+ ])
# cleanup
rm -f /tmp/main.o
CFLAGS="$CFLAGS -std"
fi
- ;;
- beos*)
- case "$target_cpu" in
- powerpc*)
- CFLAGS="$CFLAGS -relax_pointers"
- ;;
- esac
- ;;
- cygwin*|mingw*)
- case "$target_os" in
- cygwin*)
+ ],
+ [beos*], [
+ AS_CASE(["$target_cpu"],[powerpc*], [CFLAGS="$CFLAGS -relax_pointers"])
+ CPPFLAGS="$CPPFLAGS -I/boot/home/config/include"
+ ],
+ [cygwin*|mingw*], [
+ RUBY_SO_NAME="${RUBY_SO_NAME}"'$(MAJOR)$(MINOR)$(TEENY)'
+ LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
+ AS_CASE(["$target_os"],
+ [cygwin*], [
if test x"$enable_shared" = xyes; then
- LIBRUBY_SO='cyg$(RUBY_SO_NAME)'${MAJOR}${MINOR}.dll
- LIBRUBY='lib$(RUBY_SO_NAME).dll.a'
+ LIBRUBY_SO='cyg$(RUBY_SO_NAME)'.dll
+ LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
+ fi
+ ],
+ [mingw*], [
+ RUBY_SO_NAME="${rb_cv_msvcrt}-${RUBY_SO_NAME}"
+ if test x"${target_cpu}" != xi386; then
+ RUBY_SO_NAME="${target_cpu}-${RUBY_SO_NAME}"
fi
- AC_LIBOBJ([strftime])
- ;;
- mingw*)
- RUBY_SO_NAME=${rb_cv_msvcrt}-'$(RUBY_INSTALL_NAME)'${MAJOR}${MINOR}
if test x"$enable_shared" = xyes; then
LIBRUBY_SO='$(RUBY_SO_NAME)'.dll
- LIBRUBY='lib$(LIBRUBY_SO).a'
+ LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
fi
- AC_LIBOBJ([win32])
+ EXPORT_PREFIX=' '
+ DLDFLAGS="${DLDFLAGS}"' $(DEFFILE)'
+ AC_LIBOBJ([win32/win32])
+ AC_LIBOBJ([win32/file])
COMMON_LIBS=m
# COMMON_MACROS="WIN32_LEAN_AND_MEAN="
- COMMON_HEADERS="windows.h winsock.h"
- ;;
- esac
- LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
+ COMMON_HEADERS="winsock2.h windows.h"
+ THREAD_MODEL=win32
+ PLATFORM_DIR=win32
+ ])
LIBRUBY_ALIASES=''
FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
SOLIBS='$(LIBS)'
- if test x"$enable_shared" = xno; then
+ if test x"$enable_shared" = xyes; then
+ LIBRUBY='lib$(RUBY_SO_NAME).dll.a'
+ else
LIBRUBY_SO=dummy
LIBRUBY='lib$(RUBY_SO_NAME).a'
LIBRUBYARG='-l$(RUBY_SO_NAME)'
fi
- MINIOBJS=dmydln.o
- ;;
- hpux*)
- case "$YACC" in
- *yacc*)
+ ],
+ [hpux*], [
+ AS_CASE(["$YACC"],[*yacc*], [
XCFLAGS="$XCFLAGS -DYYMAXDEPTH=300"
YACC="$YACC -Nl40000 -Nm40000"
- ;;
- esac
- MINIOBJS=dmydln.o
- ;;
- aix*)
- PREINSTALL='@$(RM) -r $(prefix)/lib/$(LIBRUBY_A) $(prefix)/lib/$(LIBRUBY_SO) $(prefix)/lib/ruby/$(MAJOR).$(MINOR)/$(arch)'
- ;;
- *)
- ;;
-esac
-
-case "$build_os" in
- *msdosdjgpp*) FIRSTMAKEFILE=GNUmakefile:djgpp/GNUmakefile.in;;
-esac
+ ])],
+ [nacl], [
+ FIRSTMAKEFILE=GNUmakefile:nacl/GNUmakefile.in
+ ])
+MINIOBJS="$MINIDLNOBJ"
+
+AS_CASE(["$THREAD_MODEL"],
+[pthread], [AC_CHECK_HEADERS(pthread.h)],
+[win32], [],
+[""], [AC_MSG_ERROR(thread model is missing)],
+ [AC_MSG_ERROR(unknown thread model $THREAD_MODEL)])
+
+AC_ARG_ENABLE(debug-env,
+ AS_HELP_STRING([--enable-debug-env], [enable RUBY_DEBUG environment variable]),
+ [AC_DEFINE(RUBY_DEBUG_ENV)])
+
+AS_CASE(["$FIRSTMAKEFILE"], [*GNUmakefile:*], [gnumake=yes], [
+ AC_MSG_CHECKING([if ${MAKE-make} is GNU make])
+ mkdir conftest.dir
+ echo "all:; @echo yes" > conftest.dir/GNUmakefile
+ echo "all:; @echo no" > conftest.dir/Makefile
+ gnumake=`(cd conftest.dir; ${MAKE-make})`
+ rm -fr conftest.dir
+ AS_CASE(["$gnumake"],
+ [*yes*], [
+ echo '@%:@ -*- makefile -*-' > GNUmakefile
+ echo 'override MFLAGS := $(filter-out -j%,$(MFLAGS))' >> GNUmakefile
+ echo "include Makefile" >> GNUmakefile
+ echo "-include uncommon.mk" >> GNUmakefile
+ gnumake=yes],
+ [
+ gnumake=no])
+ AC_MSG_RESULT($gnumake)
+])
+AS_IF([test "$gnumake" = yes], [ NULLCMD=: ], [
+ AC_MSG_CHECKING([for safe null command for ${MAKE-make}])
+ mkdir conftest.dir
+ NULLCMD=
+ for cmd in : true; do
+ echo 'A=1' > conftest.dir/Makefile
+ echo 'B=$(A:1=@'$cmd')' >> conftest.dir/Makefile
+ echo 'all:; $B 1 2 3 4 5 6 7 8 9' >> conftest.dir/Makefile
+ if (cd conftest.dir; ${MAKE-make} >/dev/null 2>/dev/null); then
+ NULLCMD=$cmd
+ break
+ fi
+ done
+ rm -fr conftest.dir
+ if test -z "$NULLCMD"; then
+ AC_MSG_ERROR(no candidate for safe null command)
+ fi
+ AC_MSG_RESULT($NULLCMD)
+])
+AC_SUBST(NULLCMD)
+
+if test "${universal_binary-no}" = yes ; then
+ AC_CACHE_CHECK([for architecture macros], rb_cv_architecture_macros, [
+ mv confdefs.h confdefs1.h
+ : > confdefs.h
+ AC_TRY_COMPILE([@%:@if defined __`echo ${universal_archnames} |
+ sed 's/=[^ ]*//g;s/ /__ || defined __/g'`__
+@%:@else
+@%:@error
+>>>>>><<<<<<
+@%:@endif], [],
+[
+ rb_cv_architecture_macros=yes
+ mv -f confdefs1.h confdefs.h
+], [
+ rb_cv_architecture_macros=no
+ archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
+ new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
+ for archs in ${universal_archnames}; do
+ cpu=${archs@%:@*=}
+ archs=${archs%=*}
+ CFLAGS="$new_cflags -arch $archs"
+ archs="__${archs}__"
+ AC_MSG_CHECKING([for macro ${archs} on ${cpu}])
+ AC_TRY_COMPILE([@%:@ifndef ${archs}
+@%:@error
+@%:@endif], [], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
+ done
+ mv -f confdefs1.h confdefs.h
+ AC_MSG_ERROR([failed])
+ ])])
+fi
+AC_CHECK_FUNC(memmem, [
+ AC_CACHE_CHECK(for broken memmem, rb_cv_broken_memmem, [
+ AC_TRY_RUN([
+#include <string.h>
+
+int
+main()
+{
+ char *str = "hogefugafoobar";
+ char *rs = "foo";
+ char *empty = "";
+ char *p;
+
+ p = memmem(str, strlen(str), rs, strlen(rs));
+ if (p == str+8) {
+ p = memmem(str, strlen(str), empty, strlen(empty));
+ if (p == str)
+ return 0;
+ else
+ return 1;
+ }
+ else {
+ return 1;
+ }
+}
+ ],
+ rb_cv_broken_memmem=no,
+ rb_cv_broken_memmem=yes,
+ rb_cv_broken_memmem=yes)
+ ])
+ if test "$rb_cv_broken_memmem" = no; then
+ AC_DEFINE(HAVE_MEMMEM, 1)
+ fi
+])
+
+
+CPPFLAGS="$CPPFLAGS "'$(DEFS)'
+test -z "$CPPFLAGS" || CPPFLAGS="$CPPFLAGS "; CPPFLAGS="$CPPFLAGS"'${cppflags}'
+if test -n "${cflags+set}"; then
+ cflagspat=`eval echo '"'"${cflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/^ *$/ /'`
+ CFLAGS=`echo " $CFLAGS " | sed "s|$cflagspat"'|${cflags}|;s/^ *//;s/ *$//'`
+fi
+if test -n "${cxxflags+set}"; then
+ cxxflagspat=`eval echo '"'"${cxxflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/^ *$/ /'`
+ CXXFLAGS=`echo " $CXXFLAGS " | sed "s|$cxxflagspat"'|${cxxflags}|;s/^ *//;s/ *$//'`
+fi
+if test "${ARCH_FLAG}"; then
+ archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
+ CFLAGS=`echo "$CFLAGS" | sed "s| *$archflagpat"'||'`
+ CXXFLAGS=`echo "$CXXFLAGS" | sed "s| *$archflagpat"'||'`
+ LDFLAGS=`echo "$LDFLAGS" | sed "s| *$archflagpat"'||'`
+fi
+warnflags="$rb_cv_warnflags"
+AC_SUBST(cppflags, [])dnl
+AC_SUBST(cflags, ["$orig_cflags "'${optflags} ${debugflags} ${warnflags}'])dnl
+AC_SUBST(cxxflags, ["$orig_cxxflags "'${optflags} ${debugflags} ${warnflags}'])dnl
+AC_SUBST(optflags)dnl
+AC_SUBST(debugflags)dnl
+AC_SUBST(warnflags)dnl
+AC_SUBST(strict_warnflags)dnl
AC_SUBST(XCFLAGS)dnl
AC_SUBST(XLDFLAGS)dnl
+AC_SUBST(EXTLDFLAGS)dnl
+AC_SUBST(EXTDLDFLAGS)dnl
AC_SUBST(LIBRUBY_LDSHARED)
AC_SUBST(LIBRUBY_DLDFLAGS)
AC_SUBST(RUBY_INSTALL_NAME)
@@ -1487,8 +3111,10 @@ AC_SUBST(COMMON_LIBS)
AC_SUBST(COMMON_MACROS)
AC_SUBST(COMMON_HEADERS)
AC_SUBST(EXPORT_PREFIX)
+AC_SUBST(SYMBOL_PREFIX)
AC_SUBST(MINIOBJS)
-AC_SUBST(PREINSTALL)
+AC_SUBST(THREAD_MODEL)
+AC_SUBST(PLATFORM_DIR)
MAKEFILES="Makefile `echo $FIRSTMAKEFILE | sed 's/:.*//'`"
MAKEFILES="`echo $MAKEFILES`"
@@ -1502,92 +3128,206 @@ ri_suffix=
test "$program_suffix" != NONE &&
ri_suffix=$program_suffix
-RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
-case "$target_os" in
- cygwin*|mingw*)
- RUBYW_INSTALL_NAME="${ri_prefix}rubyw${ri_suffix}"
- rubyw_install_name="$RUBYW_INSTALL_NAME"
- ;;
-esac
-case "$target_os" in
- cygwin*|mingw*|*djgpp*|os2-emx*)
- RUBY_LIB_PREFIX="/lib/ruby"
- ;;
- *)
- RUBY_LIB_PREFIX="${prefix}/lib/ruby"
- ;;
-esac
-RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${MAJOR}.${MINOR}"
+RUBY_INSTALL_NAME="${ri_prefix}"'$(RUBY_BASE_NAME)'"${ri_suffix}"
+AS_CASE(["$target_os"],
+ [cygwin*|mingw*], [
+ RUBYW_INSTALL_NAME="${ri_prefix}"'$(RUBYW_BASE_NAME)'"${ri_suffix}"
+ rubyw_install_name='$(RUBYW_INSTALL_NAME)'
+ ])
+
+rubylibprefix='${libdir}/${RUBY_BASE_NAME}'
+AC_ARG_WITH(rubylibprefix,
+ AS_HELP_STRING([--with-rubylibprefix=DIR], [prefix for ruby libraries [[LIBDIR/RUBY_BASE_NAME]]]),
+ [if test "x$withval" = xno; then
+ AC_MSG_ERROR([No ruby, No libprefix])
+ fi
+ rubylibprefix="$withval"])
+RUBY_LIB_PREFIX=`eval echo \\"${rubylibprefix}\\"`
+AC_SUBST(rubylibprefix)
+
+RI_BASE_NAME=`echo ${RUBY_BASE_NAME} | sed 's/ruby/ri/'`
+ridir='${datarootdir}/${RI_BASE_NAME}'
+AC_ARG_WITH(ridir,
+ AS_HELP_STRING([--with-ridir=DIR], [ri documentation [[DATAROOTDIR/ri]]]),
+ [ridir=$withval])
+RIDIR=`eval echo \\"${ridir}\\"`
+AC_SUBST(ridir)
+AC_SUBST(RI_BASE_NAME)
+
+AC_ARG_WITH(ruby-version,
+ AS_HELP_STRING([--with-ruby-version=STR], [ruby version string for version specific directories [[full]] (full|minor|STR)]),
+ [ruby_version=$withval],
+ [ruby_version=full])
+unset RUBY_LIB_VERSION
+unset RUBY_LIB_VERSION_STYLE
+AS_CASE(["$ruby_version"],
+ [full], [RUBY_LIB_VERSION_STYLE='3 /* full */'],
+ [minor], [RUBY_LIB_VERSION_STYLE='2 /* minor */'])
+if test ${RUBY_LIB_VERSION_STYLE+set}; then
+ {
+ echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE"
+ echo '#define STRINGIZE(x) x'
+ test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0'
+ echo '#include "verconf.h"'
+ echo '#include "version.h"'
+ echo 'ruby_version=RUBY_LIB_VERSION'
+ } > conftest.c
+ test -f verconf.h || > verconf.h
+ ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
+ eval $ruby_version
+else
+ RUBY_LIB_VERSION="\"${ruby_version}\""
+fi
AC_ARG_WITH(sitedir,
- [ --with-sitedir=DIR site libraries in DIR [PREFIX/lib/ruby/site_ruby]],
+ AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]),
[sitedir=$withval],
- [sitedir='${prefix}/lib/ruby/site_ruby'])
-SITE_DIR=`eval echo \\"${sitedir}\\"`
-case "$target_os" in
- cygwin*|mingw*|*djgpp*|os2-emx*)
- RUBY_SITE_LIB_PATH="`expr "$SITE_DIR" : "$prefix\(/.*\)"`" ||
- RUBY_SITE_LIB_PATH="$SITE_DIR";;
- *)
- RUBY_SITE_LIB_PATH="$SITE_DIR";;
-esac
-RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${MAJOR}.${MINOR}"
-
-AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
-AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}")
-AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}")
+ [sitedir='${rubylibprefix}/site_ruby'])
+dir="${sitedir}"
+until SITE_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${SITE_DIR}"; do
+ dir="${SITE_DIR}"
+done
+
+AC_ARG_WITH(vendordir,
+ AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]),
+ [vendordir=$withval],
+ [vendordir='${rubylibprefix}/vendor_ruby'])
+dir="${vendordir}"
+until VENDOR_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${VENDOR_DIR}"; do
+ dir="${VENDOR_DIR}"
+done
+
+if test "${LOAD_RELATIVE+set}"; then
+ AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
+ RUBY_EXEC_PREFIX=""
+ RUBY_LIB_PREFIX="`eval echo "$RUBY_LIB_PREFIX" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
+ RUBY_SITE_LIB_PATH="`eval echo "$SITE_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
+ RUBY_VENDOR_LIB_PATH="`eval echo "$VENDOR_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
+else
+ RUBY_EXEC_PREFIX="`eval echo \\"$exec_prefix/\\" | sed 's|^NONE/|'"$prefix"'/|;s|/$||'`"
+ RUBY_LIB_PREFIX="`eval echo \\"$RUBY_LIB_PREFIX\\" | sed 's|^NONE/|'"$prefix"'/|'`"
+ RUBY_SITE_LIB_PATH="`eval echo \\"$SITE_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
+ RUBY_VENDOR_LIB_PATH="`eval echo \\"$VENDOR_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
+fi
+
+pat=`echo "$RUBY_LIB_PREFIX/" | tr -c '\012' .`'\(.*\)'
+AS_CASE(["$RUBY_SITE_LIB_PATH"],
+ ["$RUBY_LIB_PREFIX/"*], [
+ RUBY_SITE_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_SITE_LIB_PATH\" : \"$pat\"`"'"'
+ ],
+ [
+ RUBY_SITE_LIB_PATH="\"${RUBY_SITE_LIB_PATH}\""
+ ])
+AS_CASE(["$RUBY_VENDOR_LIB_PATH"],
+ ["$RUBY_LIB_PREFIX/"*], [
+ RUBY_VENDOR_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_VENDOR_LIB_PATH\" : \"$pat\"`"'"'
+ ],
+ [
+ RUBY_VENDOR_LIB_PATH="\"${RUBY_VENDOR_LIB_PATH}\""
+ ])
+pat=`echo "$RUBY_EXEC_PREFIX/" | tr -c '\012' .`'\(.*\)'
+AS_CASE(["$RUBY_LIB_PREFIX"],
+ ["$RUBY_EXEC_PREFIX/"*], [
+ RUBY_LIB_PREFIX='RUBY_EXEC_PREFIX"/'"`expr \"$RUBY_LIB_PREFIX\" : \"$pat\"`"'"'
+ ],
+ [
+ RUBY_LIB_PREFIX="\"${RUBY_LIB_PREFIX}\""
+ ])
+
+if test ${RUBY_LIB_VERSION_STYLE+set}; then
+ AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION_STYLE, $RUBY_LIB_VERSION_STYLE !<verconf>!)
+else
+ AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION] !<verconf>!)
+fi
+AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, "${RUBY_EXEC_PREFIX}")
+AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, ${RUBY_LIB_PREFIX} !<verconf>!)
+if test "x$SITE_DIR" = xno; then
+ AC_DEFINE(NO_RUBY_SITE_LIB, [] !<verconf>!)
+else
+ AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB_PATH} !<verconf>!)
+fi
+if test "x$VENDOR_DIR" = xno; then
+ AC_DEFINE(NO_RUBY_VENDOR_LIB, [] !<verconf>!)
+else
+ AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, ${RUBY_VENDOR_LIB_PATH} !<verconf>!)
+fi
AC_SUBST(arch)dnl
AC_SUBST(sitearch)dnl
+AC_SUBST(ruby_version)dnl
AC_SUBST(sitedir)dnl
+AC_SUBST(vendordir)dnl
configure_args=$ac_configure_args
AC_SUBST(configure_args)dnl
-if test "$fat_binary" != no ; then
- arch="fat-${target_os}"
-
- AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB,
- "${RUBY_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
-
- AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
- "${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${target_os}")
+if test "${universal_binary-no}" = yes ; then
+ arch="universal-${target_os}"
+ AC_CACHE_CHECK(whether __ARCHITECTURE__ is available, rb_cv_architecture_available,
+ AC_TRY_COMPILE([const char arch[] = __ARCHITECTURE__;], [puts(arch);],
+ [rb_cv_architecture_available=yes], [rb_cv_architecture_available=no]))
+ if test "${rb_cv_architecture_available}" = yes; then
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM_CPU, __ARCHITECTURE__ !<verconf>!)
+ else
+ for archs in ${universal_archnames}; do
+ cpu=`echo $archs | sed 's/.*=//'`
+ archs=`echo $archs | sed 's/=.*//'`
+ RUBY_DEFINE_IF([defined __${archs}__], RUBY_PLATFORM_CPU, ["${cpu}"])
+ done
+ fi
+ ints='long int short'
+ test "$ac_cv_type_long_long" = yes && ints="'long long' $ints"
+ AC_SUBST(UNIVERSAL_ARCHNAMES, "${universal_archnames}")
+ AC_SUBST(UNIVERSAL_INTS, "${ints}")
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM_OS, "${target_os}" !<verconf>!)
+ AC_DEFINE_UNQUOTED(RUBY_ARCH, "universal-"RUBY_PLATFORM_OS !<verconf>!)
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS !<verconf>!)
else
arch="${target_cpu}-${target_os}"
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}" !<verconf>!)
fi
-case "$target_os" in
- mingw*) sitearch="i386-$rb_cv_msvcrt" ;;
- *) sitearch="${arch}" ;;
-esac
-
-AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH}/${arch}")
-AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH2}/${sitearch}")
+unset sitearch
+AS_CASE(["$target_os"],[mingw*],[sitearch="$target_cpu-$rb_cv_msvcrt"])
+test ${sitearch+set} && AC_DEFINE_UNQUOTED(RUBY_SITEARCH, "${sitearch}" !<verconf>!)
+: ${sitearch='${arch}'}
AC_ARG_WITH(search-path,
- [ --with-search-path=DIR specify the additional search path],
+ AS_HELP_STRING([--with-search-path=DIR], [specify the additional search path]),
[search_path=$withval])
if test "$search_path" != ""; then
- AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
+ AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path" !<verconf>!)
fi
+AC_ARG_WITH(rubyhdrdir,
+ AS_HELP_STRING([--with-rubyhdrdir=DIR], [core headers in DIR [[INCLUDEDIR/RUBY_BASE_NAME-RUBY_VERSION]]]),
+ [rubyhdrdir=$withval],
+ [rubyhdrdir='${includedir}/${RUBY_BASE_NAME}-${ruby_version}'])
+
+AC_ARG_WITH(sitehdrdir,
+ AS_HELP_STRING([--with-sitehdrdir=DIR], [core site headers in DIR [[RUBYHDRDIR/site_ruby]]]),
+ [sitehdrdir=$withval],
+ [sitehdrdir='${rubyhdrdir}/site_ruby'])
+
+AC_ARG_WITH(vendorhdrdir,
+ AS_HELP_STRING([--with-vendorhdrdir=DIR], [core vendor headers in DIR [[RUBYHDRDIR/vendor_ruby]]]),
+ [vendorhdrdir=$withval],
+ [vendorhdrdir='${rubyhdrdir}/vendor_ruby'])
+
+AC_SUBST(rubyhdrdir)dnl
+AC_SUBST(sitehdrdir)dnl
+AC_SUBST(vendorhdrdir)dnl
+
AC_ARG_WITH(mantype,
- [ --with-mantype=TYPE specify man page type; TYPE is one of man and doc],
+ AS_HELP_STRING([--with-mantype=TYPE], [specify man page type; TYPE is one of man and doc]),
[
- case "$withval" in
- man|doc)
- MANTYPE=$withval
- ;;
- *)
- AC_MSG_ERROR(invalid man type: $withval)
- ;;
- esac
+ AS_CASE(["$withval"],
+ [man|doc], [MANTYPE=$withval],
+ [AC_MSG_ERROR(invalid man type: $withval)])
])
if test -z "$MANTYPE"; then
AC_PATH_PROGS(NROFF, nroff awf, /bin/false, "/usr/bin:/usr/ucb")
- if ${NROFF} -mdoc ${srcdir}/ruby.1 >/dev/null 2>&1; then
+ if ${NROFF} -mdoc ${srcdir}/man/ruby.1 >/dev/null 2>&1; then
MANTYPE=doc
else
MANTYPE=man
@@ -1595,18 +3335,123 @@ if test -z "$MANTYPE"; then
fi
AC_SUBST(MANTYPE)
-if test -f config.h && tr -d '\015' < confdefs.h | cmp -s config.h -; then
- echo "config.h unchanged"
+AC_ARG_ENABLE(rubygems,
+ AS_HELP_STRING([--disable-rubygems], [disable rubygems by default]),
+ [enable_rubygems="$enableval"], [enable_rubygems=yes])
+if test x"$enable_rubygems" = xno; then
+ AC_DEFINE(DISABLE_RUBYGEMS, 1)
+ USE_RUBYGEMS=NO
else
- echo "creating config.h"
- tr -d '\015' < confdefs.h > config.h
+ USE_RUBYGEMS=YES
fi
-: > confdefs.h
+AC_SUBST(USE_RUBYGEMS)
+
+arch_hdrdir="${EXTOUT}/include/${arch}/ruby"
+AS_MKDIR_P("${arch_hdrdir}")
+config_h="${arch_hdrdir}/config.h"
+guard=INCLUDE_RUBY_CONFIG_H
+{
+ echo "#ifndef $guard"
+ echo "#define $guard 1"
+ grep -v "^#define PACKAGE_" confdefs.h | grep -v ' !<verconf>!$'
+ echo "#endif /* $guard */"
+} | tr -d '\015' |
+${srcdir}/tool/ifchange "${config_h}" -
+sed -n 's/ !<verconf>!$//p' confdefs.h | ${srcdir}/tool/ifchange verconf.h -
+tr -d '\015' < largefile.h > confdefs.h
+rm largefile.h
+
+BUILTIN_ENCS=["`sed -n -e '/^BUILTIN_ENCS[ ]*=/{' \
+ -e s/// -e :l -e '/\\\\$/N' -e 's/\\\\\\n/ /' -e 't l' -e p \
+ -e '}' "${srcdir}/enc/Makefile.in"`"]
+BUILTIN_ENCOBJS=
+for e in $BUILTIN_ENCS; do BUILTIN_ENCOBJS="$BUILTIN_ENCOBJS `basename $e .c`"'.$(OBJEXT)'; done
+AC_SUBST(BUILTIN_ENCOBJS)
+
+BUILTIN_TRANSES=["`sed -n -e '/^BUILTIN_TRANSES[ ]*=/{' \
+ -e s/// -e :l -e '/\\\\$/N' -e 's/\\\\\\n/ /' -e 't l' -e p \
+ -e '}' "${srcdir}/enc/Makefile.in"`"]
+BUILTIN_TRANSSRCS=
+BUILTIN_TRANSOBJS=
+for e in $BUILTIN_TRANSES; do
+ BUILTIN_TRANSSRCS="$BUILTIN_TRANSSRCS `basename $e .trans`"'.c';
+ BUILTIN_TRANSOBJS="$BUILTIN_TRANSOBJS `basename $e .trans`"'.$(OBJEXT)';
+done
+AC_SUBST(BUILTIN_TRANSSRCS)
+AC_SUBST(BUILTIN_TRANSOBJS)
+
+PACKAGE=$RUBY_BASE_NAME
+AC_SUBST(PACKAGE)
+AC_MSG_RESULT($PACKAGE library version = $ruby_version)
+
+AS_CASE([" $CPP "], [*" $CC "*], [CPP=`echo " $CPP " | sed "s| $CC |"' $(CC) |;s/^ *//;s/ *$//'`])
AC_CONFIG_FILES($FIRSTMAKEFILE)
-AC_CONFIG_FILES(Makefile, [{
+AC_CONFIG_FILES(Makefile, [
+ tmpmk=confmk$$.tmp
+ {
+ if test ${VCS+set}; then
+ :
+ elif svn info "$srcdir" > /dev/null 2>&1; then
+ VCS='svn'
+ elif test -d "$srcdir/.git/svn"; then
+ VCS='git svn'
+ elif test -d "$srcdir/.git"; then
+ VCS='git'
+ else
+ VCS='echo cannot'
+ fi
+ AS_CASE("$VCS",
+ [svn], [VCSUP='$(VCS) up $(SVNUPOPTIONS)'],
+ ["git svn"], [VCSUP='$(VCS) rebase $(GITSVNREBASEOPTIONS)'],
+ [git], [VCSUP='$(VCS) pull $(GITPULLOPTIONS)'],
+ [VCSUP='$(VCS)'])
+ sed '/^MISSING/s/\$U\././g;/^VCS *=/s#@VCS@#'"$VCS"'#;/^VCSUP *=/s#@VCSUP@#'"$VCSUP"'#' Makefile
echo; test x"$EXEEXT" = x || echo 'miniruby: miniruby$(EXEEXT)'
- test "$RUBY_INSTALL_NAME$EXEEXT" = ruby || echo 'ruby: $(PROGRAM);'
- sed ['s/{\$([^(){}]*)[^{}]*}//g'] ${srcdir}/common.mk
-} >> Makefile], [RUBY_INSTALL_NAME=$RUBY_INSTALL_NAME EXEEXT=$EXEEXT])
+ if test "$gnumake" != yes; then
+ echo ['$(MKFILES): $(srcdir)/common.mk']
+ sed ['s/{\$([^(){}]*)[^{}]*}//g'] ${srcdir}/common.mk
+ else
+ echo 'distclean-local::; @$(RM) GNUmakefile uncommon.mk'
+ fi
+ } > $tmpmk && if ! grep '^ruby:' $tmpmk > /dev/null; then
+ if test "${gnumake}" = yes; then
+ tmpgmk=confgmk$$.tmp
+ {
+ echo "include $tmpmk"
+ echo "-include uncommon.mk"
+ } > $tmpgmk
+ else
+ tmpgmk=$tmpmk
+ fi &&
+ test -z "`${MAKE-make} -f $tmpgmk info-program | grep '^PROGRAM=ruby$'`" &&
+ echo 'ruby: $(PROGRAM);' >> $tmpmk
+ test "$tmpmk" = "$tmpgmk" || rm -f "$tmpgmk"
+ fi && mv -f $tmpmk Makefile],
+[EXEEXT='$EXEEXT' gnumake='$gnumake'])
+
+AC_ARG_WITH([ruby-pc],
+ AC_HELP_STRING([pc file basename]),
+ [ruby_pc="$withval"],
+ [ruby_pc="${RUBY_BASE_NAME}-${MAJOR}.${MINOR}.pc"])
+AC_SUBST(ruby_pc)
+AC_SUBST(exec, [exec])
+
+AC_CONFIG_FILES($ruby_pc:template/ruby.pc.in,
+ [
+ if sed ['s/\$(\([A-Za-z_][A-Za-z0-9_]*\))/${\1}/g;s/@[A-Za-z_][A-Za-z0-9_]*@//'] $ruby_pc > ruby.tmp.pc &&
+ {
+ test -z "$PKG_CONFIG" ||
+ PKG_CONFIG_PATH=. $PKG_CONFIG --print-errors ruby.tmp
+ }
+ then
+ mv -f ruby.tmp.pc $ruby_pc
+ else
+ exit 1
+ fi
+ ],
+ [ruby_pc='$ruby_pc' PKG_CONFIG='$PKG_CONFIG'])
+
AC_OUTPUT
+}
+}
diff --git a/constant.h b/constant.h
new file mode 100644
index 0000000000..9354241961
--- /dev/null
+++ b/constant.h
@@ -0,0 +1,36 @@
+/**********************************************************************
+
+ constant.h -
+
+ $Author$
+ created at: Sun Nov 15 00:09:33 2009
+
+ Copyright (C) 2009 Yusuke Endoh
+
+**********************************************************************/
+#ifndef CONSTANT_H
+#define CONSTANT_H
+
+typedef enum {
+ CONST_PUBLIC = 0x00,
+ CONST_PRIVATE = 0x01
+} rb_const_flag_t;
+
+typedef struct rb_const_entry_struct {
+ rb_const_flag_t flag;
+ VALUE value; /* should be mark */
+ VALUE file;
+ int line;
+} rb_const_entry_t;
+
+VALUE rb_mod_private_constant(int argc, VALUE *argv, VALUE obj);
+VALUE rb_mod_public_constant(int argc, VALUE *argv, VALUE obj);
+void rb_free_const_table(st_table *tbl);
+VALUE rb_public_const_get(VALUE klass, ID id);
+VALUE rb_public_const_get_at(VALUE klass, ID id);
+VALUE rb_public_const_get_from(VALUE klass, ID id);
+int rb_public_const_defined(VALUE klass, ID id);
+int rb_public_const_defined_at(VALUE klass, ID id);
+int rb_public_const_defined_from(VALUE klass, ID id);
+
+#endif /* CONSTANT_H */
diff --git a/cont.c b/cont.c
new file mode 100644
index 0000000000..43a60fa149
--- /dev/null
+++ b/cont.c
@@ -0,0 +1,1566 @@
+/**********************************************************************
+
+ cont.c -
+
+ $Author$
+ created at: Thu May 23 09:03:43 2007
+
+ Copyright (C) 2007 Koichi Sasada
+
+**********************************************************************/
+
+#include "ruby/ruby.h"
+#include "internal.h"
+#include "vm_core.h"
+#include "gc.h"
+#include "eval_intern.h"
+
+#if ((defined(_WIN32) && _WIN32_WINNT >= 0x0400) || (defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT))) && !defined(__NetBSD__) && !defined(__sun) && !defined(FIBER_USE_NATIVE)
+#define FIBER_USE_NATIVE 1
+
+/* FIBER_USE_NATIVE enables Fiber performance improvement using system
+ * dependent method such as make/setcontext on POSIX system or
+ * CreateFiber() API on Windows.
+ * This hack make Fiber context switch faster (x2 or more).
+ * However, it decrease maximum number of Fiber. For example, on the
+ * 32bit POSIX OS, ten or twenty thousands Fiber can be created.
+ *
+ * Details is reported in the paper "A Fast Fiber Implementation for Ruby 1.9"
+ * in Proc. of 51th Programming Symposium, pp.21--28 (2010) (in Japanese).
+ */
+
+/* On our experience, NetBSD doesn't support using setcontext() and pthread
+ * simultaneously. This is because pthread_self(), TLS and other information
+ * are represented by stack pointer (higher bits of stack pointer).
+ * TODO: check such constraint on configure.
+ */
+#elif !defined(FIBER_USE_NATIVE)
+#define FIBER_USE_NATIVE 0
+#endif
+
+#if FIBER_USE_NATIVE
+#ifndef _WIN32
+#include <unistd.h>
+#include <sys/mman.h>
+#include <ucontext.h>
+#endif
+#define RB_PAGE_SIZE (pagesize)
+#define RB_PAGE_MASK (~(RB_PAGE_SIZE - 1))
+static long pagesize;
+#endif /*FIBER_USE_NATIVE*/
+
+#define CAPTURE_JUST_VALID_VM_STACK 1
+
+enum context_type {
+ CONTINUATION_CONTEXT = 0,
+ FIBER_CONTEXT = 1,
+ ROOT_FIBER_CONTEXT = 2
+};
+
+typedef struct rb_context_struct {
+ enum context_type type;
+ VALUE self;
+ int argc;
+ VALUE value;
+ VALUE *vm_stack;
+#ifdef CAPTURE_JUST_VALID_VM_STACK
+ size_t vm_stack_slen; /* length of stack (head of th->stack) */
+ size_t vm_stack_clen; /* length of control frames (tail of th->stack) */
+#endif
+ VALUE *machine_stack;
+ VALUE *machine_stack_src;
+#ifdef __ia64
+ VALUE *machine_register_stack;
+ VALUE *machine_register_stack_src;
+ int machine_register_stack_size;
+#endif
+ rb_thread_t saved_thread;
+ rb_jmpbuf_t jmpbuf;
+ size_t machine_stack_size;
+} rb_context_t;
+
+enum fiber_status {
+ CREATED,
+ RUNNING,
+ TERMINATED
+};
+
+#if FIBER_USE_NATIVE && !defined(_WIN32)
+#define MAX_MAHINE_STACK_CACHE 10
+static int machine_stack_cache_index = 0;
+typedef struct machine_stack_cache_struct {
+ void *ptr;
+ size_t size;
+} machine_stack_cache_t;
+static machine_stack_cache_t machine_stack_cache[MAX_MAHINE_STACK_CACHE];
+static machine_stack_cache_t terminated_machine_stack;
+#endif
+
+typedef struct rb_fiber_struct {
+ rb_context_t cont;
+ VALUE prev;
+ enum fiber_status status;
+ struct rb_fiber_struct *prev_fiber;
+ struct rb_fiber_struct *next_fiber;
+ /* If a fiber invokes "transfer",
+ * then this fiber can't "resume" any more after that.
+ * You shouldn't mix "transfer" and "resume".
+ */
+ int transfered;
+
+#if FIBER_USE_NATIVE
+#ifdef _WIN32
+ void *fib_handle;
+#else
+ ucontext_t context;
+#endif
+#endif
+} rb_fiber_t;
+
+static const rb_data_type_t cont_data_type, fiber_data_type;
+static VALUE rb_cContinuation;
+static VALUE rb_cFiber;
+static VALUE rb_eFiberError;
+
+#define GetContPtr(obj, ptr) \
+ TypedData_Get_Struct((obj), rb_context_t, &cont_data_type, (ptr))
+
+#define GetFiberPtr(obj, ptr) do {\
+ TypedData_Get_Struct((obj), rb_fiber_t, &fiber_data_type, (ptr)); \
+ if (!(ptr)) rb_raise(rb_eFiberError, "uninitialized fiber"); \
+} while (0)
+
+NOINLINE(static VALUE cont_capture(volatile int *stat));
+
+#define THREAD_MUST_BE_RUNNING(th) do { \
+ if (!(th)->tag) rb_raise(rb_eThreadError, "not running thread"); \
+ } while (0)
+
+static void
+cont_mark(void *ptr)
+{
+ RUBY_MARK_ENTER("cont");
+ if (ptr) {
+ rb_context_t *cont = ptr;
+ rb_gc_mark(cont->value);
+ rb_thread_mark(&cont->saved_thread);
+ rb_gc_mark(cont->saved_thread.self);
+
+ if (cont->vm_stack) {
+#ifdef CAPTURE_JUST_VALID_VM_STACK
+ rb_gc_mark_locations(cont->vm_stack,
+ cont->vm_stack + cont->vm_stack_slen + cont->vm_stack_clen);
+#else
+ rb_gc_mark_localtion(cont->vm_stack,
+ cont->vm_stack, cont->saved_thread.stack_size);
+#endif
+ }
+
+ if (cont->machine_stack) {
+ if (cont->type == CONTINUATION_CONTEXT) {
+ /* cont */
+ rb_gc_mark_locations(cont->machine_stack,
+ cont->machine_stack + cont->machine_stack_size);
+ }
+ else {
+ /* fiber */
+ rb_thread_t *th;
+ rb_fiber_t *fib = (rb_fiber_t*)cont;
+ GetThreadPtr(cont->saved_thread.self, th);
+ if ((th->fiber != cont->self) && fib->status == RUNNING) {
+ rb_gc_mark_locations(cont->machine_stack,
+ cont->machine_stack + cont->machine_stack_size);
+ }
+ }
+ }
+#ifdef __ia64
+ if (cont->machine_register_stack) {
+ rb_gc_mark_locations(cont->machine_register_stack,
+ cont->machine_register_stack + cont->machine_register_stack_size);
+ }
+#endif
+ }
+ RUBY_MARK_LEAVE("cont");
+}
+
+static void
+cont_free(void *ptr)
+{
+ RUBY_FREE_ENTER("cont");
+ if (ptr) {
+ rb_context_t *cont = ptr;
+ RUBY_FREE_UNLESS_NULL(cont->saved_thread.stack); fflush(stdout);
+#if FIBER_USE_NATIVE
+ if (cont->type == CONTINUATION_CONTEXT) {
+ /* cont */
+ RUBY_FREE_UNLESS_NULL(cont->machine_stack);
+ }
+ else {
+ /* fiber */
+#ifdef _WIN32
+ if (GET_THREAD()->fiber != cont->self && cont->type != ROOT_FIBER_CONTEXT) {
+ /* don't delete root fiber handle */
+ rb_fiber_t *fib = (rb_fiber_t*)cont;
+ if (fib->fib_handle) {
+ DeleteFiber(fib->fib_handle);
+ }
+ }
+#else /* not WIN32 */
+ if (GET_THREAD()->fiber != cont->self) {
+ rb_fiber_t *fib = (rb_fiber_t*)cont;
+ if (fib->context.uc_stack.ss_sp) {
+ if (cont->type == ROOT_FIBER_CONTEXT) {
+ rb_bug("Illegal root fiber parameter");
+ }
+ munmap((void*)fib->context.uc_stack.ss_sp, fib->context.uc_stack.ss_size);
+ }
+ }
+ else {
+ /* It may reached here when finalize */
+ /* TODO examine whether it is a bug */
+ /* rb_bug("cont_free: release self"); */
+ }
+#endif
+ }
+#else /* not FIBER_USE_NATIVE */
+ RUBY_FREE_UNLESS_NULL(cont->machine_stack);
+#endif
+#ifdef __ia64
+ RUBY_FREE_UNLESS_NULL(cont->machine_register_stack);
+#endif
+ RUBY_FREE_UNLESS_NULL(cont->vm_stack);
+
+ /* free rb_cont_t or rb_fiber_t */
+ ruby_xfree(ptr);
+ }
+ RUBY_FREE_LEAVE("cont");
+}
+
+static size_t
+cont_memsize(const void *ptr)
+{
+ const rb_context_t *cont = ptr;
+ size_t size = 0;
+ if (cont) {
+ size = sizeof(*cont);
+ if (cont->vm_stack) {
+#ifdef CAPTURE_JUST_VALID_VM_STACK
+ size_t n = (cont->vm_stack_slen + cont->vm_stack_clen);
+#else
+ size_t n = cont->saved_thread.stack_size;
+#endif
+ size += n * sizeof(*cont->vm_stack);
+ }
+
+ if (cont->machine_stack) {
+ size += cont->machine_stack_size * sizeof(*cont->machine_stack);
+ }
+#ifdef __ia64
+ if (cont->machine_register_stack) {
+ size += cont->machine_register_stack_size * sizeof(*cont->machine_register_stack);
+ }
+#endif
+ }
+ return size;
+}
+
+static void
+fiber_mark(void *ptr)
+{
+ RUBY_MARK_ENTER("cont");
+ if (ptr) {
+ rb_fiber_t *fib = ptr;
+ rb_gc_mark(fib->prev);
+ cont_mark(&fib->cont);
+ }
+ RUBY_MARK_LEAVE("cont");
+}
+
+static void
+fiber_link_join(rb_fiber_t *fib)
+{
+ VALUE current_fibval = rb_fiber_current();
+ rb_fiber_t *current_fib;
+ GetFiberPtr(current_fibval, current_fib);
+
+ /* join fiber link */
+ fib->next_fiber = current_fib->next_fiber;
+ fib->prev_fiber = current_fib;
+ current_fib->next_fiber->prev_fiber = fib;
+ current_fib->next_fiber = fib;
+}
+
+static void
+fiber_link_remove(rb_fiber_t *fib)
+{
+ fib->prev_fiber->next_fiber = fib->next_fiber;
+ fib->next_fiber->prev_fiber = fib->prev_fiber;
+}
+
+static void
+fiber_free(void *ptr)
+{
+ RUBY_FREE_ENTER("fiber");
+ if (ptr) {
+ rb_fiber_t *fib = ptr;
+ if (fib->cont.type != ROOT_FIBER_CONTEXT &&
+ fib->cont.saved_thread.local_storage) {
+ st_free_table(fib->cont.saved_thread.local_storage);
+ }
+ fiber_link_remove(fib);
+
+ cont_free(&fib->cont);
+ }
+ RUBY_FREE_LEAVE("fiber");
+}
+
+static size_t
+fiber_memsize(const void *ptr)
+{
+ const rb_fiber_t *fib = ptr;
+ size_t size = 0;
+ if (ptr) {
+ size = sizeof(*fib);
+ if (fib->cont.type != ROOT_FIBER_CONTEXT) {
+ size += st_memsize(fib->cont.saved_thread.local_storage);
+ }
+ size += cont_memsize(&fib->cont);
+ }
+ return size;
+}
+
+VALUE
+rb_obj_is_fiber(VALUE obj)
+{
+ if (rb_typeddata_is_kind_of(obj, &fiber_data_type)) {
+ return Qtrue;
+ }
+ else {
+ return Qfalse;
+ }
+}
+
+static void
+cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont)
+{
+ size_t size;
+
+ SET_MACHINE_STACK_END(&th->machine_stack_end);
+#ifdef __ia64
+ th->machine_register_stack_end = rb_ia64_bsp();
+#endif
+
+ if (th->machine_stack_start > th->machine_stack_end) {
+ size = cont->machine_stack_size = th->machine_stack_start - th->machine_stack_end;
+ cont->machine_stack_src = th->machine_stack_end;
+ }
+ else {
+ size = cont->machine_stack_size = th->machine_stack_end - th->machine_stack_start;
+ cont->machine_stack_src = th->machine_stack_start;
+ }
+
+ if (cont->machine_stack) {
+ REALLOC_N(cont->machine_stack, VALUE, size);
+ }
+ else {
+ cont->machine_stack = ALLOC_N(VALUE, size);
+ }
+
+ FLUSH_REGISTER_WINDOWS;
+ MEMCPY(cont->machine_stack, cont->machine_stack_src, VALUE, size);
+
+#ifdef __ia64
+ rb_ia64_flushrs();
+ size = cont->machine_register_stack_size = th->machine_register_stack_end - th->machine_register_stack_start;
+ cont->machine_register_stack_src = th->machine_register_stack_start;
+ if (cont->machine_register_stack) {
+ REALLOC_N(cont->machine_register_stack, VALUE, size);
+ }
+ else {
+ cont->machine_register_stack = ALLOC_N(VALUE, size);
+ }
+
+ MEMCPY(cont->machine_register_stack, cont->machine_register_stack_src, VALUE, size);
+#endif
+}
+
+static const rb_data_type_t cont_data_type = {
+ "continuation",
+ {cont_mark, cont_free, cont_memsize,},
+};
+
+static void
+cont_save_thread(rb_context_t *cont, rb_thread_t *th)
+{
+ /* save thread context */
+ cont->saved_thread = *th;
+ /* saved_thread->machine_stack_(start|end) should be NULL */
+ /* because it may happen GC afterward */
+ cont->saved_thread.machine_stack_start = 0;
+ cont->saved_thread.machine_stack_end = 0;
+#ifdef __ia64
+ cont->saved_thread.machine_register_stack_start = 0;
+ cont->saved_thread.machine_register_stack_end = 0;
+#endif
+}
+
+static void
+cont_init(rb_context_t *cont, rb_thread_t *th)
+{
+ /* save thread context */
+ cont_save_thread(cont, th);
+ cont->saved_thread.local_storage = 0;
+}
+
+static rb_context_t *
+cont_new(VALUE klass)
+{
+ rb_context_t *cont;
+ volatile VALUE contval;
+ rb_thread_t *th = GET_THREAD();
+
+ THREAD_MUST_BE_RUNNING(th);
+ contval = TypedData_Make_Struct(klass, rb_context_t, &cont_data_type, cont);
+ cont->self = contval;
+ cont_init(cont, th);
+ return cont;
+}
+
+static VALUE
+cont_capture(volatile int *stat)
+{
+ rb_context_t *cont;
+ rb_thread_t *th = GET_THREAD(), *sth;
+ volatile VALUE contval;
+
+ THREAD_MUST_BE_RUNNING(th);
+ rb_vm_stack_to_heap(th);
+ cont = cont_new(rb_cContinuation);
+ contval = cont->self;
+ sth = &cont->saved_thread;
+
+#ifdef CAPTURE_JUST_VALID_VM_STACK
+ cont->vm_stack_slen = th->cfp->sp + th->mark_stack_len - th->stack;
+ cont->vm_stack_clen = th->stack + th->stack_size - (VALUE*)th->cfp;
+ cont->vm_stack = ALLOC_N(VALUE, cont->vm_stack_slen + cont->vm_stack_clen);
+ MEMCPY(cont->vm_stack, th->stack, VALUE, cont->vm_stack_slen);
+ MEMCPY(cont->vm_stack + cont->vm_stack_slen, (VALUE*)th->cfp, VALUE, cont->vm_stack_clen);
+#else
+ cont->vm_stack = ALLOC_N(VALUE, th->stack_size);
+ MEMCPY(cont->vm_stack, th->stack, VALUE, th->stack_size);
+#endif
+ sth->stack = 0;
+
+ cont_save_machine_stack(th, cont);
+
+ if (ruby_setjmp(cont->jmpbuf)) {
+ volatile VALUE value;
+
+ value = cont->value;
+ if (cont->argc == -1) rb_exc_raise(value);
+ cont->value = Qnil;
+ *stat = 1;
+ return value;
+ }
+ else {
+ *stat = 0;
+ return contval;
+ }
+}
+
+static void
+cont_restore_thread(rb_context_t *cont)
+{
+ rb_thread_t *th = GET_THREAD(), *sth = &cont->saved_thread;
+
+ /* restore thread context */
+ if (cont->type == CONTINUATION_CONTEXT) {
+ /* continuation */
+ VALUE fib;
+
+ th->fiber = sth->fiber;
+ fib = th->fiber ? th->fiber : th->root_fiber;
+
+ if (fib) {
+ rb_fiber_t *fcont;
+ GetFiberPtr(fib, fcont);
+ th->stack_size = fcont->cont.saved_thread.stack_size;
+ th->stack = fcont->cont.saved_thread.stack;
+ }
+#ifdef CAPTURE_JUST_VALID_VM_STACK
+ MEMCPY(th->stack, cont->vm_stack, VALUE, cont->vm_stack_slen);
+ MEMCPY(th->stack + sth->stack_size - cont->vm_stack_clen,
+ cont->vm_stack + cont->vm_stack_slen, VALUE, cont->vm_stack_clen);
+#else
+ MEMCPY(th->stack, cont->vm_stack, VALUE, sth->stack_size);
+#endif
+ }
+ else {
+ /* fiber */
+ th->stack = sth->stack;
+ th->stack_size = sth->stack_size;
+ th->local_storage = sth->local_storage;
+ th->fiber = cont->self;
+ }
+
+ th->cfp = sth->cfp;
+ th->safe_level = sth->safe_level;
+ th->raised_flag = sth->raised_flag;
+ th->state = sth->state;
+ th->status = sth->status;
+ th->tag = sth->tag;
+ th->protect_tag = sth->protect_tag;
+ th->errinfo = sth->errinfo;
+ th->first_proc = sth->first_proc;
+}
+
+#if FIBER_USE_NATIVE
+#ifdef _WIN32
+static void
+fiber_set_stack_location(void)
+{
+ rb_thread_t *th = GET_THREAD();
+ VALUE *ptr;
+
+ SET_MACHINE_STACK_END(&ptr);
+ th->machine_stack_start = (void*)(((VALUE)ptr & RB_PAGE_MASK) + STACK_UPPER((void *)&ptr, 0, RB_PAGE_SIZE));
+}
+
+static VOID CALLBACK
+fiber_entry(void *arg)
+{
+ fiber_set_stack_location();
+ rb_fiber_start();
+}
+#else /* _WIN32 */
+
+/*
+ * FreeBSD require a first (i.e. addr) argument of mmap(2) is not NULL
+ * if MAP_STACK is passed.
+ * http://www.FreeBSD.org/cgi/query-pr.cgi?pr=158755
+ */
+#if defined(MAP_STACK) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
+#define FIBER_STACK_FLAGS (MAP_PRIVATE | MAP_ANON | MAP_STACK)
+#else
+#define FIBER_STACK_FLAGS (MAP_PRIVATE | MAP_ANON)
+#endif
+
+static char*
+fiber_machine_stack_alloc(size_t size)
+{
+ char *ptr;
+
+ if (machine_stack_cache_index > 0) {
+ if (machine_stack_cache[machine_stack_cache_index - 1].size == (size / sizeof(VALUE))) {
+ ptr = machine_stack_cache[machine_stack_cache_index - 1].ptr;
+ machine_stack_cache_index--;
+ machine_stack_cache[machine_stack_cache_index].ptr = NULL;
+ machine_stack_cache[machine_stack_cache_index].size = 0;
+ }
+ else{
+ /* TODO handle multiple machine stack size */
+ rb_bug("machine_stack_cache size is not canonicalized");
+ }
+ }
+ else {
+ void *page;
+ STACK_GROW_DIR_DETECTION;
+
+ ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, FIBER_STACK_FLAGS, -1, 0);
+ if (ptr == MAP_FAILED) {
+ rb_raise(rb_eFiberError, "can't alloc machine stack to fiber");
+ }
+
+ /* guard page setup */
+ page = ptr + STACK_DIR_UPPER(size - RB_PAGE_SIZE, 0);
+ if (mprotect(page, RB_PAGE_SIZE, PROT_NONE) < 0) {
+ rb_raise(rb_eFiberError, "mprotect failed");
+ }
+ }
+
+ return ptr;
+}
+#endif
+
+static void
+fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
+{
+ rb_thread_t *sth = &fib->cont.saved_thread;
+
+#ifdef _WIN32
+ fib->fib_handle = CreateFiberEx(size - 1, size, 0, fiber_entry, NULL);
+ if (!fib->fib_handle) {
+ /* try to release unnecessary fibers & retry to create */
+ rb_gc();
+ fib->fib_handle = CreateFiberEx(size - 1, size, 0, fiber_entry, NULL);
+ if (!fib->fib_handle) {
+ rb_raise(rb_eFiberError, "can't create fiber");
+ }
+ }
+ sth->machine_stack_maxsize = size;
+#else /* not WIN32 */
+ ucontext_t *context = &fib->context;
+ char *ptr;
+ STACK_GROW_DIR_DETECTION;
+
+ getcontext(context);
+ ptr = fiber_machine_stack_alloc(size);
+ context->uc_link = NULL;
+ context->uc_stack.ss_sp = ptr;
+ context->uc_stack.ss_size = size;
+ makecontext(context, rb_fiber_start, 0);
+ sth->machine_stack_start = (VALUE*)(ptr + STACK_DIR_UPPER(0, size));
+ sth->machine_stack_maxsize = size - RB_PAGE_SIZE;
+#endif
+#ifdef __ia64
+ sth->machine_register_stack_maxsize = sth->machine_stack_maxsize;
+#endif
+}
+
+NOINLINE(static void fiber_setcontext(rb_fiber_t *newfib, rb_fiber_t *oldfib));
+
+static void
+fiber_setcontext(rb_fiber_t *newfib, rb_fiber_t *oldfib)
+{
+ rb_thread_t *th = GET_THREAD(), *sth = &newfib->cont.saved_thread;
+
+ if (newfib->status != RUNNING) {
+ fiber_initialize_machine_stack_context(newfib, th->vm->default_params.fiber_machine_stack_size);
+ }
+
+ /* restore thread context */
+ cont_restore_thread(&newfib->cont);
+ th->machine_stack_maxsize = sth->machine_stack_maxsize;
+ if (sth->machine_stack_end && (newfib != oldfib)) {
+ rb_bug("fiber_setcontext: sth->machine_stack_end has non zero value");
+ }
+
+ /* save oldfib's machine stack */
+ if (oldfib->status != TERMINATED) {
+ STACK_GROW_DIR_DETECTION;
+ SET_MACHINE_STACK_END(&th->machine_stack_end);
+ if (STACK_DIR_UPPER(0, 1)) {
+ oldfib->cont.machine_stack_size = th->machine_stack_start - th->machine_stack_end;
+ oldfib->cont.machine_stack = th->machine_stack_end;
+ }
+ else {
+ oldfib->cont.machine_stack_size = th->machine_stack_end - th->machine_stack_start;
+ oldfib->cont.machine_stack = th->machine_stack_start;
+ }
+ }
+ /* exchange machine_stack_start between oldfib and newfib */
+ oldfib->cont.saved_thread.machine_stack_start = th->machine_stack_start;
+ th->machine_stack_start = sth->machine_stack_start;
+ /* oldfib->machine_stack_end should be NULL */
+ oldfib->cont.saved_thread.machine_stack_end = 0;
+#ifndef _WIN32
+ if (!newfib->context.uc_stack.ss_sp && th->root_fiber != newfib->cont.self) {
+ rb_bug("non_root_fiber->context.uc_stac.ss_sp should not be NULL");
+ }
+#endif
+
+ /* swap machine context */
+#ifdef _WIN32
+ SwitchToFiber(newfib->fib_handle);
+#else
+ swapcontext(&oldfib->context, &newfib->context);
+#endif
+}
+#endif
+
+NOINLINE(NORETURN(static void cont_restore_1(rb_context_t *)));
+
+static void
+cont_restore_1(rb_context_t *cont)
+{
+ cont_restore_thread(cont);
+
+ /* restore machine stack */
+#ifdef _M_AMD64
+ {
+ /* workaround for x64 SEH */
+ jmp_buf buf;
+ setjmp(buf);
+ ((_JUMP_BUFFER*)(&cont->jmpbuf))->Frame =
+ ((_JUMP_BUFFER*)(&buf))->Frame;
+ }
+#endif
+ if (cont->machine_stack_src) {
+ FLUSH_REGISTER_WINDOWS;
+ MEMCPY(cont->machine_stack_src, cont->machine_stack,
+ VALUE, cont->machine_stack_size);
+ }
+
+#ifdef __ia64
+ if (cont->machine_register_stack_src) {
+ MEMCPY(cont->machine_register_stack_src, cont->machine_register_stack,
+ VALUE, cont->machine_register_stack_size);
+ }
+#endif
+
+ ruby_longjmp(cont->jmpbuf, 1);
+}
+
+NORETURN(NOINLINE(static void cont_restore_0(rb_context_t *, VALUE *)));
+
+#ifdef __ia64
+#define C(a) rse_##a##0, rse_##a##1, rse_##a##2, rse_##a##3, rse_##a##4
+#define E(a) rse_##a##0= rse_##a##1= rse_##a##2= rse_##a##3= rse_##a##4
+static volatile int C(a), C(b), C(c), C(d), C(e);
+static volatile int C(f), C(g), C(h), C(i), C(j);
+static volatile int C(k), C(l), C(m), C(n), C(o);
+static volatile int C(p), C(q), C(r), C(s), C(t);
+#if 0
+{/* the above lines make cc-mode.el confused so much */}
+#endif
+int rb_dummy_false = 0;
+NORETURN(NOINLINE(static void register_stack_extend(rb_context_t *, VALUE *, VALUE *)));
+static void
+register_stack_extend(rb_context_t *cont, VALUE *vp, VALUE *curr_bsp)
+{
+ if (rb_dummy_false) {
+ /* use registers as much as possible */
+ E(a) = E(b) = E(c) = E(d) = E(e) =
+ E(f) = E(g) = E(h) = E(i) = E(j) =
+ E(k) = E(l) = E(m) = E(n) = E(o) =
+ E(p) = E(q) = E(r) = E(s) = E(t) = 0;
+ E(a) = E(b) = E(c) = E(d) = E(e) =
+ E(f) = E(g) = E(h) = E(i) = E(j) =
+ E(k) = E(l) = E(m) = E(n) = E(o) =
+ E(p) = E(q) = E(r) = E(s) = E(t) = 0;
+ }
+ if (curr_bsp < cont->machine_register_stack_src+cont->machine_register_stack_size) {
+ register_stack_extend(cont, vp, (VALUE*)rb_ia64_bsp());
+ }
+ cont_restore_0(cont, vp);
+}
+#undef C
+#undef E
+#endif
+
+static void
+cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
+{
+ if (cont->machine_stack_src) {
+#ifdef HAVE_ALLOCA
+#define STACK_PAD_SIZE 1
+#else
+#define STACK_PAD_SIZE 1024
+#endif
+ VALUE space[STACK_PAD_SIZE];
+
+#if !STACK_GROW_DIRECTION
+ if (addr_in_prev_frame > &space[0]) {
+ /* Stack grows downward */
+#endif
+#if STACK_GROW_DIRECTION <= 0
+ volatile VALUE *const end = cont->machine_stack_src;
+ if (&space[0] > end) {
+# ifdef HAVE_ALLOCA
+ volatile VALUE *sp = ALLOCA_N(VALUE, &space[0] - end);
+ space[0] = *sp;
+# else
+ cont_restore_0(cont, &space[0]);
+# endif
+ }
+#endif
+#if !STACK_GROW_DIRECTION
+ }
+ else {
+ /* Stack grows upward */
+#endif
+#if STACK_GROW_DIRECTION >= 0
+ volatile VALUE *const end = cont->machine_stack_src + cont->machine_stack_size;
+ if (&space[STACK_PAD_SIZE] < end) {
+# ifdef HAVE_ALLOCA
+ volatile VALUE *sp = ALLOCA_N(VALUE, end - &space[STACK_PAD_SIZE]);
+ space[0] = *sp;
+# else
+ cont_restore_0(cont, &space[STACK_PAD_SIZE-1]);
+# endif
+ }
+#endif
+#if !STACK_GROW_DIRECTION
+ }
+#endif
+ }
+ cont_restore_1(cont);
+}
+#ifdef __ia64
+#define cont_restore_0(cont, vp) register_stack_extend((cont), (vp), (VALUE*)rb_ia64_bsp())
+#endif
+
+/*
+ * Document-class: Continuation
+ *
+ * Continuation objects are generated by Kernel#callcc,
+ * after having +require+d <i>continuation</i>. They hold
+ * a return address and execution context, allowing a nonlocal return
+ * to the end of the <code>callcc</code> block from anywhere within a
+ * program. Continuations are somewhat analogous to a structured
+ * version of C's <code>setjmp/longjmp</code> (although they contain
+ * more state, so you might consider them closer to threads).
+ *
+ * For instance:
+ *
+ * require "continuation"
+ * arr = [ "Freddie", "Herbie", "Ron", "Max", "Ringo" ]
+ * callcc{|cc| $cc = cc}
+ * puts(message = arr.shift)
+ * $cc.call unless message =~ /Max/
+ *
+ * <em>produces:</em>
+ *
+ * Freddie
+ * Herbie
+ * Ron
+ * Max
+ *
+ * This (somewhat contrived) example allows the inner loop to abandon
+ * processing early:
+ *
+ * require "continuation"
+ * callcc {|cont|
+ * for i in 0..4
+ * print "\n#{i}: "
+ * for j in i*5...(i+1)*5
+ * cont.call() if j == 17
+ * printf "%3d", j
+ * end
+ * end
+ * }
+ * puts
+ *
+ * <em>produces:</em>
+ *
+ * 0: 0 1 2 3 4
+ * 1: 5 6 7 8 9
+ * 2: 10 11 12 13 14
+ * 3: 15 16
+ */
+
+/*
+ * call-seq:
+ * callcc {|cont| block } -> obj
+ *
+ * Generates a Continuation object, which it passes to
+ * the associated block. You need to <code>require
+ * 'continuation'</code> before using this method. Performing a
+ * <em>cont</em><code>.call</code> will cause the #callcc
+ * to return (as will falling through the end of the block). The
+ * value returned by the #callcc is the value of the
+ * block, or the value passed to <em>cont</em><code>.call</code>. See
+ * class Continuation for more details. Also see
+ * Kernel#throw for an alternative mechanism for
+ * unwinding a call stack.
+ */
+
+static VALUE
+rb_callcc(VALUE self)
+{
+ volatile int called;
+ volatile VALUE val = cont_capture(&called);
+
+ if (called) {
+ return val;
+ }
+ else {
+ return rb_yield(val);
+ }
+}
+
+static VALUE
+make_passing_arg(int argc, VALUE *argv)
+{
+ switch (argc) {
+ case 0:
+ return Qnil;
+ case 1:
+ return argv[0];
+ default:
+ return rb_ary_new4(argc, argv);
+ }
+}
+
+/*
+ * call-seq:
+ * cont.call(args, ...)
+ * cont[args, ...]
+ *
+ * Invokes the continuation. The program continues from the end of the
+ * <code>callcc</code> block. If no arguments are given, the original
+ * <code>callcc</code> returns <code>nil</code>. If one argument is
+ * given, <code>callcc</code> returns it. Otherwise, an array
+ * containing <i>args</i> is returned.
+ *
+ * callcc {|cont| cont.call } #=> nil
+ * callcc {|cont| cont.call 1 } #=> 1
+ * callcc {|cont| cont.call 1, 2, 3 } #=> [1, 2, 3]
+ */
+
+static VALUE
+rb_cont_call(int argc, VALUE *argv, VALUE contval)
+{
+ rb_context_t *cont;
+ rb_thread_t *th = GET_THREAD();
+ GetContPtr(contval, cont);
+
+ if (cont->saved_thread.self != th->self) {
+ rb_raise(rb_eRuntimeError, "continuation called across threads");
+ }
+ if (cont->saved_thread.protect_tag != th->protect_tag) {
+ rb_raise(rb_eRuntimeError, "continuation called across stack rewinding barrier");
+ }
+ if (cont->saved_thread.fiber) {
+ rb_fiber_t *fcont;
+ GetFiberPtr(cont->saved_thread.fiber, fcont);
+
+ if (th->fiber != cont->saved_thread.fiber) {
+ rb_raise(rb_eRuntimeError, "continuation called across fiber");
+ }
+ }
+
+ cont->argc = argc;
+ cont->value = make_passing_arg(argc, argv);
+
+ /* restore `tracing' context. see [Feature #4347] */
+ th->trace_arg = cont->saved_thread.trace_arg;
+
+ cont_restore_0(cont, &contval);
+ return Qnil; /* unreachable */
+}
+
+/*********/
+/* fiber */
+/*********/
+
+/*
+ * Document-class: Fiber
+ *
+ * Fibers are primitives for implementing light weight cooperative
+ * concurrency in Ruby. Basically they are a means of creating code blocks
+ * that can be paused and resumed, much like threads. The main difference
+ * is that they are never preempted and that the scheduling must be done by
+ * the programmer and not the VM.
+ *
+ * As opposed to other stackless light weight concurrency models, each fiber
+ * comes with a small 4KB stack. This enables the fiber to be paused from deeply
+ * nested function calls within the fiber block.
+ *
+ * When a fiber is created it will not run automatically. Rather it must be
+ * be explicitly asked to run using the <code>Fiber#resume</code> method.
+ * The code running inside the fiber can give up control by calling
+ * <code>Fiber.yield</code> in which case it yields control back to caller
+ * (the caller of the <code>Fiber#resume</code>).
+ *
+ * Upon yielding or termination the Fiber returns the value of the last
+ * executed expression
+ *
+ * For instance:
+ *
+ * fiber = Fiber.new do
+ * Fiber.yield 1
+ * 2
+ * end
+ *
+ * puts fiber.resume
+ * puts fiber.resume
+ * puts fiber.resume
+ *
+ * <em>produces</em>
+ *
+ * 1
+ * 2
+ * FiberError: dead fiber called
+ *
+ * The <code>Fiber#resume</code> method accepts an arbitrary number of
+ * parameters, if it is the first call to <code>resume</code> then they
+ * will be passed as block arguments. Otherwise they will be the return
+ * value of the call to <code>Fiber.yield</code>
+ *
+ * Example:
+ *
+ * fiber = Fiber.new do |first|
+ * second = Fiber.yield first + 2
+ * end
+ *
+ * puts fiber.resume 10
+ * puts fiber.resume 14
+ * puts fiber.resume 18
+ *
+ * <em>produces</em>
+ *
+ * 12
+ * 14
+ * FiberError: dead fiber called
+ *
+ */
+
+static const rb_data_type_t fiber_data_type = {
+ "fiber",
+ {fiber_mark, fiber_free, fiber_memsize,},
+};
+
+static VALUE
+fiber_alloc(VALUE klass)
+{
+ return TypedData_Wrap_Struct(klass, &fiber_data_type, 0);
+}
+
+static rb_fiber_t*
+fiber_t_alloc(VALUE fibval)
+{
+ rb_fiber_t *fib;
+ rb_thread_t *th = GET_THREAD();
+
+ if (DATA_PTR(fibval) != 0) {
+ rb_raise(rb_eRuntimeError, "cannot initialize twice");
+ }
+
+ THREAD_MUST_BE_RUNNING(th);
+ fib = ALLOC(rb_fiber_t);
+ memset(fib, 0, sizeof(rb_fiber_t));
+ fib->cont.self = fibval;
+ fib->cont.type = FIBER_CONTEXT;
+ cont_init(&fib->cont, th);
+ fib->prev = Qnil;
+ fib->status = CREATED;
+
+ DATA_PTR(fibval) = fib;
+
+ return fib;
+}
+
+static VALUE
+fiber_init(VALUE fibval, VALUE proc)
+{
+ rb_fiber_t *fib = fiber_t_alloc(fibval);
+ rb_context_t *cont = &fib->cont;
+ rb_thread_t *th = &cont->saved_thread;
+
+ /* initialize cont */
+ cont->vm_stack = 0;
+
+ th->stack = 0;
+ th->stack_size = 0;
+
+ fiber_link_join(fib);
+
+ th->stack_size = th->vm->default_params.fiber_vm_stack_size / sizeof(VALUE);
+ th->stack = ALLOC_N(VALUE, th->stack_size);
+
+ th->cfp = (void *)(th->stack + th->stack_size);
+ th->cfp--;
+ th->cfp->pc = 0;
+ th->cfp->sp = th->stack + 1;
+#if VM_DEBUG_BP_CHECK
+ th->cfp->bp_check = 0;
+#endif
+ th->cfp->ep = th->stack;
+ *th->cfp->ep = VM_ENVVAL_BLOCK_PTR(0);
+ th->cfp->self = Qnil;
+ th->cfp->klass = Qnil;
+ th->cfp->flag = 0;
+ th->cfp->iseq = 0;
+ th->cfp->proc = 0;
+ th->cfp->block_iseq = 0;
+ th->cfp->me = 0;
+ th->tag = 0;
+ th->local_storage = st_init_numtable();
+
+ th->first_proc = proc;
+
+#if !FIBER_USE_NATIVE
+ MEMCPY(&cont->jmpbuf, &th->root_jmpbuf, rb_jmpbuf_t, 1);
+#endif
+
+ return fibval;
+}
+
+/* :nodoc: */
+static VALUE
+rb_fiber_init(VALUE fibval)
+{
+ return fiber_init(fibval, rb_block_proc());
+}
+
+VALUE
+rb_fiber_new(VALUE (*func)(ANYARGS), VALUE obj)
+{
+ return fiber_init(fiber_alloc(rb_cFiber), rb_proc_new(func, obj));
+}
+
+static VALUE
+return_fiber(void)
+{
+ rb_fiber_t *fib;
+ VALUE curr = rb_fiber_current();
+ VALUE prev;
+ GetFiberPtr(curr, fib);
+
+ prev = fib->prev;
+ if (NIL_P(prev)) {
+ const VALUE root_fiber = GET_THREAD()->root_fiber;
+
+ if (root_fiber == curr) {
+ rb_raise(rb_eFiberError, "can't yield from root fiber");
+ }
+ return root_fiber;
+ }
+ else {
+ fib->prev = Qnil;
+ return prev;
+ }
+}
+
+VALUE rb_fiber_transfer(VALUE fib, int argc, VALUE *argv);
+
+static void
+rb_fiber_terminate(rb_fiber_t *fib)
+{
+ VALUE value = fib->cont.value;
+ fib->status = TERMINATED;
+#if FIBER_USE_NATIVE && !defined(_WIN32)
+ /* Ruby must not switch to other thread until storing terminated_machine_stack */
+ terminated_machine_stack.ptr = fib->context.uc_stack.ss_sp;
+ terminated_machine_stack.size = fib->context.uc_stack.ss_size / sizeof(VALUE);
+ fib->context.uc_stack.ss_sp = NULL;
+ fib->cont.machine_stack = NULL;
+ fib->cont.machine_stack_size = 0;
+#endif
+ rb_fiber_transfer(return_fiber(), 1, &value);
+}
+
+void
+rb_fiber_start(void)
+{
+ rb_thread_t *th = GET_THREAD();
+ rb_fiber_t *fib;
+ rb_context_t *cont;
+ rb_proc_t *proc;
+ int state;
+
+ GetFiberPtr(th->fiber, fib);
+ cont = &fib->cont;
+
+ TH_PUSH_TAG(th);
+ if ((state = EXEC_TAG()) == 0) {
+ int argc;
+ VALUE *argv, args;
+ GetProcPtr(cont->saved_thread.first_proc, proc);
+ args = cont->value;
+ argv = (argc = cont->argc) > 1 ? RARRAY_PTR(args) : &args;
+ cont->value = Qnil;
+ th->errinfo = Qnil;
+ th->root_lep = rb_vm_ep_local_ep(proc->block.ep);
+ th->root_svar = Qnil;
+
+ fib->status = RUNNING;
+ cont->value = rb_vm_invoke_proc(th, proc, argc, argv, 0);
+ }
+ TH_POP_TAG();
+
+ if (state) {
+ if (state == TAG_RAISE || state == TAG_FATAL) {
+ rb_threadptr_pending_interrupt_enque(th, th->errinfo);
+ }
+ else {
+ VALUE err = rb_vm_make_jump_tag_but_local_jump(state, th->errinfo);
+ if (!NIL_P(err))
+ rb_threadptr_pending_interrupt_enque(th, err);
+ }
+ RUBY_VM_SET_INTERRUPT(th);
+ }
+
+ rb_fiber_terminate(fib);
+ rb_bug("rb_fiber_start: unreachable");
+}
+
+static rb_fiber_t *
+root_fiber_alloc(rb_thread_t *th)
+{
+ rb_fiber_t *fib;
+ /* no need to allocate vm stack */
+ fib = fiber_t_alloc(fiber_alloc(rb_cFiber));
+ fib->cont.type = ROOT_FIBER_CONTEXT;
+#if FIBER_USE_NATIVE
+#ifdef _WIN32
+ fib->fib_handle = ConvertThreadToFiber(0);
+#endif
+#endif
+ fib->status = RUNNING;
+ fib->prev_fiber = fib->next_fiber = fib;
+
+ return fib;
+}
+
+VALUE
+rb_fiber_current(void)
+{
+ rb_thread_t *th = GET_THREAD();
+ if (th->fiber == 0) {
+ /* save root */
+ rb_fiber_t *fib = root_fiber_alloc(th);
+ th->root_fiber = th->fiber = fib->cont.self;
+ }
+ return th->fiber;
+}
+
+static VALUE
+fiber_store(rb_fiber_t *next_fib)
+{
+ rb_thread_t *th = GET_THREAD();
+ rb_fiber_t *fib;
+
+ if (th->fiber) {
+ GetFiberPtr(th->fiber, fib);
+ cont_save_thread(&fib->cont, th);
+ }
+ else {
+ /* create current fiber */
+ fib = root_fiber_alloc(th);
+ th->root_fiber = th->fiber = fib->cont.self;
+ }
+
+#if !FIBER_USE_NATIVE
+ cont_save_machine_stack(th, &fib->cont);
+#endif
+
+ if (FIBER_USE_NATIVE || ruby_setjmp(fib->cont.jmpbuf)) {
+#if FIBER_USE_NATIVE
+ fiber_setcontext(next_fib, fib);
+#ifndef _WIN32
+ if (terminated_machine_stack.ptr) {
+ if (machine_stack_cache_index < MAX_MAHINE_STACK_CACHE) {
+ machine_stack_cache[machine_stack_cache_index].ptr = terminated_machine_stack.ptr;
+ machine_stack_cache[machine_stack_cache_index].size = terminated_machine_stack.size;
+ machine_stack_cache_index++;
+ }
+ else {
+ if (terminated_machine_stack.ptr != fib->cont.machine_stack) {
+ munmap((void*)terminated_machine_stack.ptr, terminated_machine_stack.size * sizeof(VALUE));
+ }
+ else {
+ rb_bug("terminated fiber resumed");
+ }
+ }
+ terminated_machine_stack.ptr = NULL;
+ terminated_machine_stack.size = 0;
+ }
+#endif
+#endif
+ /* restored */
+ GetFiberPtr(th->fiber, fib);
+ if (fib->cont.argc == -1) rb_exc_raise(fib->cont.value);
+ return fib->cont.value;
+ }
+#if !FIBER_USE_NATIVE
+ else {
+ return Qundef;
+ }
+#endif
+}
+
+static inline VALUE
+fiber_switch(VALUE fibval, int argc, VALUE *argv, int is_resume)
+{
+ VALUE value;
+ rb_fiber_t *fib;
+ rb_context_t *cont;
+ rb_thread_t *th = GET_THREAD();
+
+ GetFiberPtr(fibval, fib);
+ cont = &fib->cont;
+
+ if (th->fiber == fibval) {
+ /* ignore fiber context switch
+ * because destination fiber is same as current fiber
+ */
+ return make_passing_arg(argc, argv);
+ }
+
+ if (cont->saved_thread.self != th->self) {
+ rb_raise(rb_eFiberError, "fiber called across threads");
+ }
+ else if (cont->saved_thread.protect_tag != th->protect_tag) {
+ rb_raise(rb_eFiberError, "fiber called across stack rewinding barrier");
+ }
+ else if (fib->status == TERMINATED) {
+ value = rb_exc_new2(rb_eFiberError, "dead fiber called");
+ if (th->fiber != fibval) {
+ GetFiberPtr(th->fiber, fib);
+ if (fib->status != TERMINATED) rb_exc_raise(value);
+ fibval = th->root_fiber;
+ }
+ else {
+ fibval = fib->prev;
+ if (NIL_P(fibval)) fibval = th->root_fiber;
+ }
+ GetFiberPtr(fibval, fib);
+ cont = &fib->cont;
+ cont->argc = -1;
+ cont->value = value;
+#if FIBER_USE_NATIVE
+ {
+ VALUE oldfibval;
+ rb_fiber_t *oldfib;
+ oldfibval = rb_fiber_current();
+ GetFiberPtr(oldfibval, oldfib);
+ fiber_setcontext(fib, oldfib);
+ }
+#else
+ cont_restore_0(cont, &value);
+#endif
+ }
+
+ if (is_resume) {
+ fib->prev = rb_fiber_current();
+ }
+ else {
+ /* restore `tracing' context. see [Feature #4347] */
+ th->trace_arg = cont->saved_thread.trace_arg;
+ }
+
+ cont->argc = argc;
+ cont->value = make_passing_arg(argc, argv);
+
+ value = fiber_store(fib);
+#if !FIBER_USE_NATIVE
+ if (value == Qundef) {
+ cont_restore_0(cont, &value);
+ rb_bug("rb_fiber_resume: unreachable");
+ }
+#endif
+ RUBY_VM_CHECK_INTS(th);
+
+ return value;
+}
+
+VALUE
+rb_fiber_transfer(VALUE fib, int argc, VALUE *argv)
+{
+ return fiber_switch(fib, argc, argv, 0);
+}
+
+VALUE
+rb_fiber_resume(VALUE fibval, int argc, VALUE *argv)
+{
+ rb_fiber_t *fib;
+ GetFiberPtr(fibval, fib);
+
+ if (fib->prev != Qnil || fib->cont.type == ROOT_FIBER_CONTEXT) {
+ rb_raise(rb_eFiberError, "double resume");
+ }
+ if (fib->transfered != 0) {
+ rb_raise(rb_eFiberError, "cannot resume transferred Fiber");
+ }
+
+ return fiber_switch(fibval, argc, argv, 1);
+}
+
+VALUE
+rb_fiber_yield(int argc, VALUE *argv)
+{
+ return rb_fiber_transfer(return_fiber(), argc, argv);
+}
+
+void
+rb_fiber_reset_root_local_storage(VALUE thval)
+{
+ rb_thread_t *th;
+ rb_fiber_t *fib;
+
+ GetThreadPtr(thval, th);
+ if (th->root_fiber && th->root_fiber != th->fiber) {
+ GetFiberPtr(th->root_fiber, fib);
+ th->local_storage = fib->cont.saved_thread.local_storage;
+ }
+}
+
+/*
+ * call-seq:
+ * fiber.alive? -> true or false
+ *
+ * Returns true if the fiber can still be resumed (or transferred
+ * to). After finishing execution of the fiber block this method will
+ * always return false. You need to <code>require 'fiber'</code>
+ * before using this method.
+ */
+VALUE
+rb_fiber_alive_p(VALUE fibval)
+{
+ rb_fiber_t *fib;
+ GetFiberPtr(fibval, fib);
+ return fib->status != TERMINATED ? Qtrue : Qfalse;
+}
+
+/*
+ * call-seq:
+ * fiber.resume(args, ...) -> obj
+ *
+ * Resumes the fiber from the point at which the last <code>Fiber.yield</code>
+ * was called, or starts running it if it is the first call to
+ * <code>resume</code>. Arguments passed to resume will be the value of
+ * the <code>Fiber.yield</code> expression or will be passed as block
+ * parameters to the fiber's block if this is the first <code>resume</code>.
+ *
+ * Alternatively, when resume is called it evaluates to the arguments passed
+ * to the next <code>Fiber.yield</code> statement inside the fiber's block
+ * or to the block value if it runs to completion without any
+ * <code>Fiber.yield</code>
+ */
+static VALUE
+rb_fiber_m_resume(int argc, VALUE *argv, VALUE fib)
+{
+ return rb_fiber_resume(fib, argc, argv);
+}
+
+/*
+ * call-seq:
+ * fiber.transfer(args, ...) -> obj
+ *
+ * Transfer control to another fiber, resuming it from where it last
+ * stopped or starting it if it was not resumed before. The calling
+ * fiber will be suspended much like in a call to
+ * <code>Fiber.yield</code>. You need to <code>require 'fiber'</code>
+ * before using this method.
+ *
+ * The fiber which receives the transfer call is treats it much like
+ * a resume call. Arguments passed to transfer are treated like those
+ * passed to resume.
+ *
+ * You cannot resume a fiber that transferred control to another one.
+ * This will cause a double resume error. You need to transfer control
+ * back to this fiber before it can yield and resume.
+ *
+ * Example:
+ *
+ * fiber1 = Fiber.new do
+ * puts "In Fiber 1"
+ * Fiber.yield
+ * end
+ *
+ * fiber2 = Fiber.new do
+ * puts "In Fiber 2"
+ * fiber1.transfer
+ * puts "Never see this message"
+ * end
+ *
+ * fiber3 = Fiber.new do
+ * puts "In Fiber 3"
+ * end
+ *
+ * fiber2.resume
+ * fiber3.resume
+ *
+ * <em>produces</em>
+ *
+ * In fiber 2
+ * In fiber 1
+ * In fiber 3
+ *
+ */
+static VALUE
+rb_fiber_m_transfer(int argc, VALUE *argv, VALUE fibval)
+{
+ rb_fiber_t *fib;
+ GetFiberPtr(fibval, fib);
+ fib->transfered = 1;
+ return rb_fiber_transfer(fibval, argc, argv);
+}
+
+/*
+ * call-seq:
+ * Fiber.yield(args, ...) -> obj
+ *
+ * Yields control back to the context that resumed the fiber, passing
+ * along any arguments that were passed to it. The fiber will resume
+ * processing at this point when <code>resume</code> is called next.
+ * Any arguments passed to the next <code>resume</code> will be the
+ * value that this <code>Fiber.yield</code> expression evaluates to.
+ */
+static VALUE
+rb_fiber_s_yield(int argc, VALUE *argv, VALUE klass)
+{
+ return rb_fiber_yield(argc, argv);
+}
+
+/*
+ * call-seq:
+ * Fiber.current() -> fiber
+ *
+ * Returns the current fiber. You need to <code>require 'fiber'</code>
+ * before using this method. If you are not running in the context of
+ * a fiber this method will return the root fiber.
+ */
+static VALUE
+rb_fiber_s_current(VALUE klass)
+{
+ return rb_fiber_current();
+}
+
+
+
+/*
+ * Document-class: FiberError
+ *
+ * Raised when an invalid operation is attempted on a Fiber, in
+ * particular when attempting to call/resume a dead fiber,
+ * attempting to yield from the root fiber, or calling a fiber across
+ * threads.
+ *
+ * fiber = Fiber.new{}
+ * fiber.resume #=> nil
+ * fiber.resume #=> FiberError: dead fiber called
+ */
+
+void
+Init_Cont(void)
+{
+#if FIBER_USE_NATIVE
+ rb_thread_t *th = GET_THREAD();
+
+#ifdef _WIN32
+ SYSTEM_INFO info;
+ GetSystemInfo(&info);
+ pagesize = info.dwPageSize;
+#else /* not WIN32 */
+ pagesize = sysconf(_SC_PAGESIZE);
+#endif
+ SET_MACHINE_STACK_END(&th->machine_stack_end);
+#endif
+
+ rb_cFiber = rb_define_class("Fiber", rb_cObject);
+ rb_define_alloc_func(rb_cFiber, fiber_alloc);
+ rb_eFiberError = rb_define_class("FiberError", rb_eStandardError);
+ rb_define_singleton_method(rb_cFiber, "yield", rb_fiber_s_yield, -1);
+ rb_define_method(rb_cFiber, "initialize", rb_fiber_init, 0);
+ rb_define_method(rb_cFiber, "resume", rb_fiber_m_resume, -1);
+}
+
+#if defined __GNUC__ && __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
+void
+ruby_Init_Continuation_body(void)
+{
+ rb_cContinuation = rb_define_class("Continuation", rb_cObject);
+ rb_undef_alloc_func(rb_cContinuation);
+ rb_undef_method(CLASS_OF(rb_cContinuation), "new");
+ rb_define_method(rb_cContinuation, "call", rb_cont_call, -1);
+ rb_define_method(rb_cContinuation, "[]", rb_cont_call, -1);
+ rb_define_global_function("callcc", rb_callcc, 0);
+}
+
+void
+ruby_Init_Fiber_as_Coroutine(void)
+{
+ rb_define_method(rb_cFiber, "transfer", rb_fiber_m_transfer, -1);
+ rb_define_method(rb_cFiber, "alive?", rb_fiber_alive_p, 0);
+ rb_define_singleton_method(rb_cFiber, "current", rb_fiber_s_current, 0);
+}
+
+#if defined __GNUC__ && __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in
index 03208df11c..5bd414d786 100644
--- a/cygwin/GNUmakefile.in
+++ b/cygwin/GNUmakefile.in
@@ -1,14 +1,18 @@
include Makefile
ENABLE_SHARED=@ENABLE_SHARED@
-DLLWRAP = @DLLWRAP@ --target=@target_os@
+DLLWRAP = @DLLWRAP@ --target=@target_os@ --driver-name="$(CC)"
+WINDRES = @WINDRES@ --preprocessor="$(CPP) -xc" -DRC_INVOKED
ifeq (@target_os@,cygwin)
- DLL_BASE_NAME := $(subst .dll,,$(LIBRUBY_SO))
+ DLL_BASE_NAME := $(LIBRUBY_SO:.dll=)
else
DLL_BASE_NAME := $(RUBY_SO_NAME)
DLLWRAP += -mno-cygwin
- VPATH += $(srcdir)/win32
+ VPATH := $(VPATH):$(srcdir)/win32
+ STUBPROGRAM = rubystub$(EXEEXT)
+ IGNOREDPATTERNS = %~ .% %.orig %.rej \#%\#
+ SCRIPTPROGRAMS = $(addsuffix $(EXEEXT),$(filter-out $(IGNOREDPATTERNS),$(notdir $(wildcard $(srcdir)/bin/*))))
endif
ifneq ($(ENABLE_SHARED),yes)
@@ -25,21 +29,34 @@ else
endif
WPROGRAM = $(RUBYW_INSTALL_NAME)$(EXEEXT)
+
+-include uncommon.mk
+
SOLIBS := $(DLL_BASE_NAME).res.@OBJEXT@ $(SOLIBS)
-EXTOBJS += $(@:$(EXEEXT)=.res.@OBJEXT@)
+EXTOBJS += $(if $(filter-out $(RUBYW_INSTALL_NAME),$(@:$(EXEEXT)=)),$(RUBY_INSTALL_NAME),$(@:$(EXEEXT)=)).res.$(OBJEXT)
RCFILES = $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(DLL_BASE_NAME).rc
+RUBYDEF = $(DLL_BASE_NAME).def
ruby: $(PROGRAM)
rubyw: $(WPROGRAM)
+stub: $(STUBPROGRAM)
+scriptbin: $(SCRIPTPROGRAMS)
+
+%$(EXEEXT): bin/% $(STUBPROGRAM)
+ $(ECHO) generating $@
+ $(Q) { cat $(STUBPROGRAM); echo; sed -e '1{' -e '/^#!.*ruby/!i\' -e '#!/bin/ruby' -e '}' $<; } > $@
+ $(Q) chmod +x $@
$(LIBRUBY): $(RUBY_EXP) $(LIBRUBY_SO)
$(RUBY_EXP) $(LIBRUBY_SO): $(DLL_BASE_NAME).res.@OBJEXT@
%.res.@OBJEXT@: %.rc
- @WINDRES@ --include-dir . --include-dir $(<D) --include-dir $(srcdir)/win32 $< $@
+ $(ECHO) compiling $@
+ $(Q) $(WINDRES) --include-dir . --include-dir $(<D) --include-dir $(srcdir)/win32 $< $@
-$(RCFILES): $(RBCONFIG)
- @$(MINIRUBY) $(srcdir)/win32/resource.rb \
+$(RCFILES): $(RBCONFIG) $(srcdir)/revision.h $(srcdir)/win32/resource.rb
+ $(ECHO) generating $@
+ $(Q) $(MINIRUBY) $(srcdir)/win32/resource.rb \
-ruby_name=$(RUBY_INSTALL_NAME) -rubyw_name=$(RUBYW_INSTALL_NAME) \
-so_name=$(DLL_BASE_NAME) \
. $(icondirs) $(srcdir)/win32
@@ -47,32 +64,46 @@ $(RCFILES): $(RBCONFIG)
$(PROGRAM): $(RUBY_INSTALL_NAME).res.@OBJEXT@
$(WPROGRAM): $(RUBYW_INSTALL_NAME).res.@OBJEXT@
@rm -f $@
- $(PURIFY) $(CC) -mwindows -e _mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \
+ $(ECHO) linking $@
+ $(Q) $(PURIFY) $(CC) -mwindows -e $(SYMBOL_PREFIX)mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \
$(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
+$(STUBPROGRAM): $(RUBY_INSTALL_NAME).res.@OBJEXT@ stub.@OBJEXT@
+ @rm -f $@
+ $(ECHO) linking $@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) \
+ stub.@OBJEXT@ $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
$(RUBY_EXP): $(LIBRUBY_A)
- $(DLLWRAP) \
+ $(ECHO) creating $@
+ $(Q) $(DLLWRAP) \
--output-exp=$(RUBY_EXP) \
--export-all $(LIBRUBY_A) $(LIBS) -o $(PROGRAM)
- $(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.o $(SOLIBS) -o $(PROGRAM)
+ $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.o $(SOLIBS) -o $(PROGRAM)
@rm -f $(PROGRAM)
GNUmakefile: $(srcdir)/cygwin/GNUmakefile.in
ifeq (@target_os@,mingw32)
-$(OBJS) $(MAINOBJ): win32/win32.h
+$(OBJS) $(MAINOBJ): win32.h
+
+dir.$(OBJEXT) win32.$(OBJEXT): win32/dir.h
endif
+$(LIBRUBY_SO): $(RUBYDEF)
+
+$(RUBYDEF): $(LIBRUBY_A) $(PREP) $(RBCONFIG)
+ $(ECHO) generating $@
+ $(Q) $(MINIRUBY) $(srcdir)/win32/mkexports.rb -output=$@ $(LIBRUBY_A)
+
+clean-local::
+ @$(RM) $(RUBYDEF)
+
ifeq (@target_os@,cygwin)
-cygwin-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR).dll: $(LIBRUBY_A)
- @NM@ --extern --defined $(LIBRUBY_A) | \
- $(MINIRUBY) -ne 'BEGIN{puts "EXPORTS"}; puts $$1+"=cyg$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)."+$$1 if / [CDT] _(.*)$$/' >rubydll.def
- @DLLWRAP@ -s --def=rubydll.def -o $@
- @rm -f rubydll.def
+cygwin-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY).dll: $(LIBRUBY_A) $(RUBYDEF)
+ $(ECHO) generating $@
+ $(Q) @DLLWRAP@ -s --def=$(RUBYDEF) -o $@
endif
clean-local::
@$(RM) $(RUBY_EXP) $(RCFILES:.rc=.res.@OBJEXT@)
-
-distclean-local::
@$(RM) $(RCFILES)
diff --git a/debug.c b/debug.c
new file mode 100644
index 0000000000..4909a45d17
--- /dev/null
+++ b/debug.c
@@ -0,0 +1,162 @@
+/**********************************************************************
+
+ debug.c -
+
+ $Author$
+ created at: 04/08/25 02:31:54 JST
+
+ Copyright (C) 2004-2007 Koichi Sasada
+
+**********************************************************************/
+
+#include "ruby/ruby.h"
+#include "ruby/encoding.h"
+#include "ruby/util.h"
+#include "vm_debug.h"
+#include "eval_intern.h"
+#include "vm_core.h"
+#include "id.h"
+
+/* for gdb */
+const union {
+ enum ruby_special_consts special_consts;
+ enum ruby_value_type value_type;
+ enum ruby_tag_type tag_type;
+ enum node_type node_type;
+ enum ruby_method_ids method_ids;
+ enum {
+ RUBY_ENCODING_INLINE_MAX = ENCODING_INLINE_MAX,
+ RUBY_ENCODING_SHIFT = ENCODING_SHIFT,
+ RUBY_ENC_CODERANGE_MASK = ENC_CODERANGE_MASK,
+ RUBY_ENC_CODERANGE_UNKNOWN = ENC_CODERANGE_UNKNOWN,
+ RUBY_ENC_CODERANGE_7BIT = ENC_CODERANGE_7BIT,
+ RUBY_ENC_CODERANGE_VALID = ENC_CODERANGE_VALID,
+ RUBY_ENC_CODERANGE_BROKEN = ENC_CODERANGE_BROKEN,
+ RUBY_FL_RESERVED1 = FL_RESERVED1,
+ RUBY_FL_RESERVED2 = FL_RESERVED2,
+ RUBY_FL_FINALIZE = FL_FINALIZE,
+ RUBY_FL_TAINT = FL_TAINT,
+ RUBY_FL_UNTRUSTED = FL_UNTRUSTED,
+ RUBY_FL_EXIVAR = FL_EXIVAR,
+ RUBY_FL_FREEZE = FL_FREEZE,
+ RUBY_FL_SINGLETON = FL_SINGLETON,
+ RUBY_FL_USER0 = FL_USER0,
+ RUBY_FL_USER1 = FL_USER1,
+ RUBY_FL_USER2 = FL_USER2,
+ RUBY_FL_USER3 = FL_USER3,
+ RUBY_FL_USER4 = FL_USER4,
+ RUBY_FL_USER5 = FL_USER5,
+ RUBY_FL_USER6 = FL_USER6,
+ RUBY_FL_USER7 = FL_USER7,
+ RUBY_FL_USER8 = FL_USER8,
+ RUBY_FL_USER9 = FL_USER9,
+ RUBY_FL_USER10 = FL_USER10,
+ RUBY_FL_USER11 = FL_USER11,
+ RUBY_FL_USER12 = FL_USER12,
+ RUBY_FL_USER13 = FL_USER13,
+ RUBY_FL_USER14 = FL_USER14,
+ RUBY_FL_USER15 = FL_USER15,
+ RUBY_FL_USER16 = FL_USER16,
+ RUBY_FL_USER17 = FL_USER17,
+ RUBY_FL_USER18 = FL_USER18,
+ RUBY_FL_USHIFT = FL_USHIFT,
+ RUBY_NODE_TYPESHIFT = NODE_TYPESHIFT,
+ RUBY_NODE_TYPEMASK = NODE_TYPEMASK,
+ RUBY_NODE_LSHIFT = NODE_LSHIFT,
+ RUBY_NODE_FL_NEWLINE = NODE_FL_NEWLINE
+ } various;
+} ruby_dummy_gdb_enums;
+
+const VALUE RUBY_FL_USER19 = FL_USER19;
+const SIGNED_VALUE RUBY_NODE_LMASK = NODE_LMASK;
+const VALUE RUBY_ENCODING_MASK = ENCODING_MASK;
+
+int
+ruby_debug_print_indent(int level, int debug_level, int indent_level)
+{
+ if (level < debug_level) {
+ fprintf(stderr, "%*s", indent_level, "");
+ fflush(stderr);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void
+ruby_debug_printf(const char *format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+VALUE
+ruby_debug_print_value(int level, int debug_level, const char *header, VALUE obj)
+{
+ if (level < debug_level) {
+ VALUE str;
+ str = rb_inspect(obj);
+ fprintf(stderr, "DBG> %s: %s\n", header,
+ obj == (VALUE)(SIGNED_VALUE)-1 ? "" : StringValueCStr(str));
+ fflush(stderr);
+ }
+ return obj;
+}
+
+void
+ruby_debug_print_v(VALUE v)
+{
+ ruby_debug_print_value(0, 1, "", v);
+}
+
+ID
+ruby_debug_print_id(int level, int debug_level, const char *header, ID id)
+{
+ if (level < debug_level) {
+ fprintf(stderr, "DBG> %s: %s\n", header, rb_id2name(id));
+ fflush(stderr);
+ }
+ return id;
+}
+
+NODE *
+ruby_debug_print_node(int level, int debug_level, const char *header, const NODE *node)
+{
+ if (level < debug_level) {
+ fprintf(stderr, "DBG> %s: %s (%u)\n", header,
+ ruby_node_name(nd_type(node)), nd_line(node));
+ }
+ return (NODE *)node;
+}
+
+void
+ruby_debug_breakpoint(void)
+{
+ /* */
+}
+
+static void
+set_debug_option(const char *str, int len, void *arg)
+{
+#define SET_WHEN(name, var) do { \
+ if (len == sizeof(name) - 1 && \
+ strncmp(str, (name), len) == 0) { \
+ extern int var; \
+ var = 1; \
+ return; \
+ } \
+ } while (0)
+ SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr);
+ SET_WHEN("core", ruby_enable_coredump);
+#if defined _WIN32 && defined _MSC_VER && _MSC_VER >= 1400
+ SET_WHEN("rtc_error", ruby_w32_rtc_error);
+#endif
+ fprintf(stderr, "unexpected debug option: %.*s\n", len, str);
+}
+
+void
+ruby_set_debug_option(const char *str)
+{
+ ruby_each_words(str, set_debug_option, 0);
+}
diff --git a/defines.h b/defines.h
deleted file mode 100644
index ef80989925..0000000000
--- a/defines.h
+++ /dev/null
@@ -1,261 +0,0 @@
-/************************************************
-
- defines.h -
-
- $Author: nobu $
- $Date: 2005/10/25 16:59:57 $
- created at: Wed May 18 00:21:44 JST 1994
-
-************************************************/
-#ifndef DEFINES_H
-#define DEFINES_H
-
-#define RUBY
-
-#ifdef __cplusplus
-# ifndef HAVE_PROTOTYPES
-# define HAVE_PROTOTYPES 1
-# endif
-# ifndef HAVE_STDARG_PROTOTYPES
-# define HAVE_STDARG_PROTOTYPES 1
-# endif
-#endif
-
-#undef _
-#ifdef HAVE_PROTOTYPES
-# define _(args) args
-#else
-# define _(args) ()
-#endif
-
-#undef __
-#ifdef HAVE_STDARG_PROTOTYPES
-# define __(args) args
-#else
-# define __(args) ()
-#endif
-
-#ifdef __cplusplus
-#define ANYARGS ...
-#else
-#define ANYARGS
-#endif
-
-#define xmalloc ruby_xmalloc
-#define xcalloc ruby_xcalloc
-#define xrealloc ruby_xrealloc
-#define xfree ruby_xfree
-
-void *xmalloc _((long));
-void *xcalloc _((long,long));
-void *xrealloc _((void*,long));
-void xfree _((void*));
-
-#if SIZEOF_LONG_LONG > 0
-# define LONG_LONG long long
-#elif SIZEOF___INT64 > 0
-# define HAVE_LONG_LONG 1
-# define LONG_LONG __int64
-# undef SIZEOF_LONG_LONG
-# define SIZEOF_LONG_LONG SIZEOF___INT64
-#endif
-
-#if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
-# define BDIGIT unsigned int
-# define SIZEOF_BDIGITS SIZEOF_INT
-# define BDIGIT_DBL unsigned LONG_LONG
-# define BDIGIT_DBL_SIGNED LONG_LONG
-#elif SIZEOF_INT*2 <= SIZEOF_LONG
-# define BDIGIT unsigned int
-# define SIZEOF_BDIGITS SIZEOF_INT
-# define BDIGIT_DBL unsigned long
-# define BDIGIT_DBL_SIGNED long
-#elif SIZEOF_SHORT*2 <= SIZEOF_LONG
-# define BDIGIT unsigned short
-# define SIZEOF_BDIGITS SIZEOF_SHORT
-# define BDIGIT_DBL unsigned long
-# define BDIGIT_DBL_SIGNED long
-#else
-# define BDIGIT unsigned short
-# define SIZEOF_BDIGITS (SIZEOF_LONG/2)
-# define BDIGIT_DBL unsigned long
-# define BDIGIT_DBL_SIGNED long
-#endif
-
-#ifdef __CYGWIN__
-#undef _WIN32
-#endif
-
-#if defined(MSDOS) || defined(_WIN32) || defined(__human68k__) || defined(__EMX__)
-#define DOSISH 1
-#ifndef _WIN32_WCE
-# define DOSISH_DRIVE_LETTER
-#endif
-#endif
-
-/* define RUBY_USE_EUC/SJIS for default kanji-code */
-#ifndef DEFAULT_KCODE
-#if defined(DOSISH) || defined(__CYGWIN__) || defined(__MACOS__) || defined(OS2)
-#define DEFAULT_KCODE KCODE_SJIS
-#else
-#define DEFAULT_KCODE KCODE_EUC
-#endif
-#endif
-
-#ifdef __NeXT__
-/* NextStep, OpenStep, Rhapsody */
-#ifndef S_IRUSR
-#define S_IRUSR 0000400 /* read permission, owner */
-#endif
-#ifndef S_IRGRP
-#define S_IRGRP 0000040 /* read permission, group */
-#endif
-#ifndef S_IROTH
-#define S_IROTH 0000004 /* read permission, other */
-#endif
-#ifndef S_IWUSR
-#define S_IWUSR 0000200 /* write permission, owner */
-#endif
-#ifndef S_IWGRP
-#define S_IWGRP 0000020 /* write permission, group */
-#endif
-#ifndef S_IWOTH
-#define S_IWOTH 0000002 /* write permission, other */
-#endif
-#ifndef S_IXUSR
-#define S_IXUSR 0000100 /* execute/search permission, owner */
-#endif
-#ifndef S_IXGRP
-#define S_IXGRP 0000010 /* execute/search permission, group */
-#endif
-#ifndef S_IXOTH
-#define S_IXOTH 0000001 /* execute/search permission, other */
-#endif
-#ifndef S_IRWXU
-#define S_IRWXU 0000700 /* read, write, execute permissions, owner */
-#endif
-#ifndef S_IRWXG
-#define S_IRWXG 0000070 /* read, write, execute permissions, group */
-#endif
-#ifndef S_IRWXO
-#define S_IRWXO 0000007 /* read, write, execute permissions, other */
-#endif
-#ifndef S_ISBLK
-#define S_ISBLK(mode) (((mode) & (0170000)) == (0060000))
-#endif
-#ifndef S_ISCHR
-#define S_ISCHR(mode) (((mode) & (0170000)) == (0020000))
-#endif
-#ifndef S_ISDIR
-#define S_ISDIR(mode) (((mode) & (0170000)) == (0040000))
-#endif
-#ifndef S_ISFIFO
-#define S_ISFIFO(mode) (((mode) & (0170000)) == (0010000))
-#endif
-#ifndef S_ISREG
-#define S_ISREG(mode) (((mode) & (0170000)) == (0100000))
-#endif
-/* Do not trust WORDS_BIGENDIAN from configure since -arch compiler flag may
- result in a different endian. Instead trust __BIG_ENDIAN__ and
- __LITTLE_ENDIAN__ which are set correctly by -arch. */
-#undef WORDS_BIGENDIAN
-#ifdef __BIG_ENDIAN__
-#define WORDS_BIGENDIAN
-#endif
-#ifndef __APPLE__
-/* NextStep, OpenStep (but not Rhapsody) */
-#ifndef GETPGRP_VOID
-#define GETPGRP_VOID 1
-#endif
-#ifndef WNOHANG
-#define WNOHANG 01
-#endif
-#ifndef WUNTRACED
-#define WUNTRACED 02
-#endif
-#ifndef X_OK
-#define X_OK 1
-#endif
-#endif /* __APPLE__ */
-#endif /* NeXT */
-
-#ifdef _WIN32
-#include "win32/win32.h"
-#endif
-
-#if defined(__VMS)
-#include "vms.h"
-#endif
-
-#if defined(__BEOS__)
-#include <net/socket.h> /* intern.h needs fd_set definition */
-#endif
-
-#ifdef RUBY_EXPORT
-#undef RUBY_EXTERN
-#endif
-
-#ifndef RUBY_EXTERN
-#define RUBY_EXTERN extern
-#endif
-
-#ifndef EXTERN
-#define EXTERN RUBY_EXTERN /* deprecated */
-#endif
-
-#ifndef RUBY_MBCHAR_MAXSIZE
-#define RUBY_MBCHAR_MAXSIZE INT_MAX
- /* MB_CUR_MAX will not work well in C locale */
-#endif
-
-#if defined(sparc) || defined(__sparc__)
-static inline void
-flush_register_windows(void)
-{
- asm
-#ifdef __GNUC__
- volatile
-#endif
-# if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__)
- ("flushw")
-# else
- ("ta 0x03")
-# endif /* trap always to flush register windows if we are on a Sparc system */
- ;
-}
-# define FLUSH_REGISTER_WINDOWS flush_register_windows()
-#elif defined(__ia64__)
-void flush_register_windows(void)
-# if defined(__GNUC__) && (( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3)
-__attribute__ ((noinline))
-# endif
- ;
-# define FLUSH_REGISTER_WINDOWS flush_register_windows()
-#else
-# define FLUSH_REGISTER_WINDOWS ((void)0)
-#endif
-
-#if defined(DOSISH)
-#define PATH_SEP ";"
-#elif defined(riscos)
-#define PATH_SEP ","
-#else
-#define PATH_SEP ":"
-#endif
-#define PATH_SEP_CHAR PATH_SEP[0]
-
-#if defined(__human68k__)
-#define PATH_ENV "path"
-#else
-#define PATH_ENV "PATH"
-#endif
-
-#if defined(DOSISH) && !defined(__human68k__) && !defined(__EMX__)
-#define ENV_IGNORECASE
-#endif
-
-#ifndef RUBY_PLATFORM
-#define RUBY_PLATFORM "unknown-unknown"
-#endif
-
-#endif
diff --git a/defs/default_gems b/defs/default_gems
new file mode 100644
index 0000000000..e73e383b26
--- /dev/null
+++ b/defs/default_gems
@@ -0,0 +1,5 @@
+# gem base directory versioning file [executable files under bin]
+rake lib/rake lib/rake/version.rb [rake]
+rdoc lib/rdoc lib/rdoc.rb [rdoc ri]
+minitest lib/minitest lib/minitest/unit.rb
+json ext/json ext/json/lib/json/version.rb
diff --git a/defs/id.def b/defs/id.def
new file mode 100644
index 0000000000..ea0746e4d6
--- /dev/null
+++ b/defs/id.def
@@ -0,0 +1,89 @@
+# -*- mode: ruby; coding: us-ascii -*-
+firstline, predefined = __LINE__+1, %[\
+ intern
+ method_missing MethodMissing
+ length
+ size
+ gets
+ succ
+ each
+ lambda
+ send
+ __send__
+ initialize
+ initialize_copy
+ initialize_clone
+ initialize_dup
+ _ UScore
+ "/*NULL*/" NULL
+ empty?
+ respond_to? Respond_to
+ respond_to_missing? Respond_to_missing
+ <IFUNC>
+ <CFUNC>
+ core#set_method_alias
+ core#set_variable_alias
+ core#undef_method
+ core#define_method
+ core#define_singleton_method
+ core#set_postexe
+ core#hash_from_ary
+ core#hash_merge_ary
+ core#hash_merge_ptr
+ core#hash_merge_kwd
+]
+
+class KeywordError < RuntimeError
+ def self.raise(mesg, line)
+ super(self, mesg, ["#{__FILE__}:#{line}", *caller])
+ end
+end
+
+predefined_ids = {}
+preserved_ids = []
+local_ids = []
+instance_ids = []
+global_ids = []
+const_ids = []
+class_ids = []
+names = {}
+predefined.split(/^/).each_with_index do |line, num|
+ next if /^#/ =~ line or (name, token = line.split; !name)
+ token ||= name
+ if /#/ =~ token
+ token = "_#{token.gsub(/\W+/, '_')}"
+ else
+ token = token.sub(/\?/, 'P').sub(/\A[a-z]/) {$&.upcase}
+ token.sub!(/\A\$/, "_G_")
+ token.sub!(/\A@@/, "_C_")
+ token.sub!(/\A@/, "_I_")
+ token.gsub!(/\W+/, "")
+ end
+ if prev = names[name]
+ KeywordError.raise("#{name} is already registered at line #{prev+firstline}", firstline+num)
+ end
+ if prev = predefined_ids[token]
+ KeywordError.raise("#{token} is already used for #{prev} at line #{names[prev]+firstline}", firstline+num)
+ end
+ names[name] = num
+ case name
+ when /\A[A-Z]\w*\z/; const_ids
+ when /\A(?!\d)\w+\z/; local_ids
+ when /\A\$(?:\d+|(?!\d)\w+)\z/; global_ids
+ when /\A@@(?!\d)\w+\z/; class_ids
+ when /\A@(?!\d)\w+\z/; instance_ids
+ when /\A((?!\d)\w+)=\z/
+ KeywordError.raise("use ID2ATTRSET(#{$1}) instead of ATTRSET #{name}", firstline+num)
+ else preserved_ids
+ end << token
+ predefined_ids[token] = name
+end
+{
+ "LOCAL" => local_ids,
+ "INSTANCE" => instance_ids,
+ "GLOBAL" => global_ids,
+ "CONST" => const_ids,
+ "CLASS" => class_ids,
+ :preserved => preserved_ids,
+ :predefined => predefined_ids,
+}
diff --git a/defs/keywords b/defs/keywords
new file mode 100644
index 0000000000..1b5719aa85
--- /dev/null
+++ b/defs/keywords
@@ -0,0 +1,53 @@
+%{
+struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
+const struct kwtable *rb_reserved_word(const char *, unsigned int);
+#ifndef RIPPER
+static const struct kwtable *reserved_word(const char *, unsigned int);
+#define rb_reserved_word(str, len) reserved_word(str, len)
+%}
+
+struct kwtable;
+%%
+__ENCODING__, {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END
+__LINE__, {keyword__LINE__, keyword__LINE__}, EXPR_END
+__FILE__, {keyword__FILE__, keyword__FILE__}, EXPR_END
+BEGIN, {keyword_BEGIN, keyword_BEGIN}, EXPR_END
+END, {keyword_END, keyword_END}, EXPR_END
+alias, {keyword_alias, keyword_alias}, EXPR_FNAME
+and, {keyword_and, keyword_and}, EXPR_VALUE
+begin, {keyword_begin, keyword_begin}, EXPR_BEG
+break, {keyword_break, keyword_break}, EXPR_MID
+case, {keyword_case, keyword_case}, EXPR_VALUE
+class, {keyword_class, keyword_class}, EXPR_CLASS
+def, {keyword_def, keyword_def}, EXPR_FNAME
+defined?, {keyword_defined, keyword_defined}, EXPR_ARG
+do, {keyword_do, keyword_do}, EXPR_BEG
+else, {keyword_else, keyword_else}, EXPR_BEG
+elsif, {keyword_elsif, keyword_elsif}, EXPR_VALUE
+end, {keyword_end, keyword_end}, EXPR_END
+ensure, {keyword_ensure, keyword_ensure}, EXPR_BEG
+false, {keyword_false, keyword_false}, EXPR_END
+for, {keyword_for, keyword_for}, EXPR_VALUE
+if, {keyword_if, modifier_if}, EXPR_VALUE
+in, {keyword_in, keyword_in}, EXPR_VALUE
+module, {keyword_module, keyword_module}, EXPR_VALUE
+next, {keyword_next, keyword_next}, EXPR_MID
+nil, {keyword_nil, keyword_nil}, EXPR_END
+not, {keyword_not, keyword_not}, EXPR_ARG
+or, {keyword_or, keyword_or}, EXPR_VALUE
+redo, {keyword_redo, keyword_redo}, EXPR_END
+rescue, {keyword_rescue, modifier_rescue}, EXPR_MID
+retry, {keyword_retry, keyword_retry}, EXPR_END
+return, {keyword_return, keyword_return}, EXPR_MID
+self, {keyword_self, keyword_self}, EXPR_END
+super, {keyword_super, keyword_super}, EXPR_ARG
+then, {keyword_then, keyword_then}, EXPR_BEG
+true, {keyword_true, keyword_true}, EXPR_END
+undef, {keyword_undef, keyword_undef}, EXPR_FNAME
+unless, {keyword_unless, modifier_unless}, EXPR_VALUE
+until, {keyword_until, modifier_until}, EXPR_VALUE
+when, {keyword_when, keyword_when}, EXPR_VALUE
+while, {keyword_while, modifier_while}, EXPR_VALUE
+yield, {keyword_yield, keyword_yield}, EXPR_ARG
+%%
+#endif
diff --git a/defs/known_errors.def b/defs/known_errors.def
new file mode 100644
index 0000000000..3cebe90a8e
--- /dev/null
+++ b/defs/known_errors.def
@@ -0,0 +1,145 @@
+EPERM
+ENOENT
+ESRCH
+EINTR
+EIO
+ENXIO
+E2BIG
+ENOEXEC
+EBADF
+ECHILD
+EAGAIN
+ENOMEM
+EACCES
+EFAULT
+ENOTBLK
+EBUSY
+EEXIST
+EXDEV
+ENODEV
+ENOTDIR
+EISDIR
+EINVAL
+ENFILE
+EMFILE
+ENOTTY
+ETXTBSY
+EFBIG
+ENOSPC
+ESPIPE
+EROFS
+EMLINK
+EPIPE
+EDOM
+ERANGE
+EDEADLK
+ENAMETOOLONG
+ENOLCK
+ENOSYS
+ENOTEMPTY
+ELOOP
+EWOULDBLOCK
+ENOMSG
+EIDRM
+ECHRNG
+EL2NSYNC
+EL3HLT
+EL3RST
+ELNRNG
+EUNATCH
+ENOCSI
+EL2HLT
+EBADE
+EBADR
+EXFULL
+ENOANO
+EBADRQC
+EBADSLT
+EDEADLOCK
+EBFONT
+ENOSTR
+ENODATA
+ETIME
+ENOSR
+ENONET
+ENOPKG
+EREMOTE
+ENOLINK
+EADV
+ESRMNT
+ECOMM
+EPROTO
+EMULTIHOP
+EDOTDOT
+EBADMSG
+EOVERFLOW
+ENOTUNIQ
+EBADFD
+EREMCHG
+ELIBACC
+ELIBBAD
+ELIBSCN
+ELIBMAX
+ELIBEXEC
+EILSEQ
+ERESTART
+ESTRPIPE
+EUSERS
+ENOTSOCK
+EDESTADDRREQ
+EMSGSIZE
+EPROTOTYPE
+ENOPROTOOPT
+EPROTONOSUPPORT
+ESOCKTNOSUPPORT
+EOPNOTSUPP
+EPFNOSUPPORT
+EAFNOSUPPORT
+EADDRINUSE
+EADDRNOTAVAIL
+ENETDOWN
+ENETUNREACH
+ENETRESET
+ECONNABORTED
+ECONNRESET
+ENOBUFS
+EISCONN
+ENOTCONN
+ESHUTDOWN
+ETOOMANYREFS
+ETIMEDOUT
+ECONNREFUSED
+EHOSTDOWN
+EHOSTUNREACH
+EALREADY
+EINPROGRESS
+ESTALE
+EUCLEAN
+ENOTNAM
+ENAVAIL
+EISNAM
+EREMOTEIO
+EDQUOT
+ECANCELED
+EKEYEXPIRED
+EKEYREJECTED
+EKEYREVOKED
+EMEDIUMTYPE
+ENOKEY
+ENOMEDIUM
+ENOTRECOVERABLE
+EOWNERDEAD
+ERFKILL
+EAUTH
+EBADRPC
+EDOOFUS
+EFTYPE
+ENEEDAUTH
+ENOATTR
+ENOTSUP
+EPROCLIM
+EPROCUNAVAIL
+EPROGMISMATCH
+EPROGUNAVAIL
+ERPCMISMATCH
+EIPSEC
diff --git a/defs/lex.c.src b/defs/lex.c.src
new file mode 100644
index 0000000000..1b5719aa85
--- /dev/null
+++ b/defs/lex.c.src
@@ -0,0 +1,53 @@
+%{
+struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
+const struct kwtable *rb_reserved_word(const char *, unsigned int);
+#ifndef RIPPER
+static const struct kwtable *reserved_word(const char *, unsigned int);
+#define rb_reserved_word(str, len) reserved_word(str, len)
+%}
+
+struct kwtable;
+%%
+__ENCODING__, {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END
+__LINE__, {keyword__LINE__, keyword__LINE__}, EXPR_END
+__FILE__, {keyword__FILE__, keyword__FILE__}, EXPR_END
+BEGIN, {keyword_BEGIN, keyword_BEGIN}, EXPR_END
+END, {keyword_END, keyword_END}, EXPR_END
+alias, {keyword_alias, keyword_alias}, EXPR_FNAME
+and, {keyword_and, keyword_and}, EXPR_VALUE
+begin, {keyword_begin, keyword_begin}, EXPR_BEG
+break, {keyword_break, keyword_break}, EXPR_MID
+case, {keyword_case, keyword_case}, EXPR_VALUE
+class, {keyword_class, keyword_class}, EXPR_CLASS
+def, {keyword_def, keyword_def}, EXPR_FNAME
+defined?, {keyword_defined, keyword_defined}, EXPR_ARG
+do, {keyword_do, keyword_do}, EXPR_BEG
+else, {keyword_else, keyword_else}, EXPR_BEG
+elsif, {keyword_elsif, keyword_elsif}, EXPR_VALUE
+end, {keyword_end, keyword_end}, EXPR_END
+ensure, {keyword_ensure, keyword_ensure}, EXPR_BEG
+false, {keyword_false, keyword_false}, EXPR_END
+for, {keyword_for, keyword_for}, EXPR_VALUE
+if, {keyword_if, modifier_if}, EXPR_VALUE
+in, {keyword_in, keyword_in}, EXPR_VALUE
+module, {keyword_module, keyword_module}, EXPR_VALUE
+next, {keyword_next, keyword_next}, EXPR_MID
+nil, {keyword_nil, keyword_nil}, EXPR_END
+not, {keyword_not, keyword_not}, EXPR_ARG
+or, {keyword_or, keyword_or}, EXPR_VALUE
+redo, {keyword_redo, keyword_redo}, EXPR_END
+rescue, {keyword_rescue, modifier_rescue}, EXPR_MID
+retry, {keyword_retry, keyword_retry}, EXPR_END
+return, {keyword_return, keyword_return}, EXPR_MID
+self, {keyword_self, keyword_self}, EXPR_END
+super, {keyword_super, keyword_super}, EXPR_ARG
+then, {keyword_then, keyword_then}, EXPR_BEG
+true, {keyword_true, keyword_true}, EXPR_END
+undef, {keyword_undef, keyword_undef}, EXPR_FNAME
+unless, {keyword_unless, modifier_unless}, EXPR_VALUE
+until, {keyword_until, modifier_until}, EXPR_VALUE
+when, {keyword_when, keyword_when}, EXPR_VALUE
+while, {keyword_while, modifier_while}, EXPR_VALUE
+yield, {keyword_yield, keyword_yield}, EXPR_ARG
+%%
+#endif
diff --git a/defs/opt_insn_unif.def b/defs/opt_insn_unif.def
new file mode 100644
index 0000000000..1ac613dbea
--- /dev/null
+++ b/defs/opt_insn_unif.def
@@ -0,0 +1,29 @@
+#
+# a definition of instruction unification
+#
+#
+
+__END__
+
+putobject putobject
+putobject putstring
+putobject setlocal
+putobject setdynamic
+
+putstring putstring
+putstring putobject
+putstring setlocal
+putstring setdynamic
+
+# putnil end
+
+dup setlocal
+
+# from tarai
+getlocal getlocal
+# getlocal send
+
+# from tak, ackermann
+getlocal putobject
+
+
diff --git a/defs/opt_operand.def b/defs/opt_operand.def
new file mode 100644
index 0000000000..ab7103a421
--- /dev/null
+++ b/defs/opt_operand.def
@@ -0,0 +1,22 @@
+#
+# configration file for operand union optimization
+#
+# format:
+# [insn name] op1, op2 ...
+#
+# wildcard: *
+#
+
+getlocal *, 0
+getlocal *, 1
+setlocal *, 0
+setlocal *, 1
+
+putobject INT2FIX(0)
+putobject INT2FIX(1)
+
+__END__
+
+putobject Qtrue
+putobject Qfalse
+
diff --git a/dir.c b/dir.c
index 0798b3f76f..758a34eee6 100644
--- a/dir.c
+++ b/dir.c
@@ -2,17 +2,18 @@
dir.c -
- $Author: shyouhei $
- $Date: 2006/12/14 14:50:13 $
+ $Author$
created at: Wed Jan 5 09:51:01 JST 1994
- Copyright (C) 1993-2003 Yukihiro Matsumoto
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
+#include "ruby/encoding.h"
+#include "internal.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -29,12 +30,7 @@
# define NAMLEN(dirent) strlen((dirent)->d_name)
#else
# define dirent direct
-# if !defined __NeXT__
-# define NAMLEN(dirent) (dirent)->d_namlen
-# else
-# /* On some versions of NextStep, d_namlen is always zero, so avoid it. */
-# define NAMLEN(dirent) strlen((dirent)->d_name)
-# endif
+# define NAMLEN(dirent) (dirent)->d_namlen
# if HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif
@@ -48,6 +44,10 @@
# include "win32/dir.h"
# endif
#endif
+#if defined(__native_client__) && defined(NACL_NEWLIB)
+# include "nacl/dirent.h"
+# include "nacl/stat.h"
+#endif
#include <errno.h>
@@ -56,29 +56,36 @@ char *getenv();
#endif
#ifndef HAVE_STRING_H
-char *strchr _((char*,char));
+char *strchr(char*,char);
#endif
#include <ctype.h>
-#include "util.h"
+#include "ruby/util.h"
#if !defined HAVE_LSTAT && !defined lstat
#define lstat stat
#endif
-#ifndef CASEFOLD_FILESYSTEM
-# if defined DOSISH || defined __VMS
-# define CASEFOLD_FILESYSTEM 1
-# else
-# define CASEFOLD_FILESYSTEM 0
-# endif
+/* define system APIs */
+#ifdef _WIN32
+#undef chdir
+#define chdir(p) rb_w32_uchdir(p)
+#undef mkdir
+#define mkdir(p, m) rb_w32_umkdir((p), (m))
+#undef rmdir
+#define rmdir(p) rb_w32_urmdir(p)
+#undef opendir
+#define opendir(p) rb_w32_uopendir(p)
#endif
+#define rb_sys_fail_path(path) rb_sys_fail_str(path)
+
#define FNM_NOESCAPE 0x01
#define FNM_PATHNAME 0x02
#define FNM_DOTMATCH 0x04
#define FNM_CASEFOLD 0x08
+#define FNM_EXTGLOB 0x10
#if CASEFOLD_FILESYSTEM
#define FNM_SYSCASE FNM_CASEFOLD
#else
@@ -88,186 +95,285 @@ char *strchr _((char*,char));
#define FNM_NOMATCH 1
#define FNM_ERROR 2
-#define downcase(c) (nocase && ISUPPER(c) ? tolower(c) : (c))
-
-#ifndef CharNext /* defined as CharNext[AW] on Windows. */
-# if defined(DJGPP)
-# define CharNext(p) ((p) + mblen(p, MB_CUR_MAX))
-# else
-# define CharNext(p) ((p) + 1)
-# endif
-#endif
-
-#if defined DOSISH
-#define isdirsep(c) ((c) == '/' || (c) == '\\')
-#else
-#define isdirsep(c) ((c) == '/')
-#endif
+# define Next(p, e, enc) ((p)+ rb_enc_mbclen((p), (e), (enc)))
+# define Inc(p, e, enc) ((p) = Next((p), (e), (enc)))
static char *
-range(pat, test, flags)
- const char *pat;
- int test;
- int flags;
+bracket(
+ const char *p, /* pattern (next to '[') */
+ const char *pend,
+ const char *s, /* string */
+ const char *send,
+ int flags,
+ rb_encoding *enc)
{
- int not, ok = 0;
- int nocase = flags & FNM_CASEFOLD;
- int escape = !(flags & FNM_NOESCAPE);
-
- not = *pat == '!' || *pat == '^';
- if (not)
- pat++;
+ const int nocase = flags & FNM_CASEFOLD;
+ const int escape = !(flags & FNM_NOESCAPE);
+ unsigned int c1, c2;
+ int r;
+ int ok = 0, not = 0;
- test = downcase(test);
+ if (p >= pend) return NULL;
+ if (*p == '!' || *p == '^') {
+ not = 1;
+ p++;
+ }
- while (*pat != ']') {
- int cstart, cend;
- if (escape && *pat == '\\')
- pat++;
- cstart = cend = *pat++;
- if (!cstart)
+ while (*p != ']') {
+ const char *t1 = p;
+ if (escape && *t1 == '\\')
+ t1++;
+ if (!*t1)
return NULL;
- if (*pat == '-' && pat[1] != ']') {
- pat++;
- if (escape && *pat == '\\')
- pat++;
- cend = *pat++;
- if (!cend)
+ p = t1 + (r = rb_enc_mbclen(t1, pend, enc));
+ if (p >= pend) return NULL;
+ if (p[0] == '-' && p[1] != ']') {
+ const char *t2 = p + 1;
+ int r2;
+ if (escape && *t2 == '\\')
+ t2++;
+ if (!*t2)
return NULL;
+ p = t2 + (r2 = rb_enc_mbclen(t2, pend, enc));
+ if (ok) continue;
+ if ((r <= (send-s) && memcmp(t1, s, r) == 0) ||
+ (r2 <= (send-s) && memcmp(t2, s, r) == 0)) {
+ ok = 1;
+ continue;
+ }
+ c1 = rb_enc_codepoint(s, send, enc);
+ if (nocase) c1 = rb_enc_toupper(c1, enc);
+ c2 = rb_enc_codepoint(t1, pend, enc);
+ if (nocase) c2 = rb_enc_toupper(c2, enc);
+ if (c1 < c2) continue;
+ c2 = rb_enc_codepoint(t2, pend, enc);
+ if (nocase) c2 = rb_enc_toupper(c2, enc);
+ if (c1 > c2) continue;
}
- if (downcase(cstart) <= test && test <= downcase(cend))
- ok = 1;
+ else {
+ if (ok) continue;
+ if (r <= (send-s) && memcmp(t1, s, r) == 0) {
+ ok = 1;
+ continue;
+ }
+ if (!nocase) continue;
+ c1 = rb_enc_toupper(rb_enc_codepoint(s, send, enc), enc);
+ c2 = rb_enc_toupper(rb_enc_codepoint(p, pend, enc), enc);
+ if (c1 != c2) continue;
+ }
+ ok = 1;
}
- return ok == not ? NULL : (char *)pat + 1;
+
+ return ok == not ? NULL : (char *)p + 1;
}
-#define ISDIRSEP(c) (pathname && isdirsep(c))
-#define PERIOD(s) (period && *(s) == '.' && \
- ((s) == string || ISDIRSEP((s)[-1])))
+/* If FNM_PATHNAME is set, only path element will be matched. (upto '/' or '\0')
+ Otherwise, entire string will be matched.
+ End marker itself won't be compared.
+ And if function succeeds, *pcur reaches end marker.
+*/
+#define UNESCAPE(p) (escape && *(p) == '\\' ? (p) + 1 : (p))
+#define ISEND(p) (!*(p) || (pathname && *(p) == '/'))
+#define RETURN(val) return *pcur = p, *scur = s, (val);
+
static int
-fnmatch(pat, string, flags)
- const char *pat;
- const char *string;
- int flags;
+fnmatch_helper(
+ const char **pcur, /* pattern */
+ const char **scur, /* string */
+ int flags,
+ rb_encoding *enc)
{
- int c;
- int test;
- const char *s = string;
- int escape = !(flags & FNM_NOESCAPE);
- int pathname = flags & FNM_PATHNAME;
- int period = !(flags & FNM_DOTMATCH);
- int nocase = flags & FNM_CASEFOLD;
+ const int period = !(flags & FNM_DOTMATCH);
+ const int pathname = flags & FNM_PATHNAME;
+ const int escape = !(flags & FNM_NOESCAPE);
+ const int nocase = flags & FNM_CASEFOLD;
- while ((c = *pat++) != '\0') {
- switch (c) {
- case '?':
- if (!*s || ISDIRSEP(*s) || PERIOD(s))
- return FNM_NOMATCH;
- s++;
- break;
- case '*':
- while ((c = *pat++) == '*')
- ;
+ const char *ptmp = 0;
+ const char *stmp = 0;
- if (PERIOD(s))
- return FNM_NOMATCH;
+ const char *p = *pcur;
+ const char *pend = p + strlen(p);
+ const char *s = *scur;
+ const char *send = s + strlen(s);
- if (!c) {
- if (pathname && *rb_path_next(s))
- return FNM_NOMATCH;
- else
- return 0;
- }
- else if (ISDIRSEP(c)) {
- s = rb_path_next(s);
- if (*s) {
- s++;
- break;
- }
- return FNM_NOMATCH;
- }
+ int r;
- test = escape && c == '\\' ? *pat : c;
- test = downcase(test);
- pat--;
- while (*s) {
- if ((c == '?' || c == '[' || downcase(*s) == test) &&
- !fnmatch(pat, s, flags | FNM_DOTMATCH))
- return 0;
- else if (ISDIRSEP(*s))
- break;
- s++;
+ if (period && *s == '.' && *UNESCAPE(p) != '.') /* leading period */
+ RETURN(FNM_NOMATCH);
+
+ while (1) {
+ switch (*p) {
+ case '*':
+ do { p++; } while (*p == '*');
+ if (ISEND(UNESCAPE(p))) {
+ p = UNESCAPE(p);
+ RETURN(0);
}
- return FNM_NOMATCH;
+ if (ISEND(s))
+ RETURN(FNM_NOMATCH);
+ ptmp = p;
+ stmp = s;
+ continue;
- case '[':
- if (!*s || ISDIRSEP(*s) || PERIOD(s))
- return FNM_NOMATCH;
- pat = range(pat, *s, flags);
- if (pat == NULL)
- return FNM_NOMATCH;
- s++;
- break;
+ case '?':
+ if (ISEND(s))
+ RETURN(FNM_NOMATCH);
+ p++;
+ Inc(s, send, enc);
+ continue;
- case '\\':
- if (escape
-#if defined DOSISH
- && *pat && strchr("*?[]\\", *pat)
-#endif
- ) {
- c = *pat;
- if (!c)
- c = '\\';
- else
- pat++;
+ case '[': {
+ const char *t;
+ if (ISEND(s))
+ RETURN(FNM_NOMATCH);
+ if ((t = bracket(p + 1, pend, s, send, flags, enc)) != 0) {
+ p = t;
+ Inc(s, send, enc);
+ continue;
}
- /* FALLTHROUGH */
+ goto failed;
+ }
+ }
- default:
-#if defined DOSISH
- if (ISDIRSEP(c) && isdirsep(*s))
- ;
- else
-#endif
- if(downcase(c) != downcase(*s))
- return FNM_NOMATCH;
- s++;
- break;
+ /* ordinary */
+ p = UNESCAPE(p);
+ if (ISEND(s))
+ RETURN(ISEND(p) ? 0 : FNM_NOMATCH);
+ if (ISEND(p))
+ goto failed;
+ r = rb_enc_precise_mbclen(p, pend, enc);
+ if (!MBCLEN_CHARFOUND_P(r))
+ goto failed;
+ if (r <= (send-s) && memcmp(p, s, r) == 0) {
+ p += r;
+ s += r;
+ continue;
+ }
+ if (!nocase) goto failed;
+ if (rb_enc_toupper(rb_enc_codepoint(p, pend, enc), enc) !=
+ rb_enc_toupper(rb_enc_codepoint(s, send, enc), enc))
+ goto failed;
+ p += r;
+ Inc(s, send, enc);
+ continue;
+
+ failed: /* try next '*' position */
+ if (ptmp && stmp) {
+ p = ptmp;
+ Inc(stmp, send, enc); /* !ISEND(*stmp) */
+ s = stmp;
+ continue;
}
+ RETURN(FNM_NOMATCH);
}
- return !*s ? 0 : FNM_NOMATCH;
+}
+
+static int
+fnmatch(
+ const char *pattern,
+ rb_encoding *enc,
+ const char *string,
+ int flags)
+{
+ const char *p = pattern;
+ const char *s = string;
+ const char *send = s + strlen(string);
+ const int period = !(flags & FNM_DOTMATCH);
+ const int pathname = flags & FNM_PATHNAME;
+
+ const char *ptmp = 0;
+ const char *stmp = 0;
+
+ if (pathname) {
+ while (1) {
+ if (p[0] == '*' && p[1] == '*' && p[2] == '/') {
+ do { p += 3; } while (p[0] == '*' && p[1] == '*' && p[2] == '/');
+ ptmp = p;
+ stmp = s;
+ }
+ if (fnmatch_helper(&p, &s, flags, enc) == 0) {
+ while (*s && *s != '/') Inc(s, send, enc);
+ if (*p && *s) {
+ p++;
+ s++;
+ continue;
+ }
+ if (!*p && !*s)
+ return 0;
+ }
+ /* failed : try next recursion */
+ if (ptmp && stmp && !(period && *stmp == '.')) {
+ while (*stmp && *stmp != '/') Inc(stmp, send, enc);
+ if (*stmp) {
+ p = ptmp;
+ stmp++;
+ s = stmp;
+ continue;
+ }
+ }
+ return FNM_NOMATCH;
+ }
+ }
+ else
+ return fnmatch_helper(&p, &s, flags, enc);
}
VALUE rb_cDir;
struct dir_data {
DIR *dir;
- char *path;
+ VALUE path;
+ rb_encoding *enc;
};
static void
-free_dir(dir)
- struct dir_data *dir;
+dir_mark(void *ptr)
{
+ struct dir_data *dir = ptr;
+ rb_gc_mark(dir->path);
+}
+
+static void
+dir_free(void *ptr)
+{
+ struct dir_data *dir = ptr;
if (dir) {
if (dir->dir) closedir(dir->dir);
- if (dir->path) free(dir->path);
}
- free(dir);
+ xfree(dir);
+}
+
+static size_t
+dir_memsize(const void *ptr)
+{
+ return ptr ? sizeof(struct dir_data) : 0;
}
-static VALUE dir_close _((VALUE));
+static const rb_data_type_t dir_data_type = {
+ "dir",
+ {dir_mark, dir_free, dir_memsize,},
+};
+
+static VALUE dir_close(VALUE);
+
+#define GlobPathValue(str, safe) \
+ /* can contain null bytes as separators */ \
+ (!RB_TYPE_P((str), T_STRING) ? \
+ (void)FilePathValue(str) : \
+ (void)(check_safe_glob((str), (safe)), \
+ check_glob_encoding(str), (str)))
+#define check_safe_glob(str, safe) ((safe) ? rb_check_safe_obj(str) : (void)0)
+#define check_glob_encoding(str) rb_enc_check((str), rb_enc_from_encoding(rb_usascii_encoding()))
-static VALUE dir_s_alloc _((VALUE));
static VALUE
-dir_s_alloc(klass)
- VALUE klass;
+dir_s_alloc(VALUE klass)
{
struct dir_data *dirp;
- VALUE obj = Data_Make_Struct(klass, struct dir_data, 0, free_dir, dirp);
+ VALUE obj = TypedData_Make_Struct(klass, struct dir_data, &dir_data_type, dirp);
dirp->dir = NULL;
- dirp->path = NULL;
+ dirp->path = Qnil;
+ dirp->enc = NULL;
return obj;
}
@@ -279,36 +385,56 @@ dir_s_alloc(klass)
* Returns a new directory object for the named directory.
*/
static VALUE
-dir_initialize(dir, dirname)
- VALUE dir, dirname;
+dir_initialize(int argc, VALUE *argv, VALUE dir)
{
struct dir_data *dp;
+ rb_encoding *fsenc;
+ VALUE dirname, opt, orig;
+ static VALUE sym_enc;
+
+ if (!sym_enc) {
+ sym_enc = ID2SYM(rb_intern("encoding"));
+ }
+ fsenc = rb_filesystem_encoding();
+
+ rb_scan_args(argc, argv, "1:", &dirname, &opt);
+
+ if (!NIL_P(opt)) {
+ VALUE enc = rb_hash_aref(opt, sym_enc);
+ if (!NIL_P(enc)) {
+ fsenc = rb_to_encoding(enc);
+ }
+ }
- SafeStringValue(dirname);
- Data_Get_Struct(dir, struct dir_data, dp);
+ GlobPathValue(dirname, FALSE);
+ orig = rb_str_dup_frozen(dirname);
+ dirname = rb_str_encode_ospath(dirname);
+ dirname = rb_str_dup_frozen(dirname);
+
+ TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dp);
if (dp->dir) closedir(dp->dir);
- if (dp->path) free(dp->path);
dp->dir = NULL;
- dp->path = NULL;
- dp->dir = opendir(RSTRING(dirname)->ptr);
+ dp->path = Qnil;
+ dp->enc = fsenc;
+ dp->dir = opendir(RSTRING_PTR(dirname));
if (dp->dir == NULL) {
if (errno == EMFILE || errno == ENFILE) {
rb_gc();
- dp->dir = opendir(RSTRING(dirname)->ptr);
+ dp->dir = opendir(RSTRING_PTR(dirname));
}
if (dp->dir == NULL) {
- rb_sys_fail(RSTRING(dirname)->ptr);
+ rb_sys_fail_path(orig);
}
}
- dp->path = strdup(RSTRING(dirname)->ptr);
+ dp->path = orig;
return dir;
}
/*
* call-seq:
- * Dir.open( string ) => aDir
- * Dir.open( string ) {| aDir | block } => anObject
+ * Dir.open( string ) -> aDir
+ * Dir.open( string ) {| aDir | block } -> anObject
*
* With no block, <code>open</code> is a synonym for
* <code>Dir::new</code>. If a block is present, it is passed
@@ -316,15 +442,13 @@ dir_initialize(dir, dirname)
* the block, and <code>Dir::open</code> returns the value of the
* block.
*/
-
static VALUE
-dir_s_open(klass, dirname)
- VALUE klass, dirname;
+dir_s_open(int argc, VALUE *argv, VALUE klass)
{
struct dir_data *dp;
- VALUE dir = Data_Make_Struct(klass, struct dir_data, 0, free_dir, dp);
+ VALUE dir = TypedData_Make_Struct(klass, struct dir_data, &dir_data_type, dp);
- dir_initialize(dir, dirname);
+ dir_initialize(argc, argv, dir);
if (rb_block_given_p()) {
return rb_ensure(rb_yield, dir, dir_close, dir);
}
@@ -333,29 +457,52 @@ dir_s_open(klass, dirname)
}
static void
-dir_closed()
+dir_closed(void)
{
rb_raise(rb_eIOError, "closed directory");
}
-static void
-dir_check(dir)
- VALUE dir;
+static struct dir_data *
+dir_check(VALUE dir)
{
- if (!OBJ_TAINTED(dir) && rb_safe_level() >= 4)
- rb_raise(rb_eSecurityError, "Insecure: operation on untainted Dir");
+ struct dir_data *dirp;
+ if (!OBJ_UNTRUSTED(dir) && rb_safe_level() >= 4)
+ rb_raise(rb_eSecurityError, "Insecure: operation on trusted Dir");
rb_check_frozen(dir);
+ dirp = rb_check_typeddata(dir, &dir_data_type);
+ if (!dirp->dir) dir_closed();
+ return dirp;
}
-#define GetDIR(obj, dirp) do {\
- dir_check(dir);\
- Data_Get_Struct(obj, struct dir_data, dirp);\
- if (dirp->dir == NULL) dir_closed();\
-} while (0)
+#define GetDIR(obj, dirp) ((dirp) = dir_check(obj))
+
/*
* call-seq:
- * dir.path => string or nil
+ * dir.inspect -> string
+ *
+ * Return a string describing this Dir object.
+ */
+static VALUE
+dir_inspect(VALUE dir)
+{
+ struct dir_data *dirp;
+
+ TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dirp);
+ if (!NIL_P(dirp->path)) {
+ VALUE str = rb_str_new_cstr("#<");
+ rb_str_append(str, rb_class_name(CLASS_OF(dir)));
+ rb_str_cat2(str, ":");
+ rb_str_append(str, dirp->path);
+ rb_str_cat2(str, ">");
+ return str;
+ }
+ return rb_funcall(dir, rb_intern("to_s"), 0, 0);
+}
+
+/*
+ * call-seq:
+ * dir.path -> string or nil
*
* Returns the path parameter passed to <em>dir</em>'s constructor.
*
@@ -363,19 +510,64 @@ dir_check(dir)
* d.path #=> ".."
*/
static VALUE
-dir_path(dir)
- VALUE dir;
+dir_path(VALUE dir)
{
struct dir_data *dirp;
- GetDIR(dir, dirp);
- if (!dirp->path) return Qnil;
- return rb_str_new2(dirp->path);
+ TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dirp);
+ if (NIL_P(dirp->path)) return Qnil;
+ return rb_str_dup(dirp->path);
}
+#if defined HAVE_READDIR_R
+# define READDIR(dir, enc, entry, dp) (readdir_r((dir), (entry), &(dp)) == 0 && (dp) != 0)
+#elif defined _WIN32
+# define READDIR(dir, enc, entry, dp) (((dp) = rb_w32_readdir((dir), (enc))) != 0)
+#else
+# define READDIR(dir, enc, entry, dp) (((dp) = readdir(dir)) != 0)
+#endif
+#if defined HAVE_READDIR_R
+# define IF_HAVE_READDIR_R(something) something
+#else
+# define IF_HAVE_READDIR_R(something) /* nothing */
+#endif
+
+#if defined SIZEOF_STRUCT_DIRENT_TOO_SMALL
+# include <limits.h>
+# define NAME_MAX_FOR_STRUCT_DIRENT 255
+# if defined NAME_MAX
+# if NAME_MAX_FOR_STRUCT_DIRENT < NAME_MAX
+# undef NAME_MAX_FOR_STRUCT_DIRENT
+# define NAME_MAX_FOR_STRUCT_DIRENT NAME_MAX
+# endif
+# endif
+# if defined _POSIX_NAME_MAX
+# if NAME_MAX_FOR_STRUCT_DIRENT < _POSIX_NAME_MAX
+# undef NAME_MAX_FOR_STRUCT_DIRENT
+# define NAME_MAX_FOR_STRUCT_DIRENT _POSIX_NAME_MAX
+# endif
+# endif
+# if defined _XOPEN_NAME_MAX
+# if NAME_MAX_FOR_STRUCT_DIRENT < _XOPEN_NAME_MAX
+# undef NAME_MAX_FOR_STRUCT_DIRENT
+# define NAME_MAX_FOR_STRUCT_DIRENT _XOPEN_NAME_MAX
+# endif
+# endif
+# define DEFINE_STRUCT_DIRENT \
+ union { \
+ struct dirent dirent; \
+ char dummy[offsetof(struct dirent, d_name) + \
+ NAME_MAX_FOR_STRUCT_DIRENT + 1]; \
+ }
+# define STRUCT_DIRENT(entry) ((entry).dirent)
+#else
+# define DEFINE_STRUCT_DIRENT struct dirent
+# define STRUCT_DIRENT(entry) (entry)
+#endif
+
/*
* call-seq:
- * dir.read => string or nil
+ * dir.read -> string or nil
*
* Reads the next entry from <em>dir</em> and returns it as a string.
* Returns <code>nil</code> at the end of the stream.
@@ -386,34 +578,33 @@ dir_path(dir)
* d.read #=> "config.h"
*/
static VALUE
-dir_read(dir)
- VALUE dir;
+dir_read(VALUE dir)
{
struct dir_data *dirp;
struct dirent *dp;
+ IF_HAVE_READDIR_R(DEFINE_STRUCT_DIRENT entry);
GetDIR(dir, dirp);
errno = 0;
- dp = readdir(dirp->dir);
- if (dp) {
- return rb_tainted_str_new(dp->d_name, NAMLEN(dp));
- }
- else if (errno == 0) { /* end of stream */
- return Qnil;
+ if (READDIR(dirp->dir, dirp->enc, &STRUCT_DIRENT(entry), dp)) {
+ return rb_external_str_new_with_enc(dp->d_name, NAMLEN(dp), dirp->enc);
}
else {
- rb_sys_fail(0);
+ if (errno != 0) rb_sys_fail(0);
+ return Qnil; /* end of stream */
}
- return Qnil; /* not reached */
}
/*
* call-seq:
- * dir.each { |filename| block } => dir
+ * dir.each { |filename| block } -> dir
+ * dir.each -> an_enumerator
*
* Calls the block once for each entry in this directory, passing the
* filename of each entry as a parameter to the block.
*
+ * If no block is given, an enumerator is returned instead.
+ *
* d = Dir.new("testdir")
* d.each {|x| puts "Got #{x}" }
*
@@ -425,25 +616,27 @@ dir_read(dir)
* Got main.rb
*/
static VALUE
-dir_each(dir)
- VALUE dir;
+dir_each(VALUE dir)
{
struct dir_data *dirp;
struct dirent *dp;
+ IF_HAVE_READDIR_R(DEFINE_STRUCT_DIRENT entry);
+ RETURN_ENUMERATOR(dir, 0, 0);
GetDIR(dir, dirp);
rewinddir(dirp->dir);
- for (dp = readdir(dirp->dir); dp != NULL; dp = readdir(dirp->dir)) {
- rb_yield(rb_tainted_str_new(dp->d_name, NAMLEN(dp)));
+ while (READDIR(dirp->dir, dirp->enc, &STRUCT_DIRENT(entry), dp)) {
+ rb_yield(rb_external_str_new_with_enc(dp->d_name, NAMLEN(dp), dirp->enc));
if (dirp->dir == NULL) dir_closed();
}
return dir;
}
+#ifdef HAVE_TELLDIR
/*
* call-seq:
- * dir.pos => integer
- * dir.tell => integer
+ * dir.pos -> integer
+ * dir.tell -> integer
*
* Returns the current position in <em>dir</em>. See also
* <code>Dir#seek</code>.
@@ -454,24 +647,23 @@ dir_each(dir)
* d.tell #=> 12
*/
static VALUE
-dir_tell(dir)
- VALUE dir;
+dir_tell(VALUE dir)
{
-#ifdef HAVE_TELLDIR
struct dir_data *dirp;
long pos;
GetDIR(dir, dirp);
pos = telldir(dirp->dir);
return rb_int2inum(pos);
+}
#else
- rb_notimplement();
+#define dir_tell rb_f_notimplement
#endif
-}
+#ifdef HAVE_SEEKDIR
/*
* call-seq:
- * dir.seek( integer ) => dir
+ * dir.seek( integer ) -> dir
*
* Seeks to a particular location in <em>dir</em>. <i>integer</i>
* must be a value returned by <code>Dir#tell</code>.
@@ -484,24 +676,22 @@ dir_tell(dir)
* d.read #=> ".."
*/
static VALUE
-dir_seek(dir, pos)
- VALUE dir, pos;
+dir_seek(VALUE dir, VALUE pos)