From e9b652aa2a047557aaa1a68278d9d402f56d45b2 Mon Sep 17 00:00:00 2001 From: Matthias H Date: Wed, 4 Sep 2013 02:28:24 +0200 Subject: ruby 2.0.0: fix for changed @waiters in compat19 I don't really know what this is all about, but this fixes a bug with the compat19 monkeypatching. @waiters is now a Hash. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=38109&view=revision --- lib/rbot/compat19.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/rbot/compat19.rb b/lib/rbot/compat19.rb index c32d1ecb..2082ff51 100644 --- a/lib/rbot/compat19.rb +++ b/lib/rbot/compat19.rb @@ -12,7 +12,11 @@ class ConditionVariable begin # TODO: mutex should not be used @waiters_mutex.synchronize do - @waiters.push(Thread.current) + if @waiters.instance_of? Hash # ruby 2.0.0? + @waiters[Thread.current] = true + else + @waiters.push(Thread.current) + end end if timeout elapsed = mutex.sleep timeout if timeout > 0.0 -- cgit v1.2.3