Skip to content

Instantly share code, notes, and snippets.

@mattboldt
Last active August 31, 2017 23: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 mattboldt/6cda9f009460bf310f273f5a305eed2e to your computer and use it in GitHub Desktop.
Save mattboldt/6cda9f009460bf310f273f5a305eed2e to your computer and use it in GitHub Desktop.
Rake those routes!
  • Copy contents of file into a route located outside of any repos.
  • cd /YOUR-REPO-DIR/
  • chmod +x route
  • ln -s $PWD/route /usr/local/bin/

Usage:

route my_new_route

Output:

        api_v1_my_new_route POST  /api/v1/my_new_route(.:format)         api/v1/my_new_route#create
compose_api_v2_my_new_route POST  /api/v2/my_new_route/update(.:format)  api/v2/my_new_route#udpate
#!/usr/bin/env ruby
# ln -s $PWD/route /usr/local/bin/
exec "cd #{Dir.pwd} && rake routes | grep #{ARGV[0]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment