summaryrefslogtreecommitdiff
path: root/lib/rbot/plugins/fortune.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbot/plugins/fortune.rb')
-rw-r--r--lib/rbot/plugins/fortune.rb22
1 files changed, 0 insertions, 22 deletions
diff --git a/lib/rbot/plugins/fortune.rb b/lib/rbot/plugins/fortune.rb
deleted file mode 100644
index 184b6b13..00000000
--- a/lib/rbot/plugins/fortune.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-class FortunePlugin < Plugin
- def help(plugin, topic="")
- "fortune [<module>] => get a (short) fortune, optionally specifying fortune db"
- end
- def fortune(m, params)
- db = params[:db]
- fortune = nil
- ["/usr/games/fortune", "/usr/bin/fortune", "/usr/local/bin/fortune"].each {|f|
- if FileTest.executable? f
- fortune = f
- break
- end
- }
- m.reply "fortune binary not found" unless fortune
- ret = Utils.safe_exec(fortune, "-n", "255", "-s", db)
- m.reply ret.gsub(/\t/, " ").split(/\n/).join(" ")
- return
- end
-end
-plugin = FortunePlugin.new
-plugin.map 'fortune :db', :defaults => {:db => 'fortunes'},
- :requirements => {:db => /^[^-][\w-]+$/}