aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-07 10:14:26 -0800
committerJosé Valim <jose.valim@gmail.com>2011-12-07 10:14:26 -0800
commit6867212261244f35877897854c46abe287b087a0 (patch)
tree8e04985198601dddd16cd508950b5921c9663c12 /railties/lib/rails
parent0df2ef3ef4db161524d0d5eb275e41032b60db00 (diff)
parentc6e6ce437cc370db9c395c0ffc852eee89482214 (diff)
downloadrails-6867212261244f35877897854c46abe287b087a0.tar.gz
rails-6867212261244f35877897854c46abe287b087a0.tar.bz2
rails-6867212261244f35877897854c46abe287b087a0.zip
Merge pull request #3889 from kielkowicz/master
Annotating haml and slim file
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/source_annotation_extractor.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/rails/source_annotation_extractor.rb b/railties/lib/rails/source_annotation_extractor.rb
index a9f2180196..a296473632 100644
--- a/railties/lib/rails/source_annotation_extractor.rb
+++ b/railties/lib/rails/source_annotation_extractor.rb
@@ -55,7 +55,7 @@ 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+, and +.erb+
+ # those with extension +.builder+, +.rb+, +.erb+, +.haml+ and +.slim+
# are taken into account.
def find_in(dir)
results = {}
@@ -69,6 +69,10 @@ class SourceAnnotationExtractor
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$/
+ results.update(extract_annotations_from(item, /-\s*#\s*(#{tag}):?\s*(.*)$/))
+ elsif item =~ /\.slim$/
+ results.update(extract_annotations_from(item, /\/\s*\s*(#{tag}):?\s*(.*)$/))
end
end