Add bitHound integration.

This commit is contained in:
Carlos Perez 2015-12-18 13:21:09 -05:00 committed by Carlos Perez
parent 8ddc3cced7
commit abcd9d6dec
3 changed files with 42 additions and 0 deletions

1
logo/bithound.svg Normal file
View File

@ -0,0 +1 @@
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="-391.8 393.6 14 15.4"><style>.st0{fill:none}.st1{fill:#FFF}</style><path class="st0" d="M-1295 274H1v1296h-1296z"/><path class="st1" d="M-377.8 400.7c-.1-.6-.2-1.2-.4-1.8-.5-1.6-1.6-3.3-2.8-4.5-.1 0-.3-.2-.4-.1-.2.1.2.9.2 1.1.3.9.5 1.8.3 2.8-.3 1.2-1.2 2.1-2.5 2.2-.7.1-1.4 0-2.1.1-1 .1-2.1.5-2.8 1.3-.1.1-.1.2-.2.3-.3 0-.5-.1-.6-.1h-.1c-.8-.4-1.3-1.4-1.7-2.2-.2-.4-.3-.7-.4-1.1 0-.2 0-.4-.1-.5v-.4c-.1-.2-.3 0-.3.2 0 .3-.1.6-.1.8 0 .5.2 1 .3 1.4.3.7.6 1.3 1.1 1.8l.6.6c.2.2.4.3.6.5.2.3.2.6.2.9 0 .8-.1 1.5.2 2.3.2.7.4 1.4.8 1.9.2.3.5.6.7.8.2.1.5.2.3-.4-.4-1.2-.5-2.4.2-3.5.6-.9 1.6-1.7 2.8-1.6 1.7.2 2.9 1.8 2.8 3.5 0 .5 0 .9-.2 1.3-.1.2-.1.4-.1.6.1.3.4.2.6 0 .4-.6.9-1.1 1.2-1.7 1.5-2.1 2.2-4.3 1.9-6.5z"/><path class="st1" d="M-387.5 396c0 .1.1.2.1.3v.1c.1.3.4.4.6.6.1.1.4.2.6.2.2.1.7 0 .9 0 .5 0 1-.2 1.4 0-2.3 2.7-.1 3.3 1.6 2 1.9-1.5.1-5 .1-5s0-.3-.8-.4c-.1 0-.1-.1-.2-.1-.6-.3-1.3.2-1.8.7-.2.1-.3.3-.5.4-.2.2-.5.3-.7.4-.3.1-.6.3-.9.3h-.2c-.1 0-.2 0-.2.1 0 0-.1.1-.1.2-.1 0 0 .1.1.2z"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -4673,6 +4673,35 @@ cache(function(data, match, sendBadge, request) {
})}
));
// bitHound integration
camp.route(/^\/bithound\/(code\/|dependencies\/|devDependencies\/)?(.+?)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var type = match[1];
var userRepo = match[2]; // eg, `github/rexxars/sse-channel`.
var format = match[3];
var url = 'https://www.bithound.io/api/' + userRepo + '/badge/' + type;
var badgeData = getBadgeData(type === 'devDependencies' ? 'dev dependencies' : type, data);
request(url, function(err, res) {
if (err != null) {
badgeData.text[1] = 'inaccessible';
sendBadge(format, badgeData);
return;
}
try {
badgeData.text[1] = res.label;
badgeData.logo = logos['bithound'];
badgeData.logoWidth = 15;
badgeData.colorscheme = res.color;
sendBadge(format, badgeData);
} catch(e) {
badgeData.text[1] = 'invalid';
sendBadge(format, badgeData);
}
});
}));
// Any badge.
camp.route(/^\/(:|badge\/)(([^-]|--)*?)-(([^-]|--)*)-(([^-]|--)+)\.(svg|png|gif|jpg)$/,
function(data, match, end, ask) {

View File

@ -558,6 +558,10 @@ Pixel-perfect &nbsp; Retina-ready &nbsp; Fast &nbsp; Consistent &nbsp; Hackable
<td><img src='/codeclimate/coverage/github/triAGENS/ashikawa-core.svg' alt=''/></td>
<td><code>https://img.shields.io/codeclimate/coverage/github/triAGENS/ashikawa-core.svg</code></td>
</tr>
<tr><th> bitHound Code: </th>
<td><img src='/bithound/code/github/rexxars/sse-channel.svg' alt=''/></td>
<td><code>https://img.shields.io/bithound/code/github/rexxars/sse-channel.svg</code></td>
</tr>
<tr><th> Gemnasium: </th>
<td><img src='/gemnasium/mathiasbynens/he.svg' alt=''/></td>
<td><code>https://img.shields.io/gemnasium/mathiasbynens/he.svg</code></td>
@ -746,6 +750,14 @@ Pixel-perfect &nbsp; Retina-ready &nbsp; Fast &nbsp; Consistent &nbsp; Hackable
<td><img src='/david/peer/webcomponents/generator-element.svg' alt=''/></td>
<td><code>https://img.shields.io/david/peer/webcomponents/generator-element.svg</code></td>
</tr>
<tr><th> bitHound: </th>
<td><img src='/bithound/dependencies/github/rexxars/sse-channel.svg' alt=''/></td>
<td><code>https://img.shields.io/bithound/dependencies/github/rexxars/sse-channel.svg</code></td>
</tr>
<tr><th> bitHound: </th>
<td><img src='/bithound/devDependencies/github/rexxars/sse-channel.svg' alt=''/></td>
<td><code>https://img.shields.io/bithound/devDependencies/github/rexxars/sse-channel.svg</code></td>
</tr>
<tr><th> CocoaPods: </th>
<td><img src='/cocoapods/p/AFNetworking.svg' alt='' /></td>
<td><code>https://img.shields.io/cocoapods/p/AFNetworking.svg</code></td>