C0 code coverage information
Generated on Sat Feb 02 17:44:29 +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.
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 module Ramaze
5
6 # Gives you back the file, line and method of the caller number i
7 # Example:
8 # Ramaze.caller_info(1)
9 # # => ['/usr/lib/ruby/1.8/irb/workspace.rb', '52', 'irb_binding']
10
11 def self.caller_info(i = 1)
12 file, line, meth = *parse_backtrace(caller[i])
13 end
14
15 # Parses one line of backtrace and tries to extract as much information
16 # as possible.
17 #
18 # Example:
19 # line = "/web/repo/ramaze/lib/ramaze/dispatcher.rb:105:in `respond'"
20 # Ramaze.parse_backtrace(line)
21 # #=> ["/web/repo/ramaze/lib/ramaze/dispatcher.rb", "105", "respond"]
22
23 def self.parse_backtrace(line = '')
24 full = line.scan(/(.*?):(\d+):in `(.*?)'/).first
25 return full if full and full.all?
26 partial = line.scan(/(.*?):(\d+)/).first
27 return partial if partial and partial.all?
28 line
29 end
30 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.1.2.