<commit_before>#!/usr/bin/env ruby
require 'fileutils'
include FileUtils

def root_dir
  @root_dir ||= File.expand_path('../..', __FILE__)
end

def rake(*tasks)
  tasks.each do |task|
    cmd = "bundle exec rake #{task}"
    puts "Running command: #{cmd}"
    return false unless system(cmd)
  end
  true
end

puts "[CruiseControl] Rails build"
build_results = {}

# Install required version of bundler.
bundler_install_cmd = "gem install bundler -v 0.9.8 --no-ri --no-rdoc"
puts "Running command: #{bundler_install_cmd}"
build_results[:install_bundler] = system bundler_install_cmd

cd root_dir do
  puts
  puts "[CruiseControl] Bundling RubyGems"
  puts
  build_results[:bundle] = system 'rm -rf ~/.bundle; env CI=1 bundle install'
end

cd "#{root_dir}/activesupport" do<commit_msg>CI: restore sudo for bundler gem install<commit_after>#!/usr/bin/env ruby
require 'fileutils'
include FileUtils

def root_dir
  @root_dir ||= File.expand_path('../..', __FILE__)
end

def rake(*tasks)
  tasks.each do |task|
    cmd = "bundle exec rake #{task}"
    puts "Running command: #{cmd}"
    return false unless system(cmd)
  end
  true
end

puts "[CruiseControl] Rails build"
build_results = {}

# Install required version of bundler.
bundler_install_cmd = "sudo gem install bundler -v 0.9.8 --no-ri --no-rdoc"
puts "Running command: #{bundler_install_cmd}"
build_results[:install_bundler] = system bundler_install_cmd

cd root_dir do
  puts
  puts "[CruiseControl] Bundling RubyGems"
  puts
  build_results[:bundle] = system 'rm -rf ~/.bundle; env CI=1 bundle install'
end

cd "#{root_dir}/activesupport" do
{'fraction_non_alphanumeric': 0.123125, 'fraction_numerical': 0.005, 'mean_word_length': 4.37248322147651, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3339920', 'n_tokens_mistral': 564, 'n_tokens_neox': 561, 'n_words': 166}