renovate/lib/datasource/rubygems/releases.js
Rhys Arkins a9332a8db0
feat: replace purl with datasource (#3154)
This deprecates the (internal) use of package URLs and instead replaces with `datasource`/`lookupName`.

Closes #3005
2019-02-04 09:41:22 +01:00

19 lines
449 B
JavaScript

const { nonEmptyArray } = require('@sindresorhus/is');
const { getDependency } = require('./get');
async function getPkgReleases({ lookupName, registryUrls }) {
const registries = nonEmptyArray(registryUrls) ? registryUrls : [];
for (const registry of registries) {
const pkg = await getDependency({ dependency: lookupName, registry });
if (pkg) {
return pkg;
}
}
return null;
}
module.exports = {
getPkgReleases,
};