diff options
Diffstat (limited to 'data/rbot/plugins/fortune.rb')
-rw-r--r-- | data/rbot/plugins/fortune.rb | 8 |
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 |