This method is deprecated or moved on the latest stable version.
The last existing version (v7.0.0) is shown here.
extract_annotations_from(file, pattern)
public
If file is the filename of a file that contains annotations this
method returns a hash with a single entry that maps file to an
array of its annotations. Otherwise it returns an empty hash.
# File railties/lib/rails/source_annotation_extractor.rb, line 125
def extract_annotations_from(file, pattern)
lineno = 0
result = File.readlines(file, encoding: Encoding::BINARY).inject([]) do |list, line|
lineno += 1
next list unless line =~ pattern
list << Annotation.new(lineno, $1, $2)
end
result.empty? ? {} : { file => result }
end