Created
January 28, 2009 21:55
-
-
Save thbar/54214 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
#!/usr/local/bin/ruby | |
# inspired by http://ariejan.net/2009/01/04/how-to-start-a-rails-edge-app-the-easy-way/ | |
require 'fileutils' | |
def launch(cmd); puts cmd; throw "Error!" unless system(cmd); end | |
def bye(message); puts message; exit -1; end | |
bye "Syntax: my_rails app_name" unless (app_name = ARGV.first) | |
bye "Folder #{app_name} already there! Remove it first." if File.exists?(app_name) | |
launch "mkdir -p #{app_name}/vendor" | |
FileUtils.chdir app_name | |
launch "git clone git://github.com/rails/rails.git vendor/rails" | |
launch "ruby vendor/rails/railties/bin/rails ." | |
FileUtils.chdir '..' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment