Geminstaller C0 Coverage Information - RCov

spec/fixture/rubygems_dist/rubygems-trunk/lib/rubygems/text.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
spec/fixture/rubygems_dist/rubygems-trunk/lib/rubygems/text.rb 30 17
100.00%
100.00%

Key

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.

Coverage Details

1 require 'rubygems'
2 
3 ##
4 # A collection of text-wrangling methods
5 
6 module Gem::Text
7 
8   ##
9   # Wraps +text+ to +wrap+ characters and optionally indents by +indent+
10   # characters
11 
12   def format_text(text, wrap, indent=0)
13     result = []
14     work = text.dup
15 
16     while work.length > wrap do
17       if work =~ /^(.{0,#{wrap}})[ \n]/ then
18         result << $1
19         work.slice!(0, $&.length)
20       else
21         result << work.slice!(0, wrap)
22       end
23     end
24 
25     result << work if work.length.nonzero?
26     result.join("\n").gsub(/^/, " " * indent)
27   end
28 
29 end
30 

Generated on Mon May 10 23:40:29 -0700 2010 with rcov 0.9.8