10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/annotate_rb/model_annotator/project_annotator.rb', line 10
def annotate
project_model_files = model_files
annotation_instructions = project_model_files.map do |path, filename|
file = File.join(path, filename)
if AnnotationDecider.new(file, @options).annotate?
_instructions = build_instructions_for_file(file)
end
end.flatten.compact
annotated = annotation_instructions.map do |instruction|
if SingleFileAnnotator.call_with_instructions(instruction)
instruction.file
end
end.compact
if annotated.empty?
puts "Model files unchanged."
else
puts "Annotated (#{annotated.length}): #{annotated.join(", ")}"
end
end
|