From f96e20aef7cce6d47535ab63c36452f6c9e1c444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 30 Jan 2013 22:13:31 +0100 Subject: [PATCH] Rename example 'static' to 'static_world' to avoid confusion --- examples/README.md | 4 ++-- examples/{static => static_world}/README.md | 2 +- examples/{static => static_world}/priv/small.mp4 | Bin examples/{static => static_world}/priv/small.ogv | Bin examples/{static => static_world}/priv/test.txt | 0 examples/{static => static_world}/priv/video.html | 0 examples/{static => static_world}/rebar.config | 0 .../src/static_world.app.src} | 6 +++--- .../src/static_world.erl} | 4 ++-- .../src/static_world_app.erl} | 6 +++--- .../src/static_world_sup.erl} | 2 +- examples/{static => static_world}/start.sh | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) rename examples/{static => static_world}/README.md (97%) rename examples/{static => static_world}/priv/small.mp4 (100%) rename examples/{static => static_world}/priv/small.ogv (100%) rename examples/{static => static_world}/priv/test.txt (100%) rename examples/{static => static_world}/priv/video.html (100%) rename examples/{static => static_world}/rebar.config (100%) rename examples/{static/src/static.app.src => static_world/src/static_world.app.src} (60%) rename examples/{static/src/static.erl => static_world/src/static_world.erl} (77%) rename examples/{static/src/static_app.erl => static_world/src/static_world_app.erl} (80%) rename examples/{static/src/static_sup.erl => static_world/src/static_world_sup.erl} (93%) rename examples/{static => static_world}/start.sh (80%) diff --git a/examples/README.md b/examples/README.md index 3ba7c5bd..10a2b860 100644 --- a/examples/README.md +++ b/examples/README.md @@ -25,8 +25,8 @@ Cowboy Examples * [rest_hello_world](./examples/rest_hello_world): return the data type that matches the request type (ex: html, text, json) - * [static](./examples/static): - an example file server + * [static_world](./examples/static_world): + static file handler * [websocket](./examples/websocket): websocket example diff --git a/examples/static/README.md b/examples/static_world/README.md similarity index 97% rename from examples/static/README.md rename to examples/static_world/README.md index 78f53382..e947ebb1 100644 --- a/examples/static/README.md +++ b/examples/static_world/README.md @@ -1,4 +1,4 @@ -Cowboy Static Files Server +Cowboy Static File Handler ========================== To compile this example you need rebar in your PATH. diff --git a/examples/static/priv/small.mp4 b/examples/static_world/priv/small.mp4 similarity index 100% rename from examples/static/priv/small.mp4 rename to examples/static_world/priv/small.mp4 diff --git a/examples/static/priv/small.ogv b/examples/static_world/priv/small.ogv similarity index 100% rename from examples/static/priv/small.ogv rename to examples/static_world/priv/small.ogv diff --git a/examples/static/priv/test.txt b/examples/static_world/priv/test.txt similarity index 100% rename from examples/static/priv/test.txt rename to examples/static_world/priv/test.txt diff --git a/examples/static/priv/video.html b/examples/static_world/priv/video.html similarity index 100% rename from examples/static/priv/video.html rename to examples/static_world/priv/video.html diff --git a/examples/static/rebar.config b/examples/static_world/rebar.config similarity index 100% rename from examples/static/rebar.config rename to examples/static_world/rebar.config diff --git a/examples/static/src/static.app.src b/examples/static_world/src/static_world.app.src similarity index 60% rename from examples/static/src/static.app.src rename to examples/static_world/src/static_world.app.src index bf7512d4..b65995d5 100644 --- a/examples/static/src/static.app.src +++ b/examples/static_world/src/static_world.app.src @@ -1,7 +1,7 @@ %% Feel free to use, reuse and abuse the code in this file. -{application, static, [ - {description, "Cowboy static file server example."}, +{application, static_world, [ + {description, "Cowboy static file handler example."}, {vsn, "1"}, {modules, []}, {registered, []}, @@ -10,6 +10,6 @@ stdlib, cowboy ]}, - {mod, {static_app, []}}, + {mod, {static_world_app, []}}, {env, []} ]}. diff --git a/examples/static/src/static.erl b/examples/static_world/src/static_world.erl similarity index 77% rename from examples/static/src/static.erl rename to examples/static_world/src/static_world.erl index d3eb3192..6425a994 100644 --- a/examples/static/src/static.erl +++ b/examples/static_world/src/static_world.erl @@ -1,6 +1,6 @@ %% Feel free to use, reuse and abuse the code in this file. --module(static). +-module(static_world). %% API. -export([start/0]). @@ -11,4 +11,4 @@ start() -> ok = application:start(crypto), ok = application:start(ranch), ok = application:start(cowboy), - ok = application:start(static). + ok = application:start(static_world). diff --git a/examples/static/src/static_app.erl b/examples/static_world/src/static_world_app.erl similarity index 80% rename from examples/static/src/static_app.erl rename to examples/static_world/src/static_world_app.erl index a2b9c318..6470f12b 100644 --- a/examples/static/src/static_app.erl +++ b/examples/static_world/src/static_world_app.erl @@ -1,7 +1,7 @@ %% Feel free to use, reuse and abuse the code in this file. %% @private --module(static_app). +-module(static_world_app). -behaviour(application). %% API. @@ -14,7 +14,7 @@ start(_Type, _Args) -> Dispatch = cowboy_router:compile([ {'_', [ {"/[...]", cowboy_static, [ - {directory, {priv_dir, static, []}}, + {directory, {priv_dir, static_world, []}}, {mimetypes, {fun mimetypes:path_to_mimes/2, default}} ]} ]} @@ -22,7 +22,7 @@ start(_Type, _Args) -> {ok, _} = cowboy:start_http(http, 100, [{port, 8080}], [ {env, [{dispatch, Dispatch}]} ]), - static_sup:start_link(). + static_world_sup:start_link(). stop(_State) -> ok. diff --git a/examples/static/src/static_sup.erl b/examples/static_world/src/static_world_sup.erl similarity index 93% rename from examples/static/src/static_sup.erl rename to examples/static_world/src/static_world_sup.erl index a3b2e164..a57d07af 100644 --- a/examples/static/src/static_sup.erl +++ b/examples/static_world/src/static_world_sup.erl @@ -1,7 +1,7 @@ %% Feel free to use, reuse and abuse the code in this file. %% @private --module(static_sup). +-module(static_world_sup). -behaviour(supervisor). %% API. diff --git a/examples/static/start.sh b/examples/static_world/start.sh similarity index 80% rename from examples/static/start.sh rename to examples/static_world/start.sh index bc678460..995f913d 100755 --- a/examples/static/start.sh +++ b/examples/static_world/start.sh @@ -1,4 +1,4 @@ #!/bin/sh -erl -pa ebin deps/*/ebin -s static \ +erl -pa ebin deps/*/ebin -s static_world \ -eval "io:format(\"Point your browser at http://localhost:8080/test.txt~n\")." \ -eval "io:format(\"Point your browser at http://localhost:8080/video.html~n\")."