%% Copyright (c) 2012 Campanja AB %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% A copy of the license is included in the file LICENSE. %% %% Unless required by applicable law or agreed to in writing, software %% distributed under the License is distributed on an "AS IS" BASIS, %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. -module(folsomite). -export([start/0]). %% api start() -> start(folsomite). %% internal start(App) -> start_ok(App, application:start(App, permanent)). start_ok(_, ok) -> ok; start_ok(_, {error, {already_started, _}}) -> ok; start_ok(App, {error, {not_started, Dep}}) -> ok = start(Dep), start(App); start_ok(App, {error, Reason}) -> erlang:error({app_start_failed, App, Reason}).