Skip to content

Commit 72babda

Browse files
author
Petr Chalupa
authored
Merge pull request #587 from pitr-ch/master
Update CI
2 parents 4592c43 + e53f16a commit 72babda

File tree

4 files changed

+40
-33
lines changed

4 files changed

+40
-33
lines changed

.travis.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@ language: ruby
33
cache: bundler
44

55
rvm:
6+
# start with the latest
67
- 2.3.1
7-
- 2.2.3
8-
- 2.2.2
9-
- 2.1.5
10-
- 2.0.0
8+
- jruby-9.1.5.0
9+
10+
# older versions
11+
- 2.2
12+
- 2.1
13+
- 2.0
1114
- 1.9.3
12-
- ruby-head
13-
- jruby-1.7.19
14-
- jruby-9.0.1.0
15-
- jruby-9.0.3.0
15+
1616
- jruby-9.0.5.0
17+
- jruby-1.7.26
18+
19+
- ruby-head
1720
- jruby-head
18-
- rbx-2
21+
1922
- rbx
2023

2124
jdk:
@@ -29,14 +32,16 @@ branches:
2932

3033
matrix:
3134
include:
35+
- rvm: 2.3.1
36+
jdk: oraclejdk8
37+
env: COVERAGE=1
3238
- rvm: jruby-head
3339
jdk: oraclejdk8
3440
env: TRUFFLE=1
3541
allow_failures:
3642
- rvm: ruby-head
3743
- rvm: jruby-head
3844
- rvm: 1.9.3
39-
- rvm: rbx-2
4045
- rvm: rbx
4146
- rvm: jruby-head
4247
jdk: oraclejdk8

Gemfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,22 @@ group :development do
1313
# documentation
1414
gem 'countloc', '~> 0.4.0', :platforms => :mri, :require => false
1515
gem 'yard', '~> 0.8.7.6', :require => false
16+
# TODO (pitr-ch 15-Oct-2016): does not work on 1.9.3 anymore
1617
gem 'inch', '~> 0.6.3', :platforms => :mri, :require => false
1718
gem 'redcarpet', '~> 3.3.2', platforms: :mri # understands github markdown
1819
end
1920

2021
group :testing do
2122
gem 'rspec', '~> 3.3.0'
2223
gem 'timecop', '~> 0.7.4'
24+
end
2325

24-
# Coverage
25-
gem 'simplecov', '~> 0.10.0', :require => false
26-
gem 'coveralls', '~> 0.8.2', :require => false
26+
# made opt-in since it will not install on jruby 1.7
27+
if ENV['COVERAGE']
28+
group :coverage do
29+
gem 'simplecov', '~> 0.10.0', :require => false
30+
gem 'coveralls', '~> 0.8.2', :require => false
31+
end
2732
end
2833

2934
group :benchmarks do

lib/concurrent/utility/engine.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def on_jruby?
88
end
99

1010
def on_jruby_9000?
11-
on_jruby? && 0 == (JRUBY_VERSION =~ /^9\.0\.0\.0/)
11+
on_jruby? && ruby_version(:>=, 9, 0, 0, JRUBY_VERSION)
1212
end
1313

1414
def on_cruby?
@@ -39,8 +39,8 @@ def ruby_engine
3939
defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
4040
end
4141

42-
def ruby_version(comparison, major, minor = 0, patch = 0)
43-
result = (RUBY_VERSION.split('.').map(&:to_i) <=> [major, minor, patch])
42+
def ruby_version(comparison, major, minor, patch, version = RUBY_VERSION)
43+
result = (version.split('.').map(&:to_i) <=> [major, minor, patch])
4444
comparisons = { :== => [0],
4545
:>= => [1, 0],
4646
:<= => [-1, 0],

spec/spec_helper.rb

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
$VERBOSE = nil # suppress our deprecation warnings
22

3-
# we can't use our helpers here because we need to load the gem _after_ simplecov
4-
unless RUBY_ENGINE == 'jruby' && 0 == (JRUBY_VERSION =~ /^9\.0\.0\.0/)
5-
if (ENV['COVERAGE'] || ENV['CI'] || ENV['TRAVIS']) && !ENV['NO_COVERAGE']
6-
require 'simplecov'
7-
require 'coveralls'
3+
if ENV['COVERAGE']
4+
require 'simplecov'
5+
require 'coveralls'
86

9-
if ENV['TRAVIS']
10-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
7+
if ENV['TRAVIS']
8+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
119
SimpleCov::Formatter::HTMLFormatter,
1210
Coveralls::SimpleCov::Formatter
13-
]
14-
else
15-
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
16-
end
11+
]
12+
else
13+
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
14+
end
1715

18-
SimpleCov.start do
19-
project_name 'concurrent-ruby'
20-
add_filter '/build-tests/'
21-
add_filter '/examples/'
22-
add_filter '/spec/'
23-
end
16+
SimpleCov.start do
17+
project_name 'concurrent-ruby'
18+
add_filter '/build-tests/'
19+
add_filter '/examples/'
20+
add_filter '/spec/'
2421
end
2522
end
2623

0 commit comments

Comments
 (0)