Class: Coopy::TableDiff
- Inherits:
-
Object
- Object
- Coopy::TableDiff
- Defined in:
- lib/lib/coopy/table_diff.rb
Instance Method Summary collapse
- #get_comparison_state ⇒ Object
- #has_difference ⇒ Object
- #has_schema_difference ⇒ Object
- #hilite(output) ⇒ Object
- #hilite_with_nesting(output) ⇒ Object
-
#initialize(align, flags) ⇒ TableDiff
constructor
A new instance of TableDiff.
- #is_nested ⇒ Object
- #set_cell_builder(builder) ⇒ Object
Constructor Details
#initialize(align, flags) ⇒ TableDiff
7 8 9 10 11 12 |
# File 'lib/lib/coopy/table_diff.rb', line 7 def initialize(align,flags) @align = align @flags = flags @builder = nil @preserve_columns = false end |
Instance Method Details
#get_comparison_state ⇒ Object
1116 1117 1118 1119 |
# File 'lib/lib/coopy/table_diff.rb', line 1116 def get_comparison_state return nil if @align == nil @align.comp end |
#has_difference ⇒ Object
1104 1105 1106 |
# File 'lib/lib/coopy/table_diff.rb', line 1104 def has_difference @diff_found end |
#has_schema_difference ⇒ Object
1108 1109 1110 |
# File 'lib/lib/coopy/table_diff.rb', line 1108 def has_schema_difference @schema_diff_found end |
#hilite(output) ⇒ Object
955 956 957 958 |
# File 'lib/lib/coopy/table_diff.rb', line 955 def hilite(output) output = ::Coopy::Coopy.tablify(output) self.hilite_single(output) end |
#hilite_with_nesting(output) ⇒ Object
1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 |
# File 'lib/lib/coopy/table_diff.rb', line 1077 def hilite_with_nesting(output) base = output.add("base") result = self.hilite_single(base) return false if !result return true if @align.comp == nil order = @align.comp.child_order return true if order == nil output.alignment = @align begin _g = 0 while(_g < order.length) name = order[_g] _g+=1 child = @align.comp.children[name] alignment = child.alignment if alignment.is_marked_as_identical @align.comp.children[name] = nil next end td = ::Coopy::TableDiff.new(alignment,@flags) child_output = output.add(name) result = result && td.hilite_single(child_output) end end result end |
#is_nested ⇒ Object
1112 1113 1114 |
# File 'lib/lib/coopy/table_diff.rb', line 1112 def is_nested @nesting_present end |
#set_cell_builder(builder) ⇒ Object
59 60 61 |
# File 'lib/lib/coopy/table_diff.rb', line 59 def set_cell_builder(builder) @builder = builder end |