Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10037 (new enhancement)

Opened 1 year ago

Last modified 8 months ago

[PATCH] allow "rake notes" to find "# - FIXME ..." in addition to "# FIXME ..."

Reported by: phallstrom Assigned to: core
Priority: normal Milestone: 2.x
Component: Railties Version: edge
Severity: normal Keywords:
Cc:

Description

Currently "rake notes" will search for the following patterns:

# FOO ....

where "FOO" is one of the valid keywords. Without thinking about it however, I have been using it like this:

# - FOO ....
# - FOO ....

So that when I generate rdocs for my app these lines come through as a bulleted list, not jumbled together in one long line. But "rake notes" doesn't find these.

The below patch fixes this and also allows for '# * FOO" as that also is used by rdoc to make lists.

Index: source_annotation_extractor.rb
===================================================================
--- source_annotation_extractor.rb      (revision 146)
+++ source_annotation_extractor.rb      (working copy)
@@ -31,9 +31,9 @@
       if File.directory?(item)
         results.update(find_in(item))
       elsif item =~ /\.(builder|(r(?:b|xml|js)))$/
-        results.update(extract_annotations_from(item, /#\s*(#{tag}):?\s*(.*)$/))
+        results.update(extract_annotations_from(item, /#[-*\s]*(#{tag}):?\s*(.*)$/))
       elsif item =~ /\.(rhtml|erb)$/
-        results.update(extract_annotations_from(item, /<%\s*#\s*(#{tag}):?\s*(.*?)\s*%>/))
+        results.update(extract_annotations_from(item, /<%\s*#[-*\s]*(#{tag}):?\s*(.*?)\s*%>/))
       end
     end

Change History

02/27/08 20:10:39 changed by phallstrom

  • summary changed from Patch to allow "rake notes" to find "# - FIXME ..." in addition to "# FIXME ..." to [PATCH] allow "rake notes" to find "# - FIXME ..." in addition to "# FIXME ...".