]>
gitweb.michael.orlitzky.com - mailshears.git/blob - lib/rm/rm_runner.rb
1 require 'common/errors'
2 require 'common/runner'
7 def run(cfg
, plugin
, *targets
)
8 targets
.each
do |target
|
9 remove_target(plugin
, target
)
15 def remove_target(plugin
, target
)
16 # Wrap the "remove this thing" operation so that it can be reused
17 # in the prine plugin.
18 target_description
= plugin
.describe(target
)
22 msg
= "Removed #{target.class.to_s().downcase()} #{target}"
24 # Only append the extra description if it's useful.
25 if not target_description
.nil? and
26 not target_description
.empty
? and
27 not target_description
== target
.to_s() then
28 msg +
= " (#{target_description})"
33 rescue NonexistentDomainError
, NonexistentUserError
=> e
34 report(plugin
, "#{target.class.to_s()} #{e.to_s} not found.")