<commit_before>%
% This Source Code Form is subject to the terms of the Mozilla Public
% License, v. 2.0. If a copy of the MPL was not distributed with this
% file, You can obtain one at http://mozilla.org/MPL/2.0/.
%
% Copyright (C) 2014 <NAME> <<EMAIL>>
%

-module(rabbitmq_email_app).

-behaviour(application).
-export([start/2, stop/1]).

-behaviour(supervisor).
-export([init/1]).

start(normal, []) ->
    supervisor:start_link(?MODULE, _Arg = []).
    
stop(_State) ->
    ok.

init([]) ->
    % check for optional dependencies
    case erlang:function_exported(iconv, conv, 2) of
        true -> rabbit_log:info("iconv detected: content trancoding is enabled");
        false -> rabbit_log:warning("iconv not detected: content transcoding is DISABLED")
    end,
    {ok, ServerConfig} = application:get_env(rabbitmq_email, server_config),
    {ok, {{one_for_one, 3, 10},
        % email to amqp
        [{email_handler, {gen_smtp_server, start_link, [rabbit_email_handler, ServerConfig]},
            permanent, 10000, worker, [rabbit_email_handler]},
        % amqo to email
        {message_handler_sup, {rabbit_message_handler_sup, start_link, []},
            permanent, 10000, supervisor, [rabbit_message_handler_sup]}]}}.

% end of file
<commit_msg>A typo<commit_after>%
% This Source Code Form is subject to the terms of the Mozilla Public
% License, v. 2.0. If a copy of the MPL was not distributed with this
% file, You can obtain one at http://mozilla.org/MPL/2.0/.
%
% Copyright (C) 2014 <NAME> <<EMAIL>>
%

-module(rabbitmq_email_app).

-behaviour(application).
-export([start/2, stop/1]).

-behaviour(supervisor).
-export([init/1]).

start(normal, []) ->
    supervisor:start_link(?MODULE, _Arg = []).
    
stop(_State) ->
    ok.

init([]) ->
    % check for optional dependencies
    case erlang:function_exported(iconv, conv, 2) of
        true -> rabbit_log:info("iconv detected: content trancoding is enabled");
        false -> rabbit_log:warning("iconv not detected: content transcoding is DISABLED")
    end,
    {ok, ServerConfig} = application:get_env(rabbitmq_email, server_config),
    {ok, {{one_for_one, 3, 10},
        % email to amqp
        [{email_handler, {gen_smtp_server, start_link, [rabbit_email_handler, ServerConfig]},
            permanent, 10000, worker, [rabbit_email_handler]},
        % amqp to email
        {message_handler_sup, {rabbit_message_handler_sup, start_link, []},
            permanent, 10000, supervisor, [rabbit_message_handler_sup]}]}}.
{'fraction_non_alphanumeric': 0.13383939272872553, 'fraction_numerical': 0.01997602876548142, 'mean_word_length': 3.6199261992619927, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6170887', 'n_tokens_mistral': 869, 'n_tokens_neox': 806, 'n_words': 218}