<commit_before>machine:
  services:
    - docker

dependencies:
  cache_directories:
    - "~/docker"
    - .bundle
    - node_modules
    - public/assets
  override:
    - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi
    - sudo pip install --upgrade docker-compose==1.5.2
    - docker pull codegram/ruby-node-phantomjs
    - docker pull postgres
    - docker pull redis
    - cp .env.example .env
    - docker-compose build
    - docker-compose run app bundle install
    - docker-compose run app npm install
    - docker-compose run -e NODE_ENV=test app webpack 
    - mkdir -p ~/docker; docker save ultrayoshi/ruby-node-phantomjs:2.1.1 postgres redis > ~/docker/image.tar
    - docker-compose run app rake db:setup
    - docker-compose run app bundle exec rake assets:precompile

database:
  override:
    - echo 'done'

test:
  override:
    - docker-compose run -e CI=true -e CI_PULL_REQUEST=$CI_PULL_REQUEST -e CI_PULL_REQUESTS=$CI_PULL_REQUESTS -e COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN -e COVERALLS_PARALLEL=true app bundle exec rspec:
        parallel: true
        files:
          - spec/**/*_spec.rb
    - docker-compose run app npm test<commit_msg>FIx build<commit_after>machine:
  services:
    - docker

dependencies:
  cache_directories:
    - "~/docker"
    - .bundle
    - node_modules
    - public/assets
  override:
    - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi
    - sudo pip install --upgrade docker-compose==1.5.2
    - docker pull codegram/ruby-node-phantomjs
    - docker pull postgres
    - docker pull redis
    - cp .env.example .env
    - docker-compose build
    - docker-compose run app bundle install
    - docker-compose run app npm install
    - docker-compose run -e NODE_ENV=test app webpack 
    - mkdir -p ~/docker; docker save codegram/ruby-node-phantomjs:2.1.1 postgres redis > ~/docker/image.tar
    - docker-compose run app rake db:setup
    - docker-compose run app bundle exec rake assets:precompile

database:
  override:
    - echo 'done'

test:
  override:
    - docker-compose run -e CI=true -e CI_PULL_REQUEST=$CI_PULL_REQUEST -e CI_PULL_REQUESTS=$CI_PULL_REQUESTS -e COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN -e COVERALLS_PARALLEL=true app bundle exec rspec:
        parallel: true
        files:
          - spec/**/*_spec.rb
    - docker-compose run app npm test
{'fraction_non_alphanumeric': 0.10067114093959731, 'fraction_numerical': 0.0050335570469798654, 'mean_word_length': 2.6579754601226995, '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': '3977099', 'n_tokens_mistral': 875, 'n_tokens_neox': 809, 'n_words': 212}