Permalink
Browse files

merge

  • Loading branch information...
Michal Ptaszek
Michal Ptaszek committed Oct 16, 2009
2 parents 36dd6a1 + 2b11ddf commit ca0d7094d8e6175e8f01e08c070a8c3a457125f2
Showing with 149 additions and 6,890 deletions.
  1. +1 −0 .hgtags
  2. +0 −9 lib/mochiweb-0.01/LICENSE
  3. +0 −11 lib/mochiweb-0.01/Makefile
  4. +0 −1 lib/mochiweb-0.01/README
  5. +0 −32 lib/mochiweb-0.01/ebin/mochiweb.app
  6. +0 −5 lib/mochiweb-0.01/priv/skel/Makefile
  7. +0 −8 lib/mochiweb-0.01/priv/skel/priv/www/index.html
  8. +0 −9 lib/mochiweb-0.01/priv/skel/src/Makefile
  9. +0 −14 lib/mochiweb-0.01/priv/skel/src/skel.app
  10. +0 −30 lib/mochiweb-0.01/priv/skel/src/skel.erl
  11. +0 −1 lib/mochiweb-0.01/priv/skel/src/skel.hrl
  12. +0 −22 lib/mochiweb-0.01/priv/skel/src/skel_app.erl
  13. +0 −84 lib/mochiweb-0.01/priv/skel/src/skel_deps.erl
  14. +0 −54 lib/mochiweb-0.01/priv/skel/src/skel_sup.erl
  15. +0 −43 lib/mochiweb-0.01/priv/skel/src/skel_web.erl
  16. +0 −3 lib/mochiweb-0.01/priv/skel/start-dev.sh
  17. +0 −3 lib/mochiweb-0.01/priv/skel/start.sh
  18. +0 −46 lib/mochiweb-0.01/priv/skel/support/include.mk
  19. +0 −27 lib/mochiweb-0.01/scripts/new_mochiweb.erl
  20. +0 −20 lib/mochiweb-0.01/src/Makefile
  21. +0 −426 lib/mochiweb-0.01/src/mochifmt.erl
  22. +0 −30 lib/mochiweb-0.01/src/mochifmt_records.erl
  23. +0 −23 lib/mochiweb-0.01/src/mochifmt_std.erl
  24. +0 −75 lib/mochiweb-0.01/src/mochihex.erl
  25. +0 −533 lib/mochiweb-0.01/src/mochijson.erl
  26. +0 −618 lib/mochiweb-0.01/src/mochijson2.erl
  27. +0 −289 lib/mochiweb-0.01/src/mochinum.erl
  28. +0 −32 lib/mochiweb-0.01/src/mochiweb.app
  29. +0 −110 lib/mochiweb-0.01/src/mochiweb.erl
  30. +0 −20 lib/mochiweb-0.01/src/mochiweb_app.erl
  31. +0 −295 lib/mochiweb-0.01/src/mochiweb_charref.erl
  32. +0 −257 lib/mochiweb-0.01/src/mochiweb_cookies.erl
  33. +0 −31 lib/mochiweb-0.01/src/mochiweb_echo.erl
  34. +0 −186 lib/mochiweb-0.01/src/mochiweb_headers.erl
  35. +0 −893 lib/mochiweb-0.01/src/mochiweb_html.erl
  36. +0 −142 lib/mochiweb-0.01/src/mochiweb_http.erl
  37. +0 −429 lib/mochiweb-0.01/src/mochiweb_multipart.erl
  38. +0 −790 lib/mochiweb-0.01/src/mochiweb_request.erl
  39. +0 −56 lib/mochiweb-0.01/src/mochiweb_response.erl
  40. +0 −73 lib/mochiweb-0.01/src/mochiweb_skel.erl
  41. +0 −248 lib/mochiweb-0.01/src/mochiweb_socket_server.erl
  42. +0 −34 lib/mochiweb-0.01/src/mochiweb_sup.erl
  43. +0 −579 lib/mochiweb-0.01/src/mochiweb_util.erl
  44. +0 −124 lib/mochiweb-0.01/src/reloader.erl
  45. +0 −39 lib/mochiweb-0.01/support/include.mk
  46. +36 −32 lib/wpart-1.3/src/wpart.erl
  47. +40 −27 lib/wpart-1.3/src/wpart_utils.erl
  48. +6 −6 lib/wparts-1.3/src/wpart_atom.erl
  49. +10 −11 lib/wparts-1.3/src/wpart_autocomplete.erl
  50. +8 −8 lib/wparts-1.3/src/wpart_date.erl
  51. +8 −8 lib/wparts-1.3/src/wpart_datetime.erl
  52. +2 −6 lib/wparts-1.3/src/wpart_float.erl
  53. +4 −4 lib/wparts-1.3/src/wpart_integer.erl
  54. +8 −9 lib/wparts-1.3/src/wpart_string.erl
  55. +9 −9 lib/wparts-1.3/src/wpart_text.erl
  56. +5 −5 lib/wparts-1.3/src/wpart_time.erl
  57. +12 −11 lib/wparts-1.3/src/wtype_text.erl
