Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
---|---|---|---|---|
lib/twiddler/rendering.rb | 23 | 20 | 100.00%
|
100.00%
|
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 require 'erb' |
2 |
3 module Twiddler |
4 class Rendering |
5 def initialize(config) |
6 @config = config |
7 end |
8 |
9 def embed(name) |
10 path = template_path(name) |
11 template = File::read(path) |
12 erb = ERB.new(template, nil, "%>") |
13 erb.filename = path |
14 mod = erb.def_module("render") |
15 @config.extend(mod) |
16 end |
17 |
18 def template_path(name) |
19 path = File::expand_path("../../templates/#{name}.erb", |
20 File::dirname(__FILE__)) |
21 end |
22 end |
23 end |
Generated on Tue May 03 12:22:31 -0700 2011 with rcov 0.9.7.1