<commit_before>require 'securerandom'
require 'shellwords'
require 'platform-api'

module Hatchet
  class App
    HATCHET_BUILDPACK_BASE   = (ENV['HATCHET_BUILDPACK_BASE'] || "https://github.com/heroku/heroku-buildpack-ruby.git")
    HATCHET_BUILDPACK_BRANCH = -> { ENV['HATCHET_BUILDPACK_BRANCH'] || Hatchet.git_branch }
    BUILDPACK_URL = "https://github.com/heroku/heroku-buildpack-ruby.git"

    attr_reader :name, :stack, :directory, :repo_name

    class FailedDeploy < StandardError
      def initialize(app, output)
        msg = "Could not deploy '#{app.name}' (#{app.repo_name}) using '#{app.class}' at path: '#{app.directory}'\n" <<
              " if this was expected add `allow_failure: true` to your deploy hash.\n" <<
              "output:\n" <<
              "#{output}"
        super(msg)
      end
    end

    def initialize(repo_name, options = {})
      @repo_name     = repo_name
      @directory     = config.path_for_name(@repo_name)
      @name          = options[:name]          || "hatchet-t-#{SecureRandom.hex(10)}"
      @stack         = options[:stack]
      @debug         = options[:debug]         || options[:debugging]
      @allow_failure = options[:allow_failure] || false
      @labs          = ([] << options[:labs]).flatten.compact
      @buildpacks    = options[:buildpack] || options[:buildpacks] || options[:buildpack_url] || self.class.default_buildpack
      @buildpacks    = Array(@buildpacks)
      @reaper        = Reaper.new(platform_api: platform_api)<commit_msg>Require tmpdir to use Dir.mktmpdir<commit_after>require 'securerandom'
require 'shellwords'
require 'platform-api'
require 'tmpdir'

module Hatchet
  class App
    HATCHET_BUILDPACK_BASE   = (ENV['HATCHET_BUILDPACK_BASE'] || "https://github.com/heroku/heroku-buildpack-ruby.git")
    HATCHET_BUILDPACK_BRANCH = -> { ENV['HATCHET_BUILDPACK_BRANCH'] || Hatchet.git_branch }
    BUILDPACK_URL = "https://github.com/heroku/heroku-buildpack-ruby.git"

    attr_reader :name, :stack, :directory, :repo_name

    class FailedDeploy < StandardError
      def initialize(app, output)
        msg = "Could not deploy '#{app.name}' (#{app.repo_name}) using '#{app.class}' at path: '#{app.directory}'\n" <<
              " if this was expected add `allow_failure: true` to your deploy hash.\n" <<
              "output:\n" <<
              "#{output}"
        super(msg)
      end
    end

    def initialize(repo_name, options = {})
      @repo_name     = repo_name
      @directory     = config.path_for_name(@repo_name)
      @name          = options[:name]          || "hatchet-t-#{SecureRandom.hex(10)}"
      @stack         = options[:stack]
      @debug         = options[:debug]         || options[:debugging]
      @allow_failure = options[:allow_failure] || false
      @labs          = ([] << options[:labs]).flatten.compact
      @buildpacks    = options[:buildpack] || options[:buildpacks] || options[:buildpack_url] || self.class.default_buildpack
      @buildpacks    = Array(@buildpacks)
      @reaper        = Reaper.new(platform_api: platform_api)
{'fraction_non_alphanumeric': 0.14048239895697523, 'fraction_numerical': 0.001303780964797914, 'mean_word_length': 2.8652392947103276, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '2312294', 'n_tokens_mistral': 1017, 'n_tokens_neox': 995, 'n_words': 177}