Skip to content

Commit c46f2cb

Browse files
committed
Updated travis build scripts (from rspec-dev)
1 parent 2a7b518 commit c46f2cb

File tree

7 files changed

+75
-9
lines changed

7 files changed

+75
-9
lines changed

.rubocop_rspec_base.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file was generated on 2014-10-30T08:23:40-07:00 from the rspec-dev repo.
1+
# This file was generated on 2014-11-13T23:24:09-08:00 from the rspec-dev repo.
22
# DO NOT modify it by hand as your changes will get lost the next time it is generated.
33

44
# This file contains defaults for RSpec projects. Individual projects

appveyor.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file was generated on 2014-11-13T23:24:09-08:00 from the rspec-dev repo.
2+
# DO NOT modify it by hand as your changes will get lost the next time it is generated.
3+
4+
version: "{build}"
5+
6+
# This will build all PRs targetting matching branches.
7+
# Without this, each PR builds twice -- once for the PR branch HEAD,
8+
# and once for the merge commit that github creates for each mergable PR.
9+
branches:
10+
only:
11+
- master
12+
- /.*-maintenance$/
13+
14+
# Disable normal Windows builds in favor of our test script.
15+
build: off
16+
17+
install:
18+
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
19+
- ruby --version
20+
- gem --version
21+
- gem install bundler
22+
- bundler --version
23+
- bundle install
24+
- cinst ansicon
25+
26+
test_script:
27+
- bundle exec rspec
28+
29+
environment:
30+
matrix:
31+
# ruby_version: '20' doesn't work for some reason
32+
- ruby_version: '193'
33+
- ruby_version: '21'

script/clone_all_rspec_repos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# This file was generated on 2014-10-30T08:23:40-07:00 from the rspec-dev repo.
2+
# This file was generated on 2014-11-13T23:24:09-08:00 from the rspec-dev repo.
33
# DO NOT modify it by hand as your changes will get lost the next time it is generated.
44

55
set -e

script/functions.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# This file was generated on 2014-10-30T08:23:40-07:00 from the rspec-dev repo.
1+
# This file was generated on 2014-11-13T23:24:09-08:00 from the rspec-dev repo.
22
# DO NOT modify it by hand as your changes will get lost the next time it is generated.
33

4-
source script/travis_functions.sh
5-
source script/predicate_functions.sh
4+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
source $SCRIPT_DIR/travis_functions.sh
6+
source $SCRIPT_DIR/predicate_functions.sh
67

78
# idea taken from: http://blog.headius.com/2010/03/jruby-startup-time-tips.html
89
export JRUBY_OPTS="${JRUBY_OPTS} -X-C" # disable JIT since these processes are so short lived
@@ -94,6 +95,20 @@ function check_documentation_coverage {
9495
exit(1)
9596
end
9697
"
98+
99+
# Some warnings only show up when generating docs, so do that as well.
100+
bin/yard doc --no-cache | ruby -e "
101+
while line = gets
102+
has_warnings ||= line.start_with?('[warn]:')
103+
has_errors ||= line.start_with?('[error]:')
104+
puts line
105+
end
106+
107+
if has_warnings || has_errors
108+
puts \"\n\nYARD emitted documentation warnings or errors.\"
109+
exit(1)
110+
end
111+
"
97112
}
98113

99114
function check_style_and_lint {

script/predicate_functions.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file was generated on 2014-10-30T08:23:40-07:00 from the rspec-dev repo.
1+
# This file was generated on 2014-11-13T23:24:09-08:00 from the rspec-dev repo.
22
# DO NOT modify it by hand as your changes will get lost the next time it is generated.
33

44
function is_mri {
@@ -23,6 +23,18 @@ function is_mri_192 {
2323
fi
2424
}
2525

26+
function is_mri_2plus {
27+
if is_mri; then
28+
if ruby -e "exit(RUBY_VERSION.to_f > 2.0)"; then
29+
return 0
30+
else
31+
return 1
32+
fi
33+
else
34+
return 1
35+
fi
36+
}
37+
2638
function rspec_support_compatible {
2739
if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ] && [ "$MAINTENANCE_BRANCH" != "2-14-maintenance" ]; then
2840
return 0
@@ -33,7 +45,11 @@ function rspec_support_compatible {
3345

3446
function documentation_enforced {
3547
if [ -x ./bin/yard ]; then
36-
return 0
48+
if is_mri_2plus; then
49+
return 0
50+
else
51+
return 1
52+
fi
3753
else
3854
return 1
3955
fi

script/run_build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# This file was generated on 2014-10-30T08:23:40-07:00 from the rspec-dev repo.
2+
# This file was generated on 2014-11-13T23:24:09-08:00 from the rspec-dev repo.
33
# DO NOT modify it by hand as your changes will get lost the next time it is generated.
44

55
set -e

script/travis_functions.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file was generated on 2014-10-30T08:23:40-07:00 from the rspec-dev repo.
1+
# This file was generated on 2014-11-13T23:24:09-08:00 from the rspec-dev repo.
22
# DO NOT modify it by hand as your changes will get lost the next time it is generated.
33

44
# Taken from:
@@ -63,4 +63,6 @@ fold() {
6363
else
6464
STATUS="$status"
6565
fi
66+
67+
return $status
6668
}

0 commit comments

Comments
 (0)