forked from acdcorp/ruby-api-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (22 loc) · 662 Bytes
/
Makefile
File metadata and controls
27 lines (22 loc) · 662 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.PHONY: install run run_production console test
ifeq (test,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "test"
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(RUN_ARGS):;@:)
endif
install:
bundle config path .bundle
bundle
touch .env.test
touch .env.development
run:
bundle exec rerun -b --pattern '{Gemfile,Gemfile.lock,.gems,.bundle,.env*,config.ru,**/*.{rb,ru,yml}}' -- thin start --port=3000 --threaded
console:
bundle exec pry -r ./application/api
test:
ifeq ($(RUN_ARGS),)
bundle exec rake spec
else
bundle exec rake spec SPEC=$(RUN_ARGS)
endif