Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
---|---|---|---|---|
lib/jldrill/views/gtk/FileProgress.rb | 55 | 43 | 43.64%
|
30.23%
|
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 'jldrill/contexts/FileProgressContext' |
2 require 'jldrill/views/gtk/widgets/ProgressBar' |
3 require 'gtk2' |
4 |
5 module JLDrill::Gtk |
6 |
7 class FileProgress < JLDrill::FileProgressContext::FileProgress |
8 |
9 attr_reader :progressWindow |
10 |
11 def initialize(context) |
12 super(context) |
13 @progressBar = ProgressBar.new(self) |
14 @progressBar.expandWidgetWidth |
15 @block = nil |
16 @id = nil |
17 end |
18 |
19 def getWidget |
20 @progressBar |
21 end |
22 |
23 def filename |
24 return File.basename(@context.getFilename) |
25 end |
26 |
27 def update(fraction) |
28 @progressBar.update(fraction) |
29 end |
30 |
31 def run |
32 if @block.call |
33 stop |
34 end |
35 return true |
36 end |
37 |
38 def stop |
39 if !@id.nil? |
40 Gtk.idle_remove(@id) |
41 @id = nil |
42 @block = nil |
43 end |
44 end |
45 |
46 def idle_add(&block) |
47 if @block.nil? && @id.nil? |
48 @block = block |
49 @id = Gtk.idle_add do run end |
50 end |
51 end |
52 end |
53 |
54 end |
55 |
Generated on Mon May 23 16:17:46 +0900 2011 with rcov 0.9.8