Annoyingly Rails 3 spreads whatever name you give it when running ‘rails new’ over 10 or so files. This makes it hard to setup a base app. The following
shell commands will change the name of the app to the new name:
I'm a little ashamed that the snippet uses perl instead of ruby. When I was trying to get the equivalent to work in ruby 1.9 it keep complaining about encoding.
For anyone that is interested the ruby version I was attempting to use was:
Which gets an error:
Even trying to force an encoding didn't seem to solve the problem.
It is likely this wouldn't occur if used from Ruby 1.8
Update:
While it’s nice to have a one liner that will accomplish the renaming. I’ve seen the above one liner corrupt the .git/index
I’ve written a simple ruby script that is more limited in how it selects the files: