raakt 0.5 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,189 @@
1
+ module Raakt
2
+ class Test
3
+ ISO_CODES = [
4
+ "aa",
5
+ "ab",
6
+ "ae",
7
+ "af",
8
+ "ak",
9
+ "am",
10
+ "an",
11
+ "ar",
12
+ "as",
13
+ "av",
14
+ "ay",
15
+ "az",
16
+ "ba",
17
+ "be",
18
+ "bg",
19
+ "bh",
20
+ "bi",
21
+ "bm",
22
+ "bn",
23
+ "bo",
24
+ "br",
25
+ "bs",
26
+ "ca",
27
+ "ce",
28
+ "ch",
29
+ "co",
30
+ "cr",
31
+ "cs",
32
+ "cv",
33
+ "cy",
34
+ "da",
35
+ "de",
36
+ "dv",
37
+ "dz",
38
+ "ee",
39
+ "el",
40
+ "en",
41
+ "eo",
42
+ "es",
43
+ "et",
44
+ "eu",
45
+ "fa",
46
+ "ff",
47
+ "fi",
48
+ "fj",
49
+ "fo",
50
+ "fr",
51
+ "fy",
52
+ "ga",
53
+ "gd",
54
+ "gl",
55
+ "gn",
56
+ "gu",
57
+ "gv",
58
+ "ha",
59
+ "he",
60
+ "hi",
61
+ "ho",
62
+ "hr",
63
+ "ht",
64
+ "hu",
65
+ "hy",
66
+ "hz",
67
+ "ia",
68
+ "id",
69
+ "ie",
70
+ "ig",
71
+ "ii",
72
+ "ik",
73
+ "io",
74
+ "is",
75
+ "it",
76
+ "iu",
77
+ "ja",
78
+ "jv",
79
+ "ka",
80
+ "kg",
81
+ "ki",
82
+ "kj",
83
+ "kk",
84
+ "kl",
85
+ "km",
86
+ "kn",
87
+ "ko",
88
+ "kr",
89
+ "ks",
90
+ "ku",
91
+ "kv",
92
+ "kw",
93
+ "ky",
94
+ "la",
95
+ "lb",
96
+ "lg",
97
+ "li",
98
+ "ln",
99
+ "lo",
100
+ "lt",
101
+ "lv",
102
+ "mg",
103
+ "mh",
104
+ "mi",
105
+ "mk",
106
+ "ml",
107
+ "mn",
108
+ "mo",
109
+ "mr",
110
+ "ms",
111
+ "mt",
112
+ "my",
113
+ "na",
114
+ "nb",
115
+ "nd",
116
+ "ne",
117
+ "ng",
118
+ "nl",
119
+ "nn",
120
+ "no",
121
+ "nr",
122
+ "nv",
123
+ "ny",
124
+ "oc",
125
+ "oj",
126
+ "om",
127
+ "or",
128
+ "os",
129
+ "pa",
130
+ "pi",
131
+ "pl",
132
+ "ps",
133
+ "pt",
134
+ "qu",
135
+ "rm",
136
+ "rn",
137
+ "ro",
138
+ "ru",
139
+ "rw",
140
+ "sa",
141
+ "sc",
142
+ "sd",
143
+ "se",
144
+ "sg",
145
+ "sh",
146
+ "si",
147
+ "sk",
148
+ "sl",
149
+ "sm",
150
+ "sn",
151
+ "so",
152
+ "sq",
153
+ "sr",
154
+ "ss",
155
+ "st",
156
+ "su",
157
+ "sv",
158
+ "sw",
159
+ "ta",
160
+ "te",
161
+ "tg",
162
+ "th",
163
+ "ti",
164
+ "tk",
165
+ "tl",
166
+ "tn",
167
+ "to",
168
+ "tr",
169
+ "ts",
170
+ "tt",
171
+ "tw",
172
+ "ty",
173
+ "ug",
174
+ "uk",
175
+ "ur",
176
+ "uz",
177
+ "ve",
178
+ "vi",
179
+ "vo",
180
+ "wa",
181
+ "wo",
182
+ "xh",
183
+ "yi",
184
+ "yo",
185
+ "za",
186
+ "zh",
187
+ "zu"]
188
+ end
189
+ end
data/lib/raakt.rb CHANGED
@@ -19,6 +19,7 @@
19
19
  # See the examples folder for a small script that shows how to retrieve a remote web page and perform an accessibility test on it.
20
20
  module Raakt
21
21
  require 'hpricot'
22
+ require File.dirname(__FILE__) + '/iso_language_codes'
22
23
 
23
24
  MESSAGES = {
24
25
  :missing_title => "The title element is missing. Provide a descriptive title for your document.",
@@ -46,7 +47,7 @@ module Raakt
46
47
  :missing_area_alt_text => "Missing alt text for area with id/name '%s'."
47
48
  }
48
49
 
49
- VERSION = "0.5"
50
+ VERSION = "0.5.1"
50
51
 
51
52
  class ErrorMessage
52
53
 
@@ -338,11 +339,11 @@ module Raakt
338
339
  messages = []
339
340
  unless (@doc/"html[@lang]").empty?
340
341
  #load list of valid language codes
341
- iso_lang_codes = []
342
- IO.foreach(File.dirname(__FILE__) + "/iso_language_codes.txt") { |code| iso_lang_codes << code.chomp }
342
+ #iso_lang_codes = []
343
+ #IO.foreach(File.dirname(__FILE__) + "/iso_language_codes.txt") { |code| iso_lang_codes << code.chomp }
343
344
 
344
345
  doc_main_lang_code = (@doc/"html").first["lang"].to_s.downcase
345
- unless iso_lang_codes.include?(doc_main_lang_code[0..1])
346
+ unless ISO_CODES.include?(doc_main_lang_code[0..1])
346
347
  messages << ErrorMessage.new(:wrong_lang_code, doc_main_lang_code)
347
348
  end
348
349
  end
@@ -14,4 +14,4 @@
14
14
  </tr>
15
15
  </table>
16
16
  </body>
17
- </html>
17
+ </html>
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: raakt
5
5
  version: !ruby/object:Gem::Version
6
- version: "0.5"
7
- date: 2007-02-28 00:00:00 +01:00
6
+ version: 0.5.1
7
+ date: 2007-03-03 00:00:00 +01:00
8
8
  summary: A toolkit to find accessibility issues in HTML documents.
9
9
  require_paths:
10
10
  - lib
@@ -29,6 +29,7 @@ post_install_message:
29
29
  authors:
30
30
  - Peter Krantz
31
31
  files:
32
+ - lib/iso_language_codes.rb
32
33
  - lib/raakt.rb
33
34
  - tests/areadoc1.htm
34
35
  - tests/areadoc2.htm