]> gitweb.michael.orlitzky.com - mailshears.git/blobdiff - bin/mailshears
Factor out plugin running into the Plugin module (along with the includers() handling).
[mailshears.git] / bin / mailshears
index 215bd6ba1f7bf046a71f0df9bbfaa7b34f384101..f7d5afa5b10c75264e92f275f4bfeb24724bb74e 100755 (executable)
@@ -101,20 +101,7 @@ require 'stringio'
 output_buffer = StringIO.new()
 $stdout = output_buffer
 
 output_buffer = StringIO.new()
 $stdout = output_buffer
 
-plugin_module.includers.each do |plugin_module_includer|
-  plugin = plugin_module_includer.new(cfg)
-
-  if cfg.i_mean_business then
-    runner = plugin.runner().new()
-  else
-    runner = plugin.dummy_runner().new()
-  end
-
-  # The splat passes the correct (we hope) number of arguments to the
-  # appropriate runner. The Rm(Dummy)Runner have splats on their
-  # *target arguments as well, to turn ARGV back into an array.
-  runner.run(plugin, *ARGV)
-end
+plugin_module.run(cfg, *ARGV)
 
 # Restore stdout, and print the header plus whatever the plugins
 # produced if they produced anything. If they didn't, we avoid
 
 # Restore stdout, and print the header plus whatever the plugins
 # produced if they produced anything. If they didn't, we avoid