Skip to content

Commit

Permalink
Merge pull request #111 from kianmeng/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
elbrujohalcon authored Aug 25, 2023
2 parents b0d636c + a8bcdd3 commit b16947d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $ curl -i http://localhost:8080/description
desc => "Sets an env var in the server"}},
options => [],path_match => "/poor-kv/:key/[:value]"},
#{constraints => [],handler => example_description_handler,
metadata => #{get => #{desc => "Retrives trails's server description"}},
metadata => #{get => #{desc => "Retrieves trails's server description"}},
options => [],path_match => <<"/description">>}]
```

Expand Down
2 changes: 1 addition & 1 deletion example/src/example.erl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ start_phase(start_trails_http, _StartType, []) ->
trails:trail(<<"/description">>,
example_description_handler,
[],
#{get => #{desc => "Retrives trails's server description"}}),
#{get => #{desc => "Retrieves trails's server description"}}),
Handlers = [example_poor_kv_handler],
Trails = trails:trails(Handlers) ++ [DescriptionTrail],
trails:store(Trails),
Expand Down
4 changes: 2 additions & 2 deletions src/trails.erl
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ host_matches(ServerRef) ->
lists:flatten(
ets:match(ranch_server, {{proto_opts, ServerRef}, '$1'})),
Env = maps:get(env, Opts, #{}),
Dispatchs = maps:get(dispatch, Env, []),
lists:flatten([Host || {Host, _, _} <- Dispatchs]).
Dispatches = maps:get(dispatch, Env, []),
lists:flatten([Host || {Host, _, _} <- Dispatches]).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Private API.
Expand Down
14 changes: 7 additions & 7 deletions test/trails_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ end_per_testcase(_, Config) ->

-spec minimal_compile_test(config()) -> {atom(), string()}.
minimal_compile_test(_Config) ->
MininalRoute = [{'_', []}],
ExpectedResponse = cowboy_router:compile(MininalRoute),
ExpectedResponse = trails:compile(MininalRoute),
MinimalRoute = [{'_', []}],
ExpectedResponse = cowboy_router:compile(MinimalRoute),
ExpectedResponse = trails:compile(MinimalRoute),
{comment, ""}.

-spec empty_compile_test(config()) -> {atom(), string()}.
Expand All @@ -109,10 +109,10 @@ static_compile_test(_Config) ->

-spec minimal_single_host_compile_test(config()) -> {atom(), string()}.
minimal_single_host_compile_test(_Config) ->
MininalRoute = [{'_', []}],
[{_SingleHost, MininalPath}] = MininalRoute,
ExpectedResponse = cowboy_router:compile(MininalRoute),
ExpectedResponse = trails:single_host_compile(MininalPath),
MinimalRoute = [{'_', []}],
[{_SingleHost, MinimalPath}] = MinimalRoute,
ExpectedResponse = cowboy_router:compile(MinimalRoute),
ExpectedResponse = trails:single_host_compile(MinimalPath),
{comment, ""}.

-spec basic_single_host_compile_test(config()) -> {atom(), string()}.
Expand Down

0 comments on commit b16947d

Please sign in to comment.