<commit_before>require 'csv'

module EventReporter
  class Load
    attr_reader :printer
    attr_accessor :file_name, :criteria

    def initialize(instream, outstream, printer, criteria)
      @instream = instream
      @outstream = outstream
      @printer = printer
      @criteria = criteria
      @file_name = ''
    end

    def call
      get_filename
      load_file
      #save_to_datastore
    end

    def get_filename
      if criteria.length == 0
        self.file_name = 'event_attendees.csv'
      elsif criteria.length == 1
        self.file_name = criteria[0]
      else
        printer.invalid_load_criteria(criteria.length)
      end
    end

    def load_file
      file_path = File.join(EventReporter::LOAD_FILE_DIR,file_name)
      contents = CSV.open file_path, headers: true, header_converters: :symbol
      csv_rows = contents.map do |row|
        row.to_hash
      end
      @@entry_repository = EventReporter::EntryRepository.new(csv_rows)
      puts @@entry_repository.entries[0].first_name
    end
    # read file
    # parse file
    # save the results to data-store
  end
end<commit_msg>take out one testing puts<commit_after>require 'csv'

module EventReporter
  class Load
    attr_reader :printer
    attr_accessor :file_name, :criteria

    def initialize(instream, outstream, printer, criteria)
      @instream = instream
      @outstream = outstream
      @printer = printer
      @criteria = criteria
      @file_name = ''
    end

    def call
      get_filename
      load_file
      #save_to_datastore
    end

    def get_filename
      if criteria.length == 0
        self.file_name = 'event_attendees.csv'
      elsif criteria.length == 1
        self.file_name = criteria[0]
      else
        printer.invalid_load_criteria(criteria.length)
      end
    end

    def load_file
      file_path = File.join(EventReporter::LOAD_FILE_DIR,file_name)
      contents = CSV.open file_path, headers: true, header_converters: :symbol
      csv_rows = contents.map do |row|
        row.to_hash
      end
      @@entry_repository = EventReporter::EntryRepository.new(csv_rows)
    end
    # read file
    # parse file
    # save the results to data-store
  end
end
{'fraction_non_alphanumeric': 0.07272727272727272, 'fraction_numerical': 0.003181818181818182, 'mean_word_length': 2.5442834138486314, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5688046', 'n_tokens_mistral': 695, 'n_tokens_neox': 678, 'n_words': 163}