Skip to content

Instantly share code, notes, and snippets.

@thbar
Created January 28, 2009 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thbar/54214 to your computer and use it in GitHub Desktop.
Save thbar/54214 to your computer and use it in GitHub Desktop.
#!/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