From 06129c0e3fb0f20df6c0aa1509b151c51e71d180 Mon Sep 17 00:00:00 2001 From: "Brent J. Nordquist" Date: Mon, 8 Oct 2012 06:41:31 -0500 Subject: Add .rake to `rake notes` and `rake notes:custom` --- railties/lib/rails/source_annotation_extractor.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'railties/lib/rails/source_annotation_extractor.rb') diff --git a/railties/lib/rails/source_annotation_extractor.rb b/railties/lib/rails/source_annotation_extractor.rb index 31e34023c0..3474b02af4 100644 --- a/railties/lib/rails/source_annotation_extractor.rb +++ b/railties/lib/rails/source_annotation_extractor.rb @@ -32,9 +32,9 @@ class SourceAnnotationExtractor end # Prints all annotations with tag +tag+ under the root directories +app+, +config+, +lib+, - # +script+, and +test+ (recursively). Only filenames with extension - # +.builder+, +.rb+, +.erb+, +.haml+, +.slim+, +.css+, +.scss+, +.js+, and - # +.coffee+ are taken into account. The +options+ hash is passed to each + # +script+, and +test+ (recursively). Filenames with extension + # +.builder+, +.rb+, +.erb+, +.haml+, +.slim+, +.css+, +.scss+, +.js+, + # +.coffee+, and +.rake+ are taken into account. The +options+ hash is passed to each # annotation's +to_s+. # # This class method is the single entry point for the rake tasks. @@ -56,9 +56,9 @@ class SourceAnnotationExtractor end # Returns a hash that maps filenames under +dir+ (recursively) to arrays - # with their annotations. Only files with annotations are included, and only - # those with extension +.builder+, +.rb+, +.erb+, +.haml+, +.slim+, +.css+, - # +.scss+, +.js+, and +.coffee+ + # with their annotations. Only files with annotations are included. Files + # with extension +.builder+, +.rb+, +.erb+, +.haml+, +.slim+, +.css+, + # +.scss+, +.js+, +.coffee+, and +.rake+ # are taken into account. def find_in(dir) results = {} @@ -68,7 +68,7 @@ class SourceAnnotationExtractor if File.directory?(item) results.update(find_in(item)) - elsif item =~ /\.(builder|rb|coffee)$/ + elsif item =~ /\.(builder|rb|coffee|rake)$/ results.update(extract_annotations_from(item, /#\s*(#{tag}):?\s*(.*)$/)) elsif item =~ /\.(css|scss|js)$/ results.update(extract_annotations_from(item, /\/\/\s*(#{tag}):?\s*(.*)$/)) -- cgit v1.2.3