Class: Rbs::Merge::FileAligner

Inherits:
Ast::Merge::FileAlignerBase
  • Object
show all
Defined in:
lib/rbs/merge/file_aligner.rb

Overview

Aligns declarations between template and destination files by matching signatures. Produces alignment information used by SmartMerger to combine files.

Examples:

Basic usage

aligner = FileAligner.new(template_analysis, dest_analysis)
alignment = aligner.align
alignment.each do |entry|
  case entry[:type]
  when :match
    # Both files have this declaration
  when :template_only
    # Only in template
  when :dest_only
    # Only in destination
  end
end

Instance Attribute Summary collapse

Instance Attribute Details

#dest_analysisFileAnalysis (readonly)

Returns Destination file analysis.

Returns:



26
27
28
# File 'lib/rbs/merge/file_aligner.rb', line 26

def dest_analysis
  @dest_analysis
end

#template_analysisFileAnalysis (readonly)

Returns Template file analysis.

Returns:



23
24
25
# File 'lib/rbs/merge/file_aligner.rb', line 23

def template_analysis
  @template_analysis
end