<commit_before>class PdfService

  def initialize(uploader: Configuration.uploader)
    @uploader = uploader
  end

  def generate_pdf(invoice)
    phantom = Shrimp::Phantom.new(
      "http://X:#{Configuration.api_token}@#{Configuration.host}/invoices/#{invoice.id}")
    phantom.to_pdf("#{invoice.id}.pdf")

    invoice.pdf_generated! if uploader.store!(File.open("#{invoice.id}.pdf"))
  end

  def generate_missing
    Invoice.where(pdf_generated_at: nil).each do |invoice|
      generate_pdf(invoice)
    end
  end

  private

  attr_reader :uploader
end
<commit_msg>put temp invoices in tmp dir<commit_after>class PdfService

  def initialize(uploader: Configuration.uploader)
    @uploader = uploader
  end

  def generate_pdf(invoice)
    phantom = Shrimp::Phantom.new(
      "http://X:#{Configuration.api_token}@#{Configuration.host}/invoices/#{invoice.id}")
    phantom.to_pdf("tmp/#{invoice.id}.pdf")

    invoice.pdf_generated! if uploader.store!(File.open("tmp/#{invoice.id}.pdf"))
  end

  def generate_missing
    Invoice.where(pdf_generated_at: nil).each do |invoice|
      generate_pdf(invoice)
    end
  end

  private

  attr_reader :uploader
end

{'fraction_non_alphanumeric': 0.12875536480686695, 'fraction_numerical': 0.0, 'mean_word_length': 4.114035087719298, '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': '7275854', 'n_tokens_mistral': 416, 'n_tokens_neox': 394, 'n_words': 67}