#!/bin/bash

unset BUNDLE_GEMFILE
result=0

if [ "$CI" == "true" ]; then
  BUNDLE_PATH="$HOME/vendor/bundle"
fi

for test_script in $(find . -name test.sh); do
  pushd `dirname $test_script` > /dev/null
  source "$HOME/.rvm/scripts/rvm"
  rvm use $(cat .ruby-version)@$(cat .ruby-gemset) --create
  which ruby
  rvm gemset name
  ./test.sh
  result+=$?
  popd > /dev/null
done

if [ $result -eq 0 ]; then
	echo "SUCCESS"
else
	echo "FAILURE"
fi

exit $result
#!/bin/bash

unset BUNDLE_GEMFILE
result=0

if [ "$CI" == "true" ]; then
  BUNDLE_PATH="$HOME/vendor/bundle"
fi

for test_script in $(find . -name test.sh); do
  pushd `dirname $test_script` > /dev/null
  ./test.sh
  result+=$?
  popd > /dev/null
done

if [ $result -eq 0 ]; then
	echo "SUCCESS"
else
	echo "FAILURE"
fi

exit $result
--- 
+++ 
@@ -9,10 +9,6 @@
 
 for test_script in $(find . -name test.sh); do
   pushd `dirname $test_script` > /dev/null
-  source "$HOME/.rvm/scripts/rvm"
-  rvm use $(cat .ruby-version)@$(cat .ruby-gemset) --create
-  which ruby
-  rvm gemset name
   ./test.sh
   result+=$?
   popd > /dev/null
Fix rvm not using the components gemset

As documented on:
https://github.com/shageman/the_next_big_thing/issues/16
this fix change the build script to force rvm to use (and create if necessary)
the component ruby-version and ruby-gemset.

Conflicts:
	build.sh
