From 40c32ccb24cdaac307d4cf12646c3e869817a153 Mon Sep 17 00:00:00 2001 From: franz Date: Mon, 15 Jun 2009 20:41:01 +0200 Subject: ruby 1.9: get rid of Array#nitems Array#nitems is gone in ruby 1.9, changed rbot code to use Array.compact.size, which works in both 1.8 & 1.9 --- data/rbot/plugins/quotes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data/rbot/plugins') diff --git a/data/rbot/plugins/quotes.rb b/data/rbot/plugins/quotes.rb index bb5ae57e..c1066689 100644 --- a/data/rbot/plugins/quotes.rb +++ b/data/rbot/plugins/quotes.rb @@ -80,7 +80,7 @@ class QuotePlugin < Plugin end else # random quote - return @lists[channel].compact[rand(@lists[channel].nitems)], + return @lists[channel].compact.pick_one, @lists[channel].length - 1 end end -- cgit v1.2.3