diff options
author | Stavros Aronis <[email protected]> | 2011-03-21 15:17:07 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-05-04 15:06:17 +0200 |
commit | 5e76fd508af2799fbefe062fd8bb106ae316cf5d (patch) | |
tree | 425f4332cef18dcada56e36aaf5e537d5a49d8c7 /lib/dialyzer/test/opaque_SUITE_data/src/ewgi/ewgi_testapp.erl | |
parent | 7a43c9fb7e2a38263132d50dfc5cd922a91f7599 (diff) | |
download | otp-5e76fd508af2799fbefe062fd8bb106ae316cf5d.tar.gz otp-5e76fd508af2799fbefe062fd8bb106ae316cf5d.tar.bz2 otp-5e76fd508af2799fbefe062fd8bb106ae316cf5d.zip |
Add opaque/ewgi,ewgi2
Diffstat (limited to 'lib/dialyzer/test/opaque_SUITE_data/src/ewgi/ewgi_testapp.erl')
-rw-r--r-- | lib/dialyzer/test/opaque_SUITE_data/src/ewgi/ewgi_testapp.erl | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/dialyzer/test/opaque_SUITE_data/src/ewgi/ewgi_testapp.erl b/lib/dialyzer/test/opaque_SUITE_data/src/ewgi/ewgi_testapp.erl new file mode 100644 index 0000000000..59c1ae9206 --- /dev/null +++ b/lib/dialyzer/test/opaque_SUITE_data/src/ewgi/ewgi_testapp.erl @@ -0,0 +1,46 @@ +%%%------------------------------------------------------------------- +%%% File : ewgi_testapp.erl +%%% Authors : Hunter Morris <[email protected]> +%%% License : +%%% The contents of this file are subject to the Mozilla Public +%%% License Version 1.1 (the "License"); you may not use this file +%%% except in compliance with the License. You may obtain a copy of +%%% the License at http://www.mozilla.org/MPL/ +%%% +%%% Software distributed under the License is distributed on an "AS IS" +%%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%%% the License for the specific language governing rights and +%%% limitations under the License. +%%% The Initial Developer of the Original Code is S.G. Consulting +%%% srl. Portions created by S.G. Consulting s.r.l. are Copyright (C) +%%% 2007 S.G. Consulting srl. All Rights Reserved. +%%% +%%% @doc +%%% <p>ewgi test applications</p> +%%% +%%% @end +%%% +%%% Created : 05 July 2009 by Hunter Morris <[email protected]> +%%%------------------------------------------------------------------- +-module(ewgi_testapp). + +-export([htmlise/1]). + +-include_lib("ewgi.hrl"). + +htmlise(C) -> + iolist_to_binary( + ["<dl class=\"request\">", + io_lib:format("<dt>other http headers</dt><dd>~s</dd>", [htmlise_data("http_headers", ewgi_api:get_all_headers(C))]), + io_lib:format("<dt>ewgi extra data</dt><dd>~s</dd>", [htmlise_data("request_data", ewgi_api:get_all_data(C))]), + "</dl>"]). + +htmlise_data(Name, L) when is_list(L) -> + ["<dl class=\"", Name, "\">", + [io_lib:format("<dt>~s</dt><dd><pre>~p</pre><dd>", [K, V]) || {K, V} <- L], + "</dl>"]; +htmlise_data(Name, T) -> + case gb_trees:to_list(T) of + [] -> []; + L -> htmlise_data(Name, L) + end. |