language: ruby
dist: trusty
before_install:
  - if [[ $TRAVIS_RUBY_VERSION =~ ^(1|2\.[012]|jruby-1)\. ]]; then gem install rubygems-update --version '~> 2.7' --no-document --conservative && update_rubygems; else gem update --system --conservative; fi
  - gem install bundler --conservative
before_script:
  - bundle update
cache: bundler
env:
  global:
    - TESTOPTS=--verbose
rvm:
  - 1.9.3-p551
  - 2.0.0-p648
  - 2.1.10
  - 2.2.10
  - 2.3.8
  - 2.4.5
  - 2.5.3
  - 2.6.0
  - ruby-head
  - jruby-1.7.27
  - jruby-9.1.17.0
  - jruby-9.2.5.0
  - jruby-head
  - rbx-3.107
  - truffleruby-1.0.0-rc10
matrix:
  allow_failures:
    - rvm: ruby-head
    - rvm: jruby-head
    - rvm: truffleruby-1.0.0-rc10

language: ruby
dist: trusty
before_install:
  - if [[ $TRAVIS_RUBY_VERSION =~ ^(1|2\.[012]|jruby-1)\. ]]; then gem install rubygems-update --version '~> 2.7' --no-document && update_rubygems; elif [[ ! $TRAVIS_RUBY_VERSION =~ ^truffleruby- ]]; then gem update --system; fi
  - gem --version
  - if [[ $TRAVIS_RUBY_VERSION =~ ^(1|2\.[012]|jruby-1)\. ]]; then gem install bundler --version '~> 1.17'; else gem install bundler; fi
  - bundle --version
before_script:
  - bundle update
cache: bundler
env:
  global:
    - TESTOPTS=--verbose
rvm:
  - 1.9.3-p551
  - 2.0.0-p648
  - 2.1.10
  - 2.2.10
  - 2.3.8
  - 2.4.5
  - 2.5.3
  - 2.6.0
  - ruby-head
  - jruby-1.7.27
  - jruby-9.1.17.0
  - jruby-9.2.5.0
  - jruby-head
  - rbx-3.107
  - truffleruby-1.0.0-rc10
matrix:
  allow_failures:
    - rvm: ruby-head
    - rvm: jruby-head
    - rvm: truffleruby-1.0.0-rc10

Use the latest compatible versions of RubyGems and Bundler.
Use the latest compatible versions of RubyGems and Bundler.

Use the built-in RubyGems version for TruffleRuby since it contains
modifications for compatibility with TruffleRuby. RubyGems 3.0.2 also
causes a "can't modify frozen Hash error" on TruffleRuby.
