Sha256: 305f49b906b51fa90adafeb9fb2d35a1df819daa814e8472c2a14deaf788d601
Contents?: true
Size: 938 Bytes
Versions: 2
Compression:
Stored size: 938 Bytes
Contents
module RepoAnalyzer class ExtractProjectInfoJob < ApplicationJob def perform(repo_name, project_path) project_info = {} bridge = RepoAnalyzer::ProjectDataBridge.new(repo_name, project_path) for_each_extractor do |extractor| extracted_data = extractor.new(bridge).extract project_info.merge!(extracted_data) end project_info end private def for_each_extractor(&block) extractors_from_directory.each do |extractor| next if extractor == ::RepoAnalyzer::ProjectInfoExtractor block.call(extractor) end end def extractors_from_directory Dir[ RepoAnalyzer::Engine.root.join("app/extractors/repo_analyzer/*.rb") ].map do |path| file_name = path.split('/').last extractor_name = file_name.split('.').first.camelize Object.const_get("::RepoAnalyzer::#{extractor_name}") end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
repo_analyzer-1.6.0 | app/jobs/repo_analyzer/extract_project_info_job.rb |
repo_analyzer-1.5.0 | app/jobs/repo_analyzer/extract_project_info_job.rb |