language: ruby

sudo: false

cache: bundler

script: "((if [[ ruby -e 'exit RUBY_VERSION > \'2.2.0\'' ]]; then bundle exec rubocop; else return 0; fi) && bundle exec rake spec)"

rvm:
  - 1.9.3
  - 2.0.0
  - 2.1.10
  - 2.2.5
  - 2.3.1

gemfile:
  - gemfiles/rails_3.0.gemfile
  - gemfiles/rails_3.1.gemfile
  - gemfiles/rails_3.2.gemfile
  - gemfiles/rails_4.0.gemfile
  - gemfiles/rails_4.1.gemfile
  - gemfiles/rails_4.2.gemfile
  - gemfiles/rails_5.0.gemfile

matrix:
  # Rails 5 requires Ruby version 2.2+
  exclude:
  - rvm: 1.9.3
    gemfile: gemfiles/rails_5.0.gemfile
  - rvm: 2.0.0
    gemfile: gemfiles/rails_5.0.gemfile
  - rvm: 2.1.10
    gemfile: gemfiles/rails_5.0.gemfile

language: ruby

sudo: false

cache: bundler

script:
- ruby -e "RUBY_VERSION > '2.2.0' ? system('bundle exec rubocop') : exit(0)"
- bundle exec rake spec

rvm:
  - 1.9.3
  - 2.0.0
  - 2.1.10
  - 2.2.5
  - 2.3.1

gemfile:
  - gemfiles/rails_3.0.gemfile
  - gemfiles/rails_3.1.gemfile
  - gemfiles/rails_3.2.gemfile
  - gemfiles/rails_4.0.gemfile
  - gemfiles/rails_4.1.gemfile
  - gemfiles/rails_4.2.gemfile
  - gemfiles/rails_5.0.gemfile

matrix:
  # Rails 5 requires Ruby version 2.2+
  exclude:
  - rvm: 1.9.3
    gemfile: gemfiles/rails_5.0.gemfile
  - rvm: 2.0.0
    gemfile: gemfiles/rails_5.0.gemfile
  - rvm: 2.1.10
    gemfile: gemfiles/rails_5.0.gemfile

Update Rubocop command in Travis config
Update Rubocop command in Travis config