Created
June 9, 2009 21:14
-
-
Save lgs/126791 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
############################################################ | |
# # | |
# Out of the box Clearance Rails authentication tamplate # | |
# basically follow the wiki installation guide @ github # | |
# http://wiki.github.com/thoughtbot/clearance/installation # | |
# # | |
# Build the complete skeleton for a Rails 2.3 application # | |
# using Clearance Auth. This generator will automatically # | |
# build the basics for a Rails authentication with email # | |
# and password. # | |
# # | |
############################################################ | |
# Add clearance gem to config/environment.rb | |
gem "thoughtbot-clearance", | |
:lib => 'clearance', | |
:source => 'http://gems.github.com' | |
# Vendor the gem | |
rake "gems:install", :sudo => true | |
rake "gems:unpack" | |
# Create a development/test/prod database | |
inside ('') do | |
run 'rake rails:template LOCATION=http://github.com/lgs/rails-templates/raw/master/MySQL-DB-creator' | |
end | |
# Run the generator | |
generate :clearance | |
# Define a HOST constant in your environment files. | |
# In config/environments/test.rb and config/environments/development.rb | |
# it can be: HOST = "localhost" | |
environment "\r\n\r\n# clearance\r\nHOST = 'localhost'", :env => 'test' | |
environment "\r\n\r\n# clearance\r\nHOST = 'localhost'", :env => 'development' | |
# In production.rb it must be the actual host your application is deployed to. | |
# The constant is used by mailers to generate URLs in emails. | |
# In config/environment.rb: DO_NOT_REPLY = "[email protected]" | |
domain = ask("\nWhat domain will this application run under?") | |
environment "\r\n\r\n# clearance\r\nHOST = \"#{domain}\"", :env => 'production' | |
append_file 'config/environment.rb', "\r\n\r\n# clearance\r\nDO_NOT_REPLY = 'donotreply@#{domain}'\r\n" | |
# Define root_url in config/routes.rb | |
generate :controller, "home", "index" | |
route "map.root :controller => 'home'" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment