mods_display 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +16 -0
  3. data/.rubocop_todo.yml +60 -0
  4. data/.travis.yml +2 -2
  5. data/Rakefile +10 -2
  6. data/lib/mods_display.rb +42 -42
  7. data/lib/mods_display/configuration.rb +69 -67
  8. data/lib/mods_display/configuration/access_condition.rb +17 -13
  9. data/lib/mods_display/configuration/base.rb +27 -24
  10. data/lib/mods_display/configuration/format.rb +8 -4
  11. data/lib/mods_display/configuration/genre.rb +8 -4
  12. data/lib/mods_display/configuration/imprint.rb +12 -7
  13. data/lib/mods_display/configuration/name.rb +8 -4
  14. data/lib/mods_display/configuration/note.rb +8 -4
  15. data/lib/mods_display/configuration/related_item.rb +8 -4
  16. data/lib/mods_display/configuration/subject.rb +11 -9
  17. data/lib/mods_display/configuration/title.rb +8 -4
  18. data/lib/mods_display/controller_extension.rb +24 -24
  19. data/lib/mods_display/country_codes.rb +385 -384
  20. data/lib/mods_display/fields/abstract.rb +7 -6
  21. data/lib/mods_display/fields/access_condition.rb +55 -55
  22. data/lib/mods_display/fields/audience.rb +7 -6
  23. data/lib/mods_display/fields/cartographics.rb +15 -14
  24. data/lib/mods_display/fields/collection.rb +32 -17
  25. data/lib/mods_display/fields/contact.rb +15 -13
  26. data/lib/mods_display/fields/contents.rb +7 -6
  27. data/lib/mods_display/fields/description.rb +21 -21
  28. data/lib/mods_display/fields/field.rb +164 -109
  29. data/lib/mods_display/fields/format.rb +36 -33
  30. data/lib/mods_display/fields/genre.rb +12 -11
  31. data/lib/mods_display/fields/identifier.rb +34 -34
  32. data/lib/mods_display/fields/imprint.rb +258 -214
  33. data/lib/mods_display/fields/language.rb +18 -16
  34. data/lib/mods_display/fields/location.rb +27 -26
  35. data/lib/mods_display/fields/name.rb +113 -118
  36. data/lib/mods_display/fields/note.rb +33 -34
  37. data/lib/mods_display/fields/related_item.rb +64 -66
  38. data/lib/mods_display/fields/resource_type.rb +13 -11
  39. data/lib/mods_display/fields/sub_title.rb +6 -4
  40. data/lib/mods_display/fields/subject.rb +92 -90
  41. data/lib/mods_display/fields/title.rb +54 -49
  42. data/lib/mods_display/fields/values.rb +7 -8
  43. data/lib/mods_display/html.rb +117 -96
  44. data/lib/mods_display/model_extension.rb +17 -16
  45. data/lib/mods_display/relator_codes.rb +269 -267
  46. data/lib/mods_display/version.rb +1 -1
  47. data/mods_display.gemspec +13 -12
  48. data/spec/configuration/access_condition_spec.rb +5 -5
  49. data/spec/configuration/base_spec.rb +24 -24
  50. data/spec/fields/abstract_spec.rb +24 -14
  51. data/spec/fields/access_condition_spec.rb +80 -55
  52. data/spec/fields/audience_spec.rb +15 -12
  53. data/spec/fields/cartographics_spec.rb +17 -18
  54. data/spec/fields/collection_spec.rb +65 -19
  55. data/spec/fields/contact_spec.rb +11 -9
  56. data/spec/fields/contents_spec.rb +15 -12
  57. data/spec/fields/description_spec.rb +40 -22
  58. data/spec/fields/format_spec.rb +28 -18
  59. data/spec/fields/genre_spec.rb +18 -16
  60. data/spec/fields/identifier_spec.rb +46 -34
  61. data/spec/fields/imprint_spec.rb +151 -125
  62. data/spec/fields/language_spec.rb +36 -20
  63. data/spec/fields/location_spec.rb +43 -27
  64. data/spec/fields/name_spec.rb +92 -92
  65. data/spec/fields/note_spec.rb +53 -40
  66. data/spec/fields/related_item_spec.rb +42 -40
  67. data/spec/fields/resource_type_spec.rb +20 -14
  68. data/spec/fields/sub_title_spec.rb +11 -9
  69. data/spec/fields/subject_spec.rb +61 -56
  70. data/spec/fields/title_spec.rb +53 -40
  71. data/spec/fixtures/access_condition_fixtures.rb +50 -0
  72. data/spec/fixtures/cartographics_fixtures.rb +1 -1
  73. data/spec/fixtures/imprint_fixtures.rb +49 -1
  74. data/spec/fixtures/name_fixtures.rb +195 -2
  75. data/spec/fixtures/related_item_fixtures.rb +107 -0
  76. data/spec/fixtures/subjects_fixtures.rb +15 -2
  77. data/spec/fixtures/title_fixtures.rb +101 -0
  78. data/spec/integration/configuration_spec.rb +23 -20
  79. data/spec/integration/html_spec.rb +40 -29
  80. data/spec/integration/installation_spec.rb +14 -14
  81. data/spec/spec_helper.rb +5 -8
  82. metadata +25 -3
@@ -1,5 +1,9 @@
1
- class ModsDisplay::Configuration::Format < ModsDisplay::Configuration::Base
2
- def delimiter delimiter="<br/>"
3
- @delimiter ||= delimiter
1
+ module ModsDisplay
2
+ class Configuration
3
+ class Format < Base
4
+ def delimiter(delimiter = '<br/>')
5
+ @delimiter ||= delimiter
6
+ end
7
+ end
4
8
  end
