From 86300ebcec367489cca67042affa00152f3200ad Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 15 Dec 2008 10:03:40 +0100 Subject: [PATCH] utils.rb: fix handling of require return value Things such as ActiveRecord can alter the return value of Kernel::require, turning it into an array, so check for this case too. --- lib/rbot/core/utils/utils.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rbot/core/utils/utils.rb b/lib/rbot/core/utils/utils.rb index 084f92a5..11bf722c 100644 --- a/lib/rbot/core/utils/utils.rb +++ b/lib/rbot/core/utils/utils.rb @@ -22,7 +22,9 @@ rescue LoadError rescue LoadError gems = false end - if gems + # ActiveRecord alters Kernel::require making it returns an empty array + # instead of false + if gems or (Array === gems and not gems.empty?) retry else module ::Irc -- 2.32.0.93.g670b81a890