Skip to content

Commit 5f6b8e0

Browse files
committed
Drop CI support code for Ruby < 2.3
1 parent b983f41 commit 5f6b8e0

File tree

4 files changed

+12
-83
lines changed

4 files changed

+12
-83
lines changed

ci/script/clone_all_rspec_repos

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ if is_mri; then
1010
clone_repo "rspec-expectations"
1111
clone_repo "rspec-mocks"
1212
clone_repo "rspec-rails"
13-
14-
if rspec_support_compatible; then
15-
clone_repo "rspec-support"
16-
fi
13+
clone_repo "rspec-support"
1714

1815
popd
1916
else

ci/script/functions.sh

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ SPECS_HAVE_RUN_FILE=specs.out
99
MAINTENANCE_BRANCH=`cat maintenance-branch`
1010

1111
# Don't allow rubygems to pollute what's loaded. Also, things boot faster
12-
# without the extra load time of rubygems. Only works on MRI Ruby 1.9+
13-
if is_mri_192_plus; then
12+
# without the extra load time of rubygems. Only works on MRI.
13+
if is_mri; then
1414
export RUBYOPT="--disable=gem"
1515
fi
1616

@@ -44,12 +44,7 @@ function run_cukes {
4444

4545
echo "${PWD}/bin/cucumber"
4646

47-
if is_mri_192; then
48-
# For some reason we get SystemStackError on 1.9.2 when using
49-
# the bin/cucumber approach below. That approach is faster
50-
# (as it avoids the bundler tax), so we use it on rubies where we can.
51-
bundle exec cucumber --strict
52-
elif is_jruby; then
47+
if is_jruby; then
5348
# For some reason JRuby doesn't like our improved bundler setup
5449
RUBYOPT="-I${PWD}/../bundle -rbundler/setup" \
5550
PATH="${PWD}/bin:$PATH" \
@@ -184,11 +179,8 @@ function run_all_spec_suites {
184179
fold "rspec-core specs" run_spec_suite_for "rspec-core"
185180
fold "rspec-expectations specs" run_spec_suite_for "rspec-expectations"
186181
fold "rspec-mocks specs" run_spec_suite_for "rspec-mocks"
182+
fold "rspec-support specs" run_spec_suite_for "rspec-support"
187183
if rspec_rails_compatible; then
188184
fold "rspec-rails specs" run_spec_suite_for "rspec-rails"
189185
fi
190-
191-
if rspec_support_compatible; then
192-
fold "rspec-support specs" run_spec_suite_for "rspec-support"
193-
fi
194186
}

ci/script/predicate_functions.sh

Lines changed: 5 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,21 @@
11
function is_mri {
2-
if ruby -e "exit(!defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby')"; then
3-
# RUBY_ENGINE only returns 'ruby' on MRI.
4-
# MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode)
2+
# RUBY_ENGINE only returns 'ruby' on MRI.
3+
if ruby -e "exit(RUBY_ENGINE == 'ruby')"; then
54
return 0
65
else
76
return 1
87
fi;
98
}
109

1110
function is_jruby {
12-
if ruby -e "exit(defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java')"; then
13-
# RUBY_ENGINE only returns 'ruby' on MRI.
14-
# MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode)
11+
# RUBY_PLATFORM only returns 'java' on JRuby.
12+
if ruby -e "exit(RUBY_PLATFORM == 'java')"; then
1513
return 0
1614
else
1715
return 1
1816
fi;
1917
}
2018

21-
function is_mri_192 {
22-
if is_mri; then
23-
if ruby -e "exit(RUBY_VERSION == '1.9.2')"; then
24-
return 0
25-
else
26-
return 1
27-
fi
28-
else
29-
return 1
30-
fi
31-
}
32-
33-
function is_mri_192_plus {
34-
if is_mri; then
35-
if ruby -e "exit(RUBY_VERSION.to_f > 1.8)"; then
36-
return 0
37-
else
38-
return 1
39-
fi
40-
else
41-
return 1
42-
fi
43-
}
44-
45-
function is_mri_2plus {
46-
if is_mri; then
47-
if ruby -e "exit(RUBY_VERSION.to_f > 2.0)"; then
48-
return 0
49-
else
50-
return 1
51-
fi
52-
else
53-
return 1
54-
fi
55-
}
56-
57-
function is_ruby_23_plus {
58-
if ruby -e "exit(RUBY_VERSION.to_f >= 2.3)"; then
59-
return 0
60-
else
61-
return 1
62-
fi
63-
}
64-
6519
function is_ruby_25_plus {
6620
if ruby -e "exit(RUBY_VERSION.to_f >= 2.5)"; then
6721
return 0
@@ -78,22 +32,14 @@ function rspec_rails_compatible {
7832
fi
7933
}
8034

81-
function rspec_support_compatible {
82-
if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ] && [ "$MAINTENANCE_BRANCH" != "2-14-maintenance" ]; then
83-
return 0
84-
else
85-
return 1
86-
fi
87-
}
88-
8935
function additional_specs_available {
9036
type run_additional_specs > /dev/null 2>&1
9137
return $?
9238
}
9339

9440
function documentation_enforced {
9541
if [ -x ./bin/yard ]; then
96-
if is_mri_2plus; then
42+
if is_mri; then
9743
return 0
9844
else
9945
return 1

ci/script/update_rubygems_and_install_bundler

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,5 @@
22
set -e
33
source script/functions.sh
44

5-
if is_ruby_23_plus; then
6-
yes | gem update --system
7-
yes | gem install bundler
8-
else
9-
echo "Warning installing older versions of Rubygems / Bundler"
10-
gem update --system '2.7.8'
11-
gem install bundler -v '1.17.3'
12-
fi
5+
yes | gem update --system
6+
yes | gem install bundler

0 commit comments

Comments
 (0)