#!/bin/sh

set -ex

ruby-standalone gem install bundler
if [ -z "$ADTTMP" ]; then
  ADTTMP=$(mktemp -d)
  trap "rm -rf $ADTTMP" INT TERM EXIT
fi

cd $ADTTMP
cat > Gemfile <<EOF
source 'https://rubygems.org'
gem 'rake', '10.0.0'
EOF
cat > Rakefile <<EOF
task :default do
  puts 'Works'
end
EOF
ruby-standalone bundle install
ruby-standalone bundle exec rake --version
ruby-standalone bundle exec rake
