aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/source_annotation_extractor.rb
diff options
context:
space:
mode:
authortwinturbo <me@broadcastingadam.com>2012-04-28 22:33:11 -0700
committertwinturbo <me@broadcastingadam.com>2012-04-28 22:33:11 -0700
commitd7532c189f26e008fc6ef50336ed5e8168b8221c (patch)
tree681436aa5d80ed5e4c9a867ccc891eab6852f124 /railties/lib/rails/source_annotation_extractor.rb
parent2c136ae0543ea53dcb3a3ef9372b216b54d66172 (diff)
parent6659252d9f0e6d77bee268adf587e03cfeb8f9ad (diff)
downloadrails-d7532c189f26e008fc6ef50336ed5e8168b8221c.tar.gz
rails-d7532c189f26e008fc6ef50336ed5e8168b8221c.tar.bz2
rails-d7532c189f26e008fc6ef50336ed5e8168b8221c.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'railties/lib/rails/source_annotation_extractor.rb')
-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$/