Class: ZeroMcp::PromptScanner
- Inherits:
-
Object
- Object
- ZeroMcp::PromptScanner
- Defined in:
- lib/zeromcp/scanner.rb
Overview
— Prompt scanning —
Instance Attribute Summary collapse
-
#prompts ⇒ Object
readonly
Returns the value of attribute prompts.
Instance Method Summary collapse
-
#initialize(config) ⇒ PromptScanner
constructor
A new instance of PromptScanner.
- #scan ⇒ Object
Constructor Details
#initialize(config) ⇒ PromptScanner
Returns a new instance of PromptScanner.
265 266 267 268 |
# File 'lib/zeromcp/scanner.rb', line 265 def initialize(config) @config = config @prompts = {} end |
Instance Attribute Details
#prompts ⇒ Object (readonly)
Returns the value of attribute prompts.
263 264 265 |
# File 'lib/zeromcp/scanner.rb', line 263 def prompts @prompts end |
Instance Method Details
#scan ⇒ Object
270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/zeromcp/scanner.rb', line 270 def scan @prompts.clear @config.prompts_dir.each do |d| dir = File.(d) unless Dir.exist?(dir) $stderr.puts "[zeromcp] Cannot read prompts directory: #{dir}" next end scan_dir(dir, dir) end end |