<commit_before>VERSION = 0.2.0

TEMPLATES_DIR = templates
TEMPLATES_FILE = $(TEMPLATES_DIR)/templates.go

GO_BINDATA = go-bindata
GO_FMT = gofmt -w
GO_XC = goxc

GOXC_FILE = .goxc.local.json

func_name_from_file = $(subst .,zz,$(subst /,z,$(1:$(TEMPLATES_DIR)/%=%)))
file_name_from_func = $(addprefix $(TEMPLATES_DIR)/,$(subst z,/,$(subst zz,.,$(1))))
remove_tmpl_dir = $(1:$(TEMPLATES_DIR)/%=%)

SOURCES = $(filter-out %.go,$(shell find $(TEMPLATES_DIR)/* -type f))
OBJECTS = $(addsuffix .go, $(foreach src, $(SOURCES), $(call func_name_from_file,$(src))))

DEPS = \
	github.com/jteeuwen/go-bindata \
	github.com/robertkrimen/terst \
	github.com/jessevdk/go-flags \
	bitbucket.org/pkg/inflect

all:deps templates

templates:clean ${TEMPLATES_FILE} ${OBJECTS}
	$(shell echo '}' >> $(TEMPLATES_FILE))
	$(GO_FMT) $(TEMPLATES_DIR)/*.go

%.go:
	${GO_BINDATA} -pkg="templates" -out="$(TEMPLATES_DIR)/$@" -func="$(*)" $(call file_name_from_func,$*)
	$(shell echo '\t"$(call remove_tmpl_dir,$(call file_name_from_func,$*))" : $(*:($TEMPLATES_DIR)/%=%),' >> $(TEMPLATES_FILE))

${TEMPLATES_FILE}:
	$(shell echo "package templates\nvar Data = map[string] func() []byte{" > $(TEMPLATES_FILE))

compile:templates goxc

goxc:
	$(shell echo '{\n "ArtifactsDest": "build",\n "ConfigVersion": "0.9",' > $(GOXC_FILE))
	$(shell echo ' "PackageVersion": "$(VERSION)",\n "TaskSettings": {' >> $(GOXC_FILE))
	$(shell echo '  "bintray": {\n   "apikey": "",\n   "package": "alpaca",' >> $(GOXC_FILE))
	$(shell echo '   "repository": "utils",\n   "subject": "pksunkara"' >> $(GOXC_FILE))
	$(shell echo '  }\n }\n}' >> $(GOXC_FILE))
	$(GO_XC)

bintray:
	$(GO_XC) bintray

test:
	go test github.com/pksunkara/alpaca/alpaca

test-cover:
	go test -coverprofile=coverage.out github.com/pksunkara/alpaca/alpaca
	go tool cover -html=coverage.out

install:
	go install github.com/pksunkara/alpaca

deps:
	go get -u $(DEPS)

clean:
	rm -f ${TEMPLATES_DIR}/*.go<commit_msg>Change: update Makefile to use go.rice<commit_after>VERSION = 0.2.0

TEMPLATES_FILE = alpaca/back-templates.rice-box.go

GO_RICE = rice
GO_FMT = gofmt -w
GO_XC = goxc

GOXC_FILE = .goxc.local.json

DEPS = \
	github.com/GeertJohan/go.rice \
	github.com/robertkrimen/terst \
	github.com/jessevdk/go-flags \
	bitbucket.org/pkg/inflect

all:deps templates

templates:clean ${TEMPLATES_FILE}

%.go:
	$(GO_RICE) --import-path github.com/pksunkara/alpaca/alpaca embed

compile:templates goxc

goxc:
	$(shell echo '{\n "ArtifactsDest": "build",\n "ConfigVersion": "0.9",' > $(GOXC_FILE))
	$(shell echo ' "PackageVersion": "$(VERSION)",\n "TaskSettings": {' >> $(GOXC_FILE))
	$(shell echo '  "bintray": {\n   "apikey": "",\n   "package": "alpaca",' >> $(GOXC_FILE))
	$(shell echo '   "repository": "utils",\n   "subject": "pksunkara"' >> $(GOXC_FILE))
	$(shell echo '  }\n }\n}' >> $(GOXC_FILE))
	$(GO_XC)

bintray:
	$(GO_XC) bintray

test:
	go test github.com/pksunkara/alpaca/alpaca

test-cover:
	go test -coverprofile=coverage.out github.com/pksunkara/alpaca/alpaca
	go tool cover -html=coverage.out

install:
	go install github.com/pksunkara/alpaca

deps:
	go get -u $(DEPS)

clean:
	rm -f ${TEMPLATES_FILE}
{'fraction_non_alphanumeric': 0.2005092297899427, 'fraction_numerical': 0.004137492043284532, 'mean_word_length': 4.8528864059590315, 'pattern_counts': {'":': 18, '<': 3, '<?xml version=': 0, '>': 26, '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': '3118201', 'n_tokens_mistral': 1369, 'n_tokens_neox': 1330, 'n_words': 247}