librariesio / libraries.io

:books: The Open Source Discovery Service
https://libraries.io
GNU Affero General Public License v3.0
1.11k stars 203 forks source link

feat: [sc-34933] Libraries can detect yanked Rubygems versions we don't know about #3156

Closed djpowers closed 1 year ago

djpowers commented 1 year ago

This allows us to pull down yanked versions from Rubygems, which are not returned as part of the versions API endpoint.

The functionality is opt-in to avoid making unnecessary HTTP calls. The including parse_html: true will check the web associated gem's version pages for any that have been yanked.

Examples:

PackageManager::Rubygems.versions({ "name" => "flowbyte-yanked" }, "flowbyte-yanked")
=> [{:number=>"1.0.0", :published_at=>"2019-05-24T14:36:49.910Z", :original_license=>["MIT"]}]
PackageManager::Rubygems.versions({ "name" => "flowbyte-yanked" }, "flowbyte-yanked", parse_html: true)
=> [{:number=>"1.0.0", :published_at=>"2019-05-24T14:36:49.910Z", :original_license=>["MIT"]}, {:number=>"1.0.1", :published_at=>"2019-05-24T00:00:00-04:00", :original_license=>"", :yanked=>true}]