Class: DocGuard::AssessDocumentationRelevance::Subprocesses::LoadStoredDigests

Inherits:
Object
  • Object
show all
Defined in:
lib/doc_guard/assess_documentation_relevance/subprocesses/load_stored_digests.rb

Overview

Loads previously stored digests from a JSON file.

Class Method Summary collapse

Class Method Details

.run(config: ::DocGuard::Config.new) ⇒ Hash<String, Hash<String, String>>

Runs the subprocess to load stored digests from the configured file path.

Parameters:

  • config (DocGuard::Config) (defaults to: ::DocGuard::Config.new)

    The configuration containing the path to the digests store.

Returns:

  • (Hash<String, Hash<String, String>>)

    Mapping of documentation files to tracked file digests (e.g., { “docs/file.md” => { “app/file.rb” => “digest” } }), or an empty hash if the file does not exist.



14
15
16
17
18
# File 'lib/doc_guard/assess_documentation_relevance/subprocesses/load_stored_digests.rb', line 14

def self.run(config: ::DocGuard::Config.new)
  return {} unless File.exist?(config.digests_store_file_path)

  JSON.parse(File.read(config.digests_store_file_path))
end