C0 code coverage information

Generated on Tue Oct 16 11:40:50 -0400 2007 with rcov 0.8.0


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.
Name Total lines Lines of code Total coverage Code coverage
lib/alexandria/ui/dialogs/alert_dialog.rb 68 43
36.8% 
14.0% 
 1 # Copyright (C) 2004-2006 Laurent Sansonetti
 2 #
 3 # Alexandria is free software; you can redistribute it and/or
 4 # modify it under the terms of the GNU General Public License as
 5 # published by the Free Software Foundation; either version 2 of the
 6 # License, or (at your option) any later version.
 7 #
 8 # Alexandria is distributed in the hope that it will be useful,
 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public
14 # License along with Alexandria; see the file COPYING.  If not,
15 # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 # Boston, MA 02111-1307, USA.
17 
18 # HIG compliant error dialog boxes
19 module Alexandria
20 module UI
21     class AlertDialog < Gtk::Dialog
22         def initialize(parent, title, stock_icon, buttons, message=nil)
23             super("", parent, Gtk::Dialog::DESTROY_WITH_PARENT, *buttons)
24 
25             self.border_width = 6
26             self.resizable = false
27             self.has_separator = false
28             self.vbox.spacing = 12
29 
30             hbox = Gtk::HBox.new(false, 12)
31             hbox.border_width = 6
32             self.vbox.pack_start(hbox)
33 
34             image = Gtk::Image.new(stock_icon,
35                                    Gtk::IconSize::DIALOG)
36             image.set_alignment(0.5, 0)
37             hbox.pack_start(image)
38 
39             vbox = Gtk::VBox.new(false, 6)
40             hbox.pack_start(vbox)
41 
42             label = Gtk::Label.new
43             label.set_alignment(0, 0)
44             label.wrap = label.selectable = true
45             label.markup = "<b><big>#{title}</big></b>"
46             vbox.pack_start(label)
47 
48             if message
49                 label = Gtk::Label.new
50                 label.set_alignment(0, 0)
51                 label.wrap = label.selectable = true
52                 label.markup = message.strip
53                 vbox.pack_start(label)
54             end
55         end
56     end
57 
58     class ErrorDialog < AlertDialog
59         def initialize(parent, title, message=nil)
60             super(parent, title, Gtk::Stock::DIALOG_ERROR, 
61                   [[Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK]], message)
62             self.default_response = Gtk::Dialog::RESPONSE_OK
63             show_all and run
64             destroy
65         end
66     end
67 end
68 end

Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.

Valid XHTML 1.0! Valid CSS!