iq-country 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008-2009 Jamie Hill, SonicIQ Ltd. http://code.soniciq.com
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,7 @@
1
+ = IQ::Country
2
+
3
+ === Summary
4
+ Your summary here
5
+
6
+ === Description
7
+ Your description here
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,326 @@
1
+ module IQ
2
+ module Country
3
+ CODES = [
4
+ ['Afghanistan', 'AF'],
5
+ ['Åland Islands', 'AX'],
6
+ ['Albania', 'AL'],
7
+ ['Algeria', 'DZ'],
8
+ ['American Samoa', 'AS'],
9
+ ['Andorra', 'AD'],
10
+ ['Angola', 'AO'],
11
+ ['Anguilla', 'AI'],
12
+ ['Antarctica', 'AQ'],
13
+ ['Antigua and Barbuda', 'AG'],
14
+ ['Argentina', 'AR'],
15
+ ['Armenia', 'AM'],
16
+ ['Aruba', 'AW'],
17
+ ['Australia', 'AU'],
18
+ ['Austria', 'AT'],
19
+ ['Azerbaijan', 'AZ'],
20
+ ['Bahamas', 'BS'],
21
+ ['Bahrain', 'BH'],
22
+ ['Bangladesh', 'BD'],
23
+ ['Barbados', 'BB'],
24
+ ['Belarus', 'BY'],
25
+ ['Belgium', 'BE'],
26
+ ['Belize', 'BZ'],
27
+ ['Benin', 'BJ'],
28
+ ['Bermuda', 'BM'],
29
+ ['Bhutan', 'BT'],
30
+ ['Bolivia, Plurinational State of', 'BO'],
31
+ ['Bosnia and Herzegovina', 'BA'],
32
+ ['Botswana', 'BW'],
33
+ ['Bouvet Island', 'BV'],
34
+ ['Brazil', 'BR'],
35
+ ['British Indian Ocean Territory', 'IO'],
36
+ ['Brunei Darussalam', 'BN'],
37
+ ['Bulgaria', 'BG'],
38
+ ['Burkina Faso', 'BF'],
39
+ ['Burundi', 'BI'],
40
+ ['Cambodia', 'KH'],
41
+ ['Cameroon', 'CM'],
42
+ ['Canada', 'CA'],
43
+ ['Cape Verde', 'CV'],
44
+ ['Cayman Islands', 'KY'],
45
+ ['Central African Republic', 'CF'],
46
+ ['Chad', 'TD'],
47
+ ['Chile', 'CL'],
48
+ ['China', 'CN'],
49
+ ['Christmas Island', 'CX'],
50
+ ['Cocos (Keeling) Islands', 'CC'],
51
+ ['Colombia', 'CO'],
52
+ ['Comoros', 'KM'],
53
+ ['Congo', 'CG'],
54
+ ['Congo, the Democratic Republic of the', 'CD'],
55
+ ['Cook Islands', 'CK'],
56
+ ['Costa Rica', 'CR'],
57
+ ['Côte D\'ivoire' 'CI'],
58
+ ['Croatia', 'HR'],
59
+ ['Cuba', 'CU'],
60
+ ['Cyprus', 'CY'],
61
+ ['Czech Republic', 'CZ'],
62
+ ['Denmark', 'DK'],
63
+ ['Djibouti', 'DJ'],
64
+ ['Dominica', 'DM'],
65
+ ['Dominican Republic', 'DO'],
66
+ ['Ecuador', 'EC'],
67
+ ['Egypt', 'EG'],
68
+ ['El Salvador', 'SV'],
69
+ ['Equatorial Guinea', 'GQ'],
70
+ ['Eritrea', 'ER'],
71
+ ['Estonia', 'EE'],
72
+ ['Ethiopia', 'ET'],
73
+ ['Falkland Islands (Malvinas)', 'FK'],
74
+ ['Faroe Islands', 'FO'],
75
+ ['Fiji', 'FJ'],
76
+ ['Finland', 'FI'],
77
+ ['France', 'FR'],
78
+ ['French Guiana', 'GF'],
79
+ ['French Polynesia', 'PF'],
80
+ ['French Southern Territories', 'TF'],
81
+ ['Gabon', 'GA'],
82
+ ['Gambia', 'GM'],
83
+ ['Georgia', 'GE'],
84
+ ['Germany', 'DE'],
85
+ ['Ghana', 'GH'],
86
+ ['Gibraltar', 'GI'],
87
+ ['Greece', 'GR'],
88
+ ['Greenland', 'GL'],
89
+ ['Grenada', 'GD'],
90
+ ['Guadeloupe', 'GP'],
91
+ ['Guam', 'GU'],
92
+ ['Guatemala', 'GT'],
93
+ ['Guernsey', 'GG'],
94
+ ['Guinea', 'GN'],
95
+ ['Guinea-Bissau', 'GW'],
96
+ ['Guyana', 'GY'],
97
+ ['Haiti', 'HT'],
98
+ ['Heard Island and Mcdonald Islands', 'HM'],
99
+ ['Holy See (Vatican City State)', 'VA'],
100
+ ['Honduras', 'HN'],
101
+ ['Hong Kong', 'HK'],
102
+ ['Hungary', 'HU'],
103
+ ['Iceland', 'IS'],
104
+ ['India', 'IN'],
105
+ ['Indonesia', 'ID'],
106
+ ['Iran, Islamic Republic of', 'IR'],
107
+ ['Iraq', 'IQ'],
108
+ ['Ireland', 'IE'],
109
+ ['Isle of Man', 'IM'],
110
+ ['Israel', 'IL'],
111
+ ['Italy', 'IT'],
112
+ ['Jamaica', 'JM'],
113
+ ['Japan', 'JP'],
114
+ ['Jersey', 'JE'],
115
+ ['Jordan', 'JO'],
116
+ ['Kazakhstan', 'KZ'],
117
+ ['Kenya', 'KE'],
118
+ ['Kiribati', 'KI'],
119
+ ['Korea, Democratic People\'s Republic of', 'KP'],
120
+ ['Korea, Republic of', 'KR'],
121
+ ['Kuwait', 'KW'],
122
+ ['Kyrgyzstan', 'KG'],
123
+ ['Lao People\'s Democratic Republic', 'LA'],
124
+ ['Latvia', 'LV'],
125
+ ['Lebanon', 'LB'],
126
+ ['Lesotho', 'LS'],
127
+ ['Liberia', 'LR'],
128
+ ['Libyan Arab Jamahiriya', 'LY'],
129
+ ['Liechtenstein', 'LI'],
130
+ ['Lithuania', 'LT'],
131
+ ['Luxembourg', 'LU'],
132
+ ['Macao', 'MO'],
133
+ ['Macedonia, the Former Yugoslav Republic of', 'MK'],
134
+ ['Madagascar', 'MG'],
135
+ ['Malawi', 'MW'],
136
+ ['Malaysia', 'MY'],
137
+ ['Maldives', 'MV'],
138
+ ['Mali', 'ML'],
139
+ ['Malta', 'MT'],
140
+ ['Marshall Islands', 'MH'],
141
+ ['Martinique', 'MQ'],
142
+ ['Mauritania', 'MR'],
143
+ ['Mauritius', 'MU'],
144
+ ['Mayotte', 'YT'],
145
+ ['Mexico', 'MX'],
146
+ ['Micronesia, Federated States of', 'FM'],
147
+ ['Moldova, Republic of', 'MD'],
148
+ ['Monaco', 'MC'],
149
+ ['Mongolia', 'MN'],
150
+ ['Montenegro', 'ME'],
151
+ ['Montserrat', 'MS'],
152
+ ['Morocco', 'MA'],
153
+ ['Mozambique', 'MZ'],
154
+ ['Myanmar', 'MM'],
155
+ ['Namibia', 'NA'],
156
+ ['Nauru', 'NR'],
157
+ ['Nepal', 'NP'],
158
+ ['Netherlands', 'NL'],
159
+ ['Netherlands Antilles', 'AN'],
160
+ ['New Caledonia', 'NC'],
161
+ ['New Zealand', 'NZ'],
162
+ ['Nicaragua', 'NI'],
163
+ ['Niger', 'NE'],
164
+ ['Nigeria', 'NG'],
165
+ ['Niue', 'NU'],
166
+ ['Norfolk Island', 'NF'],
167
+ ['Northern Mariana Islands', 'MP'],
168
+ ['Norway', 'NO'],
169
+ ['Oman', 'OM'],
170
+ ['Pakistan', 'PK'],
171
+ ['Palau', 'PW'],
172
+ ['Palestinian Territory, Occupied', 'PS'],
173
+ ['Panama', 'PA'],
174
+ ['Papua New Guinea', 'PG'],
175
+ ['Paraguay', 'PY'],
176
+ ['Peru', 'PE'],
177
+ ['Philippines', 'PH'],
178
+ ['Pitcairn', 'PN'],
179
+ ['Poland', 'PL'],
180
+ ['Portugal', 'PT'],
181
+ ['Puerto Rico', 'PR'],
182
+ ['Qatar', 'QA'],
183
+ ['Réunion', 'RE'],
184
+ ['Romania', 'RO'],
185
+ ['Russian Federation', 'RU'],
186
+ ['Rwanda', 'RW'],
187
+ ['Saint Barthélemy', 'BL'],
188
+ ['Saint Helena', 'SH'],
189
+ ['Saint Kitts and Nevis', 'KN'],
190
+ ['Saint Lucia', 'LC'],
191
+ ['Saint Martin', 'MF'],
192
+ ['Saint Pierre and Miquelon', 'PM'],
193
+ ['Saint Vincent and the Grenadines', 'VC'],
194
+ ['Samoa', 'WS'],
195
+ ['San Marino', 'SM'],
196
+ ['Sao Tome and Principe', 'ST'],
197
+ ['Saudi Arabia', 'SA'],
198
+ ['Senegal', 'SN'],
199
+ ['Serbia', 'RS'],
200
+ ['Seychelles', 'SC'],
201
+ ['Sierra Leone', 'SL'],
202
+ ['Singapore', 'SG'],
203
+ ['Slovakia', 'SK'],
204
+ ['Slovenia', 'SI'],
205
+ ['Solomon Islands', 'SB'],
206
+ ['Somalia', 'SO'],
207
+ ['South Africa', 'ZA'],
208
+ ['South Georgia and the South Sandwich Islands', 'GS'],
209
+ ['Spain', 'ES'],
210
+ ['Sri Lanka', 'LK'],
211
+ ['Sudan', 'SD'],
212
+ ['Suriname', 'SR'],
213
+ ['Svalbard and Jan Mayen', 'SJ'],
214
+ ['Swaziland', 'SZ'],
215
+ ['Sweden', 'SE'],
216
+ ['Switzerland', 'CH'],
217
+ ['Syrian Arab Republic', 'SY'],
218
+ ['Taiwan, Province of China', 'TW'],
219
+ ['Tajikistan', 'TJ'],
220
+ ['Tanzania, United Republic of', 'TZ'],
221
+ ['Thailand', 'TH'],
222
+ ['Timor-Leste', 'TL'],
223
+ ['Togo', 'TG'],
224
+ ['Tokelau', 'TK'],
225
+ ['Tonga', 'TO'],
226
+ ['Trinidad and Tobago', 'TT'],
227
+ ['Tunisia', 'TN'],
228
+ ['Turkey', 'TR'],
229
+ ['Turkmenistan', 'TM'],
230
+ ['Turks and Caicos Islands', 'TC'],
231
+ ['Tuvalu', 'TV'],
232
+ ['Uganda', 'UG'],
233
+ ['Ukraine', 'UA'],
234
+ ['United Arab Emirates', 'AE'],
235
+ ['United Kingdom', 'GB'],
236
+ ['United States', 'US'],
237
+ ['United States Minor Outlying Islands', 'UM'],
238
+ ['Uruguay', 'UY'],
239
+ ['Uzbekistan', 'UZ'],
240
+ ['Vanuatu', 'VU'],
241
+ ['Vatican City State' 'VA'],
242
+ ['Venezuela, Bolivarian Republic of', 'VE'],
243
+ ['Viet Nam', 'VN'],
244
+ ['Virgin Islands, British', 'VG'],
245
+ ['Virgin Islands, U.S.', 'VI'],
246
+ ['Wallis and Futuna', 'WF'],
247
+ ['Western Sahara', 'EH'],
248
+ ['Yemen', 'YE'],
249
+ ['Zambia', 'ZM'],
250
+ ['Zimbabwe', 'ZW']
251
+ ].freeze
252
+
253
+ CURRENCIES = [
254
+ ['Australian Dollar', 'AUD'],
255
+ ['Canadian Dollar', 'CAD'],
256
+ ['Swiss Franc', 'CHF'],
257
+ ['Danish Krone', 'DKK'],
258
+ ['Euro', 'EUR'],
259
+ ['Pound Sterling', 'GBP'],
260
+ ['Hong Kong Dollar', 'HKD'],
261
+ ['Rupiah', 'IDR'],
262
+ ['Yen', 'JPY'],
263
+ ['Luxembourg Franc', 'LUF'],
264
+ ['Norwegian Krone', 'NOK'],
265
+ ['New Zealand Dollar', 'NZD'],
266
+ ['Swedish Krona', 'SEK'],
267
+ ['Singapore Dollar', 'SGD'],
268
+ ['Turkish Lira', 'TRL'],
269
+ ['US Dollar', 'USD']
270
+ ].freeze
271
+
272
+ STATES = [
273
+ [ "Alabama", "AL" ],
274
+ [ "Alaska", "AK" ],
275
+ [ "Arizona", "AZ" ],
276
+ [ "Arkansas", "AR" ],
277
+ [ "California", "CA" ],
278
+ [ "Colorado", "CO" ],
279
+ [ "Connecticut", "CT" ],
280
+ [ "Delaware", "DE" ],
281
+ [ "District Of Columbia", "DC" ],
282
+ [ "Florida", "FL" ],
283
+ [ "Georgia", "GA" ],
284
+ [ "Hawaii", "HI" ],
285
+ [ "Idaho", "ID" ],
286
+ [ "Illinois", "IL" ],
287
+ [ "Indiana", "IN" ],
288
+ [ "Iowa", "IA" ],
289
+ [ "Kansas", "KS" ],
290
+ [ "Kentucky", "KY" ],
291
+ [ "Louisiana", "LA" ],
292
+ [ "Maine", "ME" ],
293
+ [ "Maryland", "MD" ],
294
+ [ "Massachusetts", "MA" ],
295
+ [ "Michigan", "MI" ],
296
+ [ "Minnesota", "MN" ],
297
+ [ "Mississippi", "MS" ],
298
+ [ "Missouri", "MO" ],
299
+ [ "Montana", "MT" ],
300
+ [ "Nebraska", "NE" ],
301
+ [ "Nevada", "NV" ],
302
+ [ "New Hampshire", "NH" ],
303
+ [ "New Jersey", "NJ" ],
304
+ [ "New Mexico", "NM" ],
305
+ [ "New York", "NY" ],
306
+ [ "North Carolina", "NC" ],
307
+ [ "North Dakota", "ND" ],
308
+ [ "Ohio", "OH" ],
309
+ [ "Oklahoma", "OK" ],
310
+ [ "Oregon", "OR" ],
311
+ [ "Pennsylvania", "PA" ],
312
+ [ "Rhode Island", "RI" ],
313
+ [ "South Carolina", "SC" ],
314
+ [ "South Dakota", "SD" ],
315
+ [ "Tennessee", "TN" ],
316
+ [ "Texas", "TX" ],
317
+ [ "Utah", "UT" ],
318
+ [ "Vermont", "VT" ],
319
+ [ "Virginia", "VA" ],
320
+ [ "Washington", "WA" ],
321
+ [ "West Virginia", "WV" ],
322
+ [ "Wisconsin", "WI" ],
323
+ [ "Wyoming", "WY" ]
324
+ ].freeze
325
+ end
326
+ end
@@ -0,0 +1,5 @@
1
+ module IQ
2
+ module Country
3
+ VERSION = "0.2.0"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: iq-country
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
+ platform: ruby
12
+ authors:
13
+ - Jamie Hill, SonicIQ Ltd
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-11-15 00:00:00 Z
19
+ dependencies: []
20
+
21
+ description: Lookups for country codes, states and currencies
22
+ email: jamie@soniciq.com
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files:
28
+ - README
29
+ - MIT-LICENSE
30
+ files:
31
+ - README
32
+ - Rakefile
33
+ - MIT-LICENSE
34
+ - lib/iq-country/version.rb
35
+ - lib/iq-country.rb
36
+ homepage: http://code.soniciq.com/iq/country
37
+ licenses: []
38
+
39
+ post_install_message:
40
+ rdoc_options:
41
+ - --title
42
+ - IQ::Country
43
+ - --main
44
+ - README
45
+ - --inline-source
46
+ - --line-numbers
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ hash: 3
55
+ segments:
56
+ - 0
57
+ version: "0"
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ hash: 3
64
+ segments:
65
+ - 0
66
+ version: "0"
67
+ requirements: []
68
+
69
+ rubyforge_project:
70
+ rubygems_version: 1.8.10
71
+ signing_key:
72
+ specification_version: 3
73
+ summary: Just a bunch of multidimensional arrays
74
+ test_files: []
75
+