5
- end
9
+ end
@@ -1,5 +1,9 @@
1
- class ModsDisplay::Configuration::Genre < ModsDisplay::Configuration::Base
2
- def delimiter delimiter="<br/>"
3
- @delimiter ||= delimiter
1
+ module ModsDisplay
2
+ class Configuration
3
+ class Genre < Base
4
+ def delimiter(delimiter = '<br/>')
5
+ @delimiter ||= delimiter
6
+ end
7
+ end
4
8
  end
5
- end
9
+ end
@@ -1,8 +1,13 @@
1
- class ModsDisplay::Configuration::Imprint < ModsDisplay::Configuration::Base
2
- def full_date_format full_date_format="%B %d, %Y"
3
- @full_date_format ||= full_date_format
1
+ module ModsDisplay
2
+ class Configuration
3
+ class Imprint < Base
4
+ def full_date_format(full_date_format = '%B %d, %Y')
5
+ @full_date_format ||= full_date_format
6
+ end
7
+
8
+ def short_date_format(short_date_format = '%B %Y')
9
+ @short_date_format ||= short_date_format
10
+ end
11
+ end
4
12
  end
5
- def short_date_format short_date_format="%B %Y"
6
- @short_date_format ||= short_date_format
7
- end
8
- end
13
+ end
@@ -1,5 +1,9 @@
1
- class ModsDisplay::Configuration::Name < ModsDisplay::Configuration::Base
2
- def delimiter delimiter="<br/>"
3
- @delimiter ||= delimiter
1
+ module ModsDisplay
2
+ class Configuration
3
+ class Name < Base
4
+ def delimiter(delimiter = '<br/>')
5
+ @delimiter ||= delimiter
6
+ end
7
+ end
4
8
  end
5
- end
9
+ end
@@ -1,5 +1,9 @@
1
- class ModsDisplay::Configuration::Note < ModsDisplay::Configuration::Base
2
- def delimiter delimiter="<br/>"
3
- @delimiter ||= delimiter
1
+ module ModsDisplay
2
+ class Configuration
3
+ class Note < Base
4
+ def delimiter(delimiter = '<br/>')
5
+ @delimiter ||= delimiter
6
+ end
7
+ end
4
8
  end
5
- end
9
+ end
@@ -1,5 +1,9 @@
1
- class ModsDisplay::Configuration::RelatedItem < ModsDisplay::Configuration::Base
2
- def delimiter delimiter="<br/>"
3
- @delimiter ||= delimiter
1
+ module ModsDisplay
2
+ class Configuration
3
+ class RelatedItem < Base
4
+ def delimiter(delimiter = '<br/>')
5
+ @delimiter ||= delimiter
6
+ end
7
+ end
4
8
  end
5
- end
9
+ end
@@ -1,11 +1,13 @@
1
- class ModsDisplay::Configuration::Subject < ModsDisplay::Configuration::Base
1
+ module ModsDisplay
2
+ class Configuration
3
+ class Subject < Base
4
+ def hierarchical_link(hierarchical_link = false)
5
+ @hierarchical_link ||= hierarchical_link
6
+ end
2
7
 
3
- def hierarchical_link hierarchical_link=false
4
- @hierarchical_link ||= hierarchical_link
8
+ def delimiter(delimiter = ' &gt; ')
9
+ @delimiter ||= delimiter
10
+ end
11
+ end
5
12
  end
6
-
7
- def delimiter delimiter=" &gt; "
8
- @delimiter ||= delimiter
9
- end
10
-
11
- end
13
+ end
@@ -1,5 +1,9 @@
1
- class ModsDisplay::Configuration::Title < ModsDisplay::Configuration::Base
2
- def delimiter delimiter="<br/>"
3
- @delimiter ||= delimiter
1
+ module ModsDisplay
2
+ class Configuration
3
+ class Title < Base
4
+ def delimiter(delimiter = '<br/>')
5
+ @delimiter ||= delimiter
6
+ end
7
+ end
4
8
  end
5
- end
9
+ end
@@ -1,32 +1,32 @@
1
- module ModsDisplay::ControllerExtension
2
-
3
- def self.included(base)
4
- base.extend ClassMethods
5
- base.class_eval do
6
- def mods_display_config
7
- @mods_display_config || self.class.mods_display_config
8
- end
9
- if base.respond_to?(:helper_method)
10
- helper_method :mods_display_config, :render_mods_display
1
+ module ModsDisplay
2
+ module ControllerExtension
3
+ def self.included(base)
4
+ base.extend ClassMethods
5
+ base.class_eval do
6
+ def mods_display_config
7
+ @mods_display_config || self.class.mods_display_config
8
+ end
9
+ if base.respond_to?(:helper_method)
10
+ helper_method :mods_display_config, :render_mods_display
11
+ end
11
12
  end
12
13
  end
13
- end
14
14
 
15
- def render_mods_display model
16
- return "" if model.mods_display_xml.nil?
17
- ModsDisplay::HTML.new(mods_display_config, model.mods_display_xml, self)
18
- end
15
+ def render_mods_display(model)
16
+ return '' if model.mods_display_xml.nil?
17
+ ModsDisplay::HTML.new(mods_display_config, model.mods_display_xml, self)
18
+ end
19
19
 
20
- private
20
+ private
21
21
 
22
- module ClassMethods
23
- def configure_mods_display &config
24
- @mods_display_config = ModsDisplay::Configuration.new &config
25
- end
22
+ module ClassMethods
23
+ def configure_mods_display(&config)
24
+ @mods_display_config = ModsDisplay::Configuration.new(&config)
25
+ end
26
26
 
27
- def mods_display_config
28
- @mods_display_config || ModsDisplay::Configuration.new{}
27
+ def mods_display_config
28
+ @mods_display_config || ModsDisplay::Configuration.new {}
29
+ end
29
30
  end
30
31
  end
31
-
32
- end
32
+ end
@@ -1,386 +1,387 @@
1
1
  # encoding: utf-8
