Created
April 20, 2011 21:25
-
-
Save vargonaut/932907 to your computer and use it in GitHub Desktop.
grep rails rake routes for strings via command line function
This file contains hidden or 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
| function grep_routes() { | |
| ruby -e "ARGV[0].split(10.chr).each{|x| puts x if !ARGV[1..-1].map{|a| x =~ /#{a}/}.include?(nil)}" "$(rake routes)" "$@" | |
| } | |
| # USAGE | |
| # > grep_routes this | |
| # > grep_routes this that the other |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment