refacto was created in response to a stack overflow question here:
http://stackoverflow.com/questions/10708321/rails-code-refactoring-tool-for-mac/10861183#10861183
I decided it would be fun to make this little tool with a few extra quirks.
In a nutshell: refacto without any options renames all subfolders of
the current working directory, renames all files in the directory and all sub
directories, AND finds all instances of the findString INSIDE those files if
they are openable and renames them. There is no difference whether it's a ruby
class, a c++ class, or anything else. As long as the contents can be opened
in text format, they will be changed.
No installer exists yet.
If it wasn't obvious, YOU MUST ENABLE GARBAGE COLLECTION WHEN YOU COMPILE THIS.
Here's your readme:
Proper Usage is:
refacto findString changeString <file extensions> <options>
File extensions are not optional. In order for any files to be renamed
or refactored, you must list at least one file extension.
Options:
-a : Ask for confirmation to refactor or rename a file.
-nf : Do not rename folders or subfolders
-ci : Case Insenitive. Will change all versions of findString
Stand-Alone Options:
-h|-help : Basically print this tutorial
Example:
refacto -h
OR
refacto -help
Examples:
refacto ruby rails erb rb -a
- Will touch all folders and subfolders of current directory
- Will change all instances of ruby to rails (case sensitive)
- Will touch on all files with .erb and .rb as the last extension
- Will ask for your approval before each refactor or rename
refacto ruby rails erb rb -rf -ci
- Will NOT touch all folders and subfolders of current directory
- Will change all instances of ruby to rails (case INSENSITIVE)
- Will touch on all files with .erb and .rb as the last extension
- Will NOT ask for your approval before each refactor or rename