C0 code coverage information
Generated on Tue Oct 16 11:40:53 -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.
1 # Copyright (C) 2005-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 class Time
19 def self.parse(*arg)
20 date = nil
21 begin
22 date = super
23 rescue ArgumentError
24 if arg.length == 1
25 # Handle the 'XXXX' case (year-only)
26 if /^(\d\d\d\d)$/.match(arg.first)
27 date = super("01 January, %s" % arg.first)
28
29 # Handle the 'XXXX, YYYY' (month name and year)
30 elsif /^(\c+)\s*,\s*(\d\d\d\d)$/.match(arg.first)
31 begin
32 date = super("01 " + arg.first)
33 rescue ArgumentError
34 end
35 end
36 end
37 end
38 return date
39 end
40 end
41
42 begin
43 require 'glib2'
44
45 class String
46 def convert(charset_from, charset_to)
47 GLib.convert(self, charset_from, charset_to)
48 end
49 end
50
51 rescue LoadError
52
53 # We assume that Ruby/Cocoa is loaded there
54
55 #require 'iconv'
56
57 class String
58 def to_utf8_nsstring
59 # This should be writen in ObjC in order to catch the ObjC exception if the
60 # string could not be converted to UTF8.
61 (OSX::NSString.stringWithUTF8String(self) or self)
62 end
63
64 def convert(charset_from, charset_to)
65 # Do nothing for the moment...
66 self
67 end
68 =begin
69 return OSX::NSString.stringWithUTF8String(self)
70 x = Iconv.iconv(charset_to, charset_from, self).first
71 p "#{self} -> #{x}"
72 return x
73 #p charset_from, charset_to
74 #return self
75
76 from = OSX::NSString.alloc.initWithString(self)
77 encoding = charset_to.nsencoding
78 encoding = OSX::NSUnicodeStringEncoding
79 data = from.dataUsingEncoding(encoding)
80 s = OSX::NSString.alloc.initWithData_encoding(data, encoding).to_s
81 s
82 #self
83 end
84 =end
85 end
86
87 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.