File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,12 @@ export JRUBY_OPTS=${JRUBY_OPTS:-"--server -Xcompile.invokedynamic=false"}
8
8
SPECS_HAVE_RUN_FILE=specs.out
9
9
MAINTENANCE_BRANCH=` cat maintenance-branch`
10
10
11
+ # 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
14
+ export RUBYOPT=" --disable=gem"
15
+ fi
16
+
11
17
function clone_repo {
12
18
if [ ! -d $1 ]; then # don't clone if the dir is already there
13
19
travis_retry eval " git clone git://github.com/rspec/$1 --depth 1 --branch $MAINTENANCE_BRANCH "
@@ -43,10 +49,15 @@ function run_cukes {
43
49
# the bin/cucumber approach below. That approach is faster
44
50
# (as it avoids the bundler tax), so we use it on rubies where we can.
45
51
bundle exec cucumber --strict
52
+ elif is_jruby; then
53
+ # For some reason JRuby doesn't like our improved bundler setup
54
+ RUBYOPT=" -I${PWD} /../bundle -rbundler/setup" \
55
+ PATH=" ${PWD} /bin:$PATH " \
56
+ bin/cucumber --strict
46
57
else
47
58
# Prepare RUBYOPT for scenarios that are shelling out to ruby,
48
59
# and PATH for those that are using `rspec` or `rake`.
49
- RUBYOPT=" -I${PWD} /../bundle -rbundler/setup" \
60
+ RUBYOPT=" ${RUBYOPT} -I${PWD} /../bundle -rbundler/setup" \
50
61
PATH=" ${PWD} /bin:$PATH " \
51
62
bin/cucumber --strict
52
63
fi
Original file line number Diff line number Diff line change @@ -8,6 +8,16 @@ function is_mri {
8
8
fi ;
9
9
}
10
10
11
+ 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)
15
+ return 0
16
+ else
17
+ return 1
18
+ fi ;
19
+ }
20
+
11
21
function is_mri_192 {
12
22
if is_mri; then
13
23
if ruby -e " exit(RUBY_VERSION == '1.9.2')" ; then
@@ -20,6 +30,18 @@ function is_mri_192 {
20
30
fi
21
31
}
22
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
+
23
45
function is_mri_2plus {
24
46
if is_mri; then
25
47
if ruby -e " exit(RUBY_VERSION.to_f > 2.0)" ; then
You can’t perform that action at this time.
0 commit comments