Skip to content

Commit 5098f79

Browse files
committed
Merge pull request #133 from rspec/check-binstubs-on-build
Include a binstubs check before running CI script
2 parents 7941593 + d7c76ac commit 5098f79

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

travis/script/functions.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,49 @@ function run_spec_suite_for {
8383
fi;
8484
}
8585

86+
function check_binstubs {
87+
echo "Checking required binstubs"
88+
89+
local success=0
90+
local binstubs=""
91+
local gems=""
92+
93+
if [ ! -x ./bin/rspec ]; then
94+
binstubs="$binstubs bin/rspec"
95+
gems="$gems rspec-core"
96+
success=1
97+
fi
98+
99+
if [ ! -x ./bin/rake ]; then
100+
binstubs="$binstubs bin/rake"
101+
gems="$gems rake"
102+
success=1
103+
fi
104+
105+
if [ ! -x ./bin/cucumber ]; then
106+
binstubs="$binstubs bin/cucumber"
107+
gems="$gems cucumber"
108+
success=1
109+
fi
110+
111+
if [ $success -eq 1 ]; then
112+
echo
113+
echo "Missing binstubs:$binstubs"
114+
echo "Install missing binstubs using one of the following:"
115+
echo
116+
echo " # Create the missing binstubs"
117+
echo " $ bundle binstubs$gems"
118+
echo
119+
echo " # To binstub all gems"
120+
echo " $ bundle install --binstubs"
121+
echo
122+
echo " # To binstub all gems and avoid loading bundler"
123+
echo " $ bundle install --binstubs --standalone"
124+
fi
125+
126+
return $success
127+
}
128+
86129
function check_documentation_coverage {
87130
echo "bin/yard stats --list-undoc"
88131

travis/script/run_build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ if [ -f script/custom_build_functions.sh ]; then
77
source script/custom_build_functions.sh
88
fi
99

10+
fold "binstub check" check_binstubs
11+
1012
fold "specs" run_specs_and_record_done
1113
fold "cukes" run_cukes
1214

0 commit comments

Comments
 (0)