Skip to content

Commit ec23518

Browse files
cgmckeeverNullVoxPopuli
authored andcommitted
adds prompt for version script and a little more documentation (#1729)
better version handling looks up via yml
1 parent 6c321cd commit ec23518

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

CONTRIBUTING.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,15 @@ Run a single test
7474
`$ rake test TEST=path/to/test.rb TESTOPTS="--name=test_something"`
7575

7676
Run tests against different Rails versions by setting the RAILS_VERSION variable
77-
and bundling gems.
77+
and bundling gems. (save this script somewhere executable and run from top of AMS repository)
7878

7979
```bash
80-
for version in 4.0 4.1 4.2 master; do
80+
#!/usr/bin/env bash
81+
82+
rcommand='puts YAML.load_file("./.travis.yml")["env"]["matrix"].join(" ").gsub("RAILS_VERSION=", "")'
83+
versions=$(ruby -ryaml -e "$rcommand")
84+
85+
for version in ${versions[@]}; do
8186
export RAILS_VERSION="$version"
8287
rm -f Gemfile.lock
8388
bundle check || bundle --local || bundle
@@ -88,7 +93,12 @@ for version in 4.0 4.1 4.2 master; do
8893
else
8994
# red in ANSI
9095
echo -e "\033[31m **** Tests failed against Rails ${RAILS_VERSION} **** \033[0m"
91-
fi
96+
read -p '[Enter] any key to continue, [q] to quit...' prompt
97+
if [ "$prompt" = 'q' ]; then
98+
unset RAILS_VERSION
99+
exit 1
100+
fi
101+
fi
92102
unset RAILS_VERSION
93103
done
94104
```

0 commit comments

Comments
 (0)