I've attached a few simple commands I hacked up to practice my ruby. There may be better ways to do these so any input is welcome.
The first one "Show TODO - ignore list" is pretty basic. On the first line of the script it takes an array of patterns of files to ignore while parsing your project. Its should be pretty easy to enter your list even if you don't know ruby, just follow the example. Ideally I'd like to make it so you can set the list externally somehow to make it easy.
I wrote this because the TextMate.each_text_file was parsing everything in the project folder, regardless if I removed it from the project or not. I have a "vendored" version of edge rails in one of my project folders, and seeing a list of all of DHH et al.s comments was hindering my use of the TODO.
The other two commands go together.
"Project Statistics" displays the total word count, line count, and bytes on the tool tip for the entire project. "Project Statistics - Full Output" displays the same information for each file in the project as well as the totals as html
Both of these commands use each_text_file with an ignore list as well, so they suffer the same limitations and advantages.
I wrote these cause I had to work on a horrible web system from the pre-standards days all day today and I wanted to see just how ugly it was. I found out - they have more javascript for their drop down menus alone then the entire prototype library contains.
William  p.s. Allan: If I run any of these commands, regular todo or my versions, on a group of files from a top level directory like /Users/ username my textmate will lock up for a very long time, at least unless of course I have a lot of ignore flags set. Not too hard to avoid, certainly less than ideal. Is there a better way to iterate over project files?
p.p.s Thank you for all your hard work and amazing program.
On 30/9/2006, at 9:13, Reprisal wrote:
[...] I wrote this because the TextMate.each_text_file was parsing everything in the project folder, regardless if I removed it from the project or not. I have a "vendored" version of edge rails in one of my project folders, and seeing a list of all of DHH et al.s comments was hindering my use of the TODO.
Just FYI the TextMate.each_text_file does respect global folder reference patterns.
p.s. Allan: If I run any of these commands, regular todo or my versions, on a group of files from a top level directory like / Users/username my textmate will lock up for a very long time, at least unless of course I have a lot of ignore flags set. Not too hard to avoid, certainly less than ideal. Is there a better way to iterate over project files?
TextMate locks up when it is running a command. If the command has HTML output, TM will be responsive while the command is running. So changing to HTML output should at least solve the “locking up” part.
As for it taking long time to search your disk: probably not much to do about that. Well, other than write a Spotlight TODO-importer and use Spotlight. But if this was a network mount, it probably won’t work.