Hi,
in an attempt to do some ruby I have revamped the TODO list command again, completely. It's now written in Ruby using ERB with a template.
• It removes a bug from the older TODO comment which would descend into subdirectories for non-project files. So if you had a file in / and invoked the TODO command it would scan your complete Volume. • It sorts according to TODO/FIXME/CHANGED categories • and numbers the items, so you see how much work there is still todo :)
Soryu.
On Feb 25, 2006, at 2:28 AM, Soryu wrote:
Hi,
in an attempt to do some ruby I have revamped the TODO list command again, completely. It's now written in Ruby using ERB with a template.
• It removes a bug from the older TODO comment which would descend into subdirectories for non-project files. So if you had a file in / and invoked the TODO command it would scan your complete Volume. • It sorts according to TODO/FIXME/CHANGED categories • and numbers the items, so you see how much work there is still todo :)
Soryu.
Looks nice with a single file open, but fails with a "too many open files" error with my entire project open.
Here's the error:
/tmp/temp_textmate.mqBVat:12:in `pwd': Too many open files - getcwd (Errno::EMFILE) from /tmp/temp_textmate.mqBVat:12:in `scan_file' from /tmp/temp_textmate.mqBVat:27:in `scan_file' from /tmp/ temp_textmate.mqBVat:26:in `each' from /tmp/temp_textmate.mqBVat: 26:in `scan_file' from /tmp/temp_textmate.mqBVat:27:in `scan_file' from /tmp/temp_textmate.mqBVat:26:in `each' from /tmp/ temp_textmate.mqBVat:26:in `scan_file' from /tmp/temp_textmate.mqBVat: 27:in `scan_file' ... 7 levels... from /tmp/temp_textmate.mqBVat: 26:in `scan_file' from /tmp/temp_textmate.mqBVat:39 from /tmp/ temp_textmate.mqBVat:38:in `each' from /tmp/temp_textmate.mqBVat:38
Oh,
I'm really new to this ruby stuff and now this :). Will look into it. How many files is "many" how deep are your subdirectories nested and how long does it take for this error to pop up, instantly or after 10 seconds or so?
Soryu.
Looks nice with a single file open, but fails with a "too many open files" error with my entire project open.
Here's the error:
/tmp/temp_textmate.mqBVat:12:in `pwd': Too many open files - getcwd (Errno::EMFILE) from /tmp/temp_textmate.mqBVat:12:in `scan_file' from /tmp/temp_textmate.mqBVat:27:in `scan_file' from /tmp/ temp_textmate.mqBVat:26:in `each' from /tmp/temp_textmate.mqBVat: 26:in `scan_file' from /tmp/temp_textmate.mqBVat:27:in `scan_file' from /tmp/temp_textmate.mqBVat:26:in `each' from /tmp/ temp_textmate.mqBVat:26:in `scan_file' from /tmp/ temp_textmate.mqBVat:27:in `scan_file' ... 7 levels... from /tmp/ temp_textmate.mqBVat:26:in `scan_file' from /tmp/ temp_textmate.mqBVat:39 from /tmp/temp_textmate.mqBVat:38:in `each' from /tmp/temp_textmate.mqBVat:38 ______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 25/2/2006, at 10:35, Soryu wrote:
I'm really new to this ruby stuff and now this :). Will look into it. How many files is "many" how deep are your subdirectories nested and how long does it take for this error to pop up, instantly or after 10 seconds or so?
By default a process on Darwin can only have 256 files open at the same time (well, file descriptors) -- so likely the problem is just lack of closing files you have scanned… will check the script in 30 minutes…
Apparently I do open all the files to scan them but do not close them afterwards. D'oh! This should now be fixed.
Soryu
On 25/02/2006, at 10:58, Soryu wrote:
Apparently I do open all the files to scan them but do not close them afterwards. D'oh! This should now be fixed.
Whenever possibly, use the 'auto-dispose' way of obtaining such resources, like File.open(filename) do |f| ..the code.. end
which will close the file regardless of how the block is left (normally, 'return', exceptins, throw etc.) Alternatively, use 'ensure' which is really what the above is: begin f = File.open(...) ... ensure f.close end
(Oh and I didn't look at your code before writing this, so apologies if it's all old news).
-- Sune.
On 26/2/2006, at 19:24, stephen Hamilton wrote:
Very nice - i use this bundle alot, and it is much better looking now. No problems noticed here yet.
Soryu’s enhanced TODO has now taken the place of the previous TODO command in the repository.
I also did a few additions, like have the link show the line with the tag as a tool tip.
Note that a checkout of the TODO bundle (from the repository) also require a checkout of the Support directory.