Archive for January, 2007

Rails generators with subversion

Posted on January 5th, 2007 in Business, Delphi, Rails, TwoDesk | 3 Comments »

I was talking to Steve the other day about some Rails work I was doing for him, and I commented that “someone needs to write something that combines the rails generators/destroyers with subversion so the files automatically get added to the repository.”

As it turns out, this is already built in.  All you do is add the -c command line switch to your generate or destroy command:

ruby script/generate controller MyController -c

This will add any newly created files or directories to subversion.  It works with script/destroy too.

As development tools get better and become able to do more for us – especially things like Rails or Castalia, it becomes an increasingly important problem to make the developer aware that the capability is there.

When a Delphi developer spends 10 minutes renaming all the instances of a variable in his method by hand, can Castalia say “excuse me, but I can do that for you much faster.  Let me show you how.”  Or could the computer somehow recognize that after every ‘script/generate’, you do ‘svn add’ on the new files, and tell you that the script actually has that ability built in.

Nobody is really expected to read the documentation all the way through any more – there’s just too much of it.  And when you don’t expect a tool to have a certain functionality (like a builtin subversion client in rails scripts), you never go looking in the documentation to begin with.

This is a problem that needs solving, and if it can be solved, the solution will change the we work with our development tools in a dramatic way.