Skip to content

Commit 5e2e169

Browse files
committed
Merge pull request #55 from rspec/214_travis
Updates to script for 2-14-maintenance
2 parents fca371b + 58cbfed commit 5e2e169

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

Rakefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,15 @@ namespace :travis do
250250
end
251251

252252
each_project_with_common_travis_build do |name|
253+
if system("git show-branch #{branch_name} > /dev/null 2> /dev/null")
254+
puts "Branch #{branch_name} already exists, delete? [Y/n] or rename new branch? [r[ename] <name>]"
255+
input = STDIN.gets.downcase
256+
if input =~ /^y/
257+
`git branch -D #{branch_name}`
258+
elsif input =~ /^r(?:ename)? (.*)$/
259+
branch_name = $1
260+
end
261+
end
253262
sh "git checkout -b #{branch_name}"
254263

255264
files.each do |file|

travis/script/clone_all_rspec_repos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if is_mri; then
1010
clone_repo "rspec-expectations"
1111
clone_repo "rspec-mocks"
1212

13-
if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ]; then
13+
if rspec_support_compatible; then
1414
clone_repo "rspec-support"
1515
fi
1616

travis/script/functions.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ function is_mri_192 {
4949
fi
5050
}
5151

52+
function rspec_support_compatible {
53+
if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ] && [ "$MAINTENANCE_BRANCH" != "2-14-maintenance" ]; then
54+
return 0
55+
else
56+
return 1
57+
fi
58+
}
59+
60+
5261
function clone_repo {
5362
if [ ! -d $1 ]; then # don't clone if the dir is already there
5463
travis_retry git clone git://github.com/rspec/$1 --depth 1 --branch $MAINTENANCE_BRANCH

travis/script/run_build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if is_mri; then
1111
run_spec_suite_for "rspec-expectations"
1212
run_spec_suite_for "rspec-mocks"
1313

14-
if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ]; then
14+
if rspec_support_compatible; then
1515
run_spec_suite_for "rspec-support"
1616
fi
1717
else

0 commit comments

Comments
 (0)