Apply Tidier suggestions

This commit is contained in:
Tuncer Ayaz 2011-08-20 18:33:36 +02:00
parent 8fb385f312
commit e6d1e13966
2 changed files with 11 additions and 12 deletions

View file

@ -291,17 +291,17 @@ cover_init(true, BeamFiles) ->
%% to stdout. If the cover server is already started we'll reuse that %% to stdout. If the cover server is already started we'll reuse that
%% pid. %% pid.
{ok, CoverPid} = case cover:start() of {ok, CoverPid} = case cover:start() of
{ok, P} -> {ok, _P} = OkStart ->
{ok, P}; OkStart;
{error,{already_started, P}} -> {error,{already_started, P}} ->
{ok, P}; {ok, P};
{error, Reason} -> {error, _Reason} = ErrorStart ->
{error, Reason} ErrorStart
end, end,
{ok, F} = file:open( {ok, F} = OkOpen = file:open(
filename:join([?EUNIT_DIR, "cover.log"]), filename:join([?EUNIT_DIR, "cover.log"]),
[write]), [write]),
group_leader(F, CoverPid), group_leader(F, CoverPid),
@ -327,7 +327,7 @@ cover_init(true, BeamFiles) ->
[Beam, Desc]) [Beam, Desc])
end, end,
_ = [PrintWarning(Beam, Desc) || {Beam, {error, Desc}} <- Compiled], _ = [PrintWarning(Beam, Desc) || {Beam, {error, Desc}} <- Compiled],
{ok, F} OkOpen
end; end;
cover_init(Config, BeamFiles) -> cover_init(Config, BeamFiles) ->
cover_init(rebar_config:get(Config, cover_enabled, false), BeamFiles). cover_init(rebar_config:get(Config, cover_enabled, false), BeamFiles).

View file

@ -187,13 +187,12 @@ expand_code_path() ->
%% The end of form $FOO is delimited with whitespace or eol %% The end of form $FOO is delimited with whitespace or eol
%% %%
expand_env_variable(InStr, VarName, RawVarValue) -> expand_env_variable(InStr, VarName, RawVarValue) ->
VarValue = re:replace(RawVarValue, "\\\\", "\\\\\\\\", ReOpts = [global, {return, list}],
[global, {return, list}]), VarValue = re:replace(RawVarValue, "\\\\", "\\\\\\\\", ReOpts),
R1 = re:replace(InStr, "\\\$" ++ VarName ++ "\\s", VarValue ++ " ", R1 = re:replace(InStr, "\\\$" ++ VarName ++ "\\s", VarValue ++ " ",
[global]), [global]),
R2 = re:replace(R1, "\\\$" ++ VarName ++ "\$", VarValue), R2 = re:replace(R1, "\\\$" ++ VarName ++ "\$", VarValue),
re:replace(R2, "\\\${" ++ VarName ++ "}", VarValue, re:replace(R2, "\\\${" ++ VarName ++ "}", VarValue, ReOpts).
[global, {return, list}]).
%% ==================================================================== %% ====================================================================