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
-
#detect ⇒ Array<Hash>
Detect available engines on the system.
-
#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.
14 15 16 |
# File 'lib/rosett_ai/engines/detector.rb', line 14 def engine_name @engine_name end |
Instance Method Details
#detect ⇒ Array<Hash>
Detect available engines on the system.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rosett_ai/engines/detector.rb', line 23 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 |