Skip to content

Commit

Permalink
[CocoaPods] Use Orta-sanctioned colors
Browse files Browse the repository at this point in the history
  • Loading branch information
segiddins committed May 21, 2014
1 parent 737ee24 commit 8e055ac
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ cache(function(data, match, sendBadge) {
var format = match[3];
var apiUrl = 'http://search.cocoapods.org/api/v1/pod/' + spec + '.json';
var badgeData = getBadgeData('pod', data);
badgeData.colorscheme = null;
request(apiUrl, function(err, res, buffer) {
if (err != null) {
badgeData.text[1] = 'inaccessible';
Expand All @@ -778,19 +779,15 @@ cache(function(data, match, sendBadge) {
if (/^\d/.test(badgeData.text[1])) {
badgeData.text[1] = 'v' + version;
}
if (version[0] === '0' || /dev/.test(version)) {
badgeData.colorscheme = 'orange';
} else {
badgeData.colorscheme = 'blue';
}
badgeData.colorB = '#5BA7E9';
} else if (type === 'p') {
badgeData.text[0] = 'platform';
badgeData.text[1] = platforms;
badgeData.colorscheme = 'orange';
badgeData.colorB = '#989898';
} else if (type === 'l') {
badgeData.text[0] = 'license';
badgeData.text[1] = license;
badgeData.colorscheme = 'red';
badgeData.colorB = '#373737';
}

sendBadge(format, badgeData);
Expand Down

0 comments on commit 8e055ac

Please sign in to comment.