]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/spell.rb
figlet plugin: check paths and fonts using Utils.safe_exec
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / spell.rb
index 3d77ebb0508ff22608eb6d2e5c71898a8152c846..5c98430bdea9c3ab6e76fa70a797fe66b5d89a9d 100644 (file)
@@ -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.program. Use %s as a placeholder for the executable name'))
 
   def help(plugin, topic="")
     _("spell <word> => check spelling of <word>, 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.program'], "w+") { |p|
         p.puts m.params
         p.close_write
         p.each_line { |l|