enseadaio / enseada

A Cloud native multi-package registry
https://enseada.io
Mozilla Public License 2.0
86 stars 10 forks source link

Support RubyGems API #24

Open MatteoJoliveau opened 4 years ago

MatteoJoliveau commented 4 years ago

This follows the same destiny as the Maven and NPM APIs: it's not that well documented and will require some reverse engineering of both existing servers and the gem client.

Reference implementations:

LukeIGS commented 1 year ago

Other valuable pieces to this puzzle https://github.com/rubygems/compact_index https://github.com/rubygems/rfcs/blob/master/text/0009-deprecate-dependency-api.md

The solutions used by Gemstash/Artifactory/Geminabox/Nexus etc. are all outdated, building ruby support from the ground up using the newer approaches for dependency resolution would likely be a good idea.

Effectively the app needs to support 4 endpoints against the root of the repository

/names

ex: https://rubygems.org/names Returns an alphabetized list of all gems the gemcutter server can provide,

/versions

ex: https://rubygems.org/versions returns the last updated date followed by an alphabetized space separated list containing: gem-name comma,separated,versions checksum-of-info https://github.com/rubygems/compact_index/blob/master/lib/compact_index/versions_file.rb

/info/:gem

ex: https://rubygems.org/info/rails returns a list of all versions of a given gem, each line formatted like version comma,separted-list-of-dependency-strings|checksum:sha-checksum,ruby:ruby-version-string

/gems/:gem-version.gem

following that, each gem in a given repository should be served at :root/gems/:gem-name-:gem-version.gem, ex: https://rubygems.org/gems/rails-2.1.2.gem