C0 code coverage information

Generated on Sat Feb 02 17:44:28 +0100 2008 with rcov 0.8.1.2


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/ramaze/snippets/kernel/constant.rb 26 7
100.0% 
100.0% 
 1 #          Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
 2 # All files in this distribution are subject to the terms of the Ruby license.
 3 
 4 # Extensions for Kernel
 5 
 6 module Kernel
 7   # Original from Trans (Facets 1.4.5)
 8   # This is similar to +Module#const_get+ but is accessible at all levels,
 9   # and, unlike +const_get+, can handle module hierarchy.
10   #
11   #   constant("Fixnum")                  # -> Fixnum
12   #   constant(:Fixnum)                   # -> Fixnum
13   #
14   #   constant("Process::Sys")            # -> Process::Sys
15   #   constant("Regexp::MULTILINE")       # -> 4
16   #
17   #   require 'test/unit'
18   #   Test.constant("Unit::Assertions")   # -> Test::Unit::Assertions
19   #   Test.constant("::Test::Unit")       # -> Test::Unit
20   #
21   def constant(const)
22     const = const.to_s.dup
23     base = const.sub!(/^::/, '') ? Object : ( self.kind_of?(Module) ? self : self.class )
24     const.split(/::/).inject(base){ |mod, name| mod.const_get(name) }
25   end
26 end

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

Valid XHTML 1.0! Valid CSS!