Commits

Anonymous committed 0b6d472 Merge

Merged with main branch

Comments (0)

Files changed (4)

 Version ?:
+* Add start/0 and stop/0
 * Fix for decoding chunked HTTP responses with extraneous whitespace
   (thanks to Bob Ippolito) 
     * api.facebook.com includes extra whitespace in its chunked HTTP response
 clean:
 	@echo Cleaning
 	@rm -f ebin/*.{beam,app} test/*.beam doc/*.{html,css,png} doc/edoc-info
-	@rm -r cover_report
+	@rm -rf cover_report
 	@rm -f util/*.beam
 
 release: clean all test dialyzer
 -module(lhttpc).
 -behaviour(application).
 
--export([request/4, request/5, request/6, request/9]).
+-export([start/0, stop/0, request/4, request/5, request/6, request/9]).
+-export([start/2, stop/1]).
 -export([
         send_body_part/2,
         send_body_part/3, 
         get_body_part/1,
         get_body_part/2
         ]).
--export([start/2, stop/1]).
 
 -include("lhttpc_types.hrl").
 
 stop(_) ->
     ok.
 
+%% @spec () -> ok
+%% @doc
+%% Start the application.
+%% This is a helper function that will call `application:start(lhttpc)' to
+%% allow the library to be started using the `-s' flag.
+%% For instance:
+%% `$ erl -s crypto -s ssl -s lhttpc'
+%% @end
+-spec start() -> ok.
+start() ->
+	application:start(lhttpc),
+	ok.
+
+%% @spec () -> ok
+%% @doc
+%% Stops the application.
+%% This is a helper function that will call `application:stop(lhttpc)'.
+%% @end
+-spec stop() -> ok.
+stop() ->
+	application:stop(lhttpc).
+
 %% @spec (URL, Method, Hdrs, Timeout) -> Result
 %%   URL = string()
 %%   Method = string() | atom()
     fi
 fi
 
+make clean && make && make dialyzer
+
 if ! yesno "Did the compilation run without warnings?"; then
-    "Try again..."
+    echo "Try again..."
     exit 1
 fi
 
 if ! yesno "Is the changelog up to date?"; then
-    "Try again..."
+    echo "Try again..."
     exit 1
 fi
 
 if ! yesno "Did dialyzer run without warnings?"; then
-    "Try again..."
+    echo "Try again..."
     exit 1
 fi