require 'multi_rubocops/version' require 'rake' require 'thread' require 'rspec/core' require 'rspec/core/rake_task' require 'rubocop/rake_task' #TODO: Compile output into human readable module MultiRubocops def self.call root_folder = Dir.pwd output = [] threads = procdir(root_folder).map do |files| Thread.new(files) do |file| puts "thread: #{file}" output << `rubocop #{files}` end end threads.each(&:join) puts output end def self.procdir(dir) Dir[File.join(dir, '**', '*')].reject { |p| File.directory? p } end def self.call_single_thread root_folder = Dir.pwd procdir(root_folder) output = `rubocop` puts output end end