Skip to content

Commit

Permalink
Rename cowboy_http_rest to cowboy_rest
Browse files Browse the repository at this point in the history
  • Loading branch information
essen committed Aug 27, 2012
1 parent d3dcaf1 commit 6d84afd
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/rest_hello_world/src/toppage_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-export([hello_to_text/2]).

init(_Transport, _Req, []) ->
{upgrade, protocol, cowboy_http_rest}.
{upgrade, protocol, cowboy_rest}.

content_types_provided(Req, State) ->
{[
Expand Down
6 changes: 3 additions & 3 deletions src/cowboy_http_static.erl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
%% `application/octet-stream'. This can be overriden by supplying a list
%% of filename extension to mimetypes pairs in the `mimetypes' option.
%% The filename extension should be a binary string including the leading dot.
%% The mimetypes must be of a type that the `cowboy_http_rest' protocol can
%% The mimetypes must be of a type that the `cowboy_rest' protocol can
%% handle.
%%
%% The <a href="https://github.com/spawngrid/mimetypes">spawngrid/mimetypes</a>
Expand Down Expand Up @@ -176,7 +176,7 @@
%% cowboy_protocol callbacks
-export([init/3]).

%% cowboy_http_rest callbacks
%% cowboy_rest callbacks
-export([rest_init/2]).
-export([allowed_methods/2]).
-export([malformed_request/2]).
Expand Down Expand Up @@ -208,7 +208,7 @@

%% @private Upgrade from HTTP handler to REST handler.
init({_Transport, http}, _Req, _Opts) ->
{upgrade, protocol, cowboy_http_rest}.
{upgrade, protocol, cowboy_rest}.


%% @private Set up initial state of REST handler.
Expand Down
2 changes: 1 addition & 1 deletion src/cowboy_http_rest.erl → src/cowboy_rest.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
%% can be found in the Webmachine source tree, and on the Webmachine
%% documentation available at http://wiki.basho.com/Webmachine.html
%% at the time of writing.
-module(cowboy_http_rest).
-module(cowboy_rest).

-export([upgrade/4]).

Expand Down
2 changes: 1 addition & 1 deletion test/rest_forbidden_resource.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
post_is_create/2, create_path/2, to_text/2, from_text/2]).

init(_Transport, _Req, _Opts) ->
{upgrade, protocol, cowboy_http_rest}.
{upgrade, protocol, cowboy_rest}.

rest_init(Req, [Forbidden]) ->
{ok, Req, Forbidden}.
Expand Down
2 changes: 1 addition & 1 deletion test/rest_nodelete_resource.erl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
get_text_plain/2]).

init(_Transport, _Req, _Opts) ->
{upgrade, protocol, cowboy_http_rest}.
{upgrade, protocol, cowboy_rest}.

allowed_methods(Req, State) ->
{['GET', 'HEAD', 'DELETE'], Req, State}.
Expand Down
2 changes: 1 addition & 1 deletion test/rest_resource_etags.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-export([init/3, generate_etag/2, content_types_provided/2, get_text_plain/2]).

init(_Transport, _Req, _Opts) ->
{upgrade, protocol, cowboy_http_rest}.
{upgrade, protocol, cowboy_rest}.

generate_etag(Req, State) ->
case cowboy_req:qs_val(<<"type">>, Req) of
Expand Down
2 changes: 1 addition & 1 deletion test/rest_simple_resource.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-export([init/3, content_types_provided/2, get_text_plain/2]).

init(_Transport, _Req, _Opts) ->
{upgrade, protocol, cowboy_http_rest}.
{upgrade, protocol, cowboy_rest}.

content_types_provided(Req, State) ->
{[{{<<"text">>, <<"plain">>, []}, get_text_plain}], Req, State}.
Expand Down

0 comments on commit 6d84afd

Please sign in to comment.