MCPcopy Create free account
hub / github.com/aboutcode-org/vulnerablecode / advisory_data

Method advisory_data

vulnerabilities/importers/ruby.py:55–73  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

53 """
54
55 def advisory_data(self) -> Iterable[AdvisoryData]:
56 try:
57 self.clone(self.repo_url)
58 base_path = Path(self.vcs_response.dest_dir)
59 supported_subdir = ["rubies", "gems"]
60 for subdir in supported_subdir:
61 for file_path in base_path.glob(f"{subdir}/**/*.yml"):
62 if file_path.name.startswith("OSVDB-"):
63 continue
64 raw_data = load_yaml(file_path)
65 advisory_url = get_advisory_url(
66 file=file_path,
67 base_path=base_path,
68 url="https://github.com/rubysec/ruby-advisory-db/blob/master/",
69 )
70 yield parse_ruby_advisory(raw_data, subdir, advisory_url)
71 finally:
72 if self.vcs_response:
73 self.vcs_response.delete()
74
75
76def parse_ruby_advisory(record, schema_type, advisory_url):

Callers

nothing calls this directly

Calls 5

load_yamlFunction · 0.90
get_advisory_urlFunction · 0.90
parse_ruby_advisoryFunction · 0.70
cloneMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected