Merge pull request #164 from DDoSolitary/patch-gems-list

Add list options support for gems source
This commit is contained in:
依云 2020-10-22 00:35:59 +08:00 committed by GitHub
commit 30055a9dcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -437,6 +437,8 @@ Check `RubyGems <https://rubygems.org/>`_ for updates.
gems
The name used on RubyGems, e.g. ``sass``.
This source supports :ref:`list options`.
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):
key = conf.get('gems', name)
data = await cache.get_json(GEMS_URL % key)
return data[0]['number']
return [item['number'] for item in data]