20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/packwerk/cache.rb', line 20
def deserialize(serialized_cache_contents)
cache_contents_json = JSON.parse(serialized_cache_contents)
unresolved_references = cache_contents_json["unresolved_references"].map do |json|
UnresolvedReference.new(
constant_name: json["constant_name"],
namespace_path: json["namespace_path"],
relative_path: json["relative_path"],
source_location: Node::Location.new(json["source_location"]["line"], json["source_location"]["column"],)
)
end
CacheContents.new(
file_contents_digest: cache_contents_json["file_contents_digest"],
unresolved_references: unresolved_references,
)
end
|