From 04de588943bde5887b89ff8117c42eb712fa5465 Mon Sep 17 00:00:00 2001 From: Ken Elf Mathieu Sternberg Date: Tue, 5 Mar 2013 15:25:53 -0800 Subject: [PATCH] Initial check-in. --- .gitignore | 8 ++++++++ Makefile | 35 +++++++++++++++++++++++++++++++++++ bin/activate | 12 ++++++++++++ bin/gruntc | 12 ++++++++++++ package.json | 26 ++++++++++++++++++++++++++ 5 files changed, 93 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 bin/activate create mode 100755 bin/gruntc create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ff8c3e3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +*# +.#* +*~ +npm-debug.log +.grunt.js +node_modules/* +build/ +public/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f331214 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +.PHONY: app libs + + +app_sources:= $(wildcard src/*/*.coffee) +app_objects:= $(subst src/, app/, $(app_sources:%.coffee=%.js)) + +libs= $(shell cd src && find . -type f -name '*.js') + +home_sources = src/index.haml +home_objects = app/index.html + +default: build + +build: app bootstrap $(app_objects) $(home_objects) libs + +app: + mkdir -p $@ + +$(app_objects): app/%.js: src/%.coffee + coffee -o $(@D) -c $< + +libs: + cd src && tar cf - $(libs) | ( cd ../app; tar xvf - ) + +$(home_objects): app/%.html: src/%.haml + haml --unix-newlines --no-escape-attrs --double-quote-attributes $< > $@ + +bootstrap: app + cp bootstrap-extras/variables.less vendor/bootstrap/less + cd vendor/bootstrap && make build + cd vendor/bootstrap/bootstrap && tar cf - .| (cd ../../../app && tar xvf - ) + +clean: + rm -fr app + cd vendor/bootstrap && git reset --hard HEAD \ No newline at end of file diff --git a/bin/activate b/bin/activate new file mode 100644 index 0000000..65cb915 --- /dev/null +++ b/bin/activate @@ -0,0 +1,12 @@ +#!/bin/bash + +# /bin comes before /node_modules/.bin because sometimes I want to +# override the behaviors provided. + +PROJECT_ROOT=`pwd` +PATH="$PROJECT_ROOT/bin:$PROJECT_ROOT/node_modules/.bin:$PATH" +export PATH + +PS1="(`basename \"$PROJECT_ROOT\"`)$PS1" +export PS1 + diff --git a/bin/gruntc b/bin/gruntc new file mode 100755 index 0000000..3279758 --- /dev/null +++ b/bin/gruntc @@ -0,0 +1,12 @@ +#!/bin/sh +PROJECTPATH=$(dirname ${BASH_SOURCE})/.. +PROJECTPATH="`cd ${PROJECTPATH}; pwd`" +SRC="$PROJECTPATH/grunt.coffee" +DST="$PROJECTPATH/.grunt.js" + +if [ ! -f "$DST" -o "$SRC" -nt "$DST" ]; then + echo "Rebuilding $DST..." + coffee -cp $SRC > $DST +fi + +grunt --config $DST $* diff --git a/package.json b/package.json new file mode 100644 index 0000000..62e9e62 --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "Tumble", + "description": "An implementation of a parser for Tumbler." + "author": { + "name": "Elf M. Sternberg" + }, + "version": "0.0.1", + "keywords": ["parser", "coffeescript"], + "licenses": [{ + "type": "ARR", + "url": "http://elfsternberg.com/home/elfsternberg/repos/Tumble/LICENSE" + }], + "dependencies": { + "coffee-script": "1.x.x" + }, + "devDependencies": { + "docco": "0.3.x" + }, + "directories": { + "lib": "./lib" + }, + "main": "./lib/tumble", + "engines": { + "node": ">= 0.6.0" + } +}