]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/fortune.rb
mark translatable strings in nickserv.rb, po update
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / fortune.rb
index 467d452dffce28521da225d3b40425f813f6c033..adb6a839a656a0897387508d6792ed63792b222d 100644 (file)
@@ -1,5 +1,10 @@
+#-- vim:sw=2:et
+#++
+#
+# :title: Fortune plugin
+
 class FortunePlugin < Plugin
-  BotConfig.register BotConfigStringValue.new('fortune.path',
+  Config.register Config::StringValue.new('fortune.path',
     :default => '',
     :desc => "Full path to the fortune executable")
 
@@ -66,7 +71,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