Class: BundlerSkills::Discoverer
- Inherits:
-
Object
- Object
- BundlerSkills::Discoverer
- Defined in:
- lib/bundler_skills/discoverer.rb
Overview
Finds skills bundled in the resolved dependency gems.
This is the ONLY place that touches the Bundler spec API. The default ‘specs` come from Bundler.load.specs, which reflects the current environment’s resolved gems (includes development/test groups unless ‘without` excludes them). Each spec exposes full_gem_path / name / version and works for rubygems, path and git sources alike.
Constant Summary collapse
- SKILL_FILE =
"SKILL.md"
Instance Method Summary collapse
- #discover ⇒ Array<DiscoveredSkill>
-
#initialize(specs: nil, config: Config.new(Config::DEFAULTS), logger: nil) ⇒ Discoverer
constructor
A new instance of Discoverer.
Constructor Details
#initialize(specs: nil, config: Config.new(Config::DEFAULTS), logger: nil) ⇒ Discoverer
Returns a new instance of Discoverer.
16 17 18 19 20 |
# File 'lib/bundler_skills/discoverer.rb', line 16 def initialize(specs: nil, config: Config.new(Config::DEFAULTS), logger: nil) @specs = specs @config = config @logger = logger end |
Instance Method Details
#discover ⇒ Array<DiscoveredSkill>
23 24 25 |
# File 'lib/bundler_skills/discoverer.rb', line 23 def discover specs.flat_map { |spec| skills_in(spec) }.compact end |