lib,test: replace connection query() method with sync_exec{,_params}.
[mailshears.git] / lib / rm / rm_dummy_runner.rb
1 require 'common/runner'
2
3 # Dummy implementation of a {RmRunner}. Its <tt>run()</tt> method will
4 # tell you what would have been removed, but will not actually perform
5 # the operation.
6 #
7 class RmDummyRunner
8 include Runner
9
10
11 # Pretend to remove *targets*. Some "what if"
12 # information will be output to stdout.
13 #
14 # This dummy runner is not particularly useful on its own. About the
15 # only thing it does is let you know that the users/domains in
16 # *targets* do in fact exist (through their descriptions). It's used
17 # to good effect by {PruneDummyRunner}, though.
18 #
19 # @param cfg [Configuration] the configuration options to pass to
20 # the *plugin* we're runnning.
21 #
22 # @param plugin [RmPlugin] plugin that will perform the move.
23 #
24 # @param targets [Array<User,Domain>] the users and domains to be
25 # removed.
26 #
27 def run(cfg, plugin, *targets)
28 targets.each do |target|
29 target_description = plugin.describe(target)
30 msg = "Would remove #{target.class.to_s().downcase()} "
31 msg += add_description(target, target_description)
32 msg += '.'
33
34 report(plugin, msg)
35 end
36
37 end
38
39 end