File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -304,6 +304,16 @@ def build_golang_repo_url(purl):
304
304
return f"https://pkg.go.dev/{ namespace } /{ name } "
305
305
306
306
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
+
307
317
# Download URLs:
308
318
309
319
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ def test_purl2url_get_repo_url():
65
65
"pkg:golang/xorm.io/xorm" : "https://pkg.go.dev/xorm.io/xorm" ,
66
66
"pkg:golang/xorm.io/xorm@v0.8.2" : "https://pkg.go.dev/xorm.io/xorm@v0.8.2" ,
67
67
"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" ,
68
70
}
69
71
70
72
for purl , url in purls_url .items ():
@@ -143,6 +145,7 @@ def test_purl2url_get_inferred_urls():
143
145
"https://gitlab.com/tg1999/firebase/-/archive/1a122122/firebase-1a122122.tar.gz" ,
144
146
],
145
147
"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" ],
146
149
"pkg:composer/psr/log@1.1.3" : ["https://packagist.org/packages/psr/log#1.1.3" ],
147
150
"pkg:rubygems/package-name" : ["https://rubygems.org/gems/package-name" ],
148
151
"pkg:bitbucket/birkenfeld" : [],
You can’t perform that action at this time.
0 commit comments