<commit_before>PHANTOM = node_modules/phantomjs/bin/phantomjs

FINAL=honeybadger.js

VERSION=v$(shell cat package.json | ruby -r json -e "puts JSON.parse(ARGF.read)['version'][/\d\.\d/]")
BUILD_DIR=build/$(VERSION)
CDN=//js.honeybadger.io/$(VERSION)
MINIFIED=honeybadger.min.js
SOURCE_MAP=honeybadger.min.js.map

BUILD_FILES = src/header.txt \
							build/src/configuration.js \
							build/src/notice.js \
              build/src/honeybadger.js \
							src/footer.txt

all: compile concat minify

clean:
	rm -rf build/

compile: clean
	coffee --compile --bare --output ./build .

concat: $(BUILD_FILES)
	cat $^ >$(FINAL)

minify:
	mkdir -p $(BUILD_DIR)
	uglifyjs --source-map $(BUILD_DIR)/$(SOURCE_MAP) --source-map-url $(CDN)/$(SOURCE_MAP) -o $(BUILD_DIR)/$(MINIFIED) $(FINAL)

server:
	node spec/server.js &

kill:
	kill -9 `cat spec/pid.txt`
	rm spec/pid.txt

test: compile server
	sleep 1
	$(PHANTOM) ./spec/runner.js http://localhost:8000/spec/runner.html
	make kill
<commit_msg>Copy honeybadger.js to build directory.<commit_after>PHANTOM = node_modules/phantomjs/bin/phantomjs

FINAL=honeybadger.js

VERSION=v$(shell cat package.json | ruby -r json -e "puts JSON.parse(ARGF.read)['version'][/\d\.\d/]")
BUILD_DIR=build/$(VERSION)
CDN=//js.honeybadger.io/$(VERSION)
MINIFIED=honeybadger.min.js
SOURCE_MAP=honeybadger.min.js.map

BUILD_FILES = src/header.txt \
							build/src/configuration.js \
							build/src/notice.js \
              build/src/honeybadger.js \
							src/footer.txt

all: compile concat minify

clean:
	rm -rf build/

compile: clean
	coffee --compile --bare --output ./build .

concat: $(BUILD_FILES)
	cat $^ >$(FINAL)

minify:
	mkdir -p $(BUILD_DIR)
	cp $(FINAL) $(BUILD_DIR)
	uglifyjs --source-map $(BUILD_DIR)/$(SOURCE_MAP) --source-map-url $(CDN)/$(SOURCE_MAP) -o $(BUILD_DIR)/$(MINIFIED) $(FINAL)

server:
	node spec/server.js &

kill:
	kill -9 `cat spec/pid.txt`
	rm spec/pid.txt

test: compile server
	sleep 1
	$(PHANTOM) ./spec/runner.js http://localhost:8000/spec/runner.html
	make kill

{'fraction_non_alphanumeric': 0.16370808678500987, 'fraction_numerical': 0.005917159763313609, 'mean_word_length': 3.4593406593406595, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4677351', 'n_tokens_mistral': 845, 'n_tokens_neox': 784, 'n_words': 153}