summaryrefslogtreecommitdiff
path: root/data/rbot/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'data/rbot/plugins')
-rw-r--r--data/rbot/plugins/ri.rb22
1 files changed, 17 insertions, 5 deletions
diff --git a/data/rbot/plugins/ri.rb b/data/rbot/plugins/ri.rb
index f55cdf4d..5bde894c 100644
--- a/data/rbot/plugins/ri.rb
+++ b/data/rbot/plugins/ri.rb
@@ -1,15 +1,27 @@
+#-- vim:sw=2:et
+#++
+#
+# :title: 'ri' -- ruby documentation plugin
+#
+# Author: Michael Brailsford <brailsmt@yahoo.com> aka brailsmt
+# Author:: dmitry kim <dmitry dot kim at gmail dot com>
+# Copyright:: (C) 2007, dmitry kim
+# Copyright:: (C) Michael Brailsford
+# License:: MIT
+#
+
class RiPlugin < Plugin
+ RI_COMMAND = %w{ri -f simple -T}
+
BotConfig.register BotConfigIntegerValue.new('ri.max_length',
:default => 512,
:desc => "Maximum length of ri entry (in bytes) which is ok to be sent to channels")
-
- RI_COMMAND = %w{ri -f simple -T}
-
def help(plugin, topic="")
"ri <something> => returns ruby documentation for <something>"
end
+
def ri(m, params)
args = RI_COMMAND.dup
if a = params[:something]
@@ -34,6 +46,6 @@ class RiPlugin < Plugin
return
end
end
+
plugin = RiPlugin.new
-plugin.map 'ri :something',
- :requirements => {:something => /^((-c)|(\w\S+))$/}
+plugin.map 'ri :something', :requirements => {:something => /^((-c)|(\w\S+))$/}