Created
June 5, 2010 21:11
-
-
Save devopsmariocom/427005 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Rails 3 bootstrap | |
# run with | |
# git clone git://gist.github.com/427005.git && bash "427005/Rails 3 Bootstrap.sh" && rm -rf 427005 | |
# Setup gems | |
cat > Gemfile <<EOF | |
source 'http://rubygems.org' | |
gem 'rails', '3.0.0.beta3' | |
# Haml and Sass - templating engines | |
# > http://github.com/nex3/haml | |
gem "haml" | |
# MySQL API module for Ruby | |
# > http://rubygems.org/gems/mysql | |
gem "mysql" | |
# A collection of useful Rails generator scripts for scaffolding, layout files, authentication, and more. | |
# > http://github.com/ryanb/nifty-generators | |
gem "nifty-generators" | |
# A set of Rails 3 responders to dry up your application | |
# > http://github.com/plataformatec/responders | |
gem "responders" | |
# Forms made easy for Rails! It's tied to a simple DSL, with no opinion on markup. | |
# > http://github.com/plataformatec/simple_form | |
gem "simple_form" | |
group :development do | |
# Rails 3 compatible generators for DataMapper, Haml, Factory-girl, Authlogic, Mongomapper, Shoulda, Formtastic and SimpleForm | |
# > http://github.com/indirect/rails3-generators | |
gem "rails3-generators" | |
end | |
group :test do | |
# Shoulda - Making tests easy on the fingers and eyes | |
# > http://github.com/thoughtbot/shoulda | |
gem "shoulda" | |
# factory_girl - Fixtures replacement | |
# > http://github.com/thoughtbot/factory_girl | |
gem "factory_girl" | |
end | |
EOF | |
bundle install | |
rails generate responders:install | |
rails generate simple_form:install | |
# Install jQuery | |
curl -L http://code.jquery.com/jquery-latest.min.js > public/javascripts/jquery.js | |
curl -L http://github.com/rails/jquery-ujs/raw/master/src/rails.js > public/javascripts/rails.js | |
cd public/javascripts | |
rm -rf controls.js dragdrop.js effects.js prototype.js rails.js | |
cd ../.. | |
cat > config/initializers/jquery.rb <<EOF | |
# Switch the javascript_include_tag :defaults to use jQuery instead of | |
# the default prototype helpers. | |
# Credits: http://webtech.union.rpi.edu/blog/2010/02/21/jquery-and-rails-3/ | |
# $RAILS_ROOT/config/initializers/jquery.rb | |
if ActionView::Helpers::AssetTagHelper.const_defined?(:JAVASCRIPT_DEFAULT_SOURCES) | |
ActionView::Helpers::AssetTagHelper.send(:remove_const, "JAVASCRIPT_DEFAULT_SOURCES") | |
end | |
ActionView::Helpers::AssetTagHelper::JAVASCRIPT_DEFAULT_SOURCES = ['jquery', 'rails'] | |
ActionView::Helpers::AssetTagHelper::reset_javascript_include_default | |
EOF | |
# Install HAML | |
#haml --rails . | |
# Cleanup+gitinit | |
rm public/index.html | |
rm public/images/rails.png | |
git init | |
git commit -a -m "create basic rails application" | |
git add . | |
echo """ | |
Don't forget configure your generators | |
config.generators do |g| | |
g.template_engine :haml | |
g.stylesheets false | |
g.test_framework :shoulda | |
g.fallbacks[ :shoulda ] = :test_unit | |
g.ficture_replacement :factory_girl | |
end | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment