imdone-core
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -18,2 +18,6 @@ { | ||
"hidden": false | ||
}, | ||
{ | ||
"name": "archive", | ||
"hidden": true | ||
} | ||
@@ -20,0 +24,0 @@ ], |
@@ -28,2 +28,6 @@ var _ = require("lodash"), | ||
function escapeRegExp(value) { | ||
return value.replace(/[\/\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); | ||
} | ||
/** | ||
@@ -292,3 +296,3 @@ * Description | ||
var symbol = this.getLang().symbol; | ||
if (symbol !== "") { | ||
if (symbol && symbol !== "") { | ||
symbol.replace("/", "\\/"); | ||
@@ -300,4 +304,23 @@ var defactoPattern = "^(\\s*" + symbol + CODE_STYLE_PATTERN; | ||
// DONE:0 Implement #listname style tasks in any text file | ||
// DOING:0 Allow code style tasks to be included and excluded with regex on List name | ||
File.prototype.convertBlockToLine = function(content) { | ||
if (this.getLang().block) { | ||
var lang = this.getLang(); | ||
var block = lang.block; | ||
var symbol = lang.symbol; | ||
var start = escapeRegExp(block.start); | ||
var end = escapeRegExp(block.end); | ||
var ignore = escapeRegExp(block.ignore); | ||
var regex = new RegExp(start + "[\\s\\S]*?" + end, "gm"); | ||
content = content.replace(regex, function(match) { | ||
match = match.replace(new RegExp("^\\s*[" + start + "|" + ignore + "]", "gm"), symbol); | ||
match = match.replace(new RegExp(end, "gm"), ""); | ||
return match; | ||
}); | ||
} | ||
return content; | ||
}; | ||
// DOING:10 Implement #listname style tasks in any text file | ||
// [Allow code style tasks to be included and excluded with regex on List name](#archive:0) | ||
/** | ||
@@ -313,6 +336,13 @@ * Description | ||
this.tasks = []; | ||
// DOING:10 Store task type in task , so we know how to remove the task later | ||
// TODO:10 Store task type in task , so we know how to remove the task later | ||
// Check for codestyle tasks | ||
var codeStyleRegex = this.getCodeStyleRegex(); | ||
if (codeStyleRegex) { | ||
// DOING:0 Now we need to look for multi-line comments | ||
/* | ||
* DOING: This will show up when we're done | ||
*/ | ||
/* DOING: This will also show up when we're done */ | ||
clone = this.convertBlockToLine(clone); | ||
clone.replace(codeStyleRegex, function(match, start, list, order, text, pos) { | ||
@@ -340,2 +370,3 @@ log("Found a CODE_STYLE_PATTERN task: list:%s, order:%d, text:%s", list, order, text); | ||
}); | ||
} | ||
@@ -342,0 +373,0 @@ |
@@ -0,1 +1,2 @@ | ||
var cBlock = {"start":"/*", "end":"*/", "ignore":"*"}; | ||
module.exports = { | ||
@@ -9,7 +10,7 @@ ".coffee": {"name": "coffeescript", "symbol": "#"}, | ||
".latex": {"name": "tex", "symbol": "%"}, | ||
".js": {"name": "javascript", "symbol": "//"}, | ||
".java": {"name": "java", "symbol": "//"}, | ||
".js": {"name": "javascript", "symbol": "//", "block": cBlock}, | ||
".java": {"name": "java", "symbol": "//", "block": cBlock}, | ||
".scss": {"name": "scss", "symbol": "//"}, | ||
".cpp": {"name": "cpp", "symbol": "//"}, | ||
".cc": {"name": "cpp", "symbol": "//"}, | ||
".cpp": {"name": "cpp", "symbol": "//", "block": cBlock}, | ||
".cc": {"name": "cpp", "symbol": "//", "block": cBlock}, | ||
".php": {"name": "php", "symbol": "//"}, | ||
@@ -22,5 +23,6 @@ ".hs": {"name": "haskell", "symbol": "--"}, | ||
".less": {"name": "scss", "symbol": "//"}, | ||
".h": {"name": "objectivec", "symbol": "//"}, | ||
".m": {"name": "objectivec", "symbol": "//"}, | ||
".mm": {"name": "objectivec", "symbol": "//"}, | ||
".c": {"name": "c", "symbol":"//", "block": cBlock}, | ||
".h": {"name": "objectivec", "symbol": "//", "block": cBlock}, | ||
".m": {"name": "objectivec", "symbol": "//", "block": cBlock}, | ||
".mm": {"name": "objectivec", "symbol": "//", "block": cBlock}, | ||
".m4": {"name": "m4", "symbol": "#"}, | ||
@@ -42,3 +44,3 @@ ".scala": {"name": "scala", "symbol": "//"}, | ||
".cmd": {"name": "dos", "symbol": "@?rem"}, | ||
".go": {"name": "go", "symbol": "//"}, | ||
".go": {"name": "go", "symbol": "//", "block": cBlock}, | ||
".ini": {"name": "ini", "symbol": ";"}, | ||
@@ -45,0 +47,0 @@ ".lisp": {"name": "lisp", "symbol": ";"}, |
@@ -1,2 +0,2 @@ | ||
// TODO:0 Create list groups to show and hide for projects/repos | ||
// TODO:30 Create list groups to show and hide for projects/repos | ||
var _ = require('lodash'); | ||
@@ -3,0 +3,0 @@ |
@@ -168,3 +168,3 @@ var _ = require('lodash'), | ||
// DONE:40 Add file.update and file.delete listener for repos and emit project.modified | ||
// [Add file.update and file.delete listener for repos and emit project.modified](#archive:30) | ||
/** | ||
@@ -177,3 +177,3 @@ * Description | ||
this.fileUpdateListener = function(file) { | ||
// DONE:70 fix emit modified by saving these up and emitting only if a backlog exists | ||
// [fix emit modified by saving these up and emitting only if a backlog exists](#archive:60) | ||
self.emit('file.update', {project:self.getName(), file:file}); | ||
@@ -250,4 +250,4 @@ self.queueModified({mod:'file.update', file:file.getPath()}); | ||
// DONE:110 Use async file operations | ||
// DONE:50 Only save config if there is more than one repo | ||
// [Use async file operations](#archive:100) | ||
// [Only save config if there is more than one repo](#archive:40) | ||
/** | ||
@@ -350,3 +350,3 @@ * Description | ||
// DONE:80 Implement addRepo and removeRepo | ||
// [Implement addRepo and removeRepo](#archive:70) | ||
/** | ||
@@ -541,3 +541,3 @@ * Description | ||
} | ||
// TODO:10 Fix all empty cb to return error | ||
// [Fix all empty cb to return error](#archive:40) | ||
}; | ||
@@ -633,3 +633,3 @@ | ||
// DONE:100 Test moveTasks | ||
// [Test moveTasks](#archive:90) | ||
/** | ||
@@ -771,3 +771,3 @@ * Description | ||
// TODO:20 User should be able to add a list to a project | ||
// [User should be able to add a list to a project](#archive:50) | ||
/** | ||
@@ -829,3 +829,3 @@ * Description | ||
// DONE:60 getFilesTree should return a nested list of files | ||
// [getFilesTree should return a nested list of files](#archive:50) | ||
/** | ||
@@ -832,0 +832,0 @@ * Description |
@@ -344,3 +344,3 @@ var _ = require('lodash'), | ||
// DONE:30 Make sure lists are not saved on load in alphabetical order | ||
// [Make sure lists are not saved on load in alphabetical order](#archive:20) | ||
/** | ||
@@ -820,3 +820,3 @@ * Save the config file | ||
// DONE:90 Test renameList | ||
// [Test renameList](#archive:80) | ||
/** | ||
@@ -872,3 +872,3 @@ * Description | ||
// DOING:30 modifyTask must be async. Get file content before proceeding. | ||
// TODO:0 modifyTask must be async. Get file content before proceeding. | ||
/** | ||
@@ -875,0 +875,0 @@ * Description |
{ | ||
"name": "imdone-core", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "imdone-core", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,3 +11,3 @@ imdone-core | ||
---- | ||
1. [Use [visionmedia/dox](https://github.com/visionmedia/dox), [smartcomments/smartcomments](https://github.com/smartcomments/smartcomments) and [JSDoc](http://usejsdoc.org) for documenting the following...](#DOING:20) | ||
1. [Use [visionmedia/dox](https://github.com/visionmedia/dox), [smartcomments/smartcomments](https://github.com/smartcomments/smartcomments) and [JSDoc](http://usejsdoc.org) for documenting the following...](#TODO:20) | ||
- Project | ||
@@ -20,3 +20,3 @@ - Repository | ||
2. [Add plugin capability](#DONE:20) | ||
2. [Add plugin capability](#archive:10) | ||
- Config | ||
@@ -23,0 +23,0 @@ ```js |
@@ -31,3 +31,3 @@ var should = require('should'), | ||
(someFile.extractTasks().tasks.length).should.be.exactly(4); | ||
(someFile.extractTasks().tasks.length).should.be.exactly(6); | ||
expect(ok).to.be(true); | ||
@@ -54,4 +54,4 @@ }); | ||
file.on("task.found", expectation); | ||
expectation.exactly(4); | ||
(file.extractTasks().getTasks().length).should.be.exactly(4); | ||
expectation.exactly(6); | ||
(file.extractTasks().getTasks().length).should.be.exactly(6); | ||
expectation.verify(); | ||
@@ -58,0 +58,0 @@ }); |
// DOING:10 task 01 | ||
// TODO:0 task02 | ||
// DOING:0 task 03 | ||
// TODO:20 task04 | ||
// TODO:20 task04 | ||
/* | ||
* This is a code file DOING: another task | ||
* DOING: with a task | ||
* DOING:0 or two */ |
90547
3085