language: ruby
before_install:
  - gem update --system
rvm:
  - 2.3.8
  - 2.4.6
  - 2.5.5
  - 2.6.2
  - ruby-head
gemfile:
  - gemfiles/Gemfile-rails.4.2.x
  - gemfiles/Gemfile-rails.5.0.x
  - gemfiles/Gemfile-rails.5.1.x
  - gemfiles/Gemfile-rails.5.2.x
  - gemfiles/Gemfile-rails-edge
cache:
  bundler: true
  directories:
    - node_modules
  yarn: true

install:
  - bundle install
  - nvm install 10
  - node -v
  - npm i -g yarn
  - yarn
script:
  - yarn lint
  - yarn test
  - bundle exec rubocop
  - bundle exec rake test
matrix:
  allow_failures:
    - gemfile: gemfiles/Gemfile-rails-edge
    - rvm: ruby-head
  exclude:
    - rvm: 2.3.8
      gemfile: gemfiles/Gemfile-rails-edge
    - rvm: 2.4.6
      gemfile: gemfiles/Gemfile-rails-edge
    - rvm: 2.5.5
      gemfile: gemfiles/Gemfile-rails-edge
    - rvm: ruby-head
      gemfile: gemfiles/Gemfile-rails.4.2.x

language: ruby
before_install:
  - gem update --system
  - gem uni -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
  - gem i bundler -v '< 2'
rvm:
  - 2.3.8
  - 2.4.6
  - 2.5.5
  - 2.6.2
  - ruby-head
gemfile:
  - gemfiles/Gemfile-rails.4.2.x
  - gemfiles/Gemfile-rails.5.0.x
  - gemfiles/Gemfile-rails.5.1.x
  - gemfiles/Gemfile-rails.5.2.x
  - gemfiles/Gemfile-rails-edge
cache:
  bundler: true
  directories:
    - node_modules
  yarn: true

install:
  - bundle install
  - nvm install 10
  - node -v
  - npm i -g yarn
  - yarn
script:
  - yarn lint
  - yarn test
  - bundle exec rubocop
  - bundle exec rake test
matrix:
  allow_failures:
    - gemfile: gemfiles/Gemfile-rails-edge
    - rvm: ruby-head
  exclude:
    - rvm: 2.3.8
      gemfile: gemfiles/Gemfile-rails-edge
    - rvm: 2.4.6
      gemfile: gemfiles/Gemfile-rails-edge
    - rvm: 2.5.5
      gemfile: gemfiles/Gemfile-rails-edge
    - rvm: ruby-head
      gemfile: gemfiles/Gemfile-rails.4.2.x

Make sure bundler 2 is not installed
Make sure bundler 2 is not installed

or the CI fails on ruby 2.4.6, 2.5.5 or such
