Skip to content

Instantly share code, notes, and snippets.

@ajvargo
Created April 20, 2011 21:25
Show Gist options
  • Save ajvargo/932907 to your computer and use it in GitHub Desktop.
Save ajvargo/932907 to your computer and use it in GitHub Desktop.
grep rails rake routes for strings via command line function
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