<commit_before>#   Copyright (c) 2010-2011, Diaspora Inc.  This file is
#   licensed under the Affero General Public License version 3 or later.  See
#   the COPYRIGHT file.

begin
  require 'rspec/core'
  require 'rspec/core/rake_task'

  spec_prereq = Rails.root.join('config', 'database.yml').exist? ? "db:test:prepare" : :noop
  task :noop do
  end

  task :stats => "spec:statsetup"

  desc "Run all specs in spec directory"
  RSpec::Core::RakeTask.new(:spec => spec_prereq)

  desc "Run all specs that generate fixtures for rspec or jasmine"
  RSpec::Core::RakeTask.new(:generate_fixtures => spec_prereq) do |t|
    t.rspec_opts = ['--tag fixture']
  end

  desc "Run the specs with rcov"
  RSpec::Core::RakeTask.new(:rcov => spec_prereq) do |t|
    t.rcov = true
    t.rcov_opts = ['-Ispec', '--exclude', 'spec', '--exclude', 'gems']
  end
  namespace :"spec --color" do
    [:requests, :models, :controllers, :views, :helpers, :mailers, :lib].each do |sub|
      desc "Run the code examples in spec/#{sub}"
      RSpec::Core::RakeTask.new(sub => spec_prereq) do |t|
        t.pattern = "./spec/#{sub}/**/*_spec.rb "
      end
    end

    task :statsetup do
      require 'rails/code_statistics'
      ::STATS_DIRECTORIES << %w(Model\ specs spec/models) if File.exist?('spec/models')
      ::STATS_DIRECTORIES << %w(View\ specs spec/views) if File.exist?('spec/views')
      ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers')
      ::STATS_DIRECTORIES << %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers')
      ::STATS_DIRECTORIES << %w(Library\ specs spec/lib) if File.exist?('spec/lib')
      ::STATS_DIRECTORIES << %w(Mailer\ specs spec/mailers) if File.exist?('spec/mailers')<commit_msg>Clearing rake spec before defining it - see if this affects travis<commit_after>#   Copyright (c) 2010-2011, Diaspora Inc.  This file is
#   licensed under the Affero General Public License version 3 or later.  See
#   the COPYRIGHT file.

begin
  require 'rspec/core'
  require 'rspec/core/rake_task'

  spec_prereq = Rails.root.join('config', 'database.yml').exist? ? "db:test:prepare" : :noop
  task :noop do
  end

  task :stats => "spec:statsetup"

  Rake::Task[:spec].clear

  desc "Run all specs in spec directory"
  RSpec::Core::RakeTask.new(:spec => spec_prereq)

  desc "Run all specs that generate fixtures for rspec or jasmine"
  RSpec::Core::RakeTask.new(:generate_fixtures => spec_prereq) do |t|
    t.rspec_opts = ['--tag fixture']
  end

  desc "Run the specs with rcov"
  RSpec::Core::RakeTask.new(:rcov => spec_prereq) do |t|
    t.rcov = true
    t.rcov_opts = ['-Ispec', '--exclude', 'spec', '--exclude', 'gems']
  end
  namespace :"spec --color" do
    [:requests, :models, :controllers, :views, :helpers, :mailers, :lib].each do |sub|
      desc "Run the code examples in spec/#{sub}"
      RSpec::Core::RakeTask.new(sub => spec_prereq) do |t|
        t.pattern = "./spec/#{sub}/**/*_spec.rb "
      end
    end

    task :statsetup do
      require 'rails/code_statistics'
      ::STATS_DIRECTORIES << %w(Model\ specs spec/models) if File.exist?('spec/models')
      ::STATS_DIRECTORIES << %w(View\ specs spec/views) if File.exist?('spec/views')
      ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers')
      ::STATS_DIRECTORIES << %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers')
      ::STATS_DIRECTORIES << %w(Library\ specs spec/lib) if File.exist?('spec/lib')
      ::STATS_DIRECTORIES << %w(Mailer\ specs spec/mailers) if File.exist?('spec/mailers')
{'fraction_non_alphanumeric': 0.1555370061213133, 'fraction_numerical': 0.005008347245409015, 'mean_word_length': 3.6809895833333335, 'pattern_counts': {'":': 0, '<': 27, '<?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': '7207977', 'n_tokens_mistral': 1315, 'n_tokens_neox': 1240, 'n_words': 324}