Skip to content

Commit

Permalink
Deprecated VersionEye (#1953)
Browse files Browse the repository at this point in the history
  • Loading branch information
PyvesB authored Aug 20, 2018
1 parent 656326d commit 82bc90c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 33 deletions.
4 changes: 0 additions & 4 deletions lib/all-badge-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -1529,10 +1529,6 @@ const allBadgeExamples = [
name: 'Other',
},
examples: [
{
title: 'VersionEye',
previewUri: '/versioneye/d/ruby/rails.svg',
},
{
title: 'PyPI - Wheel',
previewUri: '/pypi/wheel/Django.svg',
Expand Down
1 change: 1 addition & 0 deletions lib/deprecated-services.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const deprecatedServices = {
dotnetstatus: new Date('2018-04-01'),
magnumci: new Date('2018-07-08'),
bithound: new Date('2018-07-08'),
versioneye: new Date('2018-08-20'),
}

module.exports = {
Expand Down
33 changes: 4 additions & 29 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2426,37 +2426,12 @@ cache(function(data, match, sendBadge, request) {
});
}));

// VersionEye integration
// VersionEye integration - deprecated as of August 2018.
camp.route(/^\/versioneye\/d\/(.+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var userRepo = match[1]; // eg, `ruby/rails`.
var format = match[2];
var url = 'https://www.versioneye.com/' + userRepo + '/badge.svg';
var badgeData = getBadgeData('dependencies', data);
fetchFromSvg(request, url, function(err, res) {
if (err != null) {
badgeData.text[1] = 'inaccessible';
sendBadge(format, badgeData);
return;
}
try {
badgeData.text[1] = res;
if (res === 'up to date') {
badgeData.colorscheme = 'brightgreen';
} else if (res === 'none') {
badgeData.colorscheme = 'green';
} else if (res === 'out of date') {
badgeData.colorscheme = 'yellow';
} else {
badgeData.colorscheme = 'red';
}
sendBadge(format, badgeData);

} catch(e) {
badgeData.text[1] = 'invalid';
sendBadge(format, badgeData);
}
});
const format = match[2];
const badgeData = getDeprecatedBadge('versioneye', data);
sendBadge(format, badgeData);
}));

// Codacy integration
Expand Down
13 changes: 13 additions & 0 deletions services/versioneye/versioneye.tester.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict'

const ServiceTester = require('../service-tester')

const t = new ServiceTester({ id: 'versioneye', title: 'VersionEye' })
module.exports = t

t.create('no longer available (previously dependencies status)')
.get('/d/ruby/rails.json')
.expectJSON({
name: 'versioneye',
value: 'no longer available',
})

0 comments on commit 82bc90c

Please sign in to comment.