Created
December 2, 2008 16:05
-
-
Save jm/31152 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Add "-m/--template" option to Rails generator to apply template to generated application. For example: | |
# Install plugins from git or svn | |
plugin "will-paginate", :git => "git://github.com/mislav/will_paginate.git" | |
plugin "old-restful-auth", :svn => "http://svn.techno-weenie.net/projects/plugins/restful_authentication/" | |
# Install gems | |
gem "jeremymcanally-context" | |
gem "bluecloth" | |
# Vendor file. Data in a string or... | |
vendor("borrowed.rb", <<CODE | |
def helpful_method | |
do_something_helpful_here | |
end | |
CODE | |
# ...file data from block return value. | |
# #initializer creates a new initializer file | |
initializer("crypto.rb") do | |
salt = "--#{Time.now}--#{rand}--#{srand(Time.now.to_i)}" | |
"SPECIAL_SALT = '#{salt}'" | |
end | |
To use a template, provide a file path or URL: | |
rails -m /path/to/my/rails_app.template | |
rails --template=http://www.mycompany.com/templates/companywide.template |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment