Browse files

Remove .rxml, .rjs and .rhtml from source annotation regexp.

  • Loading branch information...
1 parent f6cc4fd commit d2f46d053f640c568a9cea25db66c227b6dc4ec6 @ugisozols ugisozols committed Dec 5, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 railties/lib/rails/source_annotation_extractor.rb
View
10 railties/lib/rails/source_annotation_extractor.rb
@@ -30,7 +30,7 @@ def to_s(options={})
# 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,15 +47,15 @@ def initialize(tag)
# 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)) }
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+, +.rxml+, +.rhtml+, and +.erb+
+ # those with extension +.builder+, +.rb+, and +.erb+
# are taken into account.
def find_in(dir)
results = {}
@@ -65,9 +65,9 @@ def find_in(dir)
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

0 comments on commit d2f46d0

Please sign in to comment.