Created
May 9, 2009 21:54
-
-
Save domwom/109413 to your computer and use it in GitHub Desktop.
rails_templates
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
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" | |
run "rm public/robots.txt" | |
run "rm -f public/javascripts/*" | |
gitignoreItems = %w( | |
.DS_Store | |
log/*.log | |
tmp/**/* | |
config/deploy.rb | |
config/database.yml | |
db/*.sqlite3 | |
Capfile | |
) | |
# Set up git repository | |
git :init | |
# Download JQuery | |
if yes?("Download Jquery-1.3.2 to public/javascript? (y/N)") | |
run "curl -L http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js > public/javascripts/jquery.js" | |
run "curl -L http://jqueryjs.googlecode.com/svn/trunk/plugins/form/jquery.form.js > public/javascripts/jquery.form.js" | |
end | |
# depify Project | |
if yes?("Do you want to use Capistrano?") | |
if yes?("On top of that, do you want to use deprec?") | |
run 'depify .' | |
else | |
run 'capify .' | |
end | |
run "cp config/deploy.rb config/deploy.rb.example" #Copy ignored deploy.rb to example | |
gitignoreItems << "Capfile" << "config/deploy.rb" | |
end | |
# Copy ignored database.yml to example | |
run "cp config/database.yml config/database.yml.example" | |
# Set up .gitignore files | |
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} | |
file '.gitignore', gitignoreItems.join("\n") | |
# Install submoduled plugins | |
if yes?("Do you want to use RSpec? (y/n)") | |
plugin "rspec", :git => "git://github.com/dchelimsky/rspec.git", :submodule => true | |
plugin "rspec-rails", :git => "git://github.com/dchelimsky/rspec-rails.git", :submodule => true | |
generate :rspec | |
end | |
if yes?("Do you want to use Cucumber? (y/n)") | |
plugin "cucumber",:git => "git://github.com/aslakhellesoy/cucumber.git", :submodule => true | |
generate :cucumber | |
end | |
if yes?("Do you want to use Webrat? (y/n)") | |
plugin "webrat",:git => "git://github.com/brynary/webrat.git", :submodule => true | |
end | |
if yes?("Do you want to use Mocha? (y/n)") | |
plugin "mocha", :git => "git://github.com/floehopper/mocha.git", :submodule => true | |
end | |
if yes?("Do you want to use restful-authentication? (y/n)") | |
plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git', :submodule => true | |
end | |
# Initialize submodules | |
git :submodule => "init" | |
# Commit all work so far to the repository | |
git :add => '.' | |
git :commit => "-a -m 'Initial Rails import.'" | |
# Success! | |
puts "SUCCESS!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment