X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fspell.rb;h=ba5cfc19f09550571fb2400af0f2f874088c1b7b;hb=7bee70f012b85c03f73fa3e765417a939e02a5cf;hp=3d77ebb0508ff22608eb6d2e5c71898a8152c846;hpb=aac060923bb64774d4a54a1dd8e5c1dfc2a70a4f;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/spell.rb b/data/rbot/plugins/spell.rb index 3d77ebb0..ba5cfc19 100644 --- a/data/rbot/plugins/spell.rb +++ b/data/rbot/plugins/spell.rb @@ -4,9 +4,12 @@ # :title: Spell plugin class SpellPlugin < Plugin - Config.register Config::StringValue.new('spell.program', + Config.register Config::StringValue.new('spell.path', :default => 'ispell', - :desc => _('Program to use to check spelling')) + :desc => _('Path to the program to use to check spelling')) + Config.register Config::StringValue.new('spell.command_line', + :default => '%s -a -S', + :desc => _('Command line used to call the spell.path. Use %s as a placeholder for the executable name')) def help(plugin, topic="") _("spell => check spelling of , suggest alternatives") @@ -18,7 +21,7 @@ class SpellPlugin < Plugin end begin - IO.popen("%{prog} -a -S" % {:prog => @bot.config['spell.program']}, "w+") { |p| + IO.popen(@bot.config['spell.command_line'] % @bot.config['spell.path'], "w+") { |p| p.puts m.params p.close_write p.each_line { |l| @@ -36,11 +39,11 @@ class SpellPlugin < Plugin } } rescue - m.reply(_("couldn't exec %{prog} :(") % {:prog => @bot.config['spell.program']}) + m.reply(_("couldn't exec %{prog} :(") % {:prog => @bot.config['spell.path']}) return end m.reply(_("something odd happened while checking %{word} with %{prog}") % { - :word => m.params, :prog => @bot.config['spell.program'] + :word => m.params, :prog => @bot.config['spell.path'] }) end end