Return a mapping of podspec URLS.
(name=None, version=None, homepage_url=None, vcs_url=None, **kwargs)
| 627 | |
| 628 | |
| 629 | def get_urls(name=None, version=None, homepage_url=None, vcs_url=None, **kwargs): |
| 630 | """ |
| 631 | Return a mapping of podspec URLS. |
| 632 | """ |
| 633 | reponame = get_repo_base_url(vcs_url) or '' |
| 634 | |
| 635 | repository_download_url = None |
| 636 | if version: |
| 637 | if homepage_url: |
| 638 | repository_download_url = f'{homepage_url}/archive/{version}.zip' |
| 639 | if reponame: |
| 640 | repository_download_url = f'{reponame}/archive/refs/tags/{version}.zip' |
| 641 | |
| 642 | hashed_path = get_hashed_path(name) |
| 643 | # not used yet, alternative for api_data_url |
| 644 | specs_json_cdn_url = f'https://cdn.cocoapods.org/Specs/{hashed_path}/{name}/{version}/{name}.podspec.json' |
| 645 | |
| 646 | api_data_url = ( |
| 647 | hashed_path |
| 648 | and name |
| 649 | and version |
| 650 | and f'https://raw.githubusercontent.com/CocoaPods/Specs/blob/master/Specs/{hashed_path}/{name}/{version}/{name}.podspec.json' |
| 651 | ) |
| 652 | |
| 653 | return dict( |
| 654 | repository_download_url=repository_download_url or None, |
| 655 | repository_homepage_url=name and f'https://cocoapods.org/pods/{name}' or None, |
| 656 | code_view_url=reponame and version and f'{reponame}/tree/{version}' or None, |
| 657 | bug_tracking_url=reponame and f'{reponame}/issues/' or None, |
| 658 | api_data_url=api_data_url or None, |
| 659 | ) |
| 660 | |
| 661 | |
| 662 | def party_mapper(author, email): |