Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
---|---|---|---|---|
lib/jldrill/views/gtk/widgets/SelectorWindow.rb | 48 | 40 | 91.67%
|
90.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 'Context/Gtk/Widget' |
2 require 'jldrill/contexts/GetFilenameContext' |
3 require 'gtk2' |
4 |
5 module JLDrill::Gtk |
6 class SelectorWindow < Gtk::FileChooserDialog |
7 include Context::Gtk::Widget |
8 |
9 attr_reader :chosenFilename, :chosenDirectory |
10 attr_writer :chosenFilename, :chosenDirectory |
11 |
12 def initialize(type) |
13 @chosenFilename = nil |
14 @chosenDirectory = nil |
15 if (type == JLDrill::GetFilenameContext::SAVE) |
16 super("Save File", nil, |
17 Gtk::FileChooser::ACTION_SAVE, nil, |
18 [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL], |
19 [Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT]) |
20 else |
21 super("Open File", nil, |
22 Gtk::FileChooser::ACTION_OPEN, nil, |
23 [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL], |
24 [Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT]) |
25 end |
26 end |
27 |
28 # The following 2 routines are only here because I couldn't |
29 # figure out a way to set the filename and folder in my tests. |
30 def getFilename |
31 self.filename |
32 end |
33 |
34 def getCurrentFolder |
35 self.current_folder |
36 end |
37 |
38 def execute |
39 if run == Gtk::Dialog::RESPONSE_ACCEPT |
40 @chosenFilename = getFilename |
41 @chosenDirectory = getCurrentFolder |
42 return @chosenFilename |
43 else |
44 return nil |
45 end |
46 end |
47 end |
48 end |
Generated on Mon May 23 16:17:47 +0900 2011 with rcov 0.9.8