<commit_before>require 'mail'

require_relative 'mail_config'

class ScraperReport
  def initialize
    @date = Time.now.strftime('%F')
    @number_records_gathered = 'Unknown (never set by scraper)'
  end

  def send_email
    mail = Mail.new do
      from    '<EMAIL>'
      to      '<EMAIL>'
      subject 'Makler.ge Scraper Report'
    end

    mail[:body] = body

    mail.deliver!
  end

  private

  attr_reader :date, :number_records_gathered

  def body
    <<-REPORT_BODY
    Makler.Ge Scraper: Scrape Report

    Date: #{date}
    Number of records gathered: #{number_records_gathered}
    REPORT_BODY
  end
end<commit_msg>Setter method for ScraperReport number_records_gathered exposed as public.<commit_after>require 'mail'

require_relative 'mail_config'

class ScraperReport
  def initialize
    @date = Time.now.strftime('%F')
    @number_records_gathered = 0
  end

  def send_email
    mail = Mail.new do
      from    '<EMAIL>'
      to      '<EMAIL>'
      subject 'Makler.ge Scraper Report'
    end

    mail[:body] = body

    mail.deliver!
  end

  attr_accessor :number_records_gathered

  private

  attr_reader :date

  def body
    <<-REPORT_BODY
    Makler.Ge Scraper: Scrape Report

    Date: #{date}
    Number of records gathered: #{number_records_gathered.to_s}
    REPORT_BODY
  end
end
{'fraction_non_alphanumeric': 0.0841546626231994, 'fraction_numerical': 0.000758150113722517, 'mean_word_length': 2.9759036144578315, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '3346597', 'n_tokens_mistral': 468, 'n_tokens_neox': 441, 'n_words': 115}