lib/testlab/utility/misc.rb in testlab-0.9.1 vs lib/testlab/utility/misc.rb in testlab-1.0.0

- old
+ new

@@ -42,9 +42,20 @@ ZTK::Benchmark.bench(:ui => ui, :message => message, :mark => mark) do yield end end + def do_provisioner_callbacks(object, action, ui) + klass = object.class.to_s.split('::').last + method_name = %(on_#{klass.downcase}_#{action.to_s.downcase}).to_sym + + object.provisioners.each do |provisioner| + ui.logger.info { ">>>>> #{object.id.to_s.upcase} #{klass.upcase} #{action.to_s.upcase} [#{method_name}] (#{provisioner}) <<<<<" } + p = provisioner.new(object.config, ui) + p.respond_to?(method_name) and p.send(method_name, object) + end + end + end end end