Skip to content

Instantly share code, notes, and snippets.

@calebhearth
Last active December 12, 2015 08:09
Show Gist options
  • Save calebhearth/4742408 to your computer and use it in GitHub Desktop.
Save calebhearth/4742408 to your computer and use it in GitHub Desktop.
./gem_with_dummy.sh tiberius
gemname=$1
bundle gem $gemname
cd $gemname
git commit -am"bundle gem $gemname"
git checkout --orphan dummy
git rm -rf .
cd ..
rails plugin new $gemname \
--skip-bundle \
--skip-keeps \
--skip-test-unit \
--dummy-path=spec/dummy
cd $gemname
rm -r .gitignore Gemfile Rakefile $gemname.gemspec MIT-LICENSE README.rdoc lib/
mv test spec
git add .
git commit -m "rails plugin new $gemname (removed all but dummy app)"
git checkout master
git merge dummy -m "Incorporate spec/dummy from rails engine"
git branch -d dummy
sed -i '' -e '$ d' $gemname.gemspec
echo '' >> $gemname.gemspec
echo ' gem.add_dependency "rails", "~> 3.2.11"' >> $gemname.gemspec
echo ' gem.add_development_dependency "sqlite3"' >> $gemname.gemspec
echo 'end' >> $gemname.gemspec
git commit -am "Add required dependencies"
╓─[HEAD]──[master]──Add required dependencies──(cfd2eda)
╟ Incorporate spec/dummy from rails engine──(9398b97)
╠═╗
║ ╙ rails plugin new tiberius (removed all but dummy app)──(06c4158)
╙ bundle gem tiberius──(4373421)
.gitignore
Gemfile
LICENSE.txt
README.md
Rakefile
lib/tiberius.rb
lib/tiberius/version.rb
spec/dummy/README.rdoc
spec/dummy/Rakefile
spec/dummy/app/assets/javascripts/application.js
spec/dummy/app/assets/stylesheets/application.css
spec/dummy/app/controllers/application_controller.rb
spec/dummy/app/helpers/application_helper.rb
spec/dummy/app/views/layouts/application.html.erb
spec/dummy/config.ru
spec/dummy/config/application.rb
spec/dummy/config/boot.rb
spec/dummy/config/database.yml
spec/dummy/config/environment.rb
spec/dummy/config/environments/development.rb
spec/dummy/config/environments/production.rb
spec/dummy/config/environments/test.rb
spec/dummy/config/initializers/backtrace_silencers.rb
spec/dummy/config/initializers/inflections.rb
spec/dummy/config/initializers/mime_types.rb
spec/dummy/config/initializers/secret_token.rb
spec/dummy/config/initializers/session_store.rb
spec/dummy/config/initializers/wrap_parameters.rb
spec/dummy/config/locales/en.yml
spec/dummy/config/routes.rb
spec/dummy/public/404.html
spec/dummy/public/422.html
spec/dummy/public/500.html
spec/dummy/public/favicon.ico
spec/dummy/script/rails
tiberius.gemspec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment