Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
---|---|---|---|---|
lib/asir/code_more.rb | 41 | 35 | 26.83%
|
14.29%
|
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 module ASIR |
2 # !SLIDE |
3 # Code More |
4 # |
5 # Help encode/decode and resolve receiver class. |
6 module CodeMore |
7 include ObjectResolving # resolve_object() |
8 |
9 def encode_more! |
10 obj = nil |
11 if @block && ! ::String === @block_code |
12 obj ||= self.dup |
13 obj.block_code = obj.block.to_ruby if obj.block.respond_to(:to_ruby) # ruby2ruby |
14 obj.block = nil |
15 end |
16 unless ::String === @receiver_class |
17 obj ||= self.dup |
18 obj.receiver = @receiver.name if ::Module === @receiver |
19 obj.receiver_class = @receiver_class.name |
20 if resp = obj.response and resp.request == self |
21 resp.request = obj |
22 end |
23 end |
24 obj || self |
25 end |
26 |
27 def decode_more! |
28 if ::String === @block_code |
29 @block ||= eval(@block_code); @block_code = nil |
30 end |
31 if ::String === @receiver_class |
32 @receiver_class = resolve_object(@receiver_class) |
33 @receiver = resolve_object(@receiver) if ::Module === @receiver_class |
34 unless @receiver_class === @receiver |
35 raise Error, "receiver #{@receiver.class.name} is not a #{@receiver_class}" |
36 end |
37 end |
38 self |
39 end |
40 end |
41 end |
Generated on Fri Jan 27 17:37:46 -0600 2012 with rcov 0.9.8