Class: DaisyDiff::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/daisydiff/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result_text) ⇒ Result

Returns a new instance of Result.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/daisydiff/result.rb', line 7

def initialize(result_text)
  doc = Nokogiri::HTML.parse result_text
  body = doc.css('body')
  body.css('script').remove
  body.css('div.diff-topbar').remove
  
  body.xpath("//@*[starts-with(name(.), 'on')]").remove # Remove any daisy diff ui js handler
  # body.xpath('//@id').remove
  # body.xpath('//@changeid').remove
  # body.xpath('//@previous').remove
  # body.xpath('//@next').remove

  # body.xpath('//@changes').remove

  @html = body.inner_html
end

Instance Attribute Details

#htmlObject (readonly)

Returns the value of attribute html.



5
6
7
# File 'lib/daisydiff/result.rb', line 5

def html
  @html
end