|
|
|
SearchCategories
Books by the AuthorOther Ruby Projects |
Add to SubversionI love Rails generators and I love Subversion, but I'm not so sure they love each other. Little is worse than generating some scaffold files or a login system, tediously typing Given that, here's my hack to get the Rails generators and Subversion to kiss and make up:
I put that in "lib/tasks/add_to_svn.rake" for all my Rails projects. You can then access it whenever you need with I've seen similar tasks posted, but they've always been Unix specific and I work with some Windows programmers. This is my attempt to help both on platforms. How does it work?You're probably not use to seeing ugly Ruby code like that, but Ruby supports a lot of command-line shortcuts it inherited from Perl. Here's a breakdown of the options used:
Together they mean that Ruby sees the above input as something close to:
That just asks Ruby to call WARNING: Make sure you've told Subversion to ignore files you don't want it messing with (like Rails's log files), or they will be added! |
|
|
|
It so happens that this already exists as part of the generator framework.
That's great to know, as I certainly wasn't aware of it.
Quick question: does the generator solution work for files it didn't add to the application?