Skip to content

Commit 73905aa

Browse files
committed
cleanup, _*.yml quiz do not import now
1 parent d59e476 commit 73905aa

6 files changed

Lines changed: 25 additions & 49 deletions

File tree

gulpfile.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,6 @@ gulp.task('tutorial:cache:regenerate', lazyRequireTask('tutorial/tasks/cacheRege
172172

173173
gulp.task('cache:clean', lazyRequireTask('./tasks/cacheClean'));
174174

175-
gulp.task('test:spider', lazyRequireTask('./tasks/testSpider'));
176-
177-
gulp.task('mailer:track', lazyRequireTask('mailer/tasks/track'));
178-
179175
gulp.task('config:nginx', lazyRequireTask('./tasks/configNginx'));
180176

181177
// when queue finished successfully or aborted, close db

handlers/quiz/tasks/quizImport.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ module.exports = function(options) {
2828

2929
for (var i = 0; i < files.length; i++) {
3030
var yml = files[i];
31+
if (path.basename(yml)[0] == '_') {
32+
gutil.log("Skip unfinished " + yml);
33+
continue;
34+
}
3135

3236
gutil.log("Importing " + yml);
3337

handlers/tutorial/tutorialImporter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ TutorialImporter.prototype.extractHeader = function(parsed) {
9090
};
9191

9292

93-
// todo with incremental import: move to separate task?
93+
// maybe move to separate task?
9494
TutorialImporter.prototype.checkIfErrorsInParsed = function(parsed) {
9595
log.debug("checking errors in parsed");
9696
const walker = new TreeWalkerSync(parsed);

scripts/spider/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export SLIMERJSLAUNCHER=/Applications/Firefox.app/Contents/MacOS/firefox
22
export SLIMERJS_EXECUTABLE=/Users/iliakan/slimerjs-0.9.5/slimerjs
33

4-
// must have npm i -g casperjs
4+
# must have npm i -g casperjs
55
casperjs --engine=slimerjs --ssl-protocol=any --disk-cache=yes --max-disk-cache-size=1000000 ./spider.js
66

scripts/spider/spider.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,25 @@ function spider(url) {
161161

162162
var baseUrl = this.getGlobal('location').origin;
163163

164+
var formatErrors = casper.evaluate(function() {
165+
var errors = [];
166+
__utils__.findAll('.format_error').forEach(function(elem) {
167+
errors.push(elem.innerHTML);
168+
});
169+
return errors;
170+
});
171+
172+
if (formatErrors.length) {
173+
var error = {
174+
errors: formatErrors,
175+
url: url
176+
};
177+
178+
dataObj.errors.push(error);
179+
180+
casper.log('FORMAT ERRORS: ' + formatErrors, 'error');
181+
}
182+
164183
// Find links on the current page
165184
var localLinks = helpers.findLinks(this);
166185

tasks/testSpider.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)