run "rm Gemfile"
file 'Gemfile', <<-FILE
source 'http://rubygems.org'
gem 'rails', '3.0.3'
gem 'rake', '~> 0.8.7'
gem 'devise', '~> 1.2.0'
gem 'cancan'
gem 'will_paginate', '~> 3.0.pre2'
gem 'tzinfo'
gem 'hoptoad_notifier'
group :staging, :production do
gem 'mysql'
end
group :development, :test do
gem 'test-unit', '= 2.0.9', :require => 'test/unit'
gem 'sqlite3-ruby', :require => 'sqlite3'
# This is for gems without generators - like factory girl
gem 'rails3-generators'
# These help with tests
gem 'shoulda' # This is a cool library for easily writing boring tests
gem 'shoulda-matchers' # These are handy matchers from the above library
gem 'factory_girl_rails' # This lets us define objects using factories
gem 'faker' # This lets us easily define fake data in our factories
# This makes our tests colorful
gem 'turn'
gem 'ansi'
# Coffeescript
gem 'therubyracer'
# Growl notifications for testing
gem 'growl'
# Trying this out for now
gem 'guard', '>= 0.3.0'
gem 'guard-livereload'
gem 'guard-coffeescript'
gem 'guard-test'
gem 'rb-fsevent'
end
FILE
current_ruby = %x{rvm list}.match(/^=>\s+(.*)\s\[/)[1].strip
run "rvm gemset create #{app_name}"
run "rvm #{current_ruby}@#{app_name} gem install bundler --no-rdoc --no-ri"
run "rvm #{current_ruby}@#{app_name} -S bundle install"
file ".rvmrc", <<-END
rvm use #{current_ruby}@#{app_name}
END
# Clean up rails defaults
remove_file 'public/index.html'
remove_file 'rm public/images/rails.png'
inside "public" do
run "git clone http://github.com/paulirish/html5-boilerplate.git"
run 'cp -R html5-boilerplate/* .'
run 'mv js/* javascripts/'
run 'mv javascripts/libs/* javascripts/'
run 'mv css/* stylesheets/'
run 'rm -Rf js css html5-boilerplate'
run 'mv index.html example-html5b.html'
run 'rm README.md'
inside "javascripts" do
FileUtils.rm_rf %w(controls.js dragdrop.js effects.js prototype.js rails.js)
run "wget https://github.com/rails/jquery-ujs/raw/master/src/rails.js --no-check-certificate"
run "mv jquery-*.min.js jquery.js"
run "mv modernizr-* modernizr.js"
end
inside "stylesheets" do
run "wget 'http://grids.heroku.com/grid.css?column_width=20&column_amount=24&gutter_width=20' -O 960.gs"
end
end
# Layout
run 'rm app/views/layouts/application.html.erb'
file 'app/views/layouts/application.html.erb', <<-FILE