Skip to content

Instantly share code, notes, and snippets.

@koenpunt
Last active December 12, 2015 08:39
Show Gist options
  • Save koenpunt/4745774 to your computer and use it in GitHub Desktop.
Save koenpunt/4745774 to your computer and use it in GitHub Desktop.
Rename controllers, models, views ands tests in a rails project.
# List the files you need to rename you could run the following from the root of the project:
find . -name 'user*' | awk '{print $0; gsub(/user/, "system_user"); print $0}' | xargs -n2 echo "mv"
# actually move the files:
find . -name 'user*' | awk '{print $0; gsub(/user/, "system_user"); print $0}' | xargs -n2 mv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment