erlyweb:compile small patch proposal

10 views
Skip to first unread message

shaman

unread,
Mar 13, 2009, 3:33:54 PM3/13/09
to erlyweb
First of all, I must say, that erlyweb is best web development
framework.

Simple patch proposed. It's a little correction to generate correct
path for AppDir and IncludePaths (current version generates incorrect
include path on Windows due to neglect of disk letter), something like
that:

compile(AppDir, Options) ->
- AppDir1 = case lists:reverse(AppDir) of
- [$/ | _] -> AppDir;
- Other -> lists:reverse([$/ | Other])
- end,
+ AppDir1 = filename:absname(AppDir)

IncludePaths =
+ [ filename:join(AppDir,X) || {i, X} <- Options],
- lists:foldl(
- fun({i, [$/ | _] = Path}, Acc) ->
- [Path | Acc];
- ({i, Path}, Acc) ->
- [AppDir1 ++ "src/" ++ Path | Acc];
- (_Opt, Acc) ->
- Acc
- end, [AppDir1 ++ "src"], Options),

shaman

unread,
Mar 13, 2009, 6:53:42 PM3/13/09
to erlyweb
or rather:
[ filename:join(filename:join(AppDir, "src") ,X) || {i, X} <-
Options],

Buggaboo

unread,
Mar 31, 2009, 11:36:54 AM3/31/09
to erlyweb
I tried installing on windows 6 months ago, but didn't get manage to
set it up right. I gave up because I'm a linux guy anyways.

Good job.

shaman

unread,
Apr 4, 2009, 2:32:39 PM4/4/09
to erlyweb
On Windows, it requires to correct/add yaws include dir in
make_erlyweb.erl and Emakefile and it works.

The problem arise when some one need something like that:
erlyweb:compile("./myapp", [{i,"d:/some/include"}])

erlyweb_compile:compile will seak directory "./myapp/src/d:/some/
include" instead of "d:/some/include".

The above code works on any OS, for absolute and relative paths as
well.

-module(erlyweb_compile).
...
compile(AppDir, Options) ->
AppDir1 = filename:absname(AppDir)
IncludePaths = [ filename:join(filename:join(AppDir, "src") ,X) ||
{i, X} <-Options],
...
Reply all
Reply to author
Forward
0 new messages