Created
August 8, 2012 09:17
-
-
Save unimatrixZxero/3293703 to your computer and use it in GitHub Desktop.
A small function for your shell to grep from you running rails server to get the routes. Which is way faster than having to load the environment first using rake routes.
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
# requirements: | |
# - currently running rails server | |
# - gem 'sextant' bundled in your Gemfile | |
# | |
# Add this to your .zshrc or .bashrc | |
# or put it in a separate file and include it like this | |
# source ~/scripts/grep_local_rails_routes.sh | |
# | |
# You can use it like this | |
# %: routes | |
# Or grep for something | |
# %: routes posts | |
function routes { | |
curl -s http://localhost:3000/rails/routes | grep ${1:-''} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment