Class: AnnotateRb::ModelAnnotator::RelatedFilesListBuilder
- Inherits:
-
Object
- Object
- AnnotateRb::ModelAnnotator::RelatedFilesListBuilder
- Defined in:
- lib/annotate_rb/model_annotator/related_files_list_builder.rb
Overview
Given a model file and options, this class will return a list of related files (e.g. fixture, controllers, etc) to also annotate
Constant Summary collapse
- RELATED_TYPES =
%w[test fixture factory serializer scaffold controller helper].freeze
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(file, model_name, table_name, options) ⇒ RelatedFilesListBuilder
constructor
A new instance of RelatedFilesListBuilder.
Constructor Details
#initialize(file, model_name, table_name, options) ⇒ RelatedFilesListBuilder
Returns a new instance of RelatedFilesListBuilder.
10 11 12 13 14 15 |
# File 'lib/annotate_rb/model_annotator/related_files_list_builder.rb', line 10 def initialize(file, model_name, table_name, ) @file = file @model_name = model_name @table_name = table_name = end |
Instance Method Details
#build ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/annotate_rb/model_annotator/related_files_list_builder.rb', line 17 def build @list = [] if ![:exclude_tests] if ![:exclude_fixtures] if ![:exclude_factories] if ![:exclude_serializers] if ![:exclude_scaffolds] if ![:exclude_controllers] if ![:exclude_helpers] if ![:active_admin] add_additional_file_patterns if ![:additional_file_patterns].present? @list end |