language: ruby

before_install:
  # Workaround for https://github.com/travis-ci/travis-ci/issues/8969
  - gem update --system

rvm:
  - 2.2
  - 2.3
  - 2.4
  - 2.5
  - 2.6

env:
  - RAILS_VERSION=4.2
  - RAILS_VERSION=5.0
  - RAILS_VERSION=5.1
  - RAILS_VERSION=5.2

matrix:
  exclude:
    - rvm: 2.2
      env: RAILS_VERSION=5.0
    - rvm: 2.2
      env: RAILS_VERSION=5.1
    - rvm: 2.2
      env: RAILS_VERSION=5.2

sudo: false

language: ruby

before_install:
  # Workaround for https://github.com/travis-ci/travis-ci/issues/8969
  - gem update --system

rvm:
  - 2.2
  - 2.3
  - 2.4
  - 2.5
  - 2.6

env:
  - RAILS_VERSION=4.2
  - RAILS_VERSION=5.0
  - RAILS_VERSION=5.1
  - RAILS_VERSION=5.2

matrix:
  exclude:
    - rvm: 2.2
      env: RAILS_VERSION=5.0
    - rvm: 2.2
      env: RAILS_VERSION=5.1
    - rvm: 2.2
      env: RAILS_VERSION=5.2
    - rvm: 2.5
      env: RAILS_VERSION=4.2
    - rvm: 2.5
      env: RAILS_VERSION=5.0
    - rvm: 2.6
      env: RAILS_VERSION=4.2
    - rvm: 2.6
      env: RAILS_VERSION=5.0

sudo: false

Exclude builds for newer Rubies and old Rails versions
Exclude builds for newer Rubies and old Rails versions

 * Rails 4.2 supports versions between 1.9 and 2.4: https://github.com/rails/rails/blob/406e2f46/.travis.yml#L26-L31
 * Rails 5.0 supports versions between 2.2 and 2.4: https://github.com/rails/rails/blob/ecd965e7/.travis.yml#L46-L48
