<commit_before>namespace :js do

  desc 'test javascript specs with PhantomJS'
  task :test do
     exec("phantomjs spec/javascripts/support/qunit/test.js spec/javascripts/runner.html")
  end

end<commit_msg>recompile qUint coffee scripts before running tests<commit_after>namespace :js do

  desc 'test javascript specs with PhantomJS'
  task :test do
    quick = ENV["quick"] && ENV["quick"] == "true"
    unless quick
      puts "--> Recompiling everything in spec/coffeescripts, do rake js:test quick=true to skip this step."
      require 'coffee-script'
      require 'fileutils'
      Dir[Rails.root+'spec/coffeescripts/**/*.coffee'].each do |coffee|
        destination = coffee.sub('spec/coffeescripts', 'spec/javascripts').sub(%r{\.coffee$}, '.js')
        FileUtils.mkdir_p(File.dirname(destination))
        File.open(destination, 'wb') { |out| out.write CoffeeScript.compile(File.open(coffee)) }
      end
    end
    exec("phantomjs spec/javascripts/support/qunit/test.js spec/javascripts/runner.html")
  end

end
{'fraction_non_alphanumeric': 0.12755598831548198, 'fraction_numerical': 0.0, 'mean_word_length': 3.781395348837209, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5032525', 'n_tokens_mistral': 340, 'n_tokens_neox': 323, 'n_words': 77}