diff options
-rw-r--r-- | ChangeLog | 21 | ||||
-rw-r--r-- | NEWS | 20 | ||||
-rw-r--r-- | ext/digest/lib/md5.rb | 17 | ||||
-rw-r--r-- | ext/digest/lib/sha1.rb | 17 | ||||
-rw-r--r-- | ext/tk/sample/irbtkw.rbw | 7 | ||||
-rw-r--r-- | lib/shell/process-controller.rb | 8 | ||||
-rw-r--r-- | time.c | 40 | ||||
-rw-r--r-- | version.h | 6 |
8 files changed, 94 insertions, 42 deletions
@@ -1,3 +1,24 @@ +Tue Mar 6 19:03:42 2007 Akinori MUSHA <knu@iDaemons.org> + + * ext/digest/lib/md5.rb (MD5::new, MD5::md5): Do not modify + Digest::MD5. + + * ext/digest/lib/sha1.rb (SHA1::new, SHA1::sha1): Ditto. + + * lib/shell/process-controller.rb: fix thread synchronization + problem for [ruby-dev:30477]. + + * ext/digest/lib/md5.rb (MD5::new, MD5::md5): Catch up with + Digest's API changes; noted by: Kazuhiro Yoshida <moriq AT + moriq.com> in [ruby-dev:30500]. + + * ext/digest/lib/sha1.rb (SHA1::new, SHA1::sha1): Ditto. + + * time.c (time_to_s): Back out the format changes; discussed + in [ruby-dev:30495]. + + * ext/tk/sample/irbtkw.rbw: fails to exit process. + Mon Mar 5 20:26:10 2007 Akinori MUSHA <knu@iDaemons.org> * time.c (time_to_s): Correct the wrong format which did not @@ -37,6 +37,18 @@ with all sufficient information, see the ChangeLog file. * tk + * Tk::X_Scrollable (Y_Scrollable) is renamed to Tk::XScrollable + (YScrollable). Tk::X_Scrollable (Y_Scrollable) is still available, + but it is an alias name. + + * Updated Tile extension support based on Tile 0.7.8. + + * Support --without-X11 configure option for non-X11 versions of + Tcl/Tk (e.g. Tcl/Tk Aqua). + + * New sample script: irbtkw.rbw -- IRB on Ruby/Tk. It has no trouble + about STDIN blocking on Windows. + === New methods and features * builtin classes @@ -77,14 +89,6 @@ with all sufficient information, see the ChangeLog file. * builtin classes - * Time#to_s now returns a string in a form that - conforms to RFC2822. - - # Before - "Wed Mar 03 12:34:56 JST 2007" - # After - "Wed, 03 Mar 2007 12:34:56 +0900" - * String#intern now raises SecurityError when $SAFE level is greater than zero. diff --git a/ext/digest/lib/md5.rb b/ext/digest/lib/md5.rb index 1d05d7d04e..c399f2de1d 100644 --- a/ext/digest/lib/md5.rb +++ b/ext/digest/lib/md5.rb @@ -5,10 +5,19 @@ require 'digest/md5' -MD5 = Digest::MD5 +class MD5 < Digest::MD5 + class << self + alias orig_new new + def new(str = nil) + if str + orig_new.update(str) + else + orig_new + end + end -class MD5 - def self.md5(*args) - new(*args) + def md5(*args) + new(*args) + end end end diff --git a/ext/digest/lib/sha1.rb b/ext/digest/lib/sha1.rb index c4ac6f66ea..4446e12e8d 100644 --- a/ext/digest/lib/sha1.rb +++ b/ext/digest/lib/sha1.rb @@ -5,10 +5,19 @@ require 'digest/sha1' -SHA1 = Digest::SHA1 +class SHA1 < Digest::SHA1 + class << self + alias orig_new new + def new(str = nil) + if str + orig_new.update(str) + else + orig_new + end + end -class SHA1 - def self.sha1(*args) - new(*args) + def sha1(*args) + new(*args) + end end end diff --git a/ext/tk/sample/irbtkw.rbw b/ext/tk/sample/irbtkw.rbw index 92fa5692f2..f6a35be6ed 100644 --- a/ext/tk/sample/irbtkw.rbw +++ b/ext/tk/sample/irbtkw.rbw @@ -26,7 +26,11 @@ console.yscrollbar(TkScrollbar.new(top, :width=>10).pack(:before=>console, :side=>:right, :expand=>false, :fill=>:y)) -ev_loop = Thread.new{Tk.mainloop} +irb_thread = nil +ev_loop = Thread.new{ + Tk.mainloop + irb_thread.kill if irb_thread +} # window position control root = Tk.root @@ -116,4 +120,5 @@ console.bind('Control-c'){ irb_thread.join # exit +ev_thread.kill Tk.exit diff --git a/lib/shell/process-controller.rb b/lib/shell/process-controller.rb index f74abfd686..8929805506 100644 --- a/lib/shell/process-controller.rb +++ b/lib/shell/process-controller.rb @@ -246,9 +246,11 @@ class Shell redo end Thread.exclusive do - terminate_job(command) - @job_condition.signal - command.notify "job(%id) finish.", @shell.debug? + @job_monitor.synchronize do + terminate_job(command) + @job_condition.signal + command.notify "job(%id) finish.", @shell.debug? + end end end } @@ -1239,11 +1239,11 @@ time_asctime(time) * time.to_s => string * * Returns a string representing <i>time</i>. Equivalent to calling - * <code>Time#strftime</code> with a format string of ``<code>%a,</code> - * <code>%d</code> <code>%b</code> <code>%H:%M:%S</code> - * <code>%Z</code> <code>%Y</code>'' (the RFC 2822 style). + * <code>Time#strftime</code> with a format string of ``<code>%a</code> + * <code>%b</code> <code>%d</code> <code>%H:%M:%S</code> + * <code>%Z</code> <code>%Y</code>''. * - * Time.now.to_s #=> "Wed 09 Apr 08:56:04 CDT 2003" + * Time.now.to_s #=> "Wed Apr 09 08:56:04 CDT 2003" */ static VALUE @@ -1253,30 +1253,32 @@ time_to_s(time) struct time_object *tobj; char buf[128]; int len; - time_t off; - char buf2[32]; - char sign = '+'; -#if !defined(HAVE_STRUCT_TM_TM_GMTOFF) - VALUE tmp; -#endif GetTimeval(time, tobj); if (tobj->tm_got == 0) { time_get_tm(time, tobj->gmt); } + if (tobj->gmt == 1) { + len = strftime(buf, 128, "%a %b %d %H:%M:%S UTC %Y", &tobj->tm); + } + else { + time_t off; + char buf2[32]; + char sign = '+'; #if defined(HAVE_STRUCT_TM_TM_GMTOFF) - off = tobj->tm.tm_gmtoff; + off = tobj->tm.tm_gmtoff; #else - tmp = time_utc_offset(time); - off = NUM2INT(tmp); + VALUE tmp = time_utc_offset(time); + off = NUM2INT(tmp); #endif - if (off < 0) { - sign = '-'; - off = -off; + if (off < 0) { + sign = '-'; + off = -off; + } + sprintf(buf2, "%%a %%b %%d %%H:%%M:%%S %c%02d%02d %%Y", + sign, (int)(off/3600), (int)(off%3600/60)); + len = strftime(buf, 128, buf2, &tobj->tm); } - sprintf(buf2, "%%a, %%d %%b %%Y %%H:%%M:%%S %c%02d%02d", - sign, (int)(off/3600), (int)(off%3600/60)); - len = strftime(buf, 128, buf2, &tobj->tm); return rb_str_new(buf, len); } @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.8.6" -#define RUBY_RELEASE_DATE "2007-03-05" +#define RUBY_RELEASE_DATE "2007-03-06" #define RUBY_VERSION_CODE 186 -#define RUBY_RELEASE_CODE 20070305 +#define RUBY_RELEASE_CODE 20070306 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 6 #define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_MONTH 3 -#define RUBY_RELEASE_DAY 5 +#define RUBY_RELEASE_DAY 6 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; |