File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -304,6 +304,16 @@ def build_golang_repo_url(purl):
304304 return f"https://pkg.go.dev/{ namespace } /{ name } "
305305
306306
307+ @repo_router .route ("pkg:cocoapods/.*" )
308+ def build_cocoapods_repo_url (purl ):
309+ """
310+ Return a CocoaPods repo URL from the `purl` string.
311+ """
312+ purl_data = PackageURL .from_string (purl )
313+ name = purl_data .name
314+ return name and f"https://cocoapods.org/pods/{ name } "
315+
316+
307317# Download URLs:
308318
309319
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ def test_purl2url_get_repo_url():
6565 "pkg:golang/xorm.io/xorm" : "https://pkg.go.dev/xorm.io/xorm" ,
6666 "pkg:golang/xorm.io/xorm@v0.8.2" : "https://pkg.go.dev/xorm.io/xorm@v0.8.2" ,
6767 "pkg:golang/gopkg.in/ldap.v3@v3.1.0" : "https://pkg.go.dev/gopkg.in/ldap.v3@v3.1.0" ,
68+ "pkg:cocoapods/AFNetworking@4.0.1" : "https://cocoapods.org/pods/AFNetworking" ,
69+ "pkg:cocoapods/MapsIndoors@3.24.0" : "https://cocoapods.org/pods/MapsIndoors" ,
6870 }
6971
7072 for purl , url in purls_url .items ():
@@ -143,6 +145,7 @@ def test_purl2url_get_inferred_urls():
143145 "https://gitlab.com/tg1999/firebase/-/archive/1a122122/firebase-1a122122.tar.gz" ,
144146 ],
145147 "pkg:pypi/sortedcontainers@2.4.0" : ["https://pypi.org/project/sortedcontainers/2.4.0/" ],
148+ "pkg:cocoapods/AFNetworking@4.0.1" : ["https://cocoapods.org/pods/AFNetworking" ],
146149 "pkg:composer/psr/log@1.1.3" : ["https://packagist.org/packages/psr/log#1.1.3" ],
147150 "pkg:rubygems/package-name" : ["https://rubygems.org/gems/package-name" ],
148151 "pkg:bitbucket/birkenfeld" : [],
You can’t perform that action at this time.
0 commit comments