| Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
|---|---|---|---|---|
| lib/trinidad/core_ext.rb | 33 | 22 | 30.30%
|
13.64%
|
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 Hash.class_eval do |
2 # Merges self with another hash, recursively. |
3 # |
4 # This code was lovingly stolen from some random gem: |
5 # http://gemjack.com/gems/tartan-0.1.1/classes/Hash.html |
6 # |
7 # Thanks to whoever made it. |
8 def deep_merge(hash) |
9 target = dup |
10 |
11 hash.keys.each do |key| |
12 if hash[key].is_a? Hash and self[key].is_a? Hash |
13 target[key] = target[key].deep_merge(hash[key]) |
14 next |
15 end |
16 |
17 target[key] = hash[key] |
18 end |
19 |
20 target |
21 end |
22 |
23 def deep_merge!(second) |
24 second.each_pair do |k,v| |
25 if self[k].is_a?(Hash) and second[k].is_a?(Hash) |
26 self[k].deep_merge!(second[k]) |
27 else |
28 self[k] = second[k] |
29 end |
30 end |
31 end |
32 |
33 end |
Generated on Wed Dec 30 22:56:48 +0100 2009 with rcov 0.9.7.1