Created
December 12, 2012 17:07
-
-
Save davidrenne/4269614 to your computer and use it in GitHub Desktop.
setting up a new gem in bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CAMELCASE=WidgetList | |
GEMNAME=widget_list | |
rvm gemset create $GEMNAME | |
rvm gemset use $GEMNAME | |
gem install bundler | |
bundle gem $GEMNAME | |
#chown wcapp:wcapp -R $GEMNAME/* | |
mkdir -p vendor/assets/{images,javascripts,stylesheets} | |
touch vendor/assets/javascripts/$GEMNAME.js | |
touch vendor/assets/stylesheets/$GEMNAME.css | |
touch lib/$GEMNAME/engine.rb | |
echo 'Add require "'$GEMNAME'/engine" to lib/'$GEMNAME'.rb' | |
echo 'Next Add //= require '$GEMNAME' to application.js in your rails application' | |
echo 'Next Add *= require '$GEMNAME' to application.css in your rails application' | |
echo 'module '$CAMELCASE > lib/$GEMNAME/engine.rb | |
echo ' class Engine < Rails::Engine' >> lib/$GEMNAME/engine.rb | |
echo ' # auto wire' >> lib/$GEMNAME/engine.rb | |
echo " initializer 'static_assets.load_static_assets' do |app|" >> lib/$GEMNAME/engine.rb | |
echo ' app.middleware.use ::ActionDispatch::Static, "#{root}/vendor"' >> lib/$GEMNAME/engine.rb | |
echo ' end' >> lib/$GEMNAME/engine.rb | |
echo ' end' >> lib/$GEMNAME/engine.rb | |
echo 'end' >> lib/$GEMNAME/engine.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment