| 98 | |
| 99 | |
| 100 | def iter_crates(crates_index): |
| 101 | exclude = set(["config.json", ".git"]) |
| 102 | for crate_index_file in iter_files(crates_index, exclude=exclude): |
| 103 | with open(crate_index_file) as f: |
| 104 | most_recent = list(f) |
| 105 | most_recent = most_recent[len(most_recent) - 1] |
| 106 | |
| 107 | crate_info = json.loads(most_recent) |
| 108 | if "regex" not in set(d["name"] for d in crate_info["deps"]): |
| 109 | continue |
| 110 | |
| 111 | if crate_info["yanked"]: |
| 112 | continue |
| 113 | yield (crate_info["name"], crate_info["vers"]) |
| 114 | |
| 115 | |
| 116 | def iter_files(d, exclude=set()): |