From 08d2ed9279e97e08028b810e2a11a62a7f270e28 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 24 Jun 2008 00:56:37 +0200 Subject: spell plugin: spell program is a config option --- data/rbot/plugins/spell.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'data/rbot/plugins') 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 => check spelling of , 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 -- cgit v1.2.3