Class: RailsAiBridge::Doctor::Checkers::BridgeFreshnessChecker
- Inherits:
-
BaseChecker
- Object
- BaseChecker
- RailsAiBridge::Doctor::Checkers::BridgeFreshnessChecker
- Defined in:
- lib/rails_ai_bridge/doctor/checkers/bridge_freshness_checker.rb
Overview
Verifies the freshness of bridge-generated context files.
Defined Under Namespace
Classes: ScanResult
Instance Attribute Summary collapse
-
#formats ⇒ Object
readonly
Returns the value of attribute formats.
Attributes inherited from BaseChecker
Instance Method Summary collapse
-
#call ⇒ Doctor::Check
Diagnostic check for bridge file freshness.
-
#initialize(app, formats: :all) ⇒ BridgeFreshnessChecker
constructor
A new instance of BridgeFreshnessChecker.
Constructor Details
#initialize(app, formats: :all) ⇒ BridgeFreshnessChecker
Returns a new instance of BridgeFreshnessChecker.
19 20 21 22 |
# File 'lib/rails_ai_bridge/doctor/checkers/bridge_freshness_checker.rb', line 19 def initialize(app, formats: :all) super(app) @formats = formats == :all ? RailsAiBridge::Serializers::ContextFileSerializer::FORMAT_MAP.keys : Array(formats) end |
Instance Attribute Details
#formats ⇒ Object (readonly)
Returns the value of attribute formats.
15 16 17 |
# File 'lib/rails_ai_bridge/doctor/checkers/bridge_freshness_checker.rb', line 15 def formats @formats end |
Instance Method Details
#call ⇒ Doctor::Check
Diagnostic check for bridge file freshness.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rails_ai_bridge/doctor/checkers/bridge_freshness_checker.rb', line 27 def call output_dir = RailsAiBridge.configuration.output_dir_for(app) current_fp = safe_source_fingerprint return current_fp if current_fp.is_a?(Doctor::Check) scan = scan_files(output_dir, current_fp) build_outcome(scan) rescue StandardError => error check_error('Error checking freshness', error) end |