<commit_before>require "foreman/engine"

module ForemanMonit
  class Exporter
    def initialize(options)
      @app = options[:app]
      @user = options[:user]
      @target = options[:target]
      @env = options[:env]

      @engine = Foreman::Engine.new
      load_procfile
      load_env
      @port = @engine.base_port
    end

    def run!
      Dir.mkdir(target_dir) unless File.exist?(target_dir)
      @engine.each_process do |name, process|
        file_name = File.join(@target, "#{@app}-#{name}")
        File.open(file_name, 'w') { |f| f.write ERB.new(File.read(File.expand_path("../../../templates/monitrc.erb", __FILE__))).result(binding) }
      end
    end

    def info
      puts @engine.processes.inspect
    end

    def port
      @port += 1
      @port-1
    end

    def base_dir
      Dir.getwd
    end

    def pid_file(name)
      File.expand_path(File.join(target_dir, "#{@app}-#{name}.pid"))
    end

    def log_file(name)
      File.expand_path(File.join(target_dir, '/log', "#{@app}-#{name}.log"))<commit_msg>Corrected log_dir<commit_after>require "foreman/engine"

module ForemanMonit
  class Exporter
    def initialize(options)
      @app = options[:app]
      @user = options[:user]
      @target = options[:target]
      @env = options[:env]

      @engine = Foreman::Engine.new
      load_procfile
      load_env
      @port = @engine.base_port
    end

    def run!
      Dir.mkdir(target_dir) unless File.exist?(target_dir)
      @engine.each_process do |name, process|
        file_name = File.join(@target, "#{@app}-#{name}")
        File.open(file_name, 'w') { |f| f.write ERB.new(File.read(File.expand_path("../../../templates/monitrc.erb", __FILE__))).result(binding) }
      end
    end

    def info
      puts @engine.processes.inspect
    end

    def port
      @port += 1
      @port-1
    end

    def base_dir
      Dir.getwd
    end

    def pid_file(name)
      File.expand_path(File.join(target_dir, "#{@app}-#{name}.pid"))
    end

    def log_file(name)
      File.expand_path(File.join(target_dir, "#{@app}-#{name}.log"))
{'fraction_non_alphanumeric': 0.14793467819404418, 'fraction_numerical': 0.0019212295869356388, 'mean_word_length': 2.5305084745762714, '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': '7365040', 'n_tokens_mistral': 729, 'n_tokens_neox': 719, 'n_words': 135}