Class: Psych::Merge::ConflictResolver
- Inherits:
-
Ast::Merge::ConflictResolverBase
- Object
- Ast::Merge::ConflictResolverBase
- Psych::Merge::ConflictResolver
- Includes:
- Ast::Merge::CommentLayoutEmissionSupport, Ast::Merge::StructuredEmitterProvenanceSupport, Ast::Merge::TrailingGroups::DestIterate
- Defined in:
- lib/psych/merge/conflict_resolver.rb
Overview
Resolves conflicts between template and destination YAML content using structural signatures and configurable preferences.
Inherits from Ast::Merge::ConflictResolverBase using the :batch strategy, which resolves all conflicts at once using signature maps.
Instance Attribute Summary collapse
-
#corruption_handling ⇒ Object
readonly
Returns the value of attribute corruption_handling.
Instance Method Summary collapse
-
#initialize(template_analysis, dest_analysis, preference: :destination, add_template_only_nodes: false, add_template_only_sequence_items: nil, remove_template_missing_nodes: false, resolution_mode: :eager, corruption_handling: :heal, recursive: true, match_refiner: nil, node_typing: nil, comment_merge_policy: :preserve_destination, **options) ⇒ ConflictResolver
constructor
Creates a new ConflictResolver.
Constructor Details
#initialize(template_analysis, dest_analysis, preference: :destination, add_template_only_nodes: false, add_template_only_sequence_items: nil, remove_template_missing_nodes: false, resolution_mode: :eager, corruption_handling: :heal, recursive: true, match_refiner: nil, node_typing: nil, comment_merge_policy: :preserve_destination, **options) ⇒ ConflictResolver
Creates a new ConflictResolver
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/psych/merge/conflict_resolver.rb', line 49 def initialize(template_analysis, dest_analysis, preference: :destination, add_template_only_nodes: false, add_template_only_sequence_items: nil, remove_template_missing_nodes: false, resolution_mode: :eager, corruption_handling: :heal, recursive: true, match_refiner: nil, node_typing: nil, comment_merge_policy: :preserve_destination, **) super( strategy: :batch, preference: preference, template_analysis: template_analysis, dest_analysis: dest_analysis, add_template_only_nodes: add_template_only_nodes, remove_template_missing_nodes: remove_template_missing_nodes, recursive: recursive, match_refiner: match_refiner, ** ) @resolution_mode = resolution_mode @corruption_handling = ::Ast::Merge::Healer.normalize_mode(corruption_handling) @add_template_only_sequence_items = add_template_only_sequence_items.nil? ? add_template_only_nodes : add_template_only_sequence_items @node_typing = node_typing @comment_merge_policy = normalize_comment_merge_policy(comment_merge_policy) @emitter = Emitter.new @last_document_node_recursively_merged = false end |
Instance Attribute Details
#corruption_handling ⇒ Object (readonly)
Returns the value of attribute corruption_handling.
29 30 31 |
# File 'lib/psych/merge/conflict_resolver.rb', line 29 def corruption_handling @corruption_handling end |