Add list options support for gems source

This commit is contained in:
DDoSolitary 2020-10-21 22:43:46 +08:00
parent 8d1a079703
commit ab66fc0468
No known key found for this signature in database
GPG Key ID: 90A79E1B71BC0CB1
2 changed files with 3 additions and 1 deletions

View File

@ -437,6 +437,8 @@ Check `RubyGems <https://rubygems.org/>`_ for updates.
gems gems
The name used on RubyGems, e.g. ``sass``. The name used on RubyGems, e.g. ``sass``.
This source supports :ref:`list options`.
Check NPM Registry Check NPM Registry
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
:: ::

View File

@ -6,4 +6,4 @@ GEMS_URL = 'https://rubygems.org/api/v1/versions/%s.json'
async def get_version(name, conf, *, cache, **kwargs): async def get_version(name, conf, *, cache, **kwargs):
key = conf.get('gems', name) key = conf.get('gems', name)
data = await cache.get_json(GEMS_URL % key) data = await cache.get_json(GEMS_URL % key)
return data[0]['number'] return [item['number'] for item in data]