Class: Dotenv::Merge::SmartMerger
- Inherits:
-
Ast::Merge::SmartMergerBase
- Object
- Ast::Merge::SmartMergerBase
- Dotenv::Merge::SmartMerger
- Includes:
- Ast::Merge::CommentLayoutEmissionSupport, Ast::Merge::TrailingGroups::DestIterate
- Defined in:
- lib/dotenv/merge/smart_merger.rb
Overview
Smart merger for dotenv files. Intelligently combines template and destination dotenv files by matching environment variable names and preserving customizations.
Instance Attribute Summary collapse
-
#corruption_handling ⇒ Object
readonly
Returns the value of attribute corruption_handling.
Instance Method Summary collapse
-
#initialize(template_content, dest_content, signature_generator: nil, preference: :destination, add_template_only_nodes: false, remove_template_missing_nodes: false, corruption_handling: :heal, freeze_token: nil, match_refiner: nil, regions: nil, region_placeholder: nil, node_typing: nil, **options) ⇒ SmartMerger
constructor
Initialize a new SmartMerger.
Constructor Details
#initialize(template_content, dest_content, signature_generator: nil, preference: :destination, add_template_only_nodes: false, remove_template_missing_nodes: false, corruption_handling: :heal, freeze_token: nil, match_refiner: nil, regions: nil, region_placeholder: nil, node_typing: nil, **options) ⇒ SmartMerger
Initialize a new SmartMerger
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/dotenv/merge/smart_merger.rb', line 53 def initialize( template_content, dest_content, signature_generator: nil, preference: :destination, add_template_only_nodes: false, remove_template_missing_nodes: false, corruption_handling: :heal, freeze_token: nil, match_refiner: nil, regions: nil, region_placeholder: nil, node_typing: nil, ** ) @remove_template_missing_nodes = remove_template_missing_nodes @corruption_handling = ::Ast::Merge::Healer.normalize_mode(corruption_handling) super( template_content, dest_content, signature_generator: signature_generator, preference: preference, add_template_only_nodes: add_template_only_nodes, remove_template_missing_nodes: remove_template_missing_nodes, freeze_token: freeze_token, match_refiner: match_refiner, regions: regions, region_placeholder: region_placeholder, node_typing: node_typing, ** ) end |
Instance Attribute Details
#corruption_handling ⇒ Object (readonly)
Returns the value of attribute corruption_handling.
31 32 33 |
# File 'lib/dotenv/merge/smart_merger.rb', line 31 def corruption_handling @corruption_handling end |