Class: WhyClasses::Cache
- Inherits:
-
Object
- Object
- WhyClasses::Cache
- Defined in:
- lib/why_classes/cache.rb
Overview
An optional on-disk cache of analysis results, keyed by file content so a large repo can be re-scanned quickly when little has changed. Only used in report modes (never when applying corrections). Correctors are not serialized, so cached offenses render but are never re-applied from cache.
Instance Method Summary collapse
- #fetch(source_file) ⇒ Object
-
#initialize(dir:, config_digest:, rule_names:) ⇒ Cache
constructor
A new instance of Cache.
- #store(source_file, offenses) ⇒ Object
Constructor Details
#initialize(dir:, config_digest:, rule_names:) ⇒ Cache
Returns a new instance of Cache.
15 16 17 18 19 |
# File 'lib/why_classes/cache.rb', line 15 def initialize(dir:, config_digest:, rule_names:) @dir = dir @salt = [WhyClasses::VERSION, config_digest, rule_names.sort.join(",")].join(" |