diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-04-10 05:48:43 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-04-10 05:48:43 +0000 |
commit | 12e1ee3abd5587c9d0750700a2478b2fbf8904d1 (patch) | |
tree | 2897ec289b6190b3b51602bf4ca0ebbcaad2622f | |
parent | bb1321b4e52b0a6cec5003487215dc364739c897 (diff) |
2000-04-10
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 32 | ||||
-rw-r--r-- | enum.c | 2 | ||||
-rw-r--r-- | error.c | 2 | ||||
-rw-r--r-- | eval.c | 9 | ||||
-rw-r--r-- | ext/dbm/dbm.c | 2 | ||||
-rw-r--r-- | ext/extmk.rb.in | 4 | ||||
-rw-r--r-- | ext/gdbm/gdbm.c | 2 | ||||
-rw-r--r-- | ext/tk/lib/tktext.rb | 182 | ||||
-rw-r--r-- | gc.c | 4 | ||||
-rw-r--r-- | io.c | 4 | ||||
-rw-r--r-- | lib/ftplib.rb | 2 | ||||
-rw-r--r-- | lib/mkmf.rb | 2 | ||||
-rw-r--r-- | lib/shellwords.rb | 31 | ||||
-rw-r--r-- | ruby.h | 1 | ||||
-rw-r--r-- | version.h | 4 |
15 files changed, 165 insertions, 118 deletions
@@ -1,3 +1,35 @@ +Thu Apr 6 20:10:47 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp> + + * ext/extmk.rb.in (create_makefile): BeOS --program-suffix support. + * lib/mkmf.rb (create_makefile): ditto. + +Thu Apr 6 09:55:26 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp> + + * error.c (rb_sys_fail): need rb_exc_new2() call on BeOS. + +Mon Apr 3 17:22:27 2000 Yukihiro Matsumoto <matz@netlab.co.jp> + + * eval.c (catch_i): should supply argument. + +Sat Apr 1 21:30:53 2000 WATANABE Hirofumi <eban@os.rim.or.jp> + + * io.c(rb_io_printf, rb_f_printf): should use rb_io_write. + +Sat Apr 1 00:16:05 2000 Yukihiro Matsumoto <matz@netlab.co.jp> + + * gc.c (rb_gc_call_finalizer_at_exit): should be clear flags + before calling finalizers. + +Thu Mar 30 12:19:44 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp> + + * enum.c (enum_find): rb_eval_cmd() should be called with array. + +Tue Mar 28 13:57:05 2000 Clemens Hintze <c.hintze@gmx.net> + + * ext/dbm/dbm.c (fdbm_invert): should return new hash. + + * ext/gdbm/gdbm.c (fgdbm_invert): ditto. + Fri Mar 24 18:26:51 2000 Yukihiro Matsumoto <matz@netlab.co.jp> * file.c (test_check): should have checked exact number of arguments. @@ -92,7 +92,7 @@ enum_find(argc, argv, obj) return arg.val; } if (!NIL_P(if_none)) { - rb_eval_cmd(if_none, Qnil); + rb_eval_cmd(if_none, rb_ary_new2(0)); } return Qnil; } @@ -663,8 +663,8 @@ rb_sys_fail(mesg) else { ee = syserr_list[n]; } - ee = rb_exc_new2(ee, buf); #endif + ee = rb_exc_new2(ee, buf); rb_iv_set(ee, "errno", INT2FIX(n)); rb_exc_raise(ee); } @@ -393,11 +393,13 @@ rb_attr(klass, id, read, write, ex) attriv = rb_intern(buf); if (read) { rb_add_method(klass, id, NEW_IVAR(attriv), noex); + rb_funcall(klass, rb_intern("method_added"), 1, INT2FIX(id)); } sprintf(buf, "%s=", name); id = rb_intern(buf); if (write) { rb_add_method(klass, id, NEW_ATTRSET(attriv), noex); + rb_funcall(klass, rb_intern("method_added"), 1, INT2FIX(id)); } } @@ -5072,6 +5074,7 @@ rb_mod_modfunc(argc, argv, module) } rb_clear_cache_by_id(id); rb_add_method(rb_singleton_class(module), id, body->nd_body, NOEX_PUBLIC); + rb_funcall(module, rb_intern("singleton_method_added"), 1, INT2FIX(id)); } return module; } @@ -6253,6 +6256,10 @@ thread_free(th) if (th->stk_ptr) free(th->stk_ptr); th->stk_ptr = 0; if (th->locals) st_free_table(th->locals); + if (th->status != THREAD_KILLED) { + th->prev->next = th->next; + th->next->prev = th->prev; + } if (th != main_thread) free(th); } @@ -7605,7 +7612,7 @@ static VALUE catch_i(tag) ID tag; { - return rb_funcall(Qnil, rb_intern("catch"), 0, INT2FIX(tag)); + return rb_funcall(Qnil, rb_intern("catch"), 1, INT2FIX(tag)); } VALUE diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c index 4d83cec1b1..5f76c54a2a 100644 --- a/ext/dbm/dbm.c +++ b/ext/dbm/dbm.c @@ -262,7 +262,7 @@ fdbm_invert(obj) valstr = rb_tainted_str_new(val.dptr, val.dsize); rb_hash_aset(hash, valstr, keystr); } - return obj; + return hash; } static VALUE diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in index 20da2a4e47..4444399f3c 100644 --- a/ext/extmk.rb.in +++ b/ext/extmk.rb.in @@ -329,8 +329,8 @@ def create_makefile(target) $DLDFLAGS = '@DLDFLAGS@' - if RUBY_PLATFORM =~ /beos/ - $libs = $libs + " -lruby" + if RUBY_PLATFORM =~ /beos/ and not $static + $libs = $libs + " @LIBRUBYARG@" $DLDFLAGS = $DLDFLAGS + " -L" + $topdir end diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c index b38bb8ef48..3c6452a466 100644 --- a/ext/gdbm/gdbm.c +++ b/ext/gdbm/gdbm.c @@ -264,7 +264,7 @@ fgdbm_invert(obj) valstr = rb_tainted_str_new(val.dptr, val.dsize); rb_hash_aset(hash, valstr, keystr); } - return obj; + return hash; } static VALUE diff --git a/ext/tk/lib/tktext.rb b/ext/tk/lib/tktext.rb index 9e38db5032..2dea68980c 100644 --- a/ext/tk/lib/tktext.rb +++ b/ext/tk/lib/tktext.rb @@ -427,6 +427,98 @@ class TkText<TkTextWin def rsearch(pat,start,stop=None) rsearch_with_length(pat,start,stop)[0] end + + def _dump(type, *index) + str = tk_send('dump', type, *index) + result = [] + sel = nil + i = 0 + while i < str.size + # retrieve key + idx = str.index(/ /, i) + result.push str[i..(idx-1)] + i = idx + 1 + + # retrieve value + case result[-1] + when 'text' + if str[i] == ?{ + # text formed as {...} + val, i = _retrieve_braced_text(str, i) + result.push val + else + # text which may contain backslahes + val, i = _retrieve_backslashed_text(str, i) + result.push val + end + else + idx = str.index(/ /, i) + val = str[i..(idx-1)] + case result[-1] + when 'mark' + case val + when 'insert' + result.push TkTextMarkInsert.new(self) + when 'current' + result.push TkTextMarkCurrent.new(self) + when 'anchor' + result.push TkTextMarkAnchor.new(self) + else + result.push tk_tcl2rb(val) + end + when 'tagon' + if val == 'sel' + if sel + result.push sel + else + result.push TkTextTagSel.new(self) + end + else + result.push tk_tcl2rb val + end + when 'tagoff' + result.push tk_tcl2rb sel + when 'window' + result.push tk_tcl2rb val + end + i = idx + 1 + end + + # retrieve index + idx = str.index(/ /, i) + if idx + result.push str[i..(idx-1)] + i = idx + 1 + else + result.push str[i..-1] + break + end + end + + kvis = [] + until result.empty? + kvis.push [result.shift, result.shift, result.shift] + end + kvis # result is [[key1, value1, index1], [key2, value2, index2], ...] + end + private :_dump + + def dump_all(*index) + _dump('-all', *index) + end + def dump_mark(*index) + _dump('-mark', *index) + end + def dump_tag(*index) + _dump('-tag', *index) + end + def dump_text(*index) + _dump('-text', *index) + end + def dump_window(*index) + _dump('-window', *index) + end + end class TkTextTag<TkObject @@ -739,81 +831,6 @@ class TkTextWindow<TkObject end end - def _dump(type, *index) - str = tk_send('dump', type, *index) - result = [] - sel = nil - i = 0 - while i < str.size - # retrieve key - idx = str.index(/ /, i) - result.push str[i..(idx-1)] - i = idx + 1 - - # retrieve value - case result[-1] - when 'text' - if str[i] == ?{ - # text formed as {...} - val, i = _retrieve_braced_text(str, i) - result.push val - else - # text which may contain backslahes - val, i = _retrieve_backslashed_text(str, i) - result.push val - end - else - idx = str.index(/ /, i) - val = str[i..(idx-1)] - case result[-1] - when 'mark' - case val - when 'insert' - result.push TkTextMarkInsert.new(self) - when 'current' - result.push TkTextMarkCurrent.new(self) - when 'anchor' - result.push TkTextMarkAnchor.new(self) - else - result.push tk_tcl2rb(val) - end - when 'tagon' - if val == 'sel' - if sel - result.push sel - else - result.push TkTextTagSel.new(self) - end - else - result.push tk_tcl2rb val - end - when 'tagoff' - result.push tk_tcl2rb sel - when 'window' - result.push tk_tcl2rb val - end - i = idx + 1 - end - - # retrieve index - idx = str.index(/ /, i) - if idx - result.push str[i..(idx-1)] - i = idx + 1 - else - result.push str[i..-1] - break - end - end - - kvis = [] - until result.empty? - kvis.push [result.shift, result.shift, result.shift] - end - kvis # result is [[key1, value1, index1], [key2, value2, index2], ...] - end - private :_dump - def _retrieve_braced_text(str, i) cnt = 0 idx = i @@ -850,21 +867,6 @@ class TkTextWindow<TkObject end private :_retrieve_backslashed_text - def dump_all(*index) - _dump('-all', *index) - end - def dump_mark(*index) - _dump('-mark', *index) - end - def dump_tag(*index) - _dump('-tag', *index) - end - def dump_text(*index) - _dump('-text', *index) - end - def dump_window(*index) - _dump('-window', *index) - end end class TkTextImage<TkObject @@ -1134,8 +1134,10 @@ rb_gc_call_finalizer_at_exit() for (i = 0; i < heaps_used; i++) { p = heaps[i]; pend = p + HEAP_SLOTS; while (p < pend) { - if (FL_TEST(p, FL_FINALIZE)) + if (FL_TEST(p, FL_FINALIZE)) { + p->as.free.flag = 0; run_final((VALUE)p); + } p++; } } @@ -1857,7 +1857,7 @@ rb_io_printf(argc, argv, out) VALUE argv[]; VALUE out; { - io_write(out, rb_f_sprintf(argc, argv)); + rb_io_write(out, rb_f_sprintf(argc, argv)); return Qnil; } @@ -1877,7 +1877,7 @@ rb_f_printf(argc, argv) argv++; argc--; } - io_write(out, rb_f_sprintf(argc, argv)); + rb_io_write(out, rb_f_sprintf(argc, argv)); return Qnil; } diff --git a/lib/ftplib.rb b/lib/ftplib.rb index 0b90749274..4cb1b752d6 100644 --- a/lib/ftplib.rb +++ b/lib/ftplib.rb @@ -2,7 +2,7 @@ # ftplib.rb # -$stderr.puts 'Warning: ftplib.rb is obsolute: use net/ftp' +$stderr.puts 'Warning: ftplib.rb is obsolete: use net/ftp' require 'net/ftp' diff --git a/lib/mkmf.rb b/lib/mkmf.rb index f510e9c509..805be307d0 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -327,7 +327,7 @@ def create_makefile(target) $DLDFLAGS = CONFIG["DLDFLAGS"] if RUBY_PLATFORM =~ /beos/ - $libs = $libs + " -lruby" + $libs = $libs + " " + CONFIG["LIBRUBYARG"] $DLDFLAGS = $DLDFLAGS + " -L" + CONFIG["prefix"] + "/lib" end diff --git a/lib/shellwords.rb b/lib/shellwords.rb index 60996be17c..7b16c6cb52 100644 --- a/lib/shellwords.rb +++ b/lib/shellwords.rb @@ -2,43 +2,46 @@ # original is shellwords.pl # # Usage: -# require 'shellwords.rb' +# require 'shellwords' # words = Shellwords.shellwords(line) # # or # +# require 'shellwords' # include Shellwords # words = shellwords(line) module Shellwords def shellwords(line) - return '' unless line - line.sub! /^\s+/, '' + unless line.kind_of?(String) + raise ArgumentError, "Argument must be String class object." + end + line.sub!(/^\s+/, '') words = [] while line != '' field = '' while true - if line.sub! /^"(([^"\\]|\\.)*)"/, '' then #" + if line.sub!(/^"(([^"\\]|\\.)*)"/, '') then #" snippet = $1 - snippet.gsub! /\\(.)/, '\1' + snippet.gsub!(/\\(.)/, '\1') elsif line =~ /^"/ then #" - raise ArgError, "Unmatched double quote: #{line}" - elsif line.sub! /^'(([^'\\]|\\.)*)'/, '' then #' + raise ArgumentError, "Unmatched double quote: #{line}" + elsif line.sub!(/^'(([^'\\]|\\.)*)'/, '') then #' snippet = $1 - snippet.gsub! /\\(.)/, '\1' + snippet.gsub!(/\\(.)/, '\1') elsif line =~ /^'/ then #' - raise ArgError, "Unmatched single quote: #{line}" - elsif line.sub! /^\\(.)/, '' then + raise ArgumentError, "Unmatched single quote: #{line}" + elsif line.sub!(/^\\(.)/, '') then snippet = $1 - elsif line.sub! /^([^\s\\'"]+)/, '' then #' + elsif line.sub!(/^([^\s\\'"]+)/, '') then #' snippet = $1 else - line.sub! /^\s+/, '' + line.sub!(/^\s+/, '') break end - field += snippet + field.concat(snippet) end - words += field + words.push(field) end words end @@ -192,6 +192,7 @@ int rb_fix2int _((VALUE)); #define FIX2INT(x) FIX2LONG(x) #define FIX2UINT(x) FIX2ULONG(x) #endif +#define ID2SYM(x) INT2FIX(x) #define SYM2ID(x) FIX2INT(x) double rb_num2dbl _((VALUE)); @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.4.4" -#define RUBY_RELEASE_DATE "2000-03-24" +#define RUBY_RELEASE_DATE "2000-04-10" #define RUBY_VERSION_CODE 144 -#define RUBY_RELEASE_CODE 20000324 +#define RUBY_RELEASE_CODE 20000410 |