View
@@ -1,2 +1,3 @@
d93c728f66523b2eb7b58299130d26d7698caea3 1.3rc1
f9787411670df615ca8df2e215a6154a59c7331d 1.3
+de04dc1e7d2198917d7be1c6ca3b0281cc30f4f2 1.4rc1
@@ -1,9 +0,0 @@
-This is the MIT license.
-
-Copyright (c) 2007 Mochi Media, Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -1,11 +0,0 @@
-all:
- (cd src;$(MAKE) all)
-
-edoc:
- (cd src;$(MAKE) edoc)
-
-test:
- (cd src;$(MAKE) test)
-
-clean:
- (cd src;$(MAKE) clean)
View
@@ -1 +0,0 @@
-MochiWeb is an Erlang library for building lightweight HTTP servers.
@@ -1,32 +0,0 @@
-{application, mochiweb,
- [{description, "MochiMedia Web Server"},
- {vsn, "0.01"},
- {modules, [
- mochihex,
- mochijson,
- mochijson2,
- mochinum,
- mochiweb,
- mochiweb_app,
- mochiweb_charref,
- mochiweb_cookies,
- mochiweb_echo,
- mochiweb_headers,
- mochiweb_html,
- mochiweb_http,
- mochiweb_multipart,
- mochiweb_request,
- mochiweb_response,
- mochiweb_skel,
- mochiweb_socket_server,
- mochiweb_sup,
- mochiweb_util,
- reloader,
- mochifmt,
- mochifmt_std,
- mochifmt_records
- ]},
- {registered, []},
- {mod, {mochiweb_app, []}},
- {env, []},
- {applications, [kernel, stdlib]}]}.
@@ -1,5 +0,0 @@
-all:
- (cd src;$(MAKE))
-
-clean:
- (cd src;$(MAKE) clean)
@@ -1,8 +0,0 @@
-<html>
-<head>
-<title>It Worked</title>
-</head>
-<body>
-MochiWeb running.
-</body>
-</html>
@@ -1,9 +0,0 @@
-include ../support/include.mk
-
-all: $(EBIN_FILES)
-
-debug:
- $(MAKE) DEBUG=-DDEBUG
-
-clean:
- rm -rf $(EBIN_FILES)
@@ -1,14 +0,0 @@
-{application, skel,
- [{description, "skel"},
- {vsn, "0.01"},
- {modules, [
- skel,
- skel_app,
- skel_sup,
- skel_web,
- skel_deps
- ]},
- {registered, []},
- {mod, {skel_app, []}},
- {env, []},
- {applications, [kernel, stdlib, crypto]}]}.
@@ -1,30 +0,0 @@
-%% @author author <author@example.com>
-%% @copyright YYYY author.
-
-%% @doc TEMPLATE.
-
--module(skel).
--author('author <author@example.com>').
--export([start/0, stop/0]).
-
-ensure_started(App) ->
- case application:start(App) of
- ok ->
- ok;
- {error, {already_started, App}} ->
- ok
- end.
-
-%% @spec start() -> ok
-%% @doc Start the skel server.
-start() ->
- skel_deps:ensure(),
- ensure_started(crypto),
- application:start(skel).
-
-%% @spec stop() -> ok
-%% @doc Stop the skel server.
-stop() ->
- Res = application:stop(skel),
- application:stop(crypto),
- Res.
@@ -1 +0,0 @@
-
@@ -1,22 +0,0 @@
-%% @author author <author@example.com>
-%% @copyright YYYY author.
-
-%% @doc Callbacks for the skel application.
-
--module(skel_app).
--author('author <author@example.com>').
-
--behaviour(application).
--export([start/2,stop/1]).
-
-
-%% @spec start(_Type, _StartArgs) -> ServerRet
-%% @doc application start callback for skel.
-start(_Type, _StartArgs) ->
- skel_deps:ensure(),
- skel_sup:start_link().
-
-%% @spec stop(_State) -> ServerRet
-%% @doc application stop callback for skel.
-stop(_State) ->
- ok.
@@ -1,84 +0,0 @@
-%% @author author <author@example.com>
-%% @copyright YYYY author.
-
-%% @doc Ensure that the relatively-installed dependencies are on the code
-%% loading path, and locate resources relative
-%% to this application's path.
-
--module(skel_deps).
--author('author <author@example.com>').
-
--export([ensure/0, ensure/1]).
--export([get_base_dir/0, get_base_dir/1]).
--export([local_path/1, local_path/2]).
--export([deps_on_path/0, new_siblings/1]).
-
-%% @spec deps_on_path() -> [ProjNameAndVers]
-%% @doc List of project dependencies on the path.
-deps_on_path() ->
- F = fun (X, Acc) ->
- ProjDir = filename:dirname(X),
- case {filename:basename(X),
- filename:basename(filename:dirname(ProjDir))} of
- {"ebin", "deps"} ->
- [filename:basename(ProjDir) | Acc];
- _ ->
- Acc
- end
- end,
- ordsets:from_list(lists:foldl(F, [], code:get_path())).
-
-%% @spec new_siblings(Module) -> [Dir]
-%% @doc Find new siblings paths relative to Module that aren't already on the
-%% code path.
-new_siblings(Module) ->
- Existing = deps_on_path(),
- SiblingEbin = filelib:wildcard(local_path(["deps", "*", "ebin"], Module)),
- Siblings = [filename:dirname(X) || X <- SiblingEbin,
- ordsets:is_element(
- filename:basename(filename:dirname(X)),
- Existing) =:= false],
- lists:filter(fun filelib:is_dir/1,
- lists:append([[filename:join([X, "ebin"]),
- filename:join([X, "include"])] ||
- X <- Siblings])).
-
-
-%% @spec ensure(Module) -> ok
-%% @doc Ensure that all ebin and include paths for dependencies
-%% of the application for Module are on the code path.
-ensure(Module) ->
- code:add_paths(new_siblings(Module)),
- code:clash(),
- ok.
-
-%% @spec ensure() -> ok
-%% @doc Ensure that the ebin and include paths for dependencies of
-%% this application are on the code path. Equivalent to
-%% ensure(?Module).
-ensure() ->
- ensure(?MODULE).
-
-%% @spec get_base_dir(Module) -> string()
-%% @doc Return the application directory for Module. It assumes Module is in
-%% a standard OTP layout application in the ebin or src directory.
-get_base_dir(Module) ->
- {file, Here} = code:is_loaded(Module),
- filename:dirname(filename:dirname(Here)).
-
-%% @spec get_base_dir() -> string()
-%% @doc Return the application directory for this application. Equivalent to
-%% get_base_dir(?MODULE).
-get_base_dir() ->
- get_base_dir(?MODULE).
-
-%% @spec local_path([string()], Module) -> string()
-%% @doc Return an application-relative directory from Module's application.
-local_path(Components, Module) ->
- filename:join([get_base_dir(Module) | Components]).
-
-%% @spec local_path(Components) -> string()
-%% @doc Return an application-relative directory for this application.
-%% Equivalent to local_path(Components, ?MODULE).
-local_path(Components) ->
- local_path(Components, ?MODULE).
@@ -1,54 +0,0 @@
-%% @author author <author@example.com>
-%% @copyright YYYY author.
-
-%% @doc Supervisor for the skel application.
-
--module(skel_sup).
--author('author <author@example.com>').
-
--behaviour(supervisor).
-
-%% External exports
--export([start_link/0, upgrade/0]).
-
-%% supervisor callbacks
--export([init/1]).
-
-%% @spec start_link() -> ServerRet
-%% @doc API for starting the supervisor.
-start_link() ->
- supervisor:start_link({local, ?MODULE}, ?MODULE, []).
-
-%% @spec upgrade() -> ok
-%% @doc Add processes if necessary.
-upgrade() ->
- {ok, {_, Specs}} = init([]),
-
- Old = sets:from_list(
- [Name || {Name, _, _, _} <- supervisor:which_children(?MODULE)]),
- New = sets:from_list([Name || {Name, _, _, _, _, _} <- Specs]),
- Kill = sets:subtract(Old, New),
-
- sets:fold(fun (Id, ok) ->
- supervisor:terminate_child(?MODULE, Id),
- supervisor:delete_child(?MODULE, Id),
- ok
- end, ok, Kill),
-
- [supervisor:start_child(?MODULE, Spec) || Spec <- Specs],
- ok.
-
-%% @spec init([]) -> SupervisorTree
-%% @doc supervisor callback.
-init([]) ->
- Ip = case os:getenv("MOCHIWEB_IP") of false -> "0.0.0.0"; Any -> Any end,
- WebConfig = [
- {ip, Ip},
- {port, 8000},
- {docroot, skel_deps:local_path(["priv", "www"])}],
- Web = {skel_web,
- {skel_web, start, [WebConfig]},
- permanent, 5000, worker, dynamic},
-
- Processes = [Web],
- {ok, {{one_for_one, 10, 10}, Processes}}.
@@ -1,43 +0,0 @@
-%% @author author <author@example.com>
-%% @copyright YYYY author.
-
-%% @doc Web server for skel.
-
--module(skel_web).
--author('author <author@example.com>').
-
--export([start/1, stop/0, loop/2]).
-
-%% External API
-
-start(Options) ->
- {DocRoot, Options1} = get_option(docroot, Options),
- Loop = fun (Req) ->
- ?MODULE:loop(Req, DocRoot)
- end,
- mochiweb_http:start([{name, ?MODULE}, {loop, Loop} | Options1]).
-
-stop() ->
- mochiweb_http:stop(?MODULE).
-
-loop(Req, DocRoot) ->
- "/" ++ Path = Req:get(path),
- case Req:get(method) of
- Method when Method =:= 'GET'; Method =:= 'HEAD' ->
- case Path of
- _ ->
- Req:serve_file(Path, DocRoot)
- end;
- 'POST' ->
- case Path of
- _ ->
- Req:not_found()
- end;
- _ ->
- Req:respond({501, [], []})
- end.
-
-%% Internal API
-
-get_option(Option, Options) ->
- {proplists:get_value(Option, Options), proplists:delete(Option, Options)}.
@@ -1,3 +0,0 @@
-#!/bin/sh
-cd `dirname $0`
-exec erl -pa $PWD/ebin $PWD/deps/*/ebin -boot start_sasl -s reloader -s skel
@@ -1,3 +0,0 @@
-#!/bin/sh
-cd `dirname $0`
-exec erl -pa $PWD/ebin $PWD/deps/*/ebin -boot start_sasl -s skel
@@ -1,46 +0,0 @@
-## -*- makefile -*-
-
-######################################################################
-## Erlang
-
-ERL := erl
-ERLC := $(ERL)c
-
-INCLUDE_DIRS := ../include $(wildcard ../deps/*/include)
-EBIN_DIRS := $(wildcard ../deps/*/ebin)
-ERLC_FLAGS := -W $(INCLUDE_DIRS:../%=-I ../%) $(EBIN_DIRS:%=-pa %)
-
-ifndef no_debug_info
- ERLC_FLAGS += +debug_info
-endif
-
-ifdef debug
- ERLC_FLAGS += -Ddebug
-endif
-
-EBIN_DIR := ../ebin
-DOC_DIR := ../doc
-EMULATOR := beam
-
-ERL_SOURCES := $(wildcard *.erl)
-ERL_HEADERS := $(wildcard *.hrl) $(wildcard ../include/*.hrl)
-ERL_OBJECTS := $(ERL_SOURCES:%.erl=$(EBIN_DIR)/%.$(EMULATOR))
-ERL_DOCUMENTS := $(ERL_SOURCES:%.erl=$(DOC_DIR)/%.html)
-ERL_OBJECTS_LOCAL := $(ERL_SOURCES:%.erl=./%.$(EMULATOR))
-APP_FILES := $(wildcard *.app)
-EBIN_FILES = $(ERL_OBJECTS) $(ERL_DOCUMENTS) $(APP_FILES:%.app=../ebin/%.app)
-EBIN_FILES_NO_DOCS = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app)
-MODULES = $(ERL_SOURCES:%.erl=%)
-
-../ebin/%.app: %.app
- cp $< $@
-
-$(EBIN_DIR)/%.$(EMULATOR): %.erl
- $(ERLC) $(ERLC_FLAGS) -o $(EBIN_DIR) $<
-
-./%.$(EMULATOR): %.erl
- $(ERLC) $(ERLC_FLAGS) -o . $<
-
-$(DOC_DIR)/%.html: %.erl
- $(ERL) -noshell -run edoc file $< -run init stop
- mv *.html $(DOC_DIR)
Oops, something went wrong.

0 comments on commit ca0d709

Please sign in to comment.