Skip to content

Commit 0b111e9

Browse files
authored
Merge pull request #15 from martinsumner/develop-3.0-merge29
OTP 20 compatability
2 parents 59ceba1 + 1c5f79a commit 0b111e9

File tree

12 files changed

+39
-165
lines changed

12 files changed

+39
-165
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ ebin/*.app
55
doc/*
66
.local_dialyzer_plt
77
/.rebar
8+
_build/*
9+
rebar.lock

Emakefile

Lines changed: 0 additions & 6 deletions
This file was deleted.

Makefile

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,28 @@
1-
ERL ?= erl
2-
APP := webmachine
1+
REBAR3_URL=https://s3.amazonaws.com/rebar3/rebar3
32

4-
REPO = ${shell echo `basename "$${PWD}"`}
5-
ARTIFACTSFILE = ${shell echo ${REPO}-`date +%F_%H-%M-%S`.tgz}
3+
# If there is a rebar in the current directory, use it
4+
ifeq ($(wildcard rebar3),rebar3)
5+
REBAR3 = $(CURDIR)/rebar3
6+
endif
67

7-
.PHONY: deps
8+
# Fallback to rebar on PATH
9+
REBAR3 ?= $(shell which rebar3)
810

9-
all: deps compile
11+
# And finally, prep to download rebar if all else fails
12+
ifeq ($(REBAR3),)
13+
REBAR3 = $(CURDIR)/rebar3
14+
endif
1015

11-
compile: deps
12-
./rebar compile
1316

14-
deps: DEV_MODE
15-
@(./rebar get-deps)
17+
all: $(REBAR3)
18+
@$(REBAR3) do update, clean, compile, eunit, dialyzer
1619

17-
clean:
18-
@(./rebar clean)
20+
$(REBAR3):
21+
curl -Lo rebar3 $(REBAR3_URL) || wget $(REBAR3_URL)
22+
chmod a+x rebar3
1923

20-
# nuke deps first to avoid wasting time having rebar recurse into deps
21-
# for clean
2224
distclean:
23-
@rm -rf ./deps ./.rebar
24-
@(./rebar clean)
25+
@rm -rf ./_build
2526

2627
edoc:
27-
@$(ERL) -noshell -run edoc_run application '$(APP)' '"."' '[{preprocess, true},{includes, ["."]}]'
28-
DIALYZER_APPS = kernel stdlib sasl erts ssl tools os_mon runtime_tools crypto inets \
29-
xmerl webtool snmp public_key mnesia eunit syntax_tools compiler
30-
COMBO_PLT = $(HOME)/.webmachine_dialyzer_plt
31-
32-
include tools.mk
33-
34-
verbosetest: all
35-
@(./rebar -v skip_deps=true eunit)
36-
37-
travisupload:
38-
tar cvfz ${ARTIFACTSFILE} --exclude '*.beam' --exclude '*.erl' test.log .eunit
39-
travis-artifacts upload --path ${ARTIFACTSFILE}
40-
41-
DEV_MODE:
42-
@[ -d ./.rebar ] || mkdir ./.rebar
43-
@touch ./.rebar/DEV_MODE
28+
@$(REBAR3) edoc

rebar

-157 KB
Binary file not shown.

rebar.config

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,19 @@
66
{xref_checks, [undefined_function_calls]}.
77

88
{deps,
9-
[{mochiweb, ".*", {git, "git://github.com/basho/mochiweb.git", {branch, "develop-2.9"}}}
9+
[{mochiweb, ".*", {git, "git://github.com/martinsumner/mochiweb.git", {branch, "develop-3.0-merge29"}}}
1010
]}.
1111

12-
{dev_only_deps,
13-
[{meck, "0.8.*", {git, "git://github.com/basho/meck.git", {tag, "0.8.2"}}},
14-
{ibrowse, "4.0.2", {git, "git://github.com/cmullaparthi/ibrowse.git", {tag, "v4.0.2"}}}
12+
{eunit_opts, [
13+
no_tty,
14+
{report, {eunit_progress, [colored, profile]}}
15+
]}.
16+
17+
{profiles,
18+
[{test,
19+
[{deps, [meck,
20+
{ibrowse, "4.4.0"}
21+
]},
22+
{erl_opts, [debug_info]}
23+
]}
1524
]}.

rebar.config.script

Lines changed: 0 additions & 68 deletions
This file was deleted.

rebar3

679 KB
Binary file not shown.

src/webmachine_perf_log_handler.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ fmt_plog(Time, Ip, Method, Path, {VM,Vm}, Status, Length, Mod, TTPD, TTPS) ->
132132

133133
non_standard_method_test() ->
134134
LogData = #wm_log_data{resource_module=foo,
135-
start_time=now(),
135+
start_time=os:timestamp(),
136136
method="FOO",
137137
peer={127,0,0,1},
138138
path="/",
139139
version={1,1},
140140
response_code=501,
141141
response_length=1234,
142-
end_time=now(),
143-
finish_time=now()},
142+
end_time=os:timestamp(),
143+
finish_time=os:timestamp()},
144144
LogEntry = format_req(LogData),
145145
?assert(is_list(LogEntry)),
146146
ok.

src/webmachine_request.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ parts_to_body(BodyList, Size, Req) when is_list(BodyList) ->
640640
{CT, _} ->
641641
CT
642642
end,
643-
Boundary = mochihex:to_hex(crypto:rand_bytes(8)),
643+
Boundary = mochihex:to_hex(crypto:strong_rand_bytes(8)),
644644
HeaderList = [{"Content-Type",
645645
["multipart/byteranges; ",
646646
"boundary=", Boundary]}],

test/decision_core_test.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
-include("wm_reqdata.hrl").
2121
-include_lib("eunit/include/eunit.hrl").
2222

23-
-compile(export_all).
23+
-compile([export_all, nowarn_export_all]).
2424

2525
-define(RESOURCE, atom_to_list(?MODULE)).
2626
-define(RESOURCE_PATH, "/" ++ ?RESOURCE).

0 commit comments

Comments
 (0)