<commit_before>require 'fileutils'

class Project
  @@plugin_names = []

  def self.plugin(plugin_name)
    @@plugin_names << plugin_name unless RAILS_ENV == 'test' or @@plugin_names.include? plugin_name
  end

  def self.load_or_create(dir)
    project = @project = Project.new(File.basename(dir), Subversion.new, dir + "/work")
    project.path = dir
    begin
      project.load_config_file
      return project
    rescue => e
      raise "Could not load #{project.config_file} : #{e.message} in #{e.backtrace.first}"
    ensure
      @project = nil
    end
  end
  
  def self.reload(project)
    begin
      @project = project
      project.load_config_file
    rescue => e
      raise "Could not load #{config_file} : #{e.message} in #{e.backtrace.first}"
    ensure
      @project = nil
    end
  end

  def config_file
    File.expand_path(File.join(path, 'project_config.rb'))
  end

  def load_config_file
    load config_file if File.exists?(config_file)
  end

  def self.configure
    raise "No project is currently being created" unless @project
    yield @project
  end

  attr_reader :name, :plugins, :build_command, :rake_task
  attr_accessor :source_control, :path, :local_checkout, :scheduler, :builder_status

  def initialize(name, source_control = Subversion.new, local_checkout = nil)<commit_msg>r168: Removed used reload method.<commit_after>require 'fileutils'

class Project
  @@plugin_names = []

  def self.plugin(plugin_name)
    @@plugin_names << plugin_name unless RAILS_ENV == 'test' or @@plugin_names.include? plugin_name
  end

  def self.load_or_create(dir)
    project = @project = Project.new(File.basename(dir), Subversion.new, dir + "/work")
    project.path = dir
    begin
      project.load_config_file
      return project
    rescue => e
      raise "Could not load #{project.config_file} : #{e.message} in #{e.backtrace.first}"
    ensure
      @project = nil
    end
  end
  
  def config_file
    File.expand_path(File.join(path, 'project_config.rb'))
  end

  def load_config_file
    load config_file if File.exists?(config_file)
  end

  def self.configure
    raise "No project is currently being created" unless @project
    yield @project
  end

  attr_reader :name, :plugins, :build_command, :rake_task
  attr_accessor :source_control, :path, :local_checkout, :scheduler, :builder_status

  def initialize(name, source_control = Subversion.new, local_checkout = nil)
{'fraction_non_alphanumeric': 0.10119785212722016, 'fraction_numerical': 0.0012391573729863693, 'mean_word_length': 3.56120527306968, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, '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': '4400509', 'n_tokens_mistral': 784, 'n_tokens_neox': 765, 'n_words': 200}