#!/bin/sh

set -ex

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

cd $AUTOPKGTEST_TMP
cat > Gemfile <<EOF
source 'https://rubygems.org'
gem 'rake', '13.0.1'
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
