<commit_before>#/bin/sh

set -e
set -x

sh -e /etc/init.d/xvfb start
git submodule update --init

mkdir ~/.yard
bundle exec yard config -a autoload_plugins yard-doctest

if [[ "$RAKE_TASK" = "spec:chrome" ]]; then
  export CHROME_REVISION=354250
  export CHROMEDRIVER_VERSION=`curl -s http://chromedriver.storage.googleapis.com/LATEST_RELEASE`

  curl -L -O "http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/${CHROME_REVISION}/chrome-linux.zip"
  unzip chrome-linux.zip

  curl -L -O "http://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
  unzip chromedriver_linux64.zip

  mv chromedriver chrome-linux/chromedriver
  chmod +x chrome-linux/chromedriver
fi

if [[ "$RAKE_TASK" = "spec:phantomjs" ]]; then
  PHANTOMJS_NAME=phantomjs-2.1.1-linux-x86_64
  curl -L -O "https://bitbucket.org/ariya/phantomjs/downloads/${PHANTOMJS_NAME}.tar.bz2"
  tar -xvjf $PHANTOMJS_NAME.tar.bz2
  chmod +x $PHANTOMJS_NAME/bin/phantomjs
  cp $PHANTOMJS_NAME/bin/phantomjs travis-phantomjs/phantomjs
  phantomjs --version
fi<commit_msg>fix phantomjs download issues with Travis<commit_after>#/bin/sh

set -e
set -x

sh -e /etc/init.d/xvfb start
git submodule update --init

mkdir ~/.yard
bundle exec yard config -a autoload_plugins yard-doctest

if [[ "$RAKE_TASK" = "spec:chrome" ]]; then
  export CHROME_REVISION=354250
  export CHROMEDRIVER_VERSION=`curl -s http://chromedriver.storage.googleapis.com/LATEST_RELEASE`

  curl -L -O "http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/${CHROME_REVISION}/chrome-linux.zip"
  unzip chrome-linux.zip

  curl -L -O "http://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
  unzip chromedriver_linux64.zip

  mv chromedriver chrome-linux/chromedriver
  chmod +x chrome-linux/chromedriver
fi

if [[ "$RAKE_TASK" = "spec:phantomjs" ]]; then
  curl -L -O "https://bintray.com/artifact/download/tfortner/phantomjs-clone/p/phantomjs"
  chmod +x phantomjs
  mv phantomjs travis-phantomjs/phantomjs
  phantomjs --version
fi
{'fraction_non_alphanumeric': 0.1245774987928537, 'fraction_numerical': 0.0159343312409464, 'mean_word_length': 4.554959785522788, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3467118', 'n_tokens_mistral': 858, 'n_tokens_neox': 777, 'n_words': 144}