Created
July 11, 2010 08:16
-
-
Save anithri/471391 to your computer and use it in GitHub Desktop.
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
#Anithri preinstall gems | |
#gem install rails -v 3.0.0.beta4 | |
#gem install bundler -v 1.0.0.beta.4 | |
# When ready run as | |
# rails new ArtificalCasting -d mysql -J -m http://gist.github.com/471391.txt | |
puts "=" * 80 | |
puts "Step 1. Remove some unused files and directories" | |
puts "=" * 80 | |
%w(README | |
public/index.html | |
public/favicon.ico | |
public/robots.txt | |
public/images/rails.png | |
app/views/layouts/application.html.erb).each do |f| | |
remove_file fblueprint/semantic | |
end | |
# Remove test/unit directory | |
run "rm -rf test" | |
# Gemfile | |
puts "=" * 80 | |
puts "Step 2. Setup Gemfile and install gems" | |
puts "=" * 80 | |
remove_file 'Gemfile' | |
create_file 'Gemfile' do | |
<<-GEMS | |
source 'http://gemcutter.org' | |
gem 'rails', '3.0.0.beta4' | |
gem 'mysql' | |
gem 'haml' | |
gem 'compass' | |
# Use unicorn as the web server | |
# gem 'unicorn' | |
# Deploy with Capistrano | |
# gem 'capistrano' | |
# To use debugger | |
# gem 'ruby-debug' | |
gem 'nifty-layouts' | |
# Bundle the extra gems: | |
# gem 'bj' | |
# gem 'nokogiri', '1.4.1' | |
# gem 'sqlite3-ruby', :require => 'sqlite3' | |
# gem 'aws-s3', :require => 'aws/s3' | |
gem 'autotest' | |
gem 'autotest-rails' | |
group :test do | |
gem 'capybara' | |
gem 'database_cleaner' | |
#gem "factory_girl", :git => "git://github.com/thoughtbot/factory_girl.git", :branch => "rails3" | |
gem 'cucumber-rails', :git => "git://github.com/aslakhellesoy/cucumber-rails.git" | |
gem 'cucumber', '>=0.7.2' | |
gem 'launchy' | |
gem 'rspec', '>=2.0.0.beta.8', :git => "git://github.com/rspec/rspec.git" | |
gem 'rspec-rails', '>=2.0.0.beta.8', :git => "git://github.com/rspec/rspec-rails.git" | |
gem 'spork' | |
#gem ruby-debug | |
endblueprint/semantic | |
GEMS | |
end | |
# Bundle | |
#run 'bundle install' | |
#Initialize gems | |
puts "=" * 80 | |
puts "Step 3. Setup and initialize some gems" | |
puts "=" * 80 | |
# Initialize HAML & SASS | |
#run 'compass -rails -f blueprint' | |
#empty_directory('app/stylesheets') | |
#run "sass-convert --from sass2 --to scss --recursive app/stylesheets" | |
# Initialize testing suite | |
#run 'script/rails g rspec:install' | |
#run 'script/rails g cucumber:skeleton --rspec --capybara' | |
puts "=" * 80 | |
puts "Step 4. Setup jQuery" | |
puts "=" * 80 | |
# jQuery | |
run "rm public/javascripts/*.js" | |
inside "public/javascripts" do | |
get "http://code.jquery.com/jquery-latest.js", "jquery.js" | |
get "http://github.com/rails/jquery-ujs/raw/master/src/rails.js", "rails.js" | |
end | |
# Add a haml layout | |
file "app/views/layouts/application.html.haml", <<-HAML | |
!!! 5 | |
%html | |
%head | |
= csrf_meta_tag | |
= stylesheet_link_tag 'screen.css', :media => 'screen, projection' | |
= stylesheet_link_tag 'print.css', :media => 'print' | |
= javascript_include_tag 'jquery-1.4.min.js' | |
= javascript_include_tag 'application.js' | |
%body | |
= render :partial => "shared/flashes" | |
= yield | |
HAML | |
file 'public/javascripts/application.js', | |
%q|jQuery(function () { | |
}); | |
| | |
puts "=" * 80 | |
puts "Step 6. Create the databases" | |
puts "=" * 80 | |
# Create the DB | |
#rake("db:migrate") | |
puts "=" * 80 | |
puts "Step 7. Setup Git" | |
puts "=" * 80 | |
# GIT | |
git :init | |
run "touch tmp/.gitignore log/.gitignore vendor/.gitignore" | |
run %{find . -type d -empty | grep -v "vendor" | grep -v ".git" | grep -v "tmp" | xargs -I xxx touch xxx/.gitignore} | |
append_file ".gitignore", <<-EOF | |
config/database.yml | |
doc/* | |
EOF | |
git :add => ".", :commit => "-m 'initial commit.'" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment