csv_country_selector 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +34 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +49 -0
- data/Rakefile +2 -0
- data/countries.csv +222 -0
- data/csv_country_selector.gemspec +25 -0
- data/lib/csv_country_selector/version.rb +5 -0
- data/lib/csv_country_selector.rb +37 -0
- metadata +88 -0
data/.gitignore
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/test/tmp/
|
9
|
+
/test/version_tmp/
|
10
|
+
/tmp/
|
11
|
+
|
12
|
+
## Specific to RubyMotion:
|
13
|
+
.dat*
|
14
|
+
.repl_history
|
15
|
+
build/
|
16
|
+
|
17
|
+
## Documentation cache and generated files:
|
18
|
+
/.yardoc/
|
19
|
+
/_yardoc/
|
20
|
+
/doc/
|
21
|
+
/rdoc/
|
22
|
+
|
23
|
+
## Environment normalisation:
|
24
|
+
/.bundle/
|
25
|
+
/lib/bundler/man/
|
26
|
+
|
27
|
+
# for a library or gem, you might want to ignore these files since the code is
|
28
|
+
# intended to run in multiple environments; otherwise, check them in:
|
29
|
+
# Gemfile.lock
|
30
|
+
# .ruby-version
|
31
|
+
# .ruby-gemset
|
32
|
+
|
33
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
34
|
+
.rvmrc
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Marco Metz
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# CsvCountrySelector
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'csv_country_selector'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install csv_country_selector
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
CsvCountrySelector::Country.short_name_for("Deutschland") => "DE"
|
25
|
+
```
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
CsvCountrySelector::Country.long_name_for("de") => "Deutschland"
|
29
|
+
```
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
CsvCountrySelector::Country.long_list => ["Deutschland", "USA", ..]
|
33
|
+
```
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
CsvCountrySelector::Country.short_list => ["DE", "AT", ..]
|
37
|
+
```
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
CsvCountrySelector::Country.codes => {:de => "Deutschland", :at => "Österreich", ...}
|
41
|
+
```
|
42
|
+
|
43
|
+
## Contributing
|
44
|
+
|
45
|
+
1. Fork it ( https://github.com/[my-github-username]/csv_country_selector/fork )
|
46
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
47
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
48
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
49
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/countries.csv
ADDED
@@ -0,0 +1,222 @@
|
|
1
|
+
AE;UAE;AR;AE;AEMIR;Ver.Arab.Emir.;d. Verein. Arab;
|
2
|
+
AF;AFG;EN;AF;AFGHAN;Afghanistan;afghanisch;
|
3
|
+
AL;AL;EN;AL;ALBAN;Albanien;albanisch;Albanien
|
4
|
+
AM;ARM;;AM;ARMEN;Armenien;armenisch;Armenien
|
5
|
+
AN;NA;NL;AN;NLANT;Niederl.Antill.;niederländisch;
|
6
|
+
AO;ANG;FR;AO;ANGOLA;Angola;angolisch;
|
7
|
+
AR;AR;EN;AR;;Argentinien;;
|
8
|
+
AT;A;DE;AT;OESTER;Österreich;österreichisch;
|
9
|
+
AU;AUS;EN;AU;AUSTRL;Australien;australisch;
|
10
|
+
AZ;ASE;;AZ;ASERB;Aserbaidschan;aserbaidschanis;Aserbaidschan
|
11
|
+
BA;BIH;;BA;B HERZ;Bosnien-Herz.;;Bosnien-Herzegowina
|
12
|
+
BB;BDS;;BB;;Barbados;;
|
13
|
+
BD;;;BD;;Bangladesch;;
|
14
|
+
BE;B;EN;BE;BELLUX;Belgien;belgisch;
|
15
|
+
BF;;;BF;;Burkina Faso;;
|
16
|
+
BG;BG;;BG;;Bulgarien;bulgarisch;
|
17
|
+
BH;;;BH;;Bahrain;;
|
18
|
+
BI;;;BI;;Burundi;;
|
19
|
+
BJ;;;BJ;;Benin;;
|
20
|
+
BM;;;BM;;Bermuda;;
|
21
|
+
BN;;;BN;;Brunei;;
|
22
|
+
BO;;;BO;;Bolivien;bolivianisch;
|
23
|
+
BR;BRA;PT;BR;BRASIL;Brasilien;brasilianisch;
|
24
|
+
BS;BS;;BS;;Bahamas;;
|
25
|
+
BT;;;BT;;Bhutan;;
|
26
|
+
BW;;;BW;;Botsuana;;
|
27
|
+
BY;BY;RU;BY;WRUSS;Weissrussland;;
|
28
|
+
BZ;;;BZ;;Belize;;
|
29
|
+
CA;CDN;EN;CA;CANADA;Kanada;kanadisch;
|
30
|
+
CC;;;CC;;Kokosinseln;;
|
31
|
+
CD;;;CD;DR KON;Dem. Rep. Kongo;;Demokratische Republik Kongo
|
32
|
+
CF;;;CF;;Zentralaf. Rep.;;
|
33
|
+
CG;RCB;;CG;;Kongo;;
|
34
|
+
CH;CH;DE;CH;SCHWZ;Schweiz;schweizerisch;
|
35
|
+
CI;CI;;CI;;Elfenbeinküste;;
|
36
|
+
CK;;;CK;;Cookinseln;;
|
37
|
+
CL;RCH;;CL;;Chile;chilenisch;
|
38
|
+
CM;;;CM;;Kamerun;;
|
39
|
+
CN;CHI;CS;CN;CHINA;China;chinesich;
|
40
|
+
CO;CO;;CO;;Kolumbien;kolumbianisch;
|
41
|
+
CR;CR;;CR;;Costa Rica;;
|
42
|
+
CS;;;CS;SERMON;Serbien, Monten;;Serbien und Montenegro
|
43
|
+
CU;C;;CU;;Kuba;kubanisch;
|
44
|
+
CV;;;CV;;Kap Verde;;
|
45
|
+
CX;;;CX;;Weihnachtsinsel;;
|
46
|
+
CY;CY;;CY;;Zypern;zypriotisch;
|
47
|
+
CZ;CZ;;CZ;TSCHE;Tschechien;Tschechisch;
|
48
|
+
D;AND;DE;D;;Andorra;;
|
49
|
+
DE;D;DE;DE;;Deutschland;deutsch;
|
50
|
+
DJ;;;DJ;;Dschibuti;;
|
51
|
+
DK;DK;DA;DK;DAENM;Dänemark;dänisch;
|
52
|
+
DM;;;DM;;Dominica;;
|
53
|
+
DO;DOM;;DO;;Dominik. Rep.;;
|
54
|
+
DZ;DZ;;DZ;;Algerien;;
|
55
|
+
EC;EC;;EC;;Ecuador;;
|
56
|
+
EE;EST;RU;EE;ESTLD;Estland;estnisc;
|
57
|
+
EG;ET;;EG;;Ägypten;ägyptisch;
|
58
|
+
ER;;;ER;ERITRE;Eritrea;;Eritrea
|
59
|
+
ES;E;ES;ES;SPAN;Spanien;spanisch;
|
60
|
+
ET;ETH;;ET;;Äthiopien;äthiopisch;
|
61
|
+
FI;FIN;SV;FI;FINNL;Finnland;finnisch;
|
62
|
+
FJ;;;FJ;;Fidschi;;
|
63
|
+
FK;;;FK;;Falklandinseln;;
|
64
|
+
FO;;;FO;;Färöer;;
|
65
|
+
FR;F;FR;FR;FRANKR;Frankreich;französisch;
|
66
|
+
GA;;;GA;;Gabun;;
|
67
|
+
GB;GB;EN;GB;GBRIT;Grossbritanien;britisch;
|
68
|
+
GD;;;GD;;Grenada;;
|
69
|
+
GE;;;GE;GEORG;Georgien;georgisch;Georgien
|
70
|
+
GF;;;GF;;Französ. Guinea;;
|
71
|
+
GH;GH;;GH;;Ghana;;
|
72
|
+
GI;GBZ;;GI;;Gibraltar;;
|
73
|
+
GL;;;GL;;Grönland;grönländisch;
|
74
|
+
GM;;;GM;;Gambia;;
|
75
|
+
GN;;;GN;;Guinea;;
|
76
|
+
GP;;;GP;;Guadeloupe;;
|
77
|
+
GQ;;;GQ;;Äquatorialguine;;
|
78
|
+
GR;GR;;GR;;Griechenland;griechisch;
|
79
|
+
GS;;;GS;SGEORG;Südgeorgien;;Südgeorgien u.d. südl. Sandwich-Inseln
|
80
|
+
GT;GCA;;GT;;Guatemala;guatemaltekisch;
|
81
|
+
GU;;;GU;;Guam;;
|
82
|
+
GW;;;GW;;Guinea-Bissau;;
|
83
|
+
GY;GUY;;GY;;Guyana;;
|
84
|
+
HK;;;HK;;Hongkong;;
|
85
|
+
HN;;;HN;;Honduras;;
|
86
|
+
HR;;;HR;;Kroatien;;
|
87
|
+
HT;RH;;HT;;Haiti;haitisch;
|
88
|
+
HU;H;RU;HU;UNGARN;Ungarn;ungarisch;
|
89
|
+
ID;RI;;ID;;Indonesien;indonesisch;
|
90
|
+
IE;IRL;EN;IE;;Irland;irisch;
|
91
|
+
IL;IL;;IL;;Israel;israelisch;
|
92
|
+
IN;IND;;IN;;Indien m.Sikkim;indisch;
|
93
|
+
IQ;IRQ;;IQ;;Irak;irakisch;
|
94
|
+
IR;IR;;IR;;Iran;iranisch;
|
95
|
+
IS;IS;;IS;;Island;isländisch;
|
96
|
+
IT;I;IT;IT;ITAL;Italien;italienisch;
|
97
|
+
JM;JA;EN;JM;;Jamaika;jamaikanisch;
|
98
|
+
JO;JOR;;JO;;Jordanien;jordanisch;
|
99
|
+
JP;JP;JA;JP;JAPAN;Japan;japanisch;
|
100
|
+
KE;EAK;;KE;;Kenia;kenianisch;
|
101
|
+
KG;;;KG;KIGIS;Kirgistan;kirgisisch;Kirgistan
|
102
|
+
KH;;;KH;;Kambodscha;kamdodschanisch;
|
103
|
+
KI;;;KI;;Kiribati;;
|
104
|
+
KM;;;KM;;Komoren;;
|
105
|
+
KN;;;KN;;St.Chr.,Nevis;;
|
106
|
+
KP;;;KP;;Südkorea;südkoreanisch;
|
107
|
+
KR;;;KR;;Nordkorea;nordkoreanisch;
|
108
|
+
KW;;;KW;;Kuwait;kuwaitisch;
|
109
|
+
KY;;;KY;;Kaimaninseln;;
|
110
|
+
KZ;;;KZ;KASACH;Kasachstan;;Kasachstan
|
111
|
+
LA;LAO;;LA;;Laos;;
|
112
|
+
LB;RL;;LB;;Libanon;libanesisch;
|
113
|
+
LC;;;LC;;St. Lucia;;
|
114
|
+
LI;FL;DE;LI;LIECHT;Liechtenstein;liechtensteinis;
|
115
|
+
LK;CL;;LK;;Sri Lanka;;
|
116
|
+
LR;;;LR;;Liberia;liberianisch;
|
117
|
+
LS;;;LS;;Lesotho;;
|
118
|
+
LT;LT;LT;LT;LITAU;Litauen;litauisch;
|
119
|
+
LU;L;FR;LU;;Luxemburg;luxemburgisch;
|
120
|
+
LV;LV;;LV;LETTLD;Lettland;lettisch;
|
121
|
+
LY;;;LY;;Libyen;libysch;
|
122
|
+
MA;MA;;MA;;Marokko;marokkanisch;
|
123
|
+
MC;MC;FR;MC;;Monaco;monegassisch;
|
124
|
+
MD;;;MD;MOLDAU;Moldawien;;Moldawien
|
125
|
+
MG;RM;;MG;;Madagaskar;madagassisch;
|
126
|
+
MK;;;MK;MAZAD;Mazedonien;;Mazedonien
|
127
|
+
ML;RMM;;ML;;Mali;;
|
128
|
+
MM;;;MM;MYAN;Myanmar;;Myanmar
|
129
|
+
MN;;;MN;;Mongolei;mongolisch;
|
130
|
+
MQ;;;MQ;;Martinique;;
|
131
|
+
MR;;;MR;;Mauretanien;mauretanisch;
|
132
|
+
MS;;;MS;;Montserrat;;
|
133
|
+
MT;M;;MT;;Malta;maltekisch;
|
134
|
+
MU;MS;;MU;;Mauritius;;
|
135
|
+
MV;;;MV;;Malediven;;
|
136
|
+
MW;MW;;MW;;Malawi;;
|
137
|
+
MX;MEX;ES;MX;;Mexiko;mexikanisch;
|
138
|
+
MY;MAL;;MY;;Malaysia;malaysch;
|
139
|
+
MZ;;;MZ;;Mosambik;;
|
140
|
+
NA;;;NA;;Namibia;;
|
141
|
+
NC;;;NC;;Neukaledonien;neukaledonisch;
|
142
|
+
NE;;;NE;;Niger;;
|
143
|
+
NF;;EN;NF;;Nordfolkinseln;;
|
144
|
+
NG;WAN;;NG;;Nigeria;nigerianisch;
|
145
|
+
NI;NIC;;NI;;Nicaragua;;
|
146
|
+
NL;NL;NL;NL;NIEDL;Niederlande;niederländisch;
|
147
|
+
NO;N;NO;NO;NORWEG;Norwegen;norwegisch;
|
148
|
+
NP;;;NP;;Nepal;nepalesisch;
|
149
|
+
NR;;;NR;;Nauru;;
|
150
|
+
NU;;;NU;;Niue-Inseln;;
|
151
|
+
NZ;NZ;EN;NZ;;Neuseeland;neuseeländisch;
|
152
|
+
OM;;;OM;;Oman;omanisch;
|
153
|
+
PA;PA;;PA;;Panama;panamesisch;
|
154
|
+
PE;PE;;PE;;Peru;peruanisch;
|
155
|
+
PF;;;PF;;FranzPolynesien;;
|
156
|
+
PG;;;PG;;Papua-Neuguinea;;
|
157
|
+
PH;;;PH;;Philippinen;philippinisch;
|
158
|
+
PK;PAK;;PK;;Pakistan;pakistanisch;
|
159
|
+
PL;PL;;PL;;Polen;polnisch;
|
160
|
+
PM;;;PM;;St.Pier,Miquel.;;
|
161
|
+
PR;;;PR;;Puerto Rico;puertoricanisch;
|
162
|
+
PS;;;PS;BPAL G;Paläst. Gebiete;;Palästinensische Selbstverwaltungsgebiete
|
163
|
+
PT;P;PT;PT;;Portugal;portugiesisch;
|
164
|
+
PY;PY;;PY;;Paraguay;;
|
165
|
+
QU;;;QU;;Katar;;
|
166
|
+
RE;;;RE;;Reunion;;
|
167
|
+
RO;RO;;RO;;Rumänien;rumänisch;
|
168
|
+
RU;RUS;RU;RU;RUSSLD;Russische Foed.;Russisch;
|
169
|
+
RW;RWA;;RW;;Ruanda;;
|
170
|
+
SA;;;SA;;Saudi-Arabien;saudisch;
|
171
|
+
SB;;;SB;;Salomonen;;
|
172
|
+
SC;;;SC;;Seschellen;;
|
173
|
+
SD;;;SD;;Sudan;;
|
174
|
+
SE;S;SV;SE;SCHWED;Schweden;schwedisch;
|
175
|
+
SG;SGP;EN;SG;SINGAP;Singapur;;
|
176
|
+
SH;;;SH;;St. Helena;;
|
177
|
+
SI;SLO;SL;SI;SLOWEN;Slowenien;SLOWENISCH;
|
178
|
+
SK;SK;SK;SK;SLOWA;Slowakische Rep;Slowakisch;
|
179
|
+
SL;;;SL;;Sierra Leone;;
|
180
|
+
SM;RSM;IT;SM;;San Marino;;
|
181
|
+
SN;SN;FR;SN;;Senegal;senegalesisch;
|
182
|
+
SO;;;SO;;Somalia;;
|
183
|
+
SR;SME;;SR;;Suriname;;
|
184
|
+
ST;;;ST;;S.Tome,Principe;;
|
185
|
+
SU;SU;;SU;;GUS;;
|
186
|
+
SV;ES;;SV;;El Salvador;;
|
187
|
+
SY;SYR;;SY;;Syrien;syrisch;
|
188
|
+
SZ;;;SZ;;Swasiland;;
|
189
|
+
TC;;;TC;;Turks-,Caicosin;;
|
190
|
+
TD;;;TD;;Tschad;;
|
191
|
+
TG;TG;;TG;;Togo;;
|
192
|
+
TH;T;;TH;;Thailand;thailändisch;
|
193
|
+
TJ;;;TJ;TADSCH;Tadschikistan;;Tadschikistan
|
194
|
+
TL;;;TL;TIMLES;Timor;;Timor-Leste
|
195
|
+
TM;;;TM;TURKM;Turkmenistan;;Turkmenistan
|
196
|
+
TN;TN;FR;TN;;Tunesien;tunesisch;
|
197
|
+
TO;;;TO;;Tonga;;
|
198
|
+
TR;TR;;TR;;Türkei;türkisch;
|
199
|
+
TT;;;TT;;Trinidad,Tobago;;
|
200
|
+
TV;;;TV;;Tuvalu;;
|
201
|
+
TW;;;TW;;Taiwan;taiwanesisch;
|
202
|
+
TZ;EAT;;TZ;;Tansania;tansanisch;
|
203
|
+
UA;UA;RU;UA;UKRAIN;Ukraine;ukrainisch;
|
204
|
+
UG;EAU;;UG;;Uganda;;
|
205
|
+
US;USA;EN;US;USA;USA;amerikanisch;
|
206
|
+
UY;ROU;;UY;;Uruguay;;
|
207
|
+
UZ;;;UZ;USBEK;Usbekistan;;Usbekistan
|
208
|
+
VA;V;IT;VA;;Vatikanstadt;;Vatikanstadt
|
209
|
+
VC;;;VC;;St. Vincent;;
|
210
|
+
VE;YV;;VE;;Venezuela;venezolanisch;
|
211
|
+
VG;VG;;VG;;Brit.Virgin Isl;;
|
212
|
+
VI;;EN;VI;;Amer.Jungferni.;;
|
213
|
+
VN;VN;;VN;;Vietnam;vietnamesisch;
|
214
|
+
VU;;;VU;;Vanuatu;;
|
215
|
+
WF;;;WF;;Wallis,Futuna;;
|
216
|
+
WS;;;WS;;Westsamoa;;
|
217
|
+
YD;;;YD;;Südjemen;;
|
218
|
+
YE;;;YE;;Nordjemen;jemenitisch;
|
219
|
+
YT;;;YT;MAYOTT;Mayotte;;Mayotte
|
220
|
+
ZA;ZA;;ZA;;Südafrika;südafrikanisch;
|
221
|
+
ZM;;;ZM;;Sambia;;
|
222
|
+
ZW;;;ZW;;Simbabwe;;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# coding: utf-8
|
4
|
+
lib = File.expand_path('../lib', __FILE__)
|
5
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
|
+
require 'csv_country_selector/version'
|
7
|
+
|
8
|
+
Gem::Specification.new do |spec|
|
9
|
+
spec.name = "csv_country_selector"
|
10
|
+
spec.version = CsvCountrySelector::VERSION
|
11
|
+
spec.authors = ["Marco Metz"]
|
12
|
+
spec.email = ["marco.metz@gmail.com"]
|
13
|
+
spec.summary = %q{Country List with long and short names}
|
14
|
+
spec.description = %q{Country list based on a csv file wit long an short names for Dropdowns and selections}
|
15
|
+
spec.homepage = "https://github.com/ikuseiGmbH/csv_country_selector"
|
16
|
+
spec.license = "MIT"
|
17
|
+
|
18
|
+
spec.files = `git ls-files -z`.split("\x0")
|
19
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
|
+
spec.require_paths = ["lib"]
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require "csv_country_selector/version"
|
4
|
+
|
5
|
+
module CsvCountrySelector
|
6
|
+
class Country
|
7
|
+
|
8
|
+
spec = Gem::Specification.find_by_name("csv_country_selector")
|
9
|
+
gem_root = spec.gem_dir
|
10
|
+
|
11
|
+
#CSV Tabelle als Masterfreferenz
|
12
|
+
#Lnd;Kfz;Sprache;ISO-Code;Kurzbez;Bezeichnung;Nationalität;Bezeichnung lang
|
13
|
+
@@codes = CSV.read("#{gem_root}/countries.csv", :col_sep => ";").inject({}){|a,b| a.merge!({b[0] => b[5]})}
|
14
|
+
|
15
|
+
def self.short_name_for(name)
|
16
|
+
@@codes.select{|k,v| v.downcase == name.downcase}.try(:first).try(:first)
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
def self.long_name_for(name)
|
21
|
+
@@codes.select{|k,v| k.downcase == name.downcase}.try(:first).try(:last)
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.long_list
|
25
|
+
@@codes.values
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.short_list
|
29
|
+
@@codes.values
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.codes
|
33
|
+
@@codes
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: csv_country_selector
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Marco Metz
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.7'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.7'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '10.0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '10.0'
|
46
|
+
description: Country list based on a csv file wit long an short names for Dropdowns
|
47
|
+
and selections
|
48
|
+
email:
|
49
|
+
- marco.metz@gmail.com
|
50
|
+
executables: []
|
51
|
+
extensions: []
|
52
|
+
extra_rdoc_files: []
|
53
|
+
files:
|
54
|
+
- .gitignore
|
55
|
+
- Gemfile
|
56
|
+
- LICENSE.txt
|
57
|
+
- README.md
|
58
|
+
- Rakefile
|
59
|
+
- countries.csv
|
60
|
+
- csv_country_selector.gemspec
|
61
|
+
- lib/csv_country_selector.rb
|
62
|
+
- lib/csv_country_selector/version.rb
|
63
|
+
homepage: https://github.com/ikuseiGmbH/csv_country_selector
|
64
|
+
licenses:
|
65
|
+
- MIT
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options: []
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
78
|
+
requirements:
|
79
|
+
- - ! '>='
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
requirements: []
|
83
|
+
rubyforge_project:
|
84
|
+
rubygems_version: 1.8.26
|
85
|
+
signing_key:
|
86
|
+
specification_version: 3
|
87
|
+
summary: Country List with long and short names
|
88
|
+
test_files: []
|