Sha256: 5de39d57138bf397f2e646da29da096619741981f478e65dd7dbeb1a969f1eac

Contents?: true

Size: 992 Bytes

Versions: 4

Compression:

Stored size: 992 Bytes

Contents

#!/usr/bin/env bash

gem_name="$(ruby -rpathname -e"puts Pathname(ARGV.first).join('../..').expand_path.glob('*.gemspec').first.basename('.gemspec')" -- $0)"

# Stay away from the bundler env of the containing extension.
function unbundled {
  ruby -rbundler -e'b = proc {system *ARGV}; Bundler.respond_to?(:with_unbundled_env) ? Bundler.with_unbundled_env(&b) : Bundler.with_clean_env(&b)' -- $@
}

rm -rf ./sandbox
unbundled bundle exec rails new sandbox \
  --skip-bundle \
  --skip-git \
  --skip-javascript \
  --skip-keeps \
  --skip-rc \
  --skip-spring \
  --skip-test \
  $@

if [ ! -d "sandbox" ]; then
  echo 'sandbox rails application failed'
  exit 1
fi

cd ./sandbox
cat <<RUBY >> Gemfile
gem '$gem_name', path: '..'
gem 'haml'
gem 'slim'
RUBY

unbundled bundle install --gemfile Gemfile

unbundled bundle exec rake db:drop db:create

cd .. # Back to the project root.
bin/sandbox-setup # Run any custom setup.

echo
echo "🚀 Sandbox app successfully created for $gem_name!"

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
deface-1.9.0 bin/sandbox
deface-1.8.2 bin/sandbox
deface-1.8.1 bin/sandbox
deface-1.8.0 bin/sandbox