<commit_before>require "fileutils"
require "language_pack"
require "language_pack/rack"

# Rails 2 Language Pack. This is for any Rails 2.x apps.
class LanguagePack::Rails2 < LanguagePack::Ruby

  # detects if this is a valid Rails 2 app
  # @return [Boolean] true if it's a Rails 2 app
  def self.use?
    if gemfile_lock?
      rails_version = LanguagePack::Ruby.gem_version('railties')
      rails_version >= Gem::Version.new('2.0.0') && rails_version < Gem::Version.new('3.0.0') if rails_version
    end
  end

  def name
    "Ruby/Rails"
  end

  def default_config_vars
    super.merge({
      "RAILS_ENV" => "production",
      "RACK_ENV" => "production"
    })
  end

  def default_process_types
    web_process = gem_is_bundled?("thin") ?
                    "bundle exec thin start -e $RAILS_ENV -p $PORT" :
                    "bundle exec ruby script/server -p $PORT"

    super.merge({
      "web" => web_process,
      "worker" => "bundle exec rake jobs:work",<commit_msg>rails 2 doesn't have railties<commit_after>require "fileutils"
require "language_pack"
require "language_pack/rack"

# Rails 2 Language Pack. This is for any Rails 2.x apps.
class LanguagePack::Rails2 < LanguagePack::Ruby

  # detects if this is a valid Rails 2 app
  # @return [Boolean] true if it's a Rails 2 app
  def self.use?
    if gemfile_lock?
      rails_version = LanguagePack::Ruby.gem_version('rails')
      rails_version >= Gem::Version.new('2.0.0') && rails_version < Gem::Version.new('3.0.0') if rails_version
    end
  end

  def name
    "Ruby/Rails"
  end

  def default_config_vars
    super.merge({
      "RAILS_ENV" => "production",
      "RACK_ENV" => "production"
    })
  end

  def default_process_types
    web_process = gem_is_bundled?("thin") ?
                    "bundle exec thin start -e $RAILS_ENV -p $PORT" :
                    "bundle exec ruby script/server -p $PORT"

    super.merge({
      "web" => web_process,
      "worker" => "bundle exec rake jobs:work",
{'fraction_non_alphanumeric': 0.1163727959697733, 'fraction_numerical': 0.011586901763224182, 'mean_word_length': 2.9017681728880156, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '4982145', 'n_tokens_mistral': 705, 'n_tokens_neox': 641, 'n_words': 183}