2
- module ModsDisplay::CountryCodes
3
- def country_codes
4
- {"aa" => "Albania",
5
- "abc" => "Alberta",
6
- "ac" => "Ashmore and Cartier Islands",
7
- "aca" => "Australian Capital Territory",
8
- "ae" => "Algeria",
9
- "af" => "Afghanistan",
10
- "ag" => "Argentina",
11
- "ai" => "Anguilla",
12
- "ai" => "Armenia (Republic)",
13
- "air" => "Armenian S.S.R.",
14
- "aj" => "Azerbaijan",
15
- "ajr" => "Azerbaijan S.S.R.",
16
- "aku" => "Alaska",
17
- "alu" => "Alabama",
18
- "am" => "Anguilla",
19
- "an" => "Andorra",
20
- "ao" => "Angola",
21
- "aq" => "Antigua and Barbuda",
22
- "aru" => "Arkansas",
23
- "as" => "American Samoa",
24
- "at" => "Australia",
25
- "au" => "Austria",
26
- "aw" => "Aruba",
27
- "ay" => "Antarctica",
28
- "azu" => "Arizona",
29
- "ba" => "Bahrain",
30
- "bb" => "Barbados",
31
- "bcc" => "British Columbia",
32
- "bd" => "Burundi",
33
- "be" => "Belgium",
34
- "bf" => "Bahamas",
35
- "bg" => "Bangladesh",
36
- "bh" => "Belize",
37
- "bi" => "British Indian Ocean Territory",
38
- "bl" => "Brazil",
39
- "bm" => "Bermuda Islands",
40
- "bn" => "Bosnia and Hercegovina",
41
- "bo" => "Bolivia",
42
- "bp" => "Solomon Islands",
43
- "br" => "Burma",
44
- "bs" => "Botswana",
45
- "bt" => "Bhutan",
46
- "bu" => "Bulgaria",
47
- "bv" => "Bouvet Island",
48
- "bw" => "Belarus",
49
- "bwr" => "Byelorussian S.S.R.",
50
- "bx" => "Brunei",
51
- "ca" => "Caribbean Netherlands",
52
- "cau" => "California",
53
- "cb" => "Cambodia",
54
- "cc" => "China",
55
- "cd" => "Chad",
56
- "ce" => "Sri Lanka",
57
- "cf" => "Congo (Brazzaville)",
58
- "cg" => "Congo (Democratic Republic)",
59
- "ch" => "China (Republic : 1949- )",
60
- "ci" => "Croatia",
61
- "cj" => "Cayman Islands",
62
- "ck" => "Colombia",
63
- "cl" => "Chile",
64
- "cm" => "Cameroon",
65
- "cn" => "Canada",
66
- "co" => "Curaçao",
67
- "cou" => "Colorado",
68
- "cp" => "Canton and Enderbury Islands",
69
- "cq" => "Comoros",
70
- "cr" => "Costa Rica",
71
- "cs" => "Czechoslovakia",
72
- "ctu" => "Connecticut",
73
- "cu" => "Cuba",
74
- "cv" => "Cape Verde",
75
- "cw" => "Cook Islands",
76
- "cx" => "Central African Republic",
77
- "cy" => "Cyprus",
78
- "cz" => "Canal Zone",
79
- "dcu" => "District of Columbia",
80
- "deu" => "Delaware",
81
- "dk" => "Denmark",
82
- "dm" => "Benin",
83
- "dq" => "Dominica",
84
- "dr" => "Dominican Republic",
85
- "ea" => "Eritrea",
86
- "ec" => "Ecuador",
87
- "eg" => "Equatorial Guinea",
88
- "em" => "Timor-Leste",
89
- "enk" => "England",
90
- "er" => "Estonia",
91
- "err" => "Estonia",
92
- "es" => "El Salvador",
93
- "et" => "Ethiopia",
94
- "fa" => "Faroe Islands",
95
- "fg" => "French Guiana",
96
- "fi" => "Finland",
97
- "fj" => "Fiji",
98
- "fk" => "Falkland Islands",
99
- "flu" => "Florida",
100
- "fm" => "Micronesia (Federated States)",
101
- "fp" => "French Polynesia",
102
- "fr" => "France",
103
- "fs" => "Terres australes et antarctiques françaises",
104
- "ft" => "Djibouti",
105
- "gau" => "Georgia",
106
- "gb" => "Kiribati",
107
- "gd" => "Grenada",
108
- "ge" => "Germany (East)",
109
- "gh" => "Ghana",
110
- "gi" => "Gibraltar",
111
- "gl" => "Greenland",
112
- "gm" => "Gambia",
113
- "gn" => "Gilbert and Ellice Islands",
114
- "go" => "Gabon",
115
- "gp" => "Guadeloupe",
116
- "gr" => "Greece",
117
- "gs" => "Georgia (Republic)",
118
- "gsr" => "Georgian S.S.R.",
119
- "gt" => "Guatemala",
120
- "gu" => "Guam",
121
- "gv" => "Guinea",
122
- "gw" => "Germany",
123
- "gy" => "Guyana",
124
- "gz" => "Gaza Strip",
125
- "hiu" => "Hawaii",
126
- "hk" => "Hong Kong",
127
- "hm" => "Heard and McDonald Islands",
128
- "ho" => "Honduras",
129
- "ht" => "Haiti",
130
- "hu" => "Hungary",
131
- "iau" => "Iowa",
132
- "ic" => "Iceland",
133
- "idu" => "Idaho",
134
- "ie" => "Ireland",
135
- "ii" => "India",
136
- "ilu" => "Illinois",
137
- "inu" => "Indiana",
138
- "io" => "Indonesia",
139
- "iq" => "Iraq",
140
- "ir" => "Iran",
141
- "is" => "Israel",
142
- "it" => "Italy",
143
- "iu" => "Israel-Syria Demilitarized Zones",
144
- "iv" => "Côte d'Ivoire",
145
- "iw" => "Israel-Jordan Demilitarized Zones",
146
- "iy" => "Iraq-Saudi Arabia Neutral Zone",
147
- "ja" => "Japan",
148
- "ji" => "Johnston Atoll",
149
- "jm" => "Jamaica",
150
- "jn" => "Jan Mayen",
151
- "jo" => "Jordan",
152
- "ke" => "Kenya",
153
- "kg" => "Kyrgyzstan",
154
- "kgr" => "Kirghiz S.S.R.",
155
- "kn" => "Korea (North)",
156
- "ko" => "Korea (South)",
157
- "ksu" => "Kansas",
158
- "ku" => "Kuwait",
159
- "kv" => "Kosovo",
160
- "kyu" => "Kentucky",
161
- "kz" => "Kazakhstan",
162
- "kzr" => "Kazakh S.S.R.",
163
- "lau" => "Louisiana",
164
- "lb" => "Liberia",
165
- "le" => "Lebanon",
166
- "lh" => "Liechtenstein",
167
- "li" => "Lithuania",
168
- "lir" => "Lithuania",
169
- "ln" => "Central and Southern Line Islands",
170
- "lo" => "Lesotho",
171
- "ls" => "Laos",
172
- "lu" => "Luxembourg",
173
- "lv" => "Latvia",
174
- "lvr" => "Latvia",
175
- "ly" => "Libya",
176
- "mau" => "Massachusetts",
177
- "mbc" => "Manitoba",
178
- "mc" => "Monaco",
179
- "mdu" => "Maryland",
180
- "meu" => "Maine",
181
- "mf" => "Mauritius",
182
- "mg" => "Madagascar",
183
- "mh" => "Macao",
184
- "miu" => "Michigan",
185
- "mj" => "Montserrat",
186
- "mk" => "Oman",
187
- "ml" => "Mali",
188
- "mm" => "Malta",
189
- "mnu" => "Minnesota",
190
- "mo" => "Montenegro",
191
- "mou" => "Missouri",
192
- "mp" => "Mongolia",
193
- "mq" => "Martinique",
194
- "mr" => "Morocco",
195
- "msu" => "Mississippi",
196
- "mtu" => "Montana",
197
- "mu" => "Mauritania",
198
- "mv" => "Moldova",
199
- "mvr" => "Moldavian S.S.R.",
200
- "mw" => "Malawi",
201
- "mx" => "Mexico",
202
- "my" => "Malaysia",
203
- "mz" => "Mozambique",
204
- "na" => "Netherlands Antilles",
205
- "nbu" => "Nebraska",
206
- "ncu" => "North Carolina",
207
- "ndu" => "North Dakota",
208
- "ne" => "Netherlands",
209
- "nfc" => "Newfoundland and Labrador",
210
- "ng" => "Niger",
211
- "nhu" => "New Hampshire",
212
- "nik" => "Northern Ireland",
213
- "nju" => "New Jersey",
214
- "nkc" => "New Brunswick",
215
- "nl" => "New Caledonia",
216
- "nm" => "Northern Mariana Islands",
217
- "nmu" => "New Mexico",
218
- "nn" => "Vanuatu",
219
- "no" => "Norway",
220
- "np" => "Nepal",
221
- "nq" => "Nicaragua",
222
- "nr" => "Nigeria",
223
- "nsc" => "Nova Scotia",
224
- "ntc" => "Northwest Territories",
225
- "nu" => "Nauru",
226
- "nuc" => "Nunavut",
227
- "nvu" => "Nevada",
228
- "nw" => "Northern Mariana Islands",
229
- "nx" => "Norfolk Island",
230
- "nyu" => "New York (State)",
231
- "nz" => "New Zealand",
232
- "ohu" => "Ohio",
233
- "oku" => "Oklahoma",
234
- "onc" => "Ontario",
235
- "oru" => "Oregon",
236
- "ot" => "Mayotte",
237
- "pau" => "Pennsylvania",
238
- "pc" => "Pitcairn Island",
239
- "pe" => "Peru",
240
- "pf" => "Paracel Islands",
241
- "pg" => "Guinea-Bissau",
242
- "ph" => "Philippines",
243
- "pic" => "Prince Edward Island",
244
- "pk" => "Pakistan",
245
- "pl" => "Poland",
246
- "pn" => "Panama",
247
- "po" => "Portugal",
248
- "pp" => "Papua New Guinea",
249
- "pr" => "Puerto Rico",
250
- "pt" => "Portuguese Timor",
251
- "pw" => "Palau",
252
- "py" => "Paraguay",
253
- "qa" => "Qatar",
254
- "qea" => "Queensland",
255
- "quc" => "Québec (Province)",
256
- "rb" => "Serbia",
257
- "re" => "Réunion",
258
- "rh" => "Zimbabwe",
259
- "riu" => "Rhode Island",
260
- "rm" => "Romania",
261
- "ru" => "Russia (Federation)",
262
- "rur" => "Russian S.F.S.R.",
263
- "rw" => "Rwanda",
264
- "ry" => "Ryukyu Islands, Southern",
265
- "sa" => "South Africa",
266
- "sb" => "Svalbard",
267
- "sc" => "Saint-Barthélemy",
268
- "scu" => "South Carolina",
269
- "sd" => "South Sudan",
270
- "sdu" => "South Dakota",
271
- "se" => "Seychelles",
272
- "sf" => "Sao Tome and Principe",
273
- "sg" => "Senegal",
274
- "sh" => "Spanish North Africa",
275
- "si" => "Singapore",
276
- "sj" => "Sudan",
277
- "sk" => "Sikkim",
278
- "sl" => "Sierra Leone",
279
- "sm" => "San Marino",
280
- "sn" => "Sint Maarten",
281
- "snc" => "Saskatchewan",
282
- "so" => "Somalia",
283
- "sp" => "Spain",
284
- "sq" => "Swaziland",
285
- "sr" => "Surinam",
286
- "ss" => "Western Sahara",
287
- "st" => "Saint-Martin",
288
- "stk" => "Scotland",
289
- "su" => "Saudi Arabia",
290
- "sv" => "Swan Islands",
291
- "sw" => "Sweden",
292
- "sx" => "Namibia",
293
- "sy" => "Syria",
294
- "sz" => "Switzerland",
295
- "ta" => "Tajikistan",
296
- "tar" => "Tajik S.S.R.",
297
- "tc" => "Turks and Caicos Islands",
298
- "tg" => "Togo",
299
- "th" => "Thailand",
300
- "ti" => "Tunisia",
301
- "tk" => "Turkmenistan",
302
- "tkr" => " Turkmen S.S.R.",
303
- "tl" => "Tokelau",
304
- "tma" => "Tasmania",
305
- "tnu" => "Tennessee",
306
- "to" => "Tonga",
307
- "tr" => "Trinidad and Tobago",
308
- "ts" => "United Arab Emirates",
309
- "tt" => "Trust Territory of the Pacific Islands",
310
- "tu" => "Turkey",
311
- "tv" => "Tuvalu",
312
- "txu" => "Texas",
313
- "tz" => "Tanzania",
314
- "ua" => "Egypt",
315
- "uc" => "United States Misc. Caribbean Islands",
316
- "ug" => "Uganda",
317
- "ui" => "United Kingdom Misc. Islands",
318
- "uik" => "United Kingdom Misc. Islands",
319
- "uk" => "United Kingdom",
320
- "un" => "Ukraine",
321
- "unr" => "Ukraine",
322
- "up" => "United States Misc. Pacific Islands",
323
- "ur" => "Soviet Union",
324
- "us" => "United States",
325
- "utu" => "Utah",
326
- "uv" => "Burkina Faso",
327
- "uy" => "Uruguay",
328
- "uz" => "Uzbekistan",
329
- "uzr" => "Uzbek S.S.R.",
330
- "vau" => "Virginia",
331
- "vb" => "British Virgin Islands",
332
- "vc" => "Vatican City",
333
- "ve" => "Venezuela",
334
- "vi" => "Virgin Islands of the United States",
335
- "vm" => "Vietnam",
336
- "vn" => "Vietnam, North",
337
- "vp" => "Various places",
338
- "vra" => "Victoria",
339
- "vs" => "Vietnam, South",
340
- "vtu" => "Vermont",
341
- "wau" => "Washington (State)",
342
- "wb" => "West Berlin",
343
- "wea" => "Western Australia",
344
- "wf" => "Wallis and Futuna",
345
- "wiu" => "Wisconsin",
346
- "wj" => "West Bank of the Jordan River",
347
- "wk" => "Wake Island",
348
- "wlk" => "Wales",
349
- "ws" => "Samoa",
350
- "wvu" => "West Virginia",
351
- "wyu" => "Wyoming",
352
- "xa" => "Christmas Island (Indian Ocean)",
353
- "xb" => "Cocos (Keeling) Islands",
354
- "xc" => "Maldives",
355
- "xd" => "Saint Kitts-Nevis",
356
- "xe" => "Marshall Islands",
357
- "xf" => "Midway Islands",
358
- "xga" => "Coral Sea Islands Territory",
359
- "xh" => "Niue",
360
- "xi" => "Saint Kitts-Nevis-Anguilla",
361
- "xj" => "Saint Helena",
362
- "xk" => "Saint Lucia",
363
- "xl" => "Saint Pierre and Miquelon",
364
- "xm" => "Saint Vincent and the Grenadines",
365
- "xn" => "Macedonia",
366
- "xna" => "New South Wales",
367
- "xo" => "Slovakia",
368
- "xoa" => "Northern Territory",
369
- "xp" => "Spratly Island",
370
- "xr" => "Czech Republic",
371
- "xra" => "South Australia",
372
- "xs" => "South Georgia and the South Sandwich Islands",
373
- "xv" => "Slovenia",
374
- # Removing per METADOR-32
375
- #"xx" => "No place, unknown, or undetermined",
376
- "xxc" => "Canada",
377
- "xxk" => "United Kingdom",
378
- "xxr" => "Soviet Union",
379
- "xxu" => "United States",
380
- "ye" => "Yemen",
381
- "ykc" => "Yukon Territory",
382
- "ys" => "Yemen (People's Democratic Republic)",
383
- "yu" => "Serbia and Montenegro",
384
- "za" => "Zambia"}
2
+ module ModsDisplay
3
+ module CountryCodes
4
+ def country_codes
5
+ { 'aa' => 'Albania',
6
+ 'abc' => 'Alberta',
7
+ 'ac' => 'Ashmore and Cartier Islands',
8
+ 'aca' => 'Australian Capital Territory',
9
+ 'ae' => 'Algeria',
10
+ 'af' => 'Afghanistan',
11
+ 'ag' => 'Argentina',
12
+ 'ai' => 'Armenia (Republic)',
13
+ 'air' => 'Armenian S.S.R.',
14
+ 'aj' => 'Azerbaijan',
15
+ 'ajr' => 'Azerbaijan S.S.R.',
16
+ 'aku' => 'Alaska',
17
+ 'alu' => 'Alabama',
18
+ 'am' => 'Anguilla',
19
+ 'an' => 'Andorra',
20
+ 'ao' => 'Angola',
21
+ 'aq' => 'Antigua and Barbuda',
22
+ 'aru' => 'Arkansas',
23
+ 'as' => 'American Samoa',
24
+ 'at' => 'Australia',
25
+ 'au' => 'Austria',
26
+ 'aw' => 'Aruba',
27
+ 'ay' => 'Antarctica',
28
+ 'azu' => 'Arizona',
29
+ 'ba' => 'Bahrain',
30
+ 'bb' => 'Barbados',
31
+ 'bcc' => 'British Columbia',
32
+ 'bd' => 'Burundi',
33
+ 'be' => 'Belgium',
34
+ 'bf' => 'Bahamas',
35
+ 'bg' => 'Bangladesh',
36
+ 'bh' => 'Belize',
37
+ 'bi' => 'British Indian Ocean Territory',
38
+ 'bl' => 'Brazil',
39
+ 'bm' => 'Bermuda Islands',
40
+ 'bn' => 'Bosnia and Hercegovina',
41
+ 'bo' => 'Bolivia',
42
+ 'bp' => 'Solomon Islands',
43
+ 'br' => 'Burma',
44
+ 'bs' => 'Botswana',
45
+ 'bt' => 'Bhutan',
46
+ 'bu' => 'Bulgaria',
47
+ 'bv' => 'Bouvet Island',
48
+ 'bw' => 'Belarus',
49
+ 'bwr' => 'Byelorussian S.S.R.',
50
+ 'bx' => 'Brunei',
51
+ 'ca' => 'Caribbean Netherlands',
52
+ 'cau' => 'California',
53
+ 'cb' => 'Cambodia',
54
+ 'cc' => 'China',
55
+ 'cd' => 'Chad',
56
+ 'ce' => 'Sri Lanka',
57
+ 'cf' => 'Congo (Brazzaville)',
58
+ 'cg' => 'Congo (Democratic Republic)',
59
+ 'ch' => 'China (Republic : 1949- )',
60
+ 'ci' => 'Croatia',
61
+ 'cj' => 'Cayman Islands',
62
+ 'ck' => 'Colombia',
63
+ 'cl' => 'Chile',
64
+ 'cm' => 'Cameroon',
65
+ 'cn' => 'Canada',
66
+ 'co' => 'Curaçao',
67
+ 'cou' => 'Colorado',
68
+ 'cp' => 'Canton and Enderbury Islands',
69
+ 'cq' => 'Comoros',
70
+ 'cr' => 'Costa Rica',
71
+ 'cs' => 'Czechoslovakia',
72
+ 'ctu' => 'Connecticut',
73
+ 'cu' => 'Cuba',
74
+ 'cv' => 'Cape Verde',
75
+ 'cw' => 'Cook Islands',
76
+ 'cx' => 'Central African Republic',
77
+ 'cy' => 'Cyprus',
78
+ 'cz' => 'Canal Zone',
79
+ 'dcu' => 'District of Columbia',
80
+ 'deu' => 'Delaware',
81
+ 'dk' => 'Denmark',
82
+ 'dm' => 'Benin',
83
+ 'dq' => 'Dominica',
84
+ 'dr' => 'Dominican Republic',
85
+ 'ea' => 'Eritrea',
86
+ 'ec' => 'Ecuador',
87
+ 'eg' => 'Equatorial Guinea',
88
+ 'em' => 'Timor-Leste',
89
+ 'enk' => 'England',
90
+ 'er' => 'Estonia',
91
+ 'err' => 'Estonia',
92
+ 'es' => 'El Salvador',
93
+ 'et' => 'Ethiopia',
94
+ 'fa' => 'Faroe Islands',
95
+ 'fg' => 'French Guiana',
96
+ 'fi' => 'Finland',
97
+ 'fj' => 'Fiji',
98
+ 'fk' => 'Falkland Islands',
99
+ 'flu' => 'Florida',
100
+ 'fm' => 'Micronesia (Federated States)',
101
+ 'fp' => 'French Polynesia',
102
+ 'fr' => 'France',
103
+ 'fs' => 'Terres australes et antarctiques françaises',
104
+ 'ft' => 'Djibouti',
105
+ 'gau' => 'Georgia',
106
+ 'gb' => 'Kiribati',
107
+ 'gd' => 'Grenada',
108
+ 'ge' => 'Germany (East)',
109
+ 'gh' => 'Ghana',
110
+ 'gi' => 'Gibraltar',
111
+ 'gl' => 'Greenland',
112
+ 'gm' => 'Gambia',
113
+ 'gn' => 'Gilbert and Ellice Islands',
114
+ 'go' => 'Gabon',
115
+ 'gp' => 'Guadeloupe',
116
+ 'gr' => 'Greece',
117
+ 'gs' => 'Georgia (Republic)',
118
+ 'gsr' => 'Georgian S.S.R.',
119
+ 'gt' => 'Guatemala',
120
+ 'gu' => 'Guam',
121
+ 'gv' => 'Guinea',
122
+ 'gw' => 'Germany',
123
+ 'gy' => 'Guyana',
124
+ 'gz' => 'Gaza Strip',
125
+ 'hiu' => 'Hawaii',
126
+ 'hk' => 'Hong Kong',
127
+ 'hm' => 'Heard and McDonald Islands',
128
+ 'ho' => 'Honduras',
129
+ 'ht' => 'Haiti',
130
+ 'hu' => 'Hungary',
131
+ 'iau' => 'Iowa',
132
+ 'ic' => 'Iceland',
133
+ 'idu' => 'Idaho',
134
+ 'ie' => 'Ireland',
135
+ 'ii' => 'India',
136
+ 'ilu' => 'Illinois',
137
+ 'inu' => 'Indiana',
138
+ 'io' => 'Indonesia',
139
+ 'iq' => 'Iraq',
140
+ 'ir' => 'Iran',
141
+ 'is' => 'Israel',
142
+ 'it' => 'Italy',
143
+ 'iu' => 'Israel-Syria Demilitarized Zones',
144
+ 'iv' => "Côte d'Ivoire",
145
+ 'iw' => 'Israel-Jordan Demilitarized Zones',
146
+ 'iy' => 'Iraq-Saudi Arabia Neutral Zone',
147
+ 'ja' => 'Japan',
148
+ 'ji' => 'Johnston Atoll',
149
+ 'jm' => 'Jamaica',
150
+ 'jn' => 'Jan Mayen',
151
+ 'jo' => 'Jordan',
152
+ 'ke' => 'Kenya',
153
+ 'kg' => 'Kyrgyzstan',
154
+ 'kgr' => 'Kirghiz S.S.R.',
155
+ 'kn' => 'Korea (North)',
156
+ 'ko' => 'Korea (South)',
157
+ 'ksu' => 'Kansas',
158
+ 'ku' => 'Kuwait',
159
+ 'kv' => 'Kosovo',
160
+ 'kyu' => 'Kentucky',
161
+ 'kz' => 'Kazakhstan',
162
+ 'kzr' => 'Kazakh S.S.R.',
163
+ 'lau' => 'Louisiana',
164
+ 'lb' => 'Liberia',
165
+ 'le' => 'Lebanon',
166
+ 'lh' => 'Liechtenstein',
167
+ 'li' => 'Lithuania',
168
+ 'lir' => 'Lithuania',
169
+ 'ln' => 'Central and Southern Line Islands',
170
+ 'lo' => 'Lesotho',
171
+ 'ls' => 'Laos',
172
+ 'lu' => 'Luxembourg',
173
+ 'lv' => 'Latvia',
174
+ 'lvr' => 'Latvia',
175
+ 'ly' => 'Libya',
176
+ 'mau' => 'Massachusetts',
177
+ 'mbc' => 'Manitoba',
178
+ 'mc' => 'Monaco',
179
+ 'mdu' => 'Maryland',
180
+ 'meu' => 'Maine',
181
+ 'mf' => 'Mauritius',
182
+ 'mg' => 'Madagascar',
183
+ 'mh' => 'Macao',
184
+ 'miu' => 'Michigan',
185
+ 'mj' => 'Montserrat',
186
+ 'mk' => 'Oman',
187
+ 'ml' => 'Mali',
188
+ 'mm' => 'Malta',
189
+ 'mnu' => 'Minnesota',
190
+ 'mo' => 'Montenegro',
191
+ 'mou' => 'Missouri',
192
+ 'mp' => 'Mongolia',
193
+ 'mq' => 'Martinique',
194
+ 'mr' => 'Morocco',
195
+ 'msu' => 'Mississippi',
196
+ 'mtu' => 'Montana',
197
+ 'mu' => 'Mauritania',
198
+ 'mv' => 'Moldova',
199
+ 'mvr' => 'Moldavian S.S.R.',
200
+ 'mw' => 'Malawi',
201
+ 'mx' => 'Mexico',
202
+ 'my' => 'Malaysia',
203
+ 'mz' => 'Mozambique',
204
+ 'na' => 'Netherlands Antilles',
205
+ 'nbu' => 'Nebraska',
206
+ 'ncu' => 'North Carolina',
207
+ 'ndu' => 'North Dakota',
208
+ 'ne' => 'Netherlands',
209
+ 'nfc' => 'Newfoundland and Labrador',
210
+ 'ng' => 'Niger',
211
+ 'nhu' => 'New Hampshire',
212
+ 'nik' => 'Northern Ireland',
213
+ 'nju' => 'New Jersey',
214
+ 'nkc' => 'New Brunswick',
215
+ 'nl' => 'New Caledonia',
216
+ 'nm' => 'Northern Mariana Islands',
217
+ 'nmu' => 'New Mexico',
218
+ 'nn' => 'Vanuatu',
219
+ 'no' => 'Norway',
220
+ 'np' => 'Nepal',
221
+ 'nq' => 'Nicaragua',
222
+ 'nr' => 'Nigeria',
223
+ 'nsc' => 'Nova Scotia',
224
+ 'ntc' => 'Northwest Territories',
225
+ 'nu' => 'Nauru',
226
+ 'nuc' => 'Nunavut',
227
+ 'nvu' => 'Nevada',
228
+ 'nw' => 'Northern Mariana Islands',
229
+ 'nx' => 'Norfolk Island',
230
+ 'nyu' => 'New York (State)',
231
+ 'nz' => 'New Zealand',
232
+ 'ohu' => 'Ohio',
233
+ 'oku' => 'Oklahoma',
234
+ 'onc' => 'Ontario',
235
+ 'oru' => 'Oregon',
236
+ 'ot' => 'Mayotte',
237
+ 'pau' => 'Pennsylvania',
238
+ 'pc' => 'Pitcairn Island',
239
+ 'pe' => 'Peru',
240
+ 'pf' => 'Paracel Islands',
241
+ 'pg' => 'Guinea-Bissau',
242
+ 'ph' => 'Philippines',
243
+ 'pic' => 'Prince Edward Island',
244
+ 'pk' => 'Pakistan',
245
+ 'pl' => 'Poland',
246
+ 'pn' => 'Panama',
247
+ 'po' => 'Portugal',
248
+ 'pp' => 'Papua New Guinea',
249
+ 'pr' => 'Puerto Rico',
250
+ 'pt' => 'Portuguese Timor',
251
+ 'pw' => 'Palau',
252
+ 'py' => 'Paraguay',
253
+ 'qa' => 'Qatar',
254
+ 'qea' => 'Queensland',
255
+ 'quc' => 'Québec (Province)',
256
+ 'rb' => 'Serbia',
257
+ 're' => 'Réunion',
258
+ 'rh' => 'Zimbabwe',
259
+ 'riu' => 'Rhode Island',
260
+ 'rm' => 'Romania',
261
+ 'ru' => 'Russia (Federation)',
262
+ 'rur' => 'Russian S.F.S.R.',
263
+ 'rw' => 'Rwanda',
264
+ 'ry' => 'Ryukyu Islands, Southern',
265
+ 'sa' => 'South Africa',
266
+ 'sb' => 'Svalbard',
267
+ 'sc' => 'Saint-Barthélemy',
268
+ 'scu' => 'South Carolina',
269
+ 'sd' => 'South Sudan',
270
+ 'sdu' => 'South Dakota',
271
+ 'se' => 'Seychelles',
272
+ 'sf' => 'Sao Tome and Principe',
273
+ 'sg' => 'Senegal',
274
+ 'sh' => 'Spanish North Africa',
275
+ 'si' => 'Singapore',
276
+ 'sj' => 'Sudan',
277
+ 'sk' => 'Sikkim',
278
+ 'sl' => 'Sierra Leone',
279
+ 'sm' => 'San Marino',
280
+ 'sn' => 'Sint Maarten',
281
+ 'snc' => 'Saskatchewan',
282
+ 'so' => 'Somalia',
283
+ 'sp' => 'Spain',
284
+ 'sq' => 'Swaziland',
285
+ 'sr' => 'Surinam',
286
+ 'ss' => 'Western Sahara',
287
+ 'st' => 'Saint-Martin',
288
+ 'stk' => 'Scotland',
289
+ 'su' => 'Saudi Arabia',
290
+ 'sv' => 'Swan Islands',
291
+ 'sw' => 'Sweden',
292
+ 'sx' => 'Namibia',
293
+ 'sy' => 'Syria',
294
+ 'sz' => 'Switzerland',
295
+ 'ta' => 'Tajikistan',
296
+ 'tar' => 'Tajik S.S.R.',
297
+ 'tc' => 'Turks and Caicos Islands',
298
+ 'tg' => 'Togo',
299
+ 'th' => 'Thailand',
300
+ 'ti' => 'Tunisia',
301
+ 'tk' => 'Turkmenistan',
302
+ 'tkr' => ' Turkmen S.S.R.',
303
+ 'tl' => 'Tokelau',
304
+ 'tma' => 'Tasmania',
305
+ 'tnu' => 'Tennessee',
306
+ 'to' => 'Tonga',
307
+ 'tr' => 'Trinidad and Tobago',
308
+ 'ts' => 'United Arab Emirates',
309
+ 'tt' => 'Trust Territory of the Pacific Islands',
310
+ 'tu' => 'Turkey',
311
+ 'tv' => 'Tuvalu',
312
+ 'txu' => 'Texas',
313
+ 'tz' => 'Tanzania',
314
+ 'ua' => 'Egypt',
315
+ 'uc' => 'United States Misc. Caribbean Islands',
316
+ 'ug' => 'Uganda',
317
+ 'ui' => 'United Kingdom Misc. Islands',
318
+ 'uik' => 'United Kingdom Misc. Islands',
319
+ 'uk' => 'United Kingdom',
320
+ 'un' => 'Ukraine',
321
+ 'unr' => 'Ukraine',
322
+ 'up' => 'United States Misc. Pacific Islands',
323
+ 'ur' => 'Soviet Union',
324
+ 'us' => 'United States',
325
+ 'utu' => 'Utah',
326
+ 'uv' => 'Burkina Faso',
327
+ 'uy' => 'Uruguay',
328
+ 'uz' => 'Uzbekistan',
329
+ 'uzr' => 'Uzbek S.S.R.',
330
+ 'vau' => 'Virginia',
331
+ 'vb' => 'British Virgin Islands',
332
+ 'vc' => 'Vatican City',
333
+ 've' => 'Venezuela',
334
+ 'vi' => 'Virgin Islands of the United States',
335
+ 'vm' => 'Vietnam',
336
+ 'vn' => 'Vietnam, North',
337
+ 'vp' => 'Various places',
338
+ 'vra' => 'Victoria',
339
+ 'vs' => 'Vietnam, South',
340
+ 'vtu' => 'Vermont',
341
+ 'wau' => 'Washington (State)',
342
+ 'wb' => 'West Berlin',
343
+ 'wea' => 'Western Australia',
344
+ 'wf' => 'Wallis and Futuna',
345
+ 'wiu' => 'Wisconsin',
346
+ 'wj' => 'West Bank of the Jordan River',
347
+ 'wk' => 'Wake Island',
348
+ 'wlk' => 'Wales',
349
+ 'ws' => 'Samoa',
350
+ 'wvu' => 'West Virginia',
351
+ 'wyu' => 'Wyoming',
352
+ 'xa' => 'Christmas Island (Indian Ocean)',
353
+ 'xb' => 'Cocos (Keeling) Islands',
354
+ 'xc' => 'Maldives',
355
+ 'xd' => 'Saint Kitts-Nevis',
356
+ 'xe' => 'Marshall Islands',
357
+ 'xf' => 'Midway Islands',
358
+ 'xga' => 'Coral Sea Islands Territory',
359
+ 'xh' => 'Niue',
360
+ 'xi' => 'Saint Kitts-Nevis-Anguilla',
361
+ 'xj' => 'Saint Helena',
362
+ 'xk' => 'Saint Lucia',
363
+ 'xl' => 'Saint Pierre and Miquelon',
364
+ 'xm' => 'Saint Vincent and the Grenadines',
365
+ 'xn' => 'Macedonia',
366
+ 'xna' => 'New South Wales',
367
+ 'xo' => 'Slovakia',
368
+ 'xoa' => 'Northern Territory',
369
+ 'xp' => 'Spratly Island',
370
+ 'xr' => 'Czech Republic',
371
+ 'xra' => 'South Australia',
372
+ 'xs' => 'South Georgia and the South Sandwich Islands',
373
+ 'xv' => 'Slovenia',
374
+ # Removing per METADOR-32
375
+ # "xx" => "No place, unknown, or undetermined",
376
+ 'xxc' => 'Canada',
377
+ 'xxk' => 'United Kingdom',
378
+ 'xxr' => 'Soviet Union',
379
+ 'xxu' => 'United States',
380
+ 'ye' => 'Yemen',
381
+ 'ykc' => 'Yukon Territory',
382
+ 'ys' => "Yemen (People's Democratic Republic)",
383
+ 'yu' => 'Serbia and Montenegro',
384
+ 'za' => 'Zambia' }
385
+ end
385
386
  end
386
- end
387
+ end