summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-06 10:12:12 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-06 10:12:12 +0000
commitf2ba46eefaacbd786e0cd4bff8ed904008c15291 (patch)
treee8e6f9b4257a9812c4abb589d23456c4a9cceb98 /ext
parent121de31d0331bd5310aad3d89cc0ad3883273d69 (diff)
Merge changes from ruby_1_8:
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@12008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/digest/lib/md5.rb17
-rw-r--r--ext/digest/lib/sha1.rb17
-rw-r--r--ext/tk/sample/irbtkw.rbw7
3 files changed, 32 insertions, 9 deletions
diff --git a/ext/digest/lib/md5.rb b/ext/digest/lib/md5.rb
index 1d05d7d..c399f2d 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 c4ac6f6..4446e12 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 92fa569..f6a35be 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