Skip to content

Instantly share code, notes, and snippets.

@bagwanpankaj
Created April 30, 2010 04:50
Show Gist options
  • Save bagwanpankaj/384760 to your computer and use it in GitHub Desktop.
Save bagwanpankaj/384760 to your computer and use it in GitHub Desktop.
Rails Template
run "echo TODO > README"
if yes?("Do you want to use RSpec(yes/no)")
plugin "rspec", :git => "git://github.com/dchelimsky/rspec.git"
plugin "rspec-rails", :git => "git://github.com/dchelimsky/rspec-rails.git"
generate :rspec
elsif yes?("Do you want to use shoulda and factory girl(yes/no)")
gem "thoughtbot-shoulda", :lib => "shoulda", :source => "http://gems.github.com"
gem "factory_girl", :source => "http://gemcutter.org"
end
if yes?("Do you want to use Pagination")
gem 'mislav-will_paginate', :lib => 'will_paginate', :source => 'http://gems.github.com'
end
if yes?("Do you want to use jQuery in place of prototype")
plugin "jrails", :git => "http://github.com/aaronchi/jrails.git"
end
if yes?("Want Authantication System?")
gem "authlogic"
rake("gems:install",:sudo => true)
generate(:session, "user_session")
generate(:model, "user login:string email:string crypted_password:string password_salt:string persistence_token:string single_access_token:string perishable_token:string")
generate(:controller, "user_sessions")
else
rake("gems:install",:sudo => true)
end
rake("rails:freeze:gems") if yes?("Freeze Rails gems?")
#rake("gems:unpack --trace")
rake("db:create --trace")
rake("db:migrate --trace")
generate :nifty_layout
if yes?("Do you want to use GIT as version control")
git :init
file ".gitignore", <<-END
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
END
end
run "cp config/database.yml config/example_database.yml"
generate :controller, "welcome index"
route "map.root :controller => 'welcome'"
run "rm -rf public/index.html"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment