Skip to content

Instantly share code, notes, and snippets.

@alvin2ye
Created November 8, 2009 13:59
Show Gist options
  • Select an option

  • Save alvin2ye/229280 to your computer and use it in GitHub Desktop.

Select an option

Save alvin2ye/229280 to your computer and use it in GitHub Desktop.
rails templete
run "rm public/index.html"
generate(:nifty_layout, "application")
generate(:nifty_config, "")
generate(:nifty_authentication, "")
generate(:nifty_scaffold, "post title:string body:text")
route "map.root :controller => :posts"
rake("db:migrate")
git :init
file '.gitignore', <<-CODE
*.sh
log/*.log
log/*.pid
db/*.db
db/*.sqlite3
db/schema.rb
tmp
.DS_Store
doc/api
doc/app
config/database.yml
nbproject
CODE
git :add => "."
git :commit => "-a -m 'Initial Commit'"
file 'restart.sh', <<-CODE
#!/usr/bin/env bash
ps -A -f | grep "script/server -p 3000 -d" | kill -9 `awk {'print $2'}`
ruby ./script/server -p 3000 -d
CODE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment