Skip to content

Commit

Permalink
move .powrc, .ruby-version, and .ruby-gemset logic to switch.sh from …
Browse files Browse the repository at this point in the history
…Rakefile
  • Loading branch information
Mark Yoon committed Apr 8, 2014
1 parent 7601d01 commit 0f88c7f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 0 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ namespace :testbed do
gem_file_contents = File.read('Gemfile')
gem_file_contents.sub!(/^(gem 'rails'.*)$/, %Q{# \\1\nplugin_root = File.expand_path('../..', __FILE__)\neval(File.read File.join(plugin_root, 'Gemfile.rails_version'))\ngem 'surveyor', :path => plugin_root})
File.open('Gemfile', 'w'){|f| f.write(gem_file_contents) }
File.open('.powrc', 'w'){|f| f.write %(if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".ruby-version" ]; then
source "$rvm_path/scripts/rvm"
if [ -f ".ruby-gemset" ]; then
rvm use `cat .ruby-version`@`cat .ruby-gemset`
else
rvm use `cat .ruby-version`
fi
fi)}
FileUtils.copy('../.ruby-version', '.ruby-version')
FileUtils.copy('../.ruby-gemset', '.ruby-gemset')
Bundler.with_clean_env do
sh 'bundle install' # run bundle install after Gemfile modifications
end
Expand Down
10 changes: 10 additions & 0 deletions switch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ select combo in $options; do
fi
bundle _${BUNDLER_VERSION}_ update
bundle _${BUNDLER_VERSION}_ exec rake testbed
echo 'if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".ruby-version" ]; then
source "$rvm_path/scripts/rvm"
if [ -f ".ruby-gemset" ]; then
rvm use `cat .ruby-version`@`cat .ruby-gemset`
else
rvm use `cat .ruby-version`
fi
fi' > testbed/.powrc
echo "$RUBY_VERSION" > testbed/.ruby-version
echo "surveyor-rails_$RAILS_VERSION" > testbed/.ruby-gemset
;;
esac
break
Expand Down

0 comments on commit 0f88c7f

Please sign in to comment.