lib/rails-audit/runner.rb in rails-audit-0.9.0 vs lib/rails-audit/runner.rb in rails-audit-0.10.0
- old
+ new
@@ -15,17 +15,30 @@
end
def self.run
config = load_config
- failures = run_threads config
+ concurrency = config['Concurrency'].nil? && true || config['Concurrency']
+ failures = concurrency && run_threads(config) || run_sequence(config)
+
if failures.any?
puts 'Failed tests:'
failures.each { |f| puts f }
end
failures.none?
+ end
+
+ def self.run_sequence(config)
+ failures = []
+
+ Audits::ALL.each do |audit|
+ success = audit.run get_config(config, audit.get_name)
+ failures << audit.get_name unless success
+ end
+
+ failures
end
def self.run_threads(config)
failures = []
mutex = Mutex.new