Renaming modules from the command line
As we continue to build Tau Station, the free-to-play narrative sci-fi MMORPG (what a mouthful!), we find our code base is getting larger and larger. As with any large codebase, we've found ourselves sometimes mired in technical debt and need a way out.
One simple hack I wrote has saved so much grief with this process. I can run this from the command line:
bin/dev/rename-module.pl Veure::Old::Module::Name Veure::New::Module::Name
And it automatically renames the module for me, updates all references to it, creating directories as needed, renaming test classes built for it, and uses
This is that script:
It is, of course, a bit of a hack and obviously uses a few custom tools we've built ourselves, but curiously, it hasn't botched a rename a single time, including one I did this morning which resulted in a diff of over 1,000 lines.
Leave a comment