Class: ZeroMcp::ResourceScanner
- Inherits:
-
Object
- Object
- ZeroMcp::ResourceScanner
- Defined in:
- lib/zeromcp/scanner.rb
Instance Attribute Summary collapse
-
#resources ⇒ Object
readonly
Returns the value of attribute resources.
-
#templates ⇒ Object
readonly
Returns the value of attribute templates.
Instance Method Summary collapse
-
#initialize(config) ⇒ ResourceScanner
constructor
A new instance of ResourceScanner.
- #scan ⇒ Object
Constructor Details
#initialize(config) ⇒ ResourceScanner
Returns a new instance of ResourceScanner.
149 150 151 152 153 |
# File 'lib/zeromcp/scanner.rb', line 149 def initialize(config) @config = config @resources = {} @templates = {} end |
Instance Attribute Details
#resources ⇒ Object (readonly)
Returns the value of attribute resources.
147 148 149 |
# File 'lib/zeromcp/scanner.rb', line 147 def resources @resources end |
#templates ⇒ Object (readonly)
Returns the value of attribute templates.
147 148 149 |
# File 'lib/zeromcp/scanner.rb', line 147 def templates @templates end |
Instance Method Details
#scan ⇒ Object
155 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/zeromcp/scanner.rb', line 155 def scan @resources.clear @templates.clear @config.resources_dir.each do |d| dir = File.(d) unless Dir.exist?(dir) $stderr.puts "[zeromcp] Cannot read resources directory: #{dir}" next end scan_dir(dir, dir) end end |