Class: HTMLDOMDiff::Differ

Inherits:
Object
  • Object
show all
Defined in:
lib/html-dom-diff/differ.rb

Instance Method Summary collapse

Instance Method Details

#diff(ldoc, rdoc) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/html-dom-diff/differ.rb', line 15

def diff(ldoc, rdoc)
  reset ldoc, rdoc

  match_by_ids ldoc, rdoc
  prep_with @lsignatures, ldoc
  prep_with @rsignatures, rdoc

  perform_initial_top_down_matching [ldoc], [rdoc]

  @matchqueue.push(rdoc)
  perform_initial_matching

  match_bottom_up ldoc
  match_top_down  ldoc

  @builder
end

#diff_fragments(left, right) ⇒ Object



11
12
13
# File 'lib/html-dom-diff/differ.rb', line 11

def diff_fragments(left, right)
  diff parse_fragments(left).child, parse_fragments(right).child
end

#diff_strings(left, right) ⇒ Object



7
8
9
# File 'lib/html-dom-diff/differ.rb', line 7

def diff_strings(left, right)
  diff parse(left).root, parse(right).root
end