<commit_before>module Jarvis
  module Boot
    class Boot
      def initialize
        @sources = Jarvis::Boot::Session.addons[:sources]
        @clients = Jarvis::Boot::Session.addons[:clients]
        @receivers = Jarvis::Boot::Session.addons[:receivers]

        display_count
        start_sources
      end

      def display_count
        @sources.display_count
        @clients.display_count
        @receivers.display_count
      end

      def start_sources
        Jarvis::Addons::Sources.new(@sources).launch
      end
    end
  end
end<commit_msg>improve error messages if an addon is missing<commit_after>module Jarvis
  module Boot
    class Boot
      def initialize
        @sources = Jarvis::Boot::Session.addons[:sources]
        @clients = Jarvis::Boot::Session.addons[:clients]
        @receivers = Jarvis::Boot::Session.addons[:receivers]

        display_count
        start_sources
      end

      def display_count
        count = {}
        count[:sources] = @sources.display_count
        count[:clients] = @clients.display_count
        count[:receivers] = @receivers.display_count
        @abort_message = ''
        count.each do |type, count|
          @addon_missing = count == 0 || @addon_missing
          type = type.to_s.chomp('s')
          @abort_message <<  "I'm sorry, I can't start with #{count} #{type}. \n" if count == 0
        end
        Jarvis::Utility::Logger.error(@abort_message.strip) if @addon_missing
      end

      def start_sources
        Jarvis::Addons::Sources.new(@sources).launch
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10261312938177183, 'fraction_numerical': 0.0012746972594008922, 'mean_word_length': 2.4354485776805253, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2064125', 'n_tokens_mistral': 476, 'n_tokens_neox': 468, 'n_words': 98}