]> gitweb.michael.orlitzky.com - mailshears.git/blobdiff - lib/common/runner.rb
Document everything with YARD and fix some bugs along the way.
[mailshears.git] / lib / common / runner.rb
index c48f89a4f629168d657142871bc19f46ed781c27..2bb66e03aebe2145f1eaf34c246eef08e363c49f 100644 (file)
@@ -1,5 +1,33 @@
+# Methods inherited by the various runner classes ({PruneRunner},
+# {MvRunner}, {RmRunner}).
+#
 module Runner
-  def run(plugin, targets)
+
+
+  # The main thing a runner does is <tt>run()</tt>. Each runner will
+  # actually take a different number of arguments, so their
+  # <tt>run()</tt> signatures will differ. This stub is only here to
+  # let you know that it needs to be implemented.
+  #
+  # @param args [Array<Object>] whatever arguments the real implementation
+  #   would take.
+  #
+  def run(*args)
     raise NotImplementedError
   end
+
+
+  # Report a message from the given *plugin*. All this does is prefix
+  # the message with the plugin name and then print it to stdout.
+  #
+  # @param plugin [Object] t plugin object that generated the message
+  #   we're reporting.
+  #
+  # @param msg [String] the message to report.
+  #
+  def report(plugin, msg)
+    print "#{plugin.class.to_s()} - "
+    puts msg
+  end
+
 end