module RubyQA class Manager attr_reader :resources, :hosts @@tests = Array.new @@hosts = Array.new class << self def tests @@tests end def hosts @@hosts end def add_host(host) @@hosts << host register_resources(host) update_resources(host) end def register_resources (host) Resource.all_resources.each do |resource| host.add_resource(resource) end end def update_resources (host) host.update_resources end def new_test(name, options={}, &test_proc) if not options.has_key? :disabled @@tests << Test.new(name, **options, &test_proc) elsif options[:disabled] != true @@tests << Test.new(name, **options, &test_proc) end end def run_tests @@hosts.each do |host| tests = @@tests.select{|test| test.valid_host(host)} tests.each do |test| test.run(host) end end end def report (template = nil) if not template.nil? template.result(binding) else render end end end end RubyQA::Template::BASE_REPORT_TEMPLATE.def_method(RubyQA::Manager.class, 'render') end