Skip to content
This repository
Newer
Older
100644 88 lines (73 sloc) 2.547 kb
e7bcd7ec » ixti
2011-12-15 Improves makefile
1 PATH := $(shell pwd)/node_modules/.bin:${PATH}
a6283901 » ixti
2011-11-09 Improved gh-pages task
2
9c180868 » ixti
2011-12-09 Improves make tasks and test runner
3 PROJECT := $(notdir ${PWD})
4 TMP_PATH := /tmp/${PROJECT}-$(shell date +%s)
23f80838 » ixti
2011-11-09 Added make task to build browserified version
5
a6283901 » ixti
2011-11-09 Improved gh-pages task
6 REMOTE_NAME ?= origin
7 REMOTE_REPO ?= $(shell git config --get remote.${REMOTE_NAME}.url)
23f80838 » ixti
2011-11-09 Added make task to build browserified version
8
9c180868 » ixti
2011-12-09 Improves make tasks and test runner
9 CURR_HEAD := $(firstword $(shell git show-ref --hash HEAD | cut --bytes=-6) master)
10 GITHUB_NAME := nodeca/js-yaml
11 SRC_URL_FMT := https://github.com/${GITHUB_NAME}/blob/${CURR_HEAD}/{file}\#L{line}
12
e7bcd7ec » ixti
2011-12-15 Improves makefile
13 JS_FILES := $(shell find ./lib -type f -name '*.js' -print)
14
9c180868 » ixti
2011-12-09 Improves make tasks and test runner
15 lint:
16 @if test ! `which jslint` ; then \
bb13c512 » ixti
2011-12-12 Fixes makefile
17 echo "You need 'jslint' installed in order to run lint." >&2 ; \
9c180868 » ixti
2011-12-09 Improves make tasks and test runner
18 echo " $ make dev-deps" >&2 ; \
19 exit 128 ; \
20 fi
21 # (node) -> Node.JS compatibility mode
22 # (indent) -> indentation level (2 spaces)
23 # (nomen) -> tolerate underscores in identifiers (e.g. `var _val = 1`)
90564771 » ixti
2011-12-15 Linted common.js
24 # (bitwise) -> tolerate bitwise operators (used in base64)
2e9c82c1 » ixti
2011-12-16 Linted all files
25 # (white) -> tolerate messy whitespace
26 jslint --node --nomen --bitwise --white --indent=2 ${JS_FILES}
23f80838 » ixti
2011-11-09 Added make task to build browserified version
27
bf30236e » ixti
2011-12-17 Refactored issue tests to use vows
28 test: lint test-functional
29 @if test ! `which vows` ; then \
30 echo "You need 'vows' installed in order to run tests." >&2 ; \
31 echo " $ make dev-deps" >&2 ; \
32 exit 128 ; \
33 fi
34 NODE_ENV=test vows --spec
4e972453 » ixti
2011-11-03 Added make tasks to run tests
35
19f02b07 » ixti
2011-11-12 Improveed browserification
36 test-functional:
23f80838 » ixti
2011-11-09 Added make task to build browserified version
37 echo
19f02b07 » ixti
2011-11-12 Improveed browserification
38 echo "## FUNCTIONAL ##################################################################"
23f80838 » ixti
2011-11-09 Added make task to build browserified version
39 echo "################################################################################"
40 echo
19f02b07 » ixti
2011-11-12 Improveed browserification
41 node ./test/functional/run.js
23f80838 » ixti
2011-11-09 Added make task to build browserified version
42 echo
4e972453 » ixti
2011-11-03 Added make tasks to run tests
43
9c180868 » ixti
2011-12-09 Improves make tasks and test runner
44 dev-deps:
45 @if test ! `which npm` ; then \
46 echo "You need 'npm' installed." >&2 ; \
47 echo " See: http://npmjs.org/" >&2 ; \
48 exit 128 ; \
49 fi
50 npm install --dev
23f80838 » ixti
2011-11-09 Added make task to build browserified version
51
52 build: browserify uglify
53
54 browserify:
55 if test ! `which browserify` ; then npm install browserify ; fi
97923ffd » ixti
2011-12-16 Fixes Makefile
56 cp -r support/browserify/ ${TMP_PATH}
57 browserify index.js -o ${TMP_PATH}/50_js-yaml.js
58 cat ${TMP_PATH}/* > js-yaml.js
59 rm -rf ${TMP_PATH}
5e536be7 » ixti
2011-11-09 Improved ghpages geneation
60 cp js-yaml.js demo/js/
23f80838 » ixti
2011-11-09 Added make task to build browserified version
61
62 uglify:
63 if test ! `which uglifyjs` ; then npm install uglify-js ; fi
64 uglifyjs js-yaml.js > js-yaml.min.js
6cb8f91d » ixti
2011-11-09 Added update gh-pages task
65
a6283901 » ixti
2011-11-09 Improved gh-pages task
66
67 gh-pages:
68 @if test -z ${REMOTE_REPO} ; then \
69 echo 'Remote repo URL not found' >&2 ; \
70 exit 128 ; \
71 fi
97923ffd » ixti
2011-12-16 Fixes Makefile
72 mkdir ${TMP_PATH}
73 cp -r demo/* ${TMP_PATH}
74 touch ${TMP_PATH}/.nojekyll
75 cd ${TMP_PATH} && \
a6283901 » ixti
2011-11-09 Improved gh-pages task
76 git init && \
77 git add . && \
58e01dce » ixti
2011-12-12 Fixes gh-pages task commit message
78 git commit -q -m 'Update browserified demo'
97923ffd » ixti
2011-12-16 Fixes Makefile
79 cd ${TMP_PATH} && \
a6283901 » ixti
2011-11-09 Improved gh-pages task
80 git remote add remote ${REMOTE_REPO} && \
81 git push --force remote +master:gh-pages
97923ffd » ixti
2011-12-16 Fixes Makefile
82 rm -rf ${TMP_PATH}
9c180868 » ixti
2011-12-09 Improves make tasks and test runner
83
84 todo:
85 grep 'TODO' -n -r ./lib 2>/dev/null || test true
86
87 .PHONY: test lint dev-deps gh-pages todo
88 .SILENT: todo test test-functional test-issues
Something went wrong with that request. Please try again.