C0 code coverage information

Generated on Fri Jul 11 15:55:29 -0700 2008 with rcov 0.7.0


Code reported as executed by Ruby looks like this...
and this: this line is also marked as covered.
Lines considered as run by rcov, but not reported by Ruby, look like this,
and this: these lines were inferred by rcov (using simple heuristics).
Finally, here's a line marked as not executed.
Name Total lines Lines of code Total coverage Code coverage
lib/openid/yadis/parsehtml.rb 44 34
88.6% 
85.3% 
 1 require "openid/yadis/htmltokenizer"
 2 require 'cgi'
 3 
 4 module OpenID
 5   module Yadis
 6     def Yadis.html_yadis_location(html)
 7       parser = HTMLTokenizer.new(html)
 8 
 9       # to keep track of whether or not we are in the head element
10       in_head = false
11 
12       begin
13         while el = parser.getTag('head', '/head', 'meta', 'body', '/body',
14                                  'html', 'script')
15 
16           # we are leaving head or have reached body, so we bail
17           return nil if ['/head', 'body', '/body'].member?(el.tag_name)
18 
19           if el.tag_name == 'head'
20             unless el.to_s[-2] == ?/ # tag ends with a /: a short tag
21               in_head = true
22             end
23           end
24           next unless in_head
25 
26           if el.tag_name == 'script'
27             unless el.to_s[-2] == ?/ # tag ends with a /: a short tag
28               parser.getTag('/script')
29             end
30           end
31 
32           return nil if el.tag_name == 'html'
33 
34           if el.tag_name == 'meta' and (equiv = el.attr_hash['http-equiv'])
35             if ['x-xrds-location','x-yadis-location'].member?(equiv.downcase)
36               return CGI::unescapeHTML(el.attr_hash['content'])
37             end
38           end
39         end
40       rescue HTMLTokenizerError # just stop parsing if there's an error
41       end
42     end
43   end
44 end

Generated using the rcov code coverage analysis tool for Ruby version 0.7.0.

Valid XHTML 1.0! Valid CSS!