Ruby: *.gemspec — spec.name = '...' */
| 653 | |
| 654 | /* Ruby: *.gemspec — spec.name = '...' */ |
| 655 | static void parse_gemspec(const char *source, int source_len, const char *rel_path, |
| 656 | cbm_pkg_entries_t *entries) { |
| 657 | const char *end = source + source_len; |
| 658 | /* Try spec.name, s.name, gem.name patterns */ |
| 659 | static const char *patterns[] = {".name", NULL}; |
| 660 | for (int i = 0; patterns[i]; i++) { |
| 661 | const char *p = source; |
| 662 | while (p < end) { |
| 663 | const char *found = strstr(p, patterns[i]); |
| 664 | if (!found || found >= end) { |
| 665 | break; |
| 666 | } |
| 667 | char *name = extract_quoted(found + strlen(patterns[i]), end); |
| 668 | if (name) { |
| 669 | char *dir = path_dirname(rel_path); |
| 670 | char entry[PKGMAP_PATH_BUF]; |
| 671 | snprintf(entry, sizeof(entry), "%s%slib/%s", dir[0] ? dir : "", dir[0] ? "/" : "", |
| 672 | name); |
| 673 | pkg_entries_push(entries, name, strdup(entry)); |
| 674 | free(dir); |
| 675 | return; |
| 676 | } |
| 677 | p = found + SKIP_ONE; |
| 678 | } |
| 679 | } |
| 680 | } |
| 681 | |
| 682 | /* Swift: Package.swift — SwiftPM manifest. |
| 683 | * |
no test coverage detected