Class: RubyCode::ContextBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycode/context_builder.rb

Overview

Builds environment context for the AI assistant

Instance Method Summary collapse

Constructor Details

#initialize(root_path:) ⇒ ContextBuilder

Returns a new instance of ContextBuilder.



6
7
8
# File 'lib/rubycode/context_builder.rb', line 6

def initialize(root_path:)
  @root_path = root_path
end

Instance Method Details

#environment_context ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/rubycode/context_builder.rb', line 10

def environment_context
  <<~CONTEXT
    <env>
    Working directory: #{@root_path}
    Platform: #{RUBY_PLATFORM}
    Ruby version: #{RUBY_VERSION}
    Today's date: #{Time.now.strftime("%Y-%m-%d")}
    </env>
  CONTEXT
end