Class: RosettAi::Engines::Detector
- Inherits:
-
Object
- Object
- RosettAi::Engines::Detector
- Defined in:
- lib/rosett_ai/engines/detector.rb
Overview
Base engine detector that reads manifest detection rules and probes the system.
Subclasses may override custom_checks to add engine-specific detection logic
beyond the manifest-driven cli_binary and config_dir checks.
Instance Attribute Summary collapse
-
#engine_name ⇒ Object
readonly
Returns the value of attribute engine_name.
Instance Method Summary collapse
- #custom_checks ⇒ Object protected
- #detect ⇒ Object
-
#initialize(engine_name) ⇒ Detector
constructor
A new instance of Detector.
Constructor Details
Instance Attribute Details
#engine_name ⇒ Object (readonly)
Returns the value of attribute engine_name.
13 14 15 |
# File 'lib/rosett_ai/engines/detector.rb', line 13 def engine_name @engine_name end |
Instance Method Details
#custom_checks ⇒ Object (protected)
38 39 40 |
# File 'lib/rosett_ai/engines/detector.rb', line 38 def custom_checks [] end |
#detect ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rosett_ai/engines/detector.rb', line 20 def detect checks = [] detection = @manifest['detection'] || {} checks << check_cli_binary(detection['cli_binary']) if detection['cli_binary'] checks << check_config_dir(detection['config_dir']) if detection['config_dir'] checks.concat(custom_checks) { engine: @engine_name, display_name: @manifest['display_name'], checks: checks, detected: checks.all? { |check| check[:passed] } } end |