forked from sstephenson/eco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cakefile
23 lines (19 loc) · 831 Bytes
/
Cakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require.paths.unshift "#{__dirname}/lib"
task "build", "Build lib/eco/ from src/eco/", ->
require('child_process').exec 'coffee -co lib src'
task "test", "Run tests", ->
require.paths.unshift "#{__dirname}/test/lib"
process.chdir __dirname
{reporters} = require 'nodeunit'
reporters.default.run ['test']
task "fixtures", "Generate .coffee fixtures from .eco fixtures", ->
fs = require "fs"
path = require "path"
dir = "#{__dirname}/test/fixtures"
for filename in fs.readdirSync dir
if path.extname(filename) is ".eco"
eco = require "./lib/eco"
{preprocess} = require "./lib/eco/preprocessor"
basename = path.basename filename, ".eco"
source = fs.readFileSync "#{dir}/#{filename}", "utf-8"
fs.writeFileSync "#{dir}/#{basename}.coffee", preprocess source