summaryrefslogtreecommitdiff
path: root/data/rbot
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-09-09 06:44:57 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-09-09 06:44:57 +0000
commit17bbbbc1dfd32f0914ca1c5472a1268df3673b27 (patch)
tree4a4fa77ce94bb4d72e32c066157a75802f54e23d /data/rbot
parent9c6be0ed315a53cd7d9a10e4c682f94afabd6c3d (diff)
fortune plugin: suppress warning and make source more readable
Diffstat (limited to 'data/rbot')
-rw-r--r--data/rbot/plugins/fortune.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/data/rbot/plugins/fortune.rb b/data/rbot/plugins/fortune.rb
index 467d452d..d258e9ba 100644
--- a/data/rbot/plugins/fortune.rb
+++ b/data/rbot/plugins/fortune.rb
@@ -66,7 +66,13 @@ class FortunePlugin < Plugin
# Print the fortune categories
def categories(m, params)
## list all fortune files in /usr/share/games/fortune
- categories = Dir["/usr/share/games/fortune/*"].select{|f|File.split(f).last.match /^\w+$/}.select{|f|File.file? f}.map{|p|File.split(p).last}.sort
+ categories = Dir["/usr/share/games/fortune/*"].select{ |f|
+ File.split(f).last.match(/^\w+$/)
+ }.select{ |f|
+ File.file?(f)
+ }.map{ |p|
+ File.split(p).last
+ }.sort
## say 'em!
m.reply "Fortune categories: #{categories.join ', '}"
end