<commit_before>#!/usr/bin/env bash

source "$HOME/.rvm/scripts/rvm"
ruby_version="1.9.3"

function install_ruby_if_needed() {
  echo "Checking for Ruby $ruby_version..."
  if ! rvm list strings | grep "ruby-$ruby_version" > /dev/null; then
    rvm install "ruby-$ruby_version" || exit 1
  fi
}

function install_bundler_if_needed() {
  echo "Checking for Bundler..."
  gem install bundler "$bundler_version" --conservative || exit 1
}

function update_gems_if_needed() {
  echo "Installing gems..."
  bundle check || bundle install || exit 1
}

function reset_database() {
  echo "Resetting database..."
  RAILS_ENV=test bundle exec rake db:drop db:create db:schema:load || exit 1
}

function run_tests() {
  echo "Running tests..."
  bundle exec rake spec
}

install_ruby_if_needed
source .rvmrc
install_bundler_if_needed
update_gems_if_needed
reset_database
run_tests
<commit_msg>Remove undeclared variable from build script<commit_after>#!/usr/bin/env bash

source "$HOME/.rvm/scripts/rvm"
ruby_version="1.9.3"

function install_ruby_if_needed() {
  echo "Checking for Ruby $ruby_version..."
  if ! rvm list strings | grep "ruby-$ruby_version" > /dev/null; then
    rvm install "ruby-$ruby_version" || exit 1
  fi
}

function install_bundler_if_needed() {
  echo "Checking for Bundler..."
  gem install bundler --conservative || exit 1
}

function update_gems_if_needed() {
  echo "Installing gems..."
  bundle check || bundle install || exit 1
}

function reset_database() {
  echo "Resetting database..."
  RAILS_ENV=test bundle exec rake db:drop db:create db:schema:load || exit 1
}

function run_tests() {
  echo "Running tests..."
  bundle exec rake spec
}

install_ruby_if_needed
source .rvmrc
install_bundler_if_needed
update_gems_if_needed
reset_database
run_tests

{'fraction_non_alphanumeric': 0.11204954954954954, 'fraction_numerical': 0.007882882882882882, 'mean_word_length': 4.401215805471125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2189136', 'n_tokens_mistral': 643, 'n_tokens_neox': 591, 'n_words': 164}