Class: OllamaAgent::Topology::Linker::Discovery
- Inherits:
-
Object
- Object
- OllamaAgent::Topology::Linker::Discovery
- Defined in:
- lib/ollama_agent/topology/linker/discovery.rb
Overview
Collects Ruby sources under project roots while skipping bulky / vendored trees.
Constant Summary collapse
- EXCLUDED_DIR_NAMES =
%w[node_modules vendor/bundle tmp log .git].freeze
Class Method Summary collapse
Class Method Details
.files_under_root(root, extensions) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ollama_agent/topology/linker/discovery.rb', line 17 def self.files_under_root(root, extensions) return [] unless File.directory?(root) found = [] Find.find(root) do |path| if File.directory?(path) Find.prune if EXCLUDED_DIR_NAMES.include?(File.basename(path)) next end found << File.(path) if extensions.any? { |ext| path.end_with?(ext) } end found end |