Renamed the tumbler and parser files so that you import "lib/tumble"

This commit is contained in:
Elf M. Sternberg 2013-03-30 20:45:12 -07:00
parent 1806eccf20
commit 70149bcf1e
5 changed files with 12 additions and 9 deletions

View File

@ -5,17 +5,17 @@ lib_objects:= $(subst src/, lib/, $(lib_sources:%.coffee=%.js))
default: build
build: $(lib_objects) lib/tumble.js
build: $(lib_objects) lib/parser.js
lib/tumble.js: src/tumble.peg
./node_modules/.bin/pegjs src/tumble.peg lib/tumble.js
lib/parser.js: src/parser.peg
./node_modules/.bin/pegjs src/parser.peg lib/parser.js
$(lib_objects): lib/%.js: src/%.coffee
@mkdir -p $(@D)
coffee -o $(@D) -c $<
test: test/[0-9]*_mocha.coffee lib/tumble.js lib/parser.js
./node_modules/.bin/mocha -C --compilers coffee:coffee-script -u tdd $<
./node_modules/.bin/mocha -R tap -C --compilers coffee:coffee-script -u tdd $<
clean:

View File

@ -84,6 +84,11 @@ AuthorsURL
# > Handle these first
{URL}
{SeriesTitle}
{AuthorName}
{AuthorDescription}
{block:IfSeries}
{Title}
{Description}

View File

@ -1,17 +1,16 @@
tumble = require('./tumble')
tumble = require('./parser')
util = require('util')
module.exports = (template) ->
ast = tumble.parse(template)
console.log(util.inspect(ast, null, null))
# Using the AST, return a function that will render each component
# of the AST out, as long as the data provided to the AST makes
# sens.
#
(content) ->
console.log(content)
subtypes = (name) ->
return 'cond'

View File

@ -3,7 +3,7 @@ assert = chai.assert
expect = chai.expect
should = chai.should()
tumble = require('../lib/parser')
tumble = require('../lib/tumble')
test_data = [
{
@ -43,5 +43,4 @@ describe "Basic Functionality", ->
do (data) ->
it "should work with #{data.description}", ->
r = tumble(data.input)(data.data)
console.log("R:", r)
r.should.equal data.output