summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-06-24 00:56:37 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-06-24 01:40:11 +0200
commit08d2ed9279e97e08028b810e2a11a62a7f270e28 (patch)
tree68638e4ac22de02bb73047048b08790e0cc8c70f
parent240af168463621d216dad3fa9c0242d8aa6b853b (diff)
spell plugin: spell program is a config option
-rw-r--r--data/rbot/plugins/spell.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/data/rbot/plugins/spell.rb b/data/rbot/plugins/spell.rb
index 7d58b79c..bb33a864 100644
--- a/data/rbot/plugins/spell.rb
+++ b/data/rbot/plugins/spell.rb
@@ -1,4 +1,13 @@
+#-- vim:sw=2:et
+#++
+#
+# :title: Spell plugin
+
class SpellPlugin < Plugin
+ Config.register Config::StringValue.new('spell.program',
+ :default => 'ispell',
+ :desc => _('Program to use to check spelling'))
+
def help(plugin, topic="")
_("spell <word> => check spelling of <word>, suggest alternatives")
end
@@ -7,7 +16,7 @@ class SpellPlugin < Plugin
m.reply _("incorrect usage: ") + help(m.plugin)
return
end
- p = IO.popen("ispell -a -S", "w+")
+ p = IO.popen("%{prog} -a -S" % {:prog => @bot.config['spell.program']}, "w+")
if(p)
p.puts m.params
p.close_write
@@ -32,7 +41,7 @@ class SpellPlugin < Plugin
}
p.close
else
- m.reply _("couldn't exec ispell :(")
+ m.reply(_("couldn't exec %{prog} :(") % {:prog => @bot.config['spell.program']})
return
end
end