aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2012-04-24 10:12:14 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2012-04-24 10:12:14 -0700
commitf822024cccc5a0d8b16c6a595538f342fd0a6adb (patch)
treea31021b415925775a0aac8e06bb0beb94d1532df /railties/lib/rails
parentc873167402df3425e63ac0c9a7fb2e950dacf3eb (diff)
parent55ceced1fbebff2491c282308bcd8c7b2aef5bba (diff)
downloadrails-f822024cccc5a0d8b16c6a595538f342fd0a6adb.tar.gz
rails-f822024cccc5a0d8b16c6a595538f342fd0a6adb.tar.bz2
rails-f822024cccc5a0d8b16c6a595538f342fd0a6adb.zip
Merge pull request #5929 from FLOChip/notes
`rake notes` and `rake notes:custom` now support css, scss, and css.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/source_annotation_extractor.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/railties/lib/rails/source_annotation_extractor.rb b/railties/lib/rails/source_annotation_extractor.rb
index 4cd60fdc39..a443c73962 100644
--- a/railties/lib/rails/source_annotation_extractor.rb
+++ b/railties/lib/rails/source_annotation_extractor.rb
@@ -30,8 +30,9 @@ class SourceAnnotationExtractor
# Prints all annotations with tag +tag+ under the root directories +app+, +config+, +lib+,
# +script+, and +test+ (recursively). Only filenames with extension
- # +.builder+, +.rb+, and +.erb+ are taken into account. The +options+
- # hash is passed to each annotation's +to_s+.
+ # +.builder+, +.rb+, +.erb+, +.haml+, +.slim+, +.css+, +.scss+, +.js+, and
+ # +.coffee+ 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.
def self.enumerate(tag, options={})
@@ -53,7 +54,8 @@ class SourceAnnotationExtractor
# 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+ and +.coffee+
+ # those with extension +.builder+, +.rb+, +.erb+, +.haml+, +.slim+, +.css+,
+ # +.scss+, +.js+, and +.coffee+
# are taken into account.
def find_in(dir)
results = {}
@@ -65,6 +67,8 @@ class SourceAnnotationExtractor
results.update(find_in(item))
elsif item =~ /\.(builder|rb|coffee)$/
results.update(extract_annotations_from(item, /#\s*(#{tag}):?\s*(.*)$/))
+ elsif item =~ /\.(css|scss|js)$/
+ results.update(extract_annotations_from(item, /\/\/\s*(#{tag}):?\s*(.*)$/))
elsif item =~ /\.erb$/
results.update(extract_annotations_from(item, /<%\s*#\s*(#{tag}):?\s*(.*?)\s*%>/))
elsif item =~ /\.haml$/