File: document.rb

package info (click to toggle)
ruby-nokogiri-diff 0.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 192 kB
  • sloc: ruby: 271; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 543 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require 'nokogiri/diff/xml/node'

class Nokogiri::XML::Document < Nokogiri::XML::Node

  #
  # Overrides `tdiff` to only compare the child nodes of the document.
  #
  def tdiff(tree,&block)
    return enum_for(__method__,tree) unless block

    tdiff_recursive(tree,&block)
    return self
  end

  #
  # Overrides `tdiff_unordered` to only compare the child nodes of the document.
  #
  def tdiff_unordered(tree,&block)
    return enum_for(__method__,tree) unless block

    tdiff_recursive_unordered(tree,&block)
    return self
  end

end