<commit_before># makefile to help automate tasks in bookie

# jsbuild: jsbuild_bookie

BOOKIE_JS = bookie/static/js/bookie
JS_BUILD_PATH = bookie/static/js/build
JS_META_SCRIPT = scripts/js/generate_meta.py
YUIGIT = git://github.com/yui/yui3.git

js: $(JS_BUILD_PATH)/bookie/meta.js $(JS_BUILD_PATH)/yui

clean_js:
	rm -rf $(JS_BUILD_PATH)/*

$(JS_BUILD_PATH)/bookie/meta.js: $(JS_BUILD_PATH)/bookie/y*-min.js
	$(JS_META_SCRIPT) -n yui_modules -s $(BOOKIE_JS)/y* -o $(JS_BUILD_PATH)/bookie/meta.js

$(JS_BUILD_PATH)/bookie/y%-min.js: $(JS_BUILD_PATH)/bookie $(JS_BUILD_PATH)/bookie/y%.js
	scripts/js/jsmin_all.py $(JS_BUILD_PATH)/bookie

$(JS_BUILD_PATH)/bookie/y%.js: $(BOOKIE_JS)/y%.js
	cp $? $(JS_BUILD_PATH)/bookie/

$(JS_BUILD_PATH)/bookie:
	mkdir $(JS_BUILD_PATH)/bookie

$(JS_BUILD_PATH)/yui:
	mkdir $(JS_BUILD_PATH)/yui
	mkdir /tmp/yui
	git clone --depth 1 $(YUIGIT) /tmp/yui
	cp -r /tmp/yui/build $(JS_BUILD_PATH)/yui
	rm -rf /tmp/yui


run: run_combo run_css run_app
run_combo:
	gunicorn -p combo.pid combo:application &
run_css:
	sass --watch bookie/static/css/bookie.scss:bookie/static/css/bookie.css &
run_app:
	paster serve --reload --pid-file=paster.pid rick.ini &

stop: stop_combo stop_css stop_app
stop_combo:
	kill -9 `cat combo.pid`
stop_css:
	killall -9 sass
stop_app:
	kill -9 `cat paster.pid`

clean: clean_js

.phone: clean clean_js $(JS_BUILD_PATH)/bookie/meta.js \
	run run_combo run_css run_app \
	stop stop_app stop_css stop_combo<commit_msg>Add support for running livereload as well with make run_dev<commit_after># Makefile to help automate tasks in bookie

BOOKIE_INI = rick.ini
BOOKIE_JS = bookie/static/js/bookie
JS_BUILD_PATH = bookie/static/js/build
JS_META_SCRIPT = scripts/js/generate_meta.py
YUIGIT = git://github.com/yui/yui3.git

js: $(JS_BUILD_PATH)/bookie/meta.js $(JS_BUILD_PATH)/yui

clean_js:
	rm -rf $(JS_BUILD_PATH)/*

$(JS_BUILD_PATH)/bookie/meta.js: $(JS_BUILD_PATH)/bookie/y*-min.js
	$(JS_META_SCRIPT) -n yui_modules -s $(BOOKIE_JS)/y* -o $(JS_BUILD_PATH)/bookie/meta.js

$(JS_BUILD_PATH)/bookie/y%-min.js: $(JS_BUILD_PATH)/bookie $(JS_BUILD_PATH)/bookie/y%.js
	scripts/js/jsmin_all.py $(JS_BUILD_PATH)/bookie

$(JS_BUILD_PATH)/bookie/y%.js: $(BOOKIE_JS)/y%.js
	cp $? $(JS_BUILD_PATH)/bookie/

$(JS_BUILD_PATH)/bookie:
	mkdir $(JS_BUILD_PATH)/bookie

$(JS_BUILD_PATH)/yui:
	mkdir $(JS_BUILD_PATH)/yui
	mkdir /tmp/yui
	git clone --depth 1 $(YUIGIT) /tmp/yui
	cp -r /tmp/yui/build $(JS_BUILD_PATH)/yui
	rm -rf /tmp/yui


run: run_combo run_css run_app
run_dev: run run_livereload
run_combo:
	gunicorn -p combo.pid combo:application &
run_css:
	sass --watch bookie/static/css/bookie.scss:bookie/static/css/bookie.css &
run_app:
	paster serve --reload --pid-file=paster.pid $(BOOKIE_INI) &
run_livereload:
	livereload

stop: stop_combo stop_css stop_app
stop_dev: stop stop_livereload
stop_combo:
	kill -9 `cat combo.pid`
stop_css:
	killall -9 sass
stop_app:
	kill -9 `cat paster.pid`
stop_livereload:
	killall livereload

clean: clean_js

.PHONY: clean clean_js $(JS_BUILD_PATH)/bookie/meta.js \
	run run_dev run_combo run_css run_app run_livereload \
	stop stop_dev stop_app stop_css stop_combo stop_livereload
{'fraction_non_alphanumeric': 0.13801836024058245, 'fraction_numerical': 0.0031655587211142765, 'mean_word_length': 4.8088235294117645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7495241', 'n_tokens_mistral': 1389, 'n_tokens_neox': 1353, 'n_words': 253}