Sha256: 68b0bcfd133dfe1d57062feec01d26abfda6ddefb2c618688be5bd7e00a586b5
Contents?: true
Size: 1.9 KB
Versions: 1
Compression:
Stored size: 1.9 KB
Contents
#!/usr/bin/env ruby # frozen_string_literal: true require_relative '../providers/console' require_relative '../providers/datadog' require_relative '../engines/eslint/extractor' require_relative '../engines/debug/extractor' require_relative '../engines/git/extractor' require_relative '../engines/github/extractor' require_relative '../engines/npm/extractor' require_relative '../engines/packwerk/extractor' require_relative '../engines/rubocop/extractor' require_relative '../engines/semgrep/extractor' require_relative '../engines/sorbet/extractor' require_relative '../engines/scc/extractor' require_relative '../engines/custom/extractor' require_relative '../engines/jest-json-summary/extractor' PROVIDERS = { console: Providers::Console, datadog: Providers::Datadog }.freeze EXTRACTORS = { eslint: Engines::Eslint::Extractor, debug: Engines::Debug::Extractor, git: Engines::Git::Extractor, github: Engines::Github::Extractor, npm: Engines::Npm::Extractor, packwerk: Engines::Packwerk::Extractor, rubocop: Engines::Rubocop::Extractor, semgrep: Engines::Semgrep::Extractor, sorbet: Engines::Sorbet::Extractor, scc: Engines::Scc::Extractor, custom: Engines::Custom::Extractor, jest_json_summary: Engines::JestJsonSummary::Extractor }.freeze config_provider = ENV['CODEMONITOR_PROVIDER'] || 'console' config_extractors = ENV['CODEMONITOR_EXTRACTORS'] provider = PROVIDERS[config_provider.to_sym].new extractors = if config_extractors EXTRACTORS.slice(*config_extractors.split(',').map(&:to_sym)).values else EXTRACTORS.values end puts '# process start' # Run all the extractors and collect the data extractors .map(&:new) .map do |extractor| raise "Requirements not fullfiled in #{extractor.class.name}" unless extractor.requirements? extractor.call(provider) end # Send all the data to the provider provider.send puts '# process end'
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
codemonitor-0.5.0 | exe/codemonitor |