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.
267 268 269 270 |
# File 'lib/zeromcp/scanner.rb', line 267 def initialize(config) @config = config @prompts = {} end |
Instance Attribute Details
#prompts ⇒ Object (readonly)
Returns the value of attribute prompts.
265 266 267 |
# File 'lib/zeromcp/scanner.rb', line 265 def prompts @prompts end |
Instance Method Details
#scan ⇒ Object
272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/zeromcp/scanner.rb', line 272 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 |