This repository has been archived by the owner on Nov 7, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Cleaning up some sake stuff and added test coverage
- Loading branch information
1 parent
67025e8
commit 81fe718
Showing
10 changed files
with
54 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
index.js | ||
lib/esprima.js | ||
test/test.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
/.coverage_data | ||
/cover_html | ||
/node_modules | ||
/*.sublime-* | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,33 @@ | ||
task('default', (t) => { | ||
console.log('Please specify a task.'); | ||
t.done(); | ||
}); | ||
|
||
task('test', (t) => { | ||
sh('node node_modules/mocha/bin/mocha', function(err, result){ | ||
console.log(result); | ||
t.done(); | ||
}); | ||
}); | ||
import { exec } from "child_process"; | ||
|
||
task('compile', (t) => { | ||
sh('node bin/six -co ./lib ./src', function(err, result){ | ||
console.log(result); | ||
t.done(); | ||
}); | ||
}); | ||
var launch = (cmd, callback) => { | ||
var child = exec(cmd, callback) | ||
child.stdout.pipe(process.stdout) | ||
child.stderr.pipe(process.stderr) | ||
} | ||
|
||
task('default', t => { | ||
console.log('Please specify a task.') | ||
t.done() | ||
}) | ||
|
||
task('test', t => { | ||
launch('node node_modules/mocha/bin/mocha', () => t.done()) | ||
}) | ||
|
||
task('compile', t => { | ||
launch('node bin/six -co ./lib ./src', () => t.done()) | ||
}) | ||
|
||
task('cover', t => { | ||
launch('node node_modules/cover/bin/cover run node_modules/mocha/bin/_mocha', () => { | ||
launch('node node_modules/cover/bin/cover report html') | ||
launch('node node_modules/cover/bin/cover report cli') | ||
t.done() | ||
}) | ||
}) | ||
|
||
task('watch', t => { | ||
launch('node bin/six -cwo ./lib ./src', () => t.done()) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
#!/usr/bin/env node | ||
|
||
var path = require('path'); | ||
var fs = require('fs'); | ||
var readFileSync = fs.readFileSync; | ||
var path = require('path') | ||
var fs = require('fs') | ||
var readFileSync = fs.readFileSync | ||
|
||
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib'); | ||
var Sakefile = fs.realpathSync('./Sakefile'); | ||
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib') | ||
var tasks = fs.realpathSync('./Sakefile') | ||
|
||
var six = require(lib + '/six'); | ||
var cli = require(lib + '/../node_modules/sake/node_modules/sake/cli-app'); | ||
var six = require(lib + '/six') | ||
|
||
fs.readFileSync = function(file, enc){ | ||
fs.readFileSync = function(file, enc) { | ||
var ret = readFileSync(file, enc); | ||
if(file === Sakefile){ | ||
ret = six.compile(ret); | ||
} | ||
return ret; | ||
return file === tasks ? six.compile(ret, {style: 'node', module: 'Sakefile'}) : ret | ||
} | ||
|
||
cli.run(); | ||
require(lib + '/../node_modules/sake/node_modules/sake/cli-app').run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,9 +125,6 @@ function timeLog(message) { | |
|
||
|
||
|
||
|
||
|
||
|
||
module.exports = { | ||
run: run | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
"devDependencies" : { | ||
"mocha" : "", | ||
"chai" : "", | ||
"should" : "" | ||
"should" : "", | ||
"cover" : "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,6 +123,3 @@ function timeLog(message) { | |
console.log((new Date).toLocaleTimeString() + ' - ' + message) | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters