Class: ZeroMcp::Scanner
- Inherits:
-
Object
- Object
- ZeroMcp::Scanner
- Defined in:
- lib/zeromcp/scanner.rb
Instance Attribute Summary collapse
-
#tools ⇒ Object
readonly
Returns the value of attribute tools.
Instance Method Summary collapse
-
#initialize(config) ⇒ Scanner
constructor
A new instance of Scanner.
- #scan ⇒ Object
Constructor Details
#initialize(config) ⇒ Scanner
Returns a new instance of Scanner.
9 10 11 12 |
# File 'lib/zeromcp/scanner.rb', line 9 def initialize(config) @config = config @tools = {} end |
Instance Attribute Details
#tools ⇒ Object (readonly)
Returns the value of attribute tools.
7 8 9 |
# File 'lib/zeromcp/scanner.rb', line 7 def tools @tools end |
Instance Method Details
#scan ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/zeromcp/scanner.rb', line 14 def scan @tools.clear dirs = @config.tools_dir dirs = [dirs] unless dirs.is_a?(Array) dirs.each do |d| dir = File.(d) unless Dir.exist?(dir) $stderr.puts "[zeromcp] Cannot read tools directory: #{dir}" next end scan_dir(dir, dir) end @tools end |