greek-cities 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/gc.rb +3 -0
- data/lib/gc/cities/ahaia.yml +17 -0
- data/lib/gc/cities/aitoloakarnania.yml +24 -0
- data/lib/gc/cities/argolida.yml +14 -0
- data/lib/gc/cities/arkadia.yml +17 -0
- data/lib/gc/cities/arta.yml +14 -0
- data/lib/gc/cities/attiki.yml +200 -0
- data/lib/gc/cities/boiotia.yml +20 -0
- data/lib/gc/cities/dodekanisa.yml +47 -0
- data/lib/gc/cities/drama.yml +17 -0
- data/lib/gc/cities/evros.yml +17 -0
- data/lib/gc/cities/eyrytania.yml +11 -0
- data/lib/gc/cities/eyvoia.yml +26 -0
- data/lib/gc/cities/florina.yml +11 -0
- data/lib/gc/cities/fokida.yml +9 -0
- data/lib/gc/cities/fthiotida.yml +23 -0
- data/lib/gc/cities/grevena.yml +8 -0
- data/lib/gc/cities/halkidiki.yml +17 -0
- data/lib/gc/cities/hania.yml +23 -0
- data/lib/gc/cities/hios.yml +8 -0
- data/lib/gc/cities/ilia.yml +23 -0
- data/lib/gc/cities/imathia.yml +11 -0
- data/lib/gc/cities/ioannina.yml +26 -0
- data/lib/gc/cities/irakleio.yml +23 -0
- data/lib/gc/cities/karditsa.yml +20 -0
- data/lib/gc/cities/kastoria.yml +11 -0
- data/lib/gc/cities/kavala.yml +14 -0
- data/lib/gc/cities/kefallonia.yml +8 -0
- data/lib/gc/cities/kerkira.yml +8 -0
- data/lib/gc/cities/kiklades.yml +60 -0
- data/lib/gc/cities/kilkis.yml +8 -0
- data/lib/gc/cities/korinthos.yml +20 -0
- data/lib/gc/cities/kozani.yml +14 -0
- data/lib/gc/cities/lakonia.yml +17 -0
- data/lib/gc/cities/larisa.yml +23 -0
- data/lib/gc/cities/lasithi.yml +11 -0
- data/lib/gc/cities/lefkada.yml +8 -0
- data/lib/gc/cities/lesvos.yml +11 -0
- data/lib/gc/cities/magnisia.yml +26 -0
- data/lib/gc/cities/messinia.yml +20 -0
- data/lib/gc/cities/pella.yml +14 -0
- data/lib/gc/cities/pieria.yml +11 -0
- data/lib/gc/cities/preveza.yml +11 -0
- data/lib/gc/cities/rethymno.yml +17 -0
- data/lib/gc/cities/rodopi.yml +14 -0
- data/lib/gc/cities/samos.yml +11 -0
- data/lib/gc/cities/serres.yml +23 -0
- data/lib/gc/cities/thesprotia.yml +11 -0
- data/lib/gc/cities/thessaloniki.yml +44 -0
- data/lib/gc/cities/trikala.yml +14 -0
- data/lib/gc/cities/xanthi.yml +14 -0
- data/lib/gc/cities/zakinthos.yml +5 -0
- data/lib/gc/city.rb +59 -57
- data/lib/gc/helpers/load_files.rb +13 -0
- data/lib/gc/states.rb +1 -55
- data/lib/gc/states.yml +155 -0
- data/lib/gc/version.rb +1 -1
- metadata +58 -56
- data/lib/gc/cities/ahaia.rb +0 -13
- data/lib/gc/cities/aitoloakarnania.rb +0 -15
- data/lib/gc/cities/argolida.rb +0 -12
- data/lib/gc/cities/arkadia.rb +0 -13
- data/lib/gc/cities/arta.rb +0 -12
- data/lib/gc/cities/attiki.rb +0 -74
- data/lib/gc/cities/boiotia.rb +0 -14
- data/lib/gc/cities/dodekanisa.rb +0 -23
- data/lib/gc/cities/drama.rb +0 -13
- data/lib/gc/cities/evros.rb +0 -13
- data/lib/gc/cities/eyrytania.rb +0 -11
- data/lib/gc/cities/eyvoia.rb +0 -16
- data/lib/gc/cities/florina.rb +0 -11
- data/lib/gc/cities/fokida.rb +0 -10
- data/lib/gc/cities/fthiotida.rb +0 -15
- data/lib/gc/cities/grevena.rb +0 -10
- data/lib/gc/cities/halkidiki.rb +0 -13
- data/lib/gc/cities/hania.rb +0 -15
- data/lib/gc/cities/hios.rb +0 -10
- data/lib/gc/cities/ilia.rb +0 -15
- data/lib/gc/cities/imathia.rb +0 -11
- data/lib/gc/cities/ioannina.rb +0 -16
- data/lib/gc/cities/irakleio.rb +0 -15
- data/lib/gc/cities/karditsa.rb +0 -14
- data/lib/gc/cities/kastoria.rb +0 -11
- data/lib/gc/cities/kavala.rb +0 -12
- data/lib/gc/cities/kefallonia.rb +0 -10
- data/lib/gc/cities/kerkira.rb +0 -10
- data/lib/gc/cities/kiklades.rb +0 -27
- data/lib/gc/cities/kilkis.rb +0 -10
- data/lib/gc/cities/korinthos.rb +0 -14
- data/lib/gc/cities/kozani.rb +0 -12
- data/lib/gc/cities/lakonia.rb +0 -13
- data/lib/gc/cities/larisa.rb +0 -15
- data/lib/gc/cities/lasithi.rb +0 -11
- data/lib/gc/cities/lefkada.rb +0 -10
- data/lib/gc/cities/lesvos.rb +0 -11
- data/lib/gc/cities/magnisia.rb +0 -16
- data/lib/gc/cities/messinia.rb +0 -14
- data/lib/gc/cities/pella.rb +0 -12
- data/lib/gc/cities/pieria.rb +0 -11
- data/lib/gc/cities/preveza.rb +0 -11
- data/lib/gc/cities/rethymno.rb +0 -13
- data/lib/gc/cities/rodopi.rb +0 -12
- data/lib/gc/cities/samos.rb +0 -11
- data/lib/gc/cities/serres.rb +0 -15
- data/lib/gc/cities/thesprotia.rb +0 -11
- data/lib/gc/cities/thessaloniki.rb +0 -22
- data/lib/gc/cities/trikala.rb +0 -12
- data/lib/gc/cities/xanthi.rb +0 -12
- data/lib/gc/cities/zakinthos.rb +0 -9
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
-
|
4
|
+
- 'Βόλος'
|
5
|
+
- 'volos-MAG'
|
6
|
+
-
|
7
|
+
- 'Βελεστίνο'
|
8
|
+
- 'velestino-MAG'
|
9
|
+
-
|
10
|
+
- 'Ζαγορά'
|
11
|
+
- 'zagora-MAG'
|
12
|
+
-
|
13
|
+
- 'Αλμυρός'
|
14
|
+
- 'almiros-MAG'
|
15
|
+
-
|
16
|
+
- 'Αργαλαστή'
|
17
|
+
- 'argalasti-MAG'
|
18
|
+
-
|
19
|
+
- 'Αλόννησος'
|
20
|
+
- 'alonnisos-MAG'
|
21
|
+
-
|
22
|
+
- 'Σκιάθος'
|
23
|
+
- 'skiathos-MAG'
|
24
|
+
-
|
25
|
+
- 'Σκοπέλος'
|
26
|
+
- 'skopelos-MAG'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
-
|
4
|
+
- 'Καλαμάτα'
|
5
|
+
- 'kalamata-MES'
|
6
|
+
-
|
7
|
+
- 'Μεσσήνη'
|
8
|
+
- 'messini-MES'
|
9
|
+
-
|
10
|
+
- 'Πύλος'
|
11
|
+
- 'pilos-MES'
|
12
|
+
-
|
13
|
+
- 'Κυπαρισσία'
|
14
|
+
- 'kiparissia-MES'
|
15
|
+
-
|
16
|
+
- 'Μελιγαλά'
|
17
|
+
- 'meligala-MES'
|
18
|
+
-
|
19
|
+
- 'Καρδαμύλη'
|
20
|
+
- 'kardamili-MES'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
-
|
4
|
+
- 'Σέρρες'
|
5
|
+
- 'serres-SER'
|
6
|
+
-
|
7
|
+
- 'Σιδηρόκαστρο'
|
8
|
+
- 'sidirokastro-SER'
|
9
|
+
-
|
10
|
+
- 'Νιγρίτα'
|
11
|
+
- 'nigrita-SER'
|
12
|
+
-
|
13
|
+
- 'Χρυσό'
|
14
|
+
- 'hriso-SER'
|
15
|
+
-
|
16
|
+
- 'Ροδολίβος'
|
17
|
+
- 'rodolivos-SER'
|
18
|
+
-
|
19
|
+
- 'Νέα Ζίχνη'
|
20
|
+
- 'nea-zihni-SER'
|
21
|
+
-
|
22
|
+
- 'Ηράκλεια'
|
23
|
+
- 'irakleia-SER'
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
-
|
4
|
+
- 'Θεσσαλονίκη'
|
5
|
+
- 'thessaloniki-THESS'
|
6
|
+
-
|
7
|
+
- 'Κορδελιό - Εύοσμο'
|
8
|
+
- 'kordelio-euosmo-THESS'
|
9
|
+
-
|
10
|
+
- 'Νεάπολη - Συκιές'
|
11
|
+
- 'neapoli-sikies-THESS'
|
12
|
+
-
|
13
|
+
- 'Σταυρούπολη'
|
14
|
+
- 'stavroupoli-THESS'
|
15
|
+
-
|
16
|
+
- 'Αμπελόκηποι'
|
17
|
+
- 'ampelokipoi-THESS'
|
18
|
+
-
|
19
|
+
- 'Πανόραμα'
|
20
|
+
- 'panorama-THESS'
|
21
|
+
-
|
22
|
+
- 'Κουφάλια'
|
23
|
+
- 'koufalia-THESS'
|
24
|
+
-
|
25
|
+
- 'Σίνδος'
|
26
|
+
- 'sindos-THESS'
|
27
|
+
-
|
28
|
+
- 'Ωραιόκαστρο'
|
29
|
+
- 'oraiokastro-THESS'
|
30
|
+
-
|
31
|
+
- 'Λαγκαδάς'
|
32
|
+
- 'lagkadas-THESS'
|
33
|
+
-
|
34
|
+
- 'Περαία'
|
35
|
+
- 'peraia-THESS'
|
36
|
+
-
|
37
|
+
- 'θέρμη'
|
38
|
+
- 'thermi-THESS'
|
39
|
+
-
|
40
|
+
- 'Σταυρός'
|
41
|
+
- 'stavros-THESS'
|
42
|
+
-
|
43
|
+
- 'Καλαμαριά'
|
44
|
+
- 'kalamaria-THESS'
|
data/lib/gc/city.rb
CHANGED
@@ -1,63 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
Dir[File.dirname(__FILE__) + "/cities/*.rb"].each { |file| require file }
|
4
|
-
|
5
3
|
module GC
|
6
4
|
module City
|
7
|
-
CITY_HASH = {
|
8
|
-
aha: GC::Cities::AHAIA,
|
9
|
-
ait: GC::Cities::AITOLOAKARNANIA,
|
10
|
-
arg: GC::Cities::ARGOLIDA,
|
11
|
-
ark: GC::Cities::ARKADIA,
|
12
|
-
art: GC::Cities::ARTA,
|
13
|
-
att: GC::Cities::ATTIKI,
|
14
|
-
boi: GC::Cities::BOIOTIA,
|
15
|
-
dod: GC::Cities::DODEKANISA,
|
16
|
-
dra: GC::Cities::DRAMA,
|
17
|
-
evr: GC::Cities::EVROS,
|
18
|
-
eyr: GC::Cities::EYRYTANIA,
|
19
|
-
eyv: GC::Cities::EYVOIA,
|
20
|
-
flo: GC::Cities::FLORINA,
|
21
|
-
fok: GC::Cities::FOKIDA,
|
22
|
-
fth: GC::Cities::FTHIOTIDA,
|
23
|
-
gre: GC::Cities::GREVENA,
|
24
|
-
hal: GC::Cities::HALKIDIKI,
|
25
|
-
han: GC::Cities::HANIA,
|
26
|
-
hio: GC::Cities::HIOS,
|
27
|
-
ili: GC::Cities::ILIA,
|
28
|
-
ima: GC::Cities::IMATHIA,
|
29
|
-
ioa: GC::Cities::IOANNINA,
|
30
|
-
ira: GC::Cities::IRAKLEIO,
|
31
|
-
kar: GC::Cities::KARDITSA,
|
32
|
-
kas: GC::Cities::KASTORIA,
|
33
|
-
kav: GC::Cities::KAVALA,
|
34
|
-
kef: GC::Cities::KEFALLONIA,
|
35
|
-
ker: GC::Cities::KERKIRA,
|
36
|
-
kik: GC::Cities::KIKLADES,
|
37
|
-
kil: GC::Cities::KILKIS,
|
38
|
-
kor: GC::Cities::KORINTHOS,
|
39
|
-
koz: GC::Cities::KOZANI,
|
40
|
-
lak: GC::Cities::LAKONIA,
|
41
|
-
lar: GC::Cities::LARISA,
|
42
|
-
las: GC::Cities::LASITHI,
|
43
|
-
lef: GC::Cities::LEFKADA,
|
44
|
-
les: GC::Cities::LESVOS,
|
45
|
-
mag: GC::Cities::MAGNISIA,
|
46
|
-
mes: GC::Cities::MESSINIA,
|
47
|
-
pel: GC::Cities::PELLA,
|
48
|
-
pie: GC::Cities::PIERIA,
|
49
|
-
pre: GC::Cities::PREVEZA,
|
50
|
-
ret: GC::Cities::RETHYMNO,
|
51
|
-
rod: GC::Cities::RODOPI,
|
52
|
-
sam: GC::Cities::SAMOS,
|
53
|
-
ser: GC::Cities::SERRES,
|
54
|
-
thesp: GC::Cities::THESPROTIA,
|
55
|
-
thess: GC::Cities::THESSALONIKI,
|
56
|
-
tri: GC::Cities::TRIKALA,
|
57
|
-
xan: GC::Cities::XANTHI,
|
58
|
-
zak: GC::Cities::ZAKINTHOS
|
59
|
-
}.freeze
|
60
|
-
|
61
5
|
def get_city_name(state_code, city)
|
62
6
|
cities_by_code = cities(state_code)
|
63
7
|
cities_hash = cities_by_code.map(&:reverse).to_h
|
@@ -65,7 +9,65 @@ module GC
|
|
65
9
|
end
|
66
10
|
|
67
11
|
def cities(code)
|
68
|
-
|
12
|
+
cities_hash_table[code.downcase.to_sym] || raise('city not found')
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def cities_hash_table
|
18
|
+
@cities_hash_table ||= {
|
19
|
+
aha: GC::Helpers::LoadFiles.load('/cities/ahaia.yml'),
|
20
|
+
ait: GC::Helpers::LoadFiles.load('/cities/aitoloakarnania.yml'),
|
21
|
+
arg: GC::Helpers::LoadFiles.load('/cities/argolida.yml'),
|
22
|
+
ark: GC::Helpers::LoadFiles.load('/cities/arkadia.yml'),
|
23
|
+
art: GC::Helpers::LoadFiles.load('/cities/arta.yml'),
|
24
|
+
att: GC::Helpers::LoadFiles.load('/cities/attiki.yml'),
|
25
|
+
boi: GC::Helpers::LoadFiles.load('/cities/boiotia.yml'),
|
26
|
+
dod: GC::Helpers::LoadFiles.load('/cities/dodekanisa.yml'),
|
27
|
+
dra: GC::Helpers::LoadFiles.load('/cities/drama.yml'),
|
28
|
+
evr: GC::Helpers::LoadFiles.load('/cities/evros.yml'),
|
29
|
+
eyr: GC::Helpers::LoadFiles.load('/cities/eyrytania.yml'),
|
30
|
+
eyv: GC::Helpers::LoadFiles.load('/cities/eyvoia.yml'),
|
31
|
+
flo: GC::Helpers::LoadFiles.load('/cities/florina.yml'),
|
32
|
+
fok: GC::Helpers::LoadFiles.load('/cities/fokida.yml'),
|
33
|
+
fth: GC::Helpers::LoadFiles.load('/cities/fthiotida.yml'),
|
34
|
+
gre: GC::Helpers::LoadFiles.load('/cities/grevena.yml'),
|
35
|
+
hal: GC::Helpers::LoadFiles.load('/cities/halkidiki.yml'),
|
36
|
+
han: GC::Helpers::LoadFiles.load('/cities/hania.yml'),
|
37
|
+
hio: GC::Helpers::LoadFiles.load('/cities/hios.yml'),
|
38
|
+
ili: GC::Helpers::LoadFiles.load('/cities/ilia.yml'),
|
39
|
+
ima: GC::Helpers::LoadFiles.load('/cities/imathia.yml'),
|
40
|
+
ioa: GC::Helpers::LoadFiles.load('/cities/ioannina.yml'),
|
41
|
+
ira: GC::Helpers::LoadFiles.load('/cities/irakleio.yml'),
|
42
|
+
kar: GC::Helpers::LoadFiles.load('/cities/karditsa.yml'),
|
43
|
+
kas: GC::Helpers::LoadFiles.load('/cities/kastoria.yml'),
|
44
|
+
kav: GC::Helpers::LoadFiles.load('/cities/kavala.yml'),
|
45
|
+
kef: GC::Helpers::LoadFiles.load('/cities/kefallonia.yml'),
|
46
|
+
ker: GC::Helpers::LoadFiles.load('/cities/kerkira.yml'),
|
47
|
+
kik: GC::Helpers::LoadFiles.load('/cities/kiklades.yml'),
|
48
|
+
kil: GC::Helpers::LoadFiles.load('/cities/kilkis.yml'),
|
49
|
+
kor: GC::Helpers::LoadFiles.load('/cities/korinthos.yml'),
|
50
|
+
koz: GC::Helpers::LoadFiles.load('/cities/kozani.yml'),
|
51
|
+
lak: GC::Helpers::LoadFiles.load('/cities/lakonia.yml'),
|
52
|
+
lar: GC::Helpers::LoadFiles.load('/cities/larisa.yml'),
|
53
|
+
las: GC::Helpers::LoadFiles.load('/cities/lasithi.yml'),
|
54
|
+
lef: GC::Helpers::LoadFiles.load('/cities/lefkada.yml'),
|
55
|
+
les: GC::Helpers::LoadFiles.load('/cities/lesvos.yml'),
|
56
|
+
mag: GC::Helpers::LoadFiles.load('/cities/magnisia.yml'),
|
57
|
+
mes: GC::Helpers::LoadFiles.load('/cities/messinia.yml'),
|
58
|
+
pel: GC::Helpers::LoadFiles.load('/cities/pella.yml'),
|
59
|
+
pie: GC::Helpers::LoadFiles.load('/cities/pieria.yml'),
|
60
|
+
pre: GC::Helpers::LoadFiles.load('/cities/preveza.yml'),
|
61
|
+
ret: GC::Helpers::LoadFiles.load('/cities/rethymno.yml'),
|
62
|
+
rod: GC::Helpers::LoadFiles.load('/cities/rodopi.yml'),
|
63
|
+
sam: GC::Helpers::LoadFiles.load('/cities/samos.yml'),
|
64
|
+
ser: GC::Helpers::LoadFiles.load('/cities/serres.yml'),
|
65
|
+
thesp: GC::Helpers::LoadFiles.load('/cities/thesprotia.yml'),
|
66
|
+
thess: GC::Helpers::LoadFiles.load('/cities/thessaloniki.yml'),
|
67
|
+
tri: GC::Helpers::LoadFiles.load('/cities/trikala.yml'),
|
68
|
+
xan: GC::Helpers::LoadFiles.load('/cities/xanthi.yml'),
|
69
|
+
zak: GC::Helpers::LoadFiles.load('/cities/zakinthos.yml')
|
70
|
+
}
|
69
71
|
end
|
70
72
|
end
|
71
73
|
end
|
data/lib/gc/states.rb
CHANGED
@@ -2,67 +2,13 @@
|
|
2
2
|
|
3
3
|
module GC
|
4
4
|
module States
|
5
|
-
STATES = [
|
6
|
-
%w[Αιτωλοακαρνανίας ait],
|
7
|
-
%w[Αργολίδας arg],
|
8
|
-
%w[Αρκαδίας ark],
|
9
|
-
%w[Άρτας art],
|
10
|
-
%w[Αττικής att],
|
11
|
-
%w[Αχαΐας aha],
|
12
|
-
%w[Βοιωτίας boi],
|
13
|
-
%w[Γρεβενών gre],
|
14
|
-
%w[Δράμας dra],
|
15
|
-
%w[Δωδεκανήσου dod],
|
16
|
-
%w[Έβρου evr],
|
17
|
-
%w[Ευβοίας eyv],
|
18
|
-
%w[Ευρυτανίας eyr],
|
19
|
-
%w[Ζακύνθου zak],
|
20
|
-
%w[Ηλείας ili],
|
21
|
-
%w[Ημαθίας ima],
|
22
|
-
%w[Ηρακλείου ira],
|
23
|
-
%w[Θεσπρωτίας thesp],
|
24
|
-
%w[Θεσσαλονίκης thess],
|
25
|
-
%w[Ιωαννίνων ioa],
|
26
|
-
%w[Καβάλας kav],
|
27
|
-
%w[Καρδίτσας kar],
|
28
|
-
%w[Καστοριάς kas],
|
29
|
-
%w[Κερκύρας ker],
|
30
|
-
%w[Κεφαλληνίας kef],
|
31
|
-
%w[Κιλκίς kil],
|
32
|
-
%w[Κοζάνης koz],
|
33
|
-
%w[Κορινθίας kor],
|
34
|
-
%w[Κυκλάδων kik],
|
35
|
-
%w[Λακωνίας lak],
|
36
|
-
%w[Λάρισας lar],
|
37
|
-
%w[Λασιθίου las],
|
38
|
-
%w[Λέσβου les],
|
39
|
-
%w[Λευκάδας lef],
|
40
|
-
%w[Μαγνησίας mag],
|
41
|
-
%w[Μεσσηνίας mes],
|
42
|
-
%w[Ξάνθης xan],
|
43
|
-
%w[Πέλλας pel],
|
44
|
-
%w[Πιερίας pie],
|
45
|
-
%w[Πρεβέζης pre],
|
46
|
-
%w[Ρεθύμνης ret],
|
47
|
-
%w[Ροδόπης rod],
|
48
|
-
%w[Σάμου sam],
|
49
|
-
%w[Σερρών ser],
|
50
|
-
%w[Τρικάλων tri],
|
51
|
-
%w[Φθιώτιδας fth],
|
52
|
-
%w[Φλώρινας flo],
|
53
|
-
%w[Φωκίδας fok],
|
54
|
-
%w[Χαλκιδικής hal],
|
55
|
-
%w[Χανίων han],
|
56
|
-
%w[Χίου hio]
|
57
|
-
].freeze
|
58
|
-
|
59
5
|
def get_state_name(state)
|
60
6
|
states_hash = states.map(&:reverse).to_h
|
61
7
|
states_hash[state]
|
62
8
|
end
|
63
9
|
|
64
10
|
def states
|
65
|
-
|
11
|
+
@states ||= GC::Helpers::LoadFiles.load('states.yml')
|
66
12
|
end
|
67
13
|
end
|
68
14
|
end
|