instance method
find_in
Ruby on Rails 5.2.8.1
Since v2.2.3 Last seen in v5.2.8.1Signature
find_in(dir)
Returns a hash that maps filenames under dir (recursively) to arrays with their annotations. Only files with annotations are included. Files with extension .builder, .rb, .rake, .yml, .yaml, .ruby, .css, .js and .erb are taken into account.
Parameters
-
dirreq
Source
# File railties/lib/rails/source_annotation_extractor.rb, line 93
def find_in(dir)
results = {}
Dir.glob("#{dir}/*") do |item|
next if File.basename(item)[0] == ?.
if File.directory?(item)
results.update(find_in(item))
else
extension = Annotation.extensions.detect do |regexp, _block|
regexp.match(item)
end
if extension
pattern = extension.last.call(tag)
results.update(extract_annotations_from(item, pattern)) if pattern
end
end
end
results
end
Defined in railties/lib/rails/source_annotation_extractor.rb line 93
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in SourceAnnotationExtractor