<commit_before>require "language_pack"
require "language_pack/rails3"

# Rails 4 Language Pack. This is for all Rails 4.x apps.
class LanguagePack::Rails4 < LanguagePack::Rails3
  # detects if this is a Rails 3.x app
  # @return [Boolean] true if it's a Rails 3.x app
  def self.use?
    rails_version = LanguagePack::Ruby.gem_version('rails')
    rails_version >= Gem::Version.new('4.0.0') && rails_version < Gem::Version.new('5.0.0') if rails_version
  end

  def name
    "Ruby/Rails"
  end

  def default_process_types
    web_process = gem_is_bundled?("thin") ?
      "bin/rails server thin -p $PORT -e $RAILS_ENV" :
      "bin/rails server -p $PORT -e $RAILS_ENV"
    super.merge({
      "web"     => web_process,
      "console" => "bin/rails console"
    })
  end

  private
  def plugins
    []
  end

  def run_assets_precompile_rake_task
    log("assets_precompile") do
      if rake_task_defined?("assets:precompile")
        topic("Preparing app for Rails asset pipeline")
        if File.exists?("public/assets/manifest.yml")
          puts "Detected manifest.yml, assuming assets were compiled locally"
        else
          ENV["RAILS_GROUPS"] ||= "assets"
          ENV["RAILS_ENV"]    ||= "production"

          puts "Running: rake assets:precompile"
          require 'benchmark'
          time = Benchmark.realtime { pipe("env PATH=$PATH:bin bundle exec rake assets:precompile 2>&1") }

          if $?.success?
            log "assets_precompile", :status => "success"
            puts "Asset precompilation completed (#{"%.2f" % time}s)"
          else
            log "assets_precompile", :status => "failure"
            puts "Precompiling assets failed."
            puts "Please see this article for troubleshooting help:"
            puts "http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting"
          end
        end
      else
        puts "Error detecting the assets:precompile task"
      end
    end
  end

  def create_database_yml
  end
end
<commit_msg>include the beta into the rails 4 beta<commit_after>require "language_pack"
require "language_pack/rails3"

# Rails 4 Language Pack. This is for all Rails 4.x apps.
class LanguagePack::Rails4 < LanguagePack::Rails3
  # detects if this is a Rails 3.x app
  # @return [Boolean] true if it's a Rails 3.x app
  def self.use?
    rails_version = LanguagePack::Ruby.gem_version('rails')
    rails_version >= Gem::Version.new('4.0.0.beta') && rails_version < Gem::Version.new('5.0.0') if rails_version
  end

  def name
    "Ruby/Rails"
  end

  def default_process_types
    web_process = gem_is_bundled?("thin") ?
      "bin/rails server thin -p $PORT -e $RAILS_ENV" :
      "bin/rails server -p $PORT -e $RAILS_ENV"
    super.merge({
      "web"     => web_process,
      "console" => "bin/rails console"
    })
  end

  private
  def plugins
    []
  end

  def run_assets_precompile_rake_task
    log("assets_precompile") do
      if rake_task_defined?("assets:precompile")
        topic("Preparing app for Rails asset pipeline")
        if File.exists?("public/assets/manifest.yml")
          puts "Detected manifest.yml, assuming assets were compiled locally"
        else
          ENV["RAILS_GROUPS"] ||= "assets"
          ENV["RAILS_ENV"]    ||= "production"

          puts "Running: rake assets:precompile"
          require 'benchmark'
          time = Benchmark.realtime { pipe("env PATH=$PATH:bin bundle exec rake assets:precompile 2>&1") }

          if $?.success?
            log "assets_precompile", :status => "success"
            puts "Asset precompilation completed (#{"%.2f" % time}s)"
          else
            log "assets_precompile", :status => "failure"
            puts "Precompiling assets failed."
            puts "Please see this article for troubleshooting help:"
            puts "http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting"
          end
        end
      else
        puts "Error detecting the assets:precompile task"
      end
    end
  end

  def create_database_yml
  end
end

{'fraction_non_alphanumeric': 0.10779477059694129, 'fraction_numerical': 0.009126788357178096, 'mean_word_length': 2.6367713004484306, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '4709983', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1251, 'n_words': 341}