Skip to content

Commit

Permalink
Fixed Ruby version in various script/*
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-nathan committed Oct 16, 2014
1 parent b665f84 commit b1995f7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion script/run_rake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

source $(ls /usr/local/rvm/environments/ruby-1.9.3-p* | grep -v @ | tail -1)
ruby_version=$(cat /var/web/mushroom-observer/.ruby-version)
source /usr/local/rvm/environments/ruby-$ruby_version

rake $* -f /var/web/mushroom-observer/Rakefile | \
grep -v '(in /home/' | grep -v '^\*\* '
3 changes: 2 additions & 1 deletion script/run_script
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

source $(ls /usr/local/rvm/environments/ruby-1.9.3-p* | grep -v @ | tail -1)
ruby_version=$(cat /var/web/mushroom-observer/.ruby-version)
source /usr/local/rvm/environments/ruby-$ruby_version

dir=$(dirname "$0")
if [[ $2 == '-v' ]]; then
Expand Down
5 changes: 3 additions & 2 deletions script/run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
if [[ $RAKE_TEST_LOADER != '' ]]; then
loader=$RAKE_TEST_LOADER
elif [[ $MY_RUBY_HOME != '' ]]; then
loader=$MY_RUBY_HOME/lib/ruby/1.9.1/rake/rake_test_loader.rb
loader=$(ls $MY_RUBY_HOME/lib/ruby/*/rake/rake_test_loader.rb | tail -1)
else
loader=/usr/local/lib/ruby/1.9.3/rake/rake_test_loader.rb
ruby_version=$(cat /var/web/mushroom-observer/.ruby-version)
loader=/usr/local/lib/ruby/$ruby_version/rake/rake_test_loader.rb
fi

ruby -Ilib:test $loader test/{unit,functional,integration}/*_test.rb
3 changes: 2 additions & 1 deletion script/unicorn
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ start)
else
echo "Starting unicorn..."
cd $app_root
rvm_env=$(ls /usr/local/rvm/environments/ruby-1.9.3-p* | grep -v @ | tail -1)
ruby_version=$(cat /var/web/mushroom-observer/.ruby-version)
rvm_env=/usr/local/rvm/environments/ruby-$ruby_version
start_cmd="source $rvm_env && bundle exec unicorn_rails -c $conf_file -D"
case `whoami` in
mo)
Expand Down

0 comments on commit b1995f7

Please sign in to comment.