Skip to content

Instantly share code, notes, and snippets.

@misternu
Last active April 27, 2016 18:39
Show Gist options
  • Select an option

  • Save misternu/465ce5beabdc4a6df23a to your computer and use it in GitHub Desktop.

Select an option

Save misternu/465ce5beabdc4a6df23a to your computer and use it in GitHub Desktop.
Rake yolo task and yolo alias
# Hey Chi-Town, I made this rake task, and it has saved some of us a lot of time.
# Some people asked me to post it, so here it is:
desc 'You only live once'
task 'yolo' => ['db:drop', 'db:create', 'db:migrate', 'db:seed'] do
exec "bundle exec shotgun config.ru"
end
# NOTE: If db:create or db:drop use "exec" instead of "system", this will not work.
# If you decide to fix this, google why this happens first.
# If you just paste that in after the console task, you now will be able to call the
# command "bundle exec rake yolo" or "be rake yolo" and it will drop, create, migrate, seed,
# then shotgun your server.
# I also have at the bottom of my .bash_profile:
alias yolo="bundle; bundle exec rake yolo"
# So that, if I find myself in a repo that already has my rake task installed,
# I can just plain "yolo". This is courtesy of a guy named Chase who comes around some times
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment