Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 1b5592e

Browse files
bennacer860soulcutter
authored andcommitted
Update Rubocop to latest version.
This also updates the travis setup to use the latest bundler. Travis currently defaults to Bundler version 1.7.4, however, this bundler version does not support the `platform: :ruby_22` configuration setting. So we need to tell travis to install a more recent bundler. Also, `platform: :ruby_19` applies to **both** 1.9.2 and 1.9.3. But Rubocop stopped supporting 1.9.2. Thus we need to check the `RUBY_VERSION` in our `Gemfile` and not attempt to install Rubocop specifically for 1.9.2. Unfortunately, this bundler does not work with JRuby (2.0 mode), but does work with JRuby 1.8 mode. So we need to update the config to ignore JRuby 2.0. However, the current config incorrectly assumes we can do that by checking the `JRUBY_OPTS` environment variable. Travis actually sets this be default on _all_ systems: http://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables However, we can check the Ruby version we pass into the travis matrix by using the `TRAVIS_RUBY_VERSION` and seeing if it equals "jruby".
1 parent 3bfe466 commit 1b5592e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ cache:
88
- ../bundle
99
before_install:
1010
- "script/clone_all_rspec_repos"
11-
# Downgrade bundler to work around https://github.com/bundler/bundler/issues/3004
1211
# Note this doesn't work on JRUBY 2.0.0 mode so we don't do it
13-
- if [ -z "$JRUBY_OPTS" ]; then gem install bundler -v=1.5.3 && alias bundle="bundle _1.5.3_"; fi
12+
- if [ "jruby" != "$TRAVIS_RUBY_VERSION" ]; then gem install bundler; fi
1413
bundler_args: "--binstubs --standalone --without documentation --path ../bundle"
1514
script: "script/run_build"
1615
rvm:

Gemfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ platforms :jruby do
2929
end
3030

3131
gem 'simplecov', '~> 0.8'
32-
gem 'rubocop', "~> 0.32.1", :platform => [:ruby_19, :ruby_20, :ruby_21, :ruby_22]
32+
33+
# There is no platform :ruby_193 and Rubocop only supports >= 1.9.3
34+
unless RUBY_VERSION == "1.9.2"
35+
gem "rubocop",
36+
"~> 0.32.1",
37+
:platform => [:ruby_19, :ruby_20, :ruby_21, :ruby_22]
38+
end
39+
3340
gem 'test-unit', '~> 3.0' if RUBY_VERSION.to_f >= 2.2
3441

3542
eval File.read('Gemfile-custom') if File.exist?('Gemfile-custom')

0 commit comments

Comments
 (0)