Skip to content

Commit

Permalink
don't crawl repositories with issues disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanong committed Apr 5, 2014
1 parent 88c9118 commit 7bd8d3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/crawl.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function* crawlRepository(user, data) {
if (!data.size) return; // ignore bare repositories
var master = data.default_branch; // not sure when this will happen
if (!master) return;
if (!data.has_issues) return;
var repo = data.name.toLowerCase();
var res = yield* request('https://raw.github.com/' + user + '/' + repo + '/' + master + '/component.json', true);
if (res.statusCode === 404) {
Expand Down
4 changes: 2 additions & 2 deletions test/crawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ describe('crawler', function () {
it('should delete any current .json', function (done) {
store.client.deleteFile('/db.json', done);
store.json = {
users: {},
users: [],
components: [],
};
})

it('should crawl jonathanong', co(function* () {
yield* crawler.patch('jonathanong');
var json = store.json;
json.users.jonathanong.should.be.ok;
json.users.should.include('jonathanong');
assert(json.components.some(function (component) {
return component.name === 'horizontal-grid-packing';
}))
Expand Down

0 comments on commit 7bd8d3e

Please sign in to comment.