Class: Appydave::Tools::LlmContext::FileCollector

Inherits:
Object
  • Object
show all
Defined in:
lib/appydave/tools/llm_context/file_collector.rb

Overview

Gathers file names and content based on include and exclude patterns

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ FileCollector

Returns a new instance of FileCollector.



9
10
11
12
13
14
15
16
17
# File 'lib/appydave/tools/llm_context/file_collector.rb', line 9

def initialize(options)
  @options = options
  @include_patterns = options.include_patterns
  @exclude_patterns = options.exclude_patterns
  @format = options.format
  @working_directory = File.expand_path(options.working_directory)
  @line_limit = options.line_limit
  @file_paths = options.file_paths
end

Instance Method Details

#buildObject



19
20
21
22
23
# File 'lib/appydave/tools/llm_context/file_collector.rb', line 19

def build
  return '' unless @working_directory && Dir.exist?(@working_directory)

  FileUtils.cd(@working_directory) { build_formats }
end