Class: AnnotateRb::ModelAnnotator::ProjectAnnotator
- Inherits:
-
Object
- Object
- AnnotateRb::ModelAnnotator::ProjectAnnotator
- Defined in:
- lib/annotate_rb/model_annotator/project_annotator.rb
Instance Method Summary collapse
- #annotate ⇒ Object
-
#initialize(options) ⇒ ProjectAnnotator
constructor
A new instance of ProjectAnnotator.
Constructor Details
#initialize(options) ⇒ ProjectAnnotator
Returns a new instance of ProjectAnnotator.
6 7 8 |
# File 'lib/annotate_rb/model_annotator/project_annotator.rb', line 6 def initialize() @options = end |
Instance Method Details
#annotate ⇒ Object
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 |