Using Subversion with Rails Code Generation
Posted by kev Sun, 28 Aug 2005 01:51:00 GMT
Subversion is a wonderful thing. Unfortunately, when using rails code generators it can be annoying adding all the newly generated files by hand. Using script/destroy can be hazardous because subversion will complain the files are not there, but have not been flagged for removal from the repository.
So, I wrote a patch. If it is accepted, you should be able to do things like:
[Dionysus:~/web/testbed] kevincla% script/generate model -c Monkey
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/monkey.rb
A app/models/monkey.rb
create test/unit/monkey_test.rb
A test/unit/monkey_test.rb
create test/fixtures/monkeys.yml
A test/fixtures/monkeys.yml
And all of your happy new code will go into your repository automatically. My patch also accounts for code which has been marked for addition which you would like to delete, so if you just ran the code above and then do script/destroy model -c Monkey it will revert the files and then delete them without any messy svn warnings.


Turnaround time of one day. “It doesn’t suck.” :)