sudo: false
addons:
  apt:
    packages:
    - net-tools

cache: bundler
language: ruby
notifications:
  email:
    on_success: change
    on_failure: always

before_install:
  - gem update --system $RUBYGEMS_VERSION
  - gem --version
  - gem install bundler ${BUNDLER_VERSION:+-v} ${BUNDLER_VERSION}
  - gem install smarter_bundler
  - bundle --version
  - mkdir -p tmp/bundle

bundler_args: "--binstubs"

script: ./test/test_with_railsapp

matrix:
  fast_finish: true

  include:
    # -------------------------------------
    # Standard
    
    # ruby 5.0  Jun. 2016
    
    - rvm: 2.2.2
      gemfile: test/rails_5.0.gemfile
      env: RAILS_VERSION=5.0 MIDDLEWARE=no

    - rvm: 2.3.6
      gemfile: test/rails_5.0.gemfile
      env: RAILS_VERSION=5.0 MIDDLEWARE=no

    # rails 5.1 sometime before May 2017
    
    - rvm: 2.2.2
      gemfile: test/rails_5.1.gemfile
      env: RAILS_VERSION=5.1 MIDDLEWARE=no

    - rvm: 2.3.6
      gemfile: test/rails_5.1.gemfile
      env: RAILS_VERSION=5.1 MIDDLEWARE=no

    - rvm: 2.4.3
      gemfile: test/rails_5.1.gemfile
      env: RAILS_VERSION=5.1 MIDDLEWARE=no

    # -------------------------------------
    # Middleware
    
    # ruby 5.0  Jun. 2016
    
    - rvm: 2.2.2
      gemfile: test/rails_5.0.gemfile
      env: RAILS_VERSION=5.0 MIDDLEWARE=yes

    - rvm: 2.3.6
      gemfile: test/rails_5.0.gemfile
      env: RAILS_VERSION=5.0 MIDDLEWARE=yes

    # rails 5.1 sometime before May 2017
    
    - rvm: 2.2.2
      gemfile: test/rails_5.1.gemfile
      env: RAILS_VERSION=5.1 MIDDLEWARE=yes

    - rvm: 2.4.3
      gemfile: test/rails_5.1.gemfile
      env: RAILS_VERSION=5.1 MIDDLEWARE=yes

