Skip to content

Instantly share code, notes, and snippets.

@karthiks
Created October 27, 2011 03:16
Show Gist options
  • Save karthiks/1318701 to your computer and use it in GitHub Desktop.
Save karthiks/1318701 to your computer and use it in GitHub Desktop.
Bash Aliases - RoR
findrb() {
find . -iname "*.rb" -print0 | xargs -0 egrep -n --color "$@"
}
findyml() {
find . -iname "*.yml" -print0 | xargs -0 egrep -n --color "$@"
}
findrake() {
find . -iname "*.rake" -print0 | xargs -0 egrep -n --color "$@"
}
findrhtml() {
find . -iname "*.rhtml" -print0 | xargs -0 egrep -n --color "$@"
}
findhtmlerb() {
find . -iname "*.html.erb" -print0 | xargs -0 egrep -n --color "$@"
}
findjs() {
find . -iname "*.js*" -print0 | xargs -0 egrep -n --color "$@"
}
##############################################################
#### Pre-bundler era when gems and plugins were vendorized ###
##############################################################
find_novendor() {
find . -path "*/vendor" -prune -o -iname "*.*" -print0 | xargs -0 egrep -n --color "$@"
}
findrb_novendor() {
find . -path "*/vendor" -prune -o -iname "*.rb" -print0 | xargs -0 egrep -n --color "$@"
}
findjs_novendor() {
find . -path "*/vendor" -prune -o -iname "*.js" -print0 | xargs -0 egrep -n --color "$@"
}
findyml_novendor() {
find . -path "*/vendor" -prune -o -iname "*.yml" -print0 | xargs -0 egrep -n --color "$@"
}
findrake_novendor() {
find . -path "*/vendor" -prune -o -iname "*.rake" -print0 | xargs -0 egrep -n --color "$@"
}
findrhtml_novendor() {
find . -path "*/vendor" -prune -o -iname "*.rhtml" -print0 | xargs -0 egrep -n --color "$@"
}
findhtmlerb_novendor() {
find . -path "*/vendor" -prune -o -iname "*.html.erb" -print0 | xargs -0 egrep -n --color "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment