aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-05 12:31:37 -0800
committerJosé Valim <jose.valim@gmail.com>2011-12-05 12:31:37 -0800
commit38185f670e2dd4bb1ec9bf6e3397d7ad9da630ee (patch)
tree82f2ea9a19e9349223cc42a5f91a786f058543c4
parentf6cc4fd7a251490df717a85be3be335a70edaec5 (diff)
parentd2f46d053f640c568a9cea25db66c227b6dc4ec6 (diff)
downloadrails-38185f670e2dd4bb1ec9bf6e3397d7ad9da630ee.tar.gz
rails-38185f670e2dd4bb1ec9bf6e3397d7ad9da630ee.tar.bz2
rails-38185f670e2dd4bb1ec9bf6e3397d7ad9da630ee.zip
Merge pull request #3866 from ugisozols/master
Remove .rxml, .rjs and .rhtml from source annotation regexp.
-rw-r--r--railties/lib/rails/source_annotation_extractor.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/railties/lib/rails/source_annotation_extractor.rb b/railties/lib/rails/source_annotation_extractor.rb
index 1eed763aa3..a9f2180196 100644
--- a/railties/lib/rails/source_annotation_extractor.rb
+++ b/railties/lib/rails/source_annotation_extractor.rb
@@ -30,7 +30,7 @@ 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+, +.rxml+, +.rhtml+, or +.erb+ are taken into account. The +options+
+ # +.builder+, +.rb+, and +.erb+ 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.
@@ -47,7 +47,7 @@ class SourceAnnotationExtractor
# Returns a hash that maps filenames under +dirs+ (recursively) to arrays
# with their annotations. Only files with annotations are included, and only
- # those with extension +.builder+, +.rb+, +.rxml+, +.rhtml+, and +.erb+
+ # those with extension +.builder+, +.rb+, and +.erb+
# are taken into account.
def find(dirs=%w(app config lib script test))
dirs.inject({}) { |h, dir| h.update(find_in(dir)) }
@@ -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+, +.rxml+, +.rhtml+, and +.erb+
+ # those with extension +.builder+, +.rb+, and +.erb+
# are taken into account.
def find_in(dir)
results = {}
@@ -65,9 +65,9 @@ class SourceAnnotationExtractor
if File.directory?(item)
results.update(find_in(item))
- elsif item =~ /\.(builder|(r(?:b|xml|js)))$/
+ elsif item =~ /\.(builder|rb)$/
results.update(extract_annotations_from(item, /#\s*(#{tag}):?\s*(.*)$/))
- elsif item =~ /\.(rhtml|erb)$/
+ elsif item =~ /\.erb$/
results.update(extract_annotations_from(item, /<%\s*#\s*(#{tag}):?\s*(.*?)\s*%>/))
end
end