greek-cities 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -0
  3. data/lib/gc.rb +9 -0
  4. data/lib/{greek-cities → gc}/cities/ahaia.rb +3 -1
  5. data/lib/{greek-cities → gc}/cities/aitoloakarnania.rb +3 -1
  6. data/lib/{greek-cities → gc}/cities/argolida.rb +3 -1
  7. data/lib/{greek-cities → gc}/cities/arkadia.rb +3 -1
  8. data/lib/{greek-cities → gc}/cities/arta.rb +3 -1
  9. data/lib/{greek-cities → gc}/cities/attiki.rb +3 -1
  10. data/lib/{greek-cities → gc}/cities/boiotia.rb +3 -1
  11. data/lib/{greek-cities → gc}/cities/dodekanisa.rb +3 -1
  12. data/lib/{greek-cities → gc}/cities/drama.rb +3 -1
  13. data/lib/{greek-cities → gc}/cities/evros.rb +3 -1
  14. data/lib/{greek-cities → gc}/cities/eyrytania.rb +3 -1
  15. data/lib/{greek-cities → gc}/cities/eyvoia.rb +3 -1
  16. data/lib/{greek-cities → gc}/cities/florina.rb +3 -1
  17. data/lib/{greek-cities → gc}/cities/fokida.rb +3 -1
  18. data/lib/{greek-cities → gc}/cities/fthiotida.rb +3 -1
  19. data/lib/{greek-cities → gc}/cities/grevena.rb +3 -1
  20. data/lib/{greek-cities → gc}/cities/halkidiki.rb +3 -1
  21. data/lib/{greek-cities → gc}/cities/hania.rb +3 -1
  22. data/lib/{greek-cities → gc}/cities/hios.rb +3 -1
  23. data/lib/{greek-cities → gc}/cities/ilia.rb +3 -1
  24. data/lib/{greek-cities → gc}/cities/imathia.rb +3 -1
  25. data/lib/{greek-cities → gc}/cities/ioannina.rb +3 -1
  26. data/lib/{greek-cities → gc}/cities/irakleio.rb +3 -1
  27. data/lib/{greek-cities → gc}/cities/karditsa.rb +3 -1
  28. data/lib/{greek-cities → gc}/cities/kastoria.rb +3 -1
  29. data/lib/{greek-cities → gc}/cities/kavala.rb +3 -1
  30. data/lib/{greek-cities → gc}/cities/kefallonia.rb +3 -1
  31. data/lib/{greek-cities → gc}/cities/kerkira.rb +3 -1
  32. data/lib/{greek-cities → gc}/cities/kiklades.rb +3 -1
  33. data/lib/{greek-cities → gc}/cities/kilkis.rb +3 -1
  34. data/lib/{greek-cities → gc}/cities/korinthos.rb +3 -1
  35. data/lib/{greek-cities → gc}/cities/kozani.rb +3 -1
  36. data/lib/{greek-cities → gc}/cities/lakonia.rb +3 -1
  37. data/lib/{greek-cities → gc}/cities/larisa.rb +3 -1
  38. data/lib/{greek-cities → gc}/cities/lasithi.rb +3 -1
  39. data/lib/{greek-cities → gc}/cities/lefkada.rb +3 -1
  40. data/lib/{greek-cities → gc}/cities/lesvos.rb +3 -1
  41. data/lib/{greek-cities → gc}/cities/magnisia.rb +3 -1
  42. data/lib/{greek-cities → gc}/cities/messinia.rb +3 -1
  43. data/lib/{greek-cities → gc}/cities/pella.rb +3 -1
  44. data/lib/{greek-cities → gc}/cities/pieria.rb +3 -1
  45. data/lib/{greek-cities → gc}/cities/preveza.rb +3 -1
  46. data/lib/{greek-cities → gc}/cities/rethymno.rb +3 -1
  47. data/lib/{greek-cities → gc}/cities/rodopi.rb +3 -1
  48. data/lib/{greek-cities → gc}/cities/samos.rb +3 -1
  49. data/lib/{greek-cities → gc}/cities/serres.rb +3 -1
  50. data/lib/{greek-cities → gc}/cities/thesprotia.rb +3 -1
  51. data/lib/{greek-cities → gc}/cities/thessaloniki.rb +3 -1
  52. data/lib/{greek-cities → gc}/cities/trikala.rb +3 -1
  53. data/lib/{greek-cities → gc}/cities/xanthi.rb +3 -1
  54. data/lib/{greek-cities → gc}/cities/zakinthos.rb +3 -1
  55. data/lib/gc/city.rb +71 -0
  56. data/lib/gc/states.rb +68 -0
  57. data/lib/gc/version.rb +5 -0
  58. metadata +56 -57
  59. data/lib/greek-cities.rb +0 -23
  60. data/lib/greek-cities/city.rb +0 -63
  61. data/lib/greek-cities/city_includes.rb +0 -51
  62. data/lib/greek-cities/states.rb +0 -55
  63. data/lib/greek-cities/version.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dd800465d12d63b2d74e3566d8274699e289b46393ae8492df80815a8daa590
4
- data.tar.gz: 51a30d5954fca16c0458cb4be9f30adafdba838293841e227cc3cad21a1405b5
3
+ metadata.gz: 97ad7a21d20352f00f41e8dc49659ec6085147eb68b120624e564735c93f6802
4
+ data.tar.gz: e49cce42d3ecea4511e12387a2323aaa4e464c8bbdead1edec487beb1a759981
5
5
  SHA512:
6
- metadata.gz: af0a066f8cb18b6e7d292a73211b2f25524b179c53d7d285afbbe8fe35a99cd34816424a2fc40c20cc675245bc359f1a1dde0627bb03eca91769807d20832290
7
- data.tar.gz: 764de16b809810ddec551f70b51ad6b0f699b140db78e9c9ac4cf37e55732d3e6b85950cae634a1c35293e7c2345270bacb3487b38e0ebffcf7bdaaa7e4779d7
6
+ metadata.gz: c3ea2a236ba800f52f35e9f9f64f6a52739ef763a2ade1baac9348c2c2422ae6a59178e403fc675221eb2bd69dbea427a4c88ae532640d490df17c70c4b2bc56
7
+ data.tar.gz: 4f7873ed8478f4fabded08c1e7710bbc7024408a8056319731b43a43b392c41d86a90ab8064d9b71ac690526f0a3b8ec75fdb617e736957c6ff5ca2bad703fdb
data/README.md CHANGED
@@ -5,7 +5,12 @@ greek-cities gem includes all the states (nomous) of Greece and their biggest ci
5
5
 
6
6
  ## Install the gem
7
7
  ```ruby
8
+ # Rails
8
9
  gem 'greek-cities'
10
+
11
+ # Ruby
12
+ gem install 'greek-cities'
13
+ require 'gc'
9
14
  ```
10
15
 
11
16
  ## List of all states
data/lib/gc.rb ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'gc/states'
4
+ require 'gc/city'
5
+
6
+ module GC
7
+ extend GC::City
8
+ extend GC::States
9
+ end
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  AHAIA = [
4
6
  ['Πάτρα', 'patra-AHA'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  AITOLOAKARNANIA = [
4
6
  ['Αγρίνιο', 'agrinio-AIT'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  ARGOLIDA = [
4
6
  ['Άργος - Μυκήνες', 'argos-mikines-ARG'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  ARKADIA = [
4
6
  ['Τρίπολη', 'tripoli-ARK'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  ARTA = [
4
6
  ['Αρτα', 'arta-ART'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  ATTIKI = [
4
6
  ['Νέα Φιλαδέλφεια', 'nea-filadelpheia-ATT'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  BOIOTIA = [
4
6
  ['Σχηματάρι', 'shimatari-BOI'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  DODEKANISA = [
4
6
  ['Ρόδος', 'rodos-DOD'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  DRAMA = [
4
6
  ['Δράμα', 'drama-DRA'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  EVROS = [
4
6
  ['Αλεξανδρούπολη', 'alexandroupoli-EVR'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  EYRYTANIA = [
4
6
  ['Καρπενήσι', 'karpenisi-EYR'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  EYVOIA = [
4
6
  ['Χαλκίδα', 'halkida-EYV'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  FLORINA = [
4
6
  ['Φλώρινα', 'florina-FLO'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  FOKIDA = [
4
6
  ['Αμφισσα', 'amfissa-FOK'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  FTHIOTIDA = [
4
6
  ['Κάτω Τιθορέα', 'kato-tithorea-FTH'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  GREVENA = [
4
6
  ['Δεσκάτη', 'deskati-GRE'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  HALKIDIKI = [
4
6
  ['Πολύγυρος', 'poligiros-HAL'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  HANIA = [
4
6
  ['Χανιά', 'hania-HAN'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  HIOS = [
4
6
  ['Χίος', 'hios-HIO'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  ILIA = [
4
6
  ['Ζαχάρω', 'zaharo-ILI'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  IMATHIA = [
4
6
  ['Βέροια', 'veroia-IMA'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  IOANNINA = [
4
6
  ['Ιωάννινα', 'ioannina-IOA'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  IRAKLEIO = [
4
6
  ['Ηράκλειο', 'irakleio-IRA'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  KARDITSA = [
4
6
  ['Ανθηρό', 'anthiro-KAR'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  KASTORIA = [
4
6
  ['Καστοριά', 'kastoria-KAS'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  KAVALA = [
4
6
  ['Καβάλα', 'kavala-KAV'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  KEFALLONIA = [
4
6
  ['Αργοστόλι', 'argostoli-KEF'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  KERKIRA = [
4
6
  ['Κέρκυρα', 'kerkira-KER'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  KIKLADES = [
4
6
  ['Σύρος - Ερμούπολη', 'siros-ermoupoli-KIK'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  KILKIS = [
4
6
  ['Κιλκίς', 'kilkis-KIL'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  KORINTHOS = [
4
6
  ['Κόρινθος', 'korinthos-KOR'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  KOZANI = [
4
6
  ['Κοζάνη', 'kozani-KOZ'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  LAKONIA = [
4
6
  ['Σπάρτη', 'sparti-LAK'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  LARISA = [
4
6
  ['Ελασσόνα', 'elassona-LAR'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  LASITHI = [
4
6
  ['Αγιος Νικόλαος', 'ag-nikolaos-LAS'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  LEFKADA = [
4
6
  ['Λευκάδα', 'lefkada-LEF'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  LESVOS = [
4
6
  ['Μυτιλήνη', 'mitilini-LES'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  MAGNISIA = [
4
6
  ['Βόλος', 'volos-MAG'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  MESSINIA = [
4
6
  ['Καλαμάτα', 'kalamata-MES'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  PELLA = [
4
6
  ['Εδεσσα', 'edessa-PEL'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  PIERIA = [
4
6
  ['Λιτόχωρο', 'litohoro-PIE'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  PREVEZA = [
4
6
  ['Πρέβεζα', 'preveza-PRE'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  RETHYMNO = [
4
6
  ['Ρέθυμνο', 'rethimno-RET'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  RODOPI = [
4
6
  ['Κομοτηνή', 'komotini-ROD'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  SAMOS = [
4
6
  ['Σάμος', 'samos-SAM'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  SERRES = [
4
6
  ['Σέρρες', 'serres-SER'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  THESPROTIA = [
4
6
  ['Ηγουμενίτσα', 'igoumenitsa-THESP'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  THESSALONIKI = [
4
6
  ['Θεσσαλονίκη', 'thessaloniki-THESS'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  TRIKALA = [
4
6
  ['Πύλη', 'pili-TRI'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  XANTHI = [
4
6
  ['Ξάνθη', 'xanthi-XAN'],
@@ -1,4 +1,6 @@
1
- module GreekCities
1
+ # frozen_string_literal: true
2
+
3
+ module GC
2
4
  module Cities
3
5
  ZAKINTHOS = [
4
6
  ['Ζάκυνθος', 'zakinthos-ZAK']
data/lib/gc/city.rb ADDED
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ Dir[File.dirname(__FILE__) + "/cities/*.rb"].each { |file| require file }
4
+
5
+ module GC
6
+ 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
+ def get_city_name(state_code, city)
62
+ cities_by_code = cities(state_code)
63
+ cities_hash = cities_by_code.map(&:reverse).to_h
64
+ cities_hash[city]
65
+ end
66
+
67
+ def cities(code)
68
+ CITY_HASH[code.downcase.to_sym] || raise('city not found')
69
+ end
70
+ end
71
+ end
data/lib/gc/states.rb ADDED
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GC
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
+ def get_state_name(state)
60
+ states_hash = states.map(&:reverse).to_h
61
+ states_hash[state]
62
+ end
63
+
64
+ def states
65
+ STATES
66
+ end
67
+ end
68
+ end
data/lib/gc/version.rb ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GC
4
+ VERSION = '1.1.3'.freeze
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: greek-cities
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Avlonitis
@@ -31,62 +31,61 @@ extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
33
  - README.md
34
- - lib/greek-cities.rb
35
- - lib/greek-cities/cities/ahaia.rb
36
- - lib/greek-cities/cities/aitoloakarnania.rb
37
- - lib/greek-cities/cities/argolida.rb
38
- - lib/greek-cities/cities/arkadia.rb
39
- - lib/greek-cities/cities/arta.rb
40
- - lib/greek-cities/cities/attiki.rb
41
- - lib/greek-cities/cities/boiotia.rb
42
- - lib/greek-cities/cities/dodekanisa.rb
43
- - lib/greek-cities/cities/drama.rb
44
- - lib/greek-cities/cities/evros.rb
45
- - lib/greek-cities/cities/eyrytania.rb
46
- - lib/greek-cities/cities/eyvoia.rb
47
- - lib/greek-cities/cities/florina.rb
48
- - lib/greek-cities/cities/fokida.rb
49
- - lib/greek-cities/cities/fthiotida.rb
50
- - lib/greek-cities/cities/grevena.rb
51
- - lib/greek-cities/cities/halkidiki.rb
52
- - lib/greek-cities/cities/hania.rb
53
- - lib/greek-cities/cities/hios.rb
54
- - lib/greek-cities/cities/ilia.rb
55
- - lib/greek-cities/cities/imathia.rb
56
- - lib/greek-cities/cities/ioannina.rb
57
- - lib/greek-cities/cities/irakleio.rb
58
- - lib/greek-cities/cities/karditsa.rb
59
- - lib/greek-cities/cities/kastoria.rb
60
- - lib/greek-cities/cities/kavala.rb
61
- - lib/greek-cities/cities/kefallonia.rb
62
- - lib/greek-cities/cities/kerkira.rb
63
- - lib/greek-cities/cities/kiklades.rb
64
- - lib/greek-cities/cities/kilkis.rb
65
- - lib/greek-cities/cities/korinthos.rb
66
- - lib/greek-cities/cities/kozani.rb
67
- - lib/greek-cities/cities/lakonia.rb
68
- - lib/greek-cities/cities/larisa.rb
69
- - lib/greek-cities/cities/lasithi.rb
70
- - lib/greek-cities/cities/lefkada.rb
71
- - lib/greek-cities/cities/lesvos.rb
72
- - lib/greek-cities/cities/magnisia.rb
73
- - lib/greek-cities/cities/messinia.rb
74
- - lib/greek-cities/cities/pella.rb
75
- - lib/greek-cities/cities/pieria.rb
76
- - lib/greek-cities/cities/preveza.rb
77
- - lib/greek-cities/cities/rethymno.rb
78
- - lib/greek-cities/cities/rodopi.rb
79
- - lib/greek-cities/cities/samos.rb
80
- - lib/greek-cities/cities/serres.rb
81
- - lib/greek-cities/cities/thesprotia.rb
82
- - lib/greek-cities/cities/thessaloniki.rb
83
- - lib/greek-cities/cities/trikala.rb
84
- - lib/greek-cities/cities/xanthi.rb
85
- - lib/greek-cities/cities/zakinthos.rb
86
- - lib/greek-cities/city.rb
87
- - lib/greek-cities/city_includes.rb
88
- - lib/greek-cities/states.rb
89
- - lib/greek-cities/version.rb
34
+ - lib/gc.rb
35
+ - lib/gc/cities/ahaia.rb
36
+ - lib/gc/cities/aitoloakarnania.rb
37
+ - lib/gc/cities/argolida.rb
38
+ - lib/gc/cities/arkadia.rb
39
+ - lib/gc/cities/arta.rb
40
+ - lib/gc/cities/attiki.rb
41
+ - lib/gc/cities/boiotia.rb
42
+ - lib/gc/cities/dodekanisa.rb
43
+ - lib/gc/cities/drama.rb
44
+ - lib/gc/cities/evros.rb
45
+ - lib/gc/cities/eyrytania.rb
46
+ - lib/gc/cities/eyvoia.rb
47
+ - lib/gc/cities/florina.rb
48
+ - lib/gc/cities/fokida.rb
49
+ - lib/gc/cities/fthiotida.rb
50
+ - lib/gc/cities/grevena.rb
51
+ - lib/gc/cities/halkidiki.rb
52
+ - lib/gc/cities/hania.rb
53
+ - lib/gc/cities/hios.rb
54
+ - lib/gc/cities/ilia.rb
55
+ - lib/gc/cities/imathia.rb
56
+ - lib/gc/cities/ioannina.rb
57
+ - lib/gc/cities/irakleio.rb
58
+ - lib/gc/cities/karditsa.rb
59
+ - lib/gc/cities/kastoria.rb
60
+ - lib/gc/cities/kavala.rb
61
+ - lib/gc/cities/kefallonia.rb
62
+ - lib/gc/cities/kerkira.rb
63
+ - lib/gc/cities/kiklades.rb
64
+ - lib/gc/cities/kilkis.rb
65
+ - lib/gc/cities/korinthos.rb
66
+ - lib/gc/cities/kozani.rb
67
+ - lib/gc/cities/lakonia.rb
68
+ - lib/gc/cities/larisa.rb
69
+ - lib/gc/cities/lasithi.rb
70
+ - lib/gc/cities/lefkada.rb
71
+ - lib/gc/cities/lesvos.rb
72
+ - lib/gc/cities/magnisia.rb
73
+ - lib/gc/cities/messinia.rb
74
+ - lib/gc/cities/pella.rb
75
+ - lib/gc/cities/pieria.rb
76
+ - lib/gc/cities/preveza.rb
77
+ - lib/gc/cities/rethymno.rb
78
+ - lib/gc/cities/rodopi.rb
79
+ - lib/gc/cities/samos.rb
80
+ - lib/gc/cities/serres.rb
81
+ - lib/gc/cities/thesprotia.rb
82
+ - lib/gc/cities/thessaloniki.rb
83
+ - lib/gc/cities/trikala.rb
84
+ - lib/gc/cities/xanthi.rb
85
+ - lib/gc/cities/zakinthos.rb
86
+ - lib/gc/city.rb
87
+ - lib/gc/states.rb
88
+ - lib/gc/version.rb
90
89
  homepage: https://github.com/AlexAvlonitis/greek-cities
91
90
  licenses:
92
91
  - MIT
data/lib/greek-cities.rb DELETED
@@ -1,23 +0,0 @@
1
- require 'greek-cities/states'
2
- require 'greek-cities/city'
3
-
4
- module GC
5
- def self.states
6
- GreekCities::STATES
7
- end
8
-
9
- def self.cities(code)
10
- GreekCities::City.get_cities(code)
11
- end
12
-
13
- def self.get_state_name(state)
14
- states_hash = GreekCities::STATES.map(&:reverse).to_h
15
- states_hash[state]
16
- end
17
-
18
- def self.get_city_name(state_code, city)
19
- cities = GreekCities::City.get_cities(state_code)
20
- cities_hash = cities.map(&:reverse).to_h
21
- cities_hash[city]
22
- end
23
- end
@@ -1,63 +0,0 @@
1
- require 'greek-cities/city_includes'
2
-
3
- module GreekCities
4
- class City
5
- CITY_HASH = {
6
- aha: GreekCities::Cities::AHAIA,
7
- ait: GreekCities::Cities::AITOLOAKARNANIA,
8
- arg: GreekCities::Cities::ARGOLIDA,
9
- ark: GreekCities::Cities::ARKADIA,
10
- art: GreekCities::Cities::ARTA,
11
- att: GreekCities::Cities::ATTIKI,
12
- boi: GreekCities::Cities::BOIOTIA,
13
- dod: GreekCities::Cities::DODEKANISA,
14
- dra: GreekCities::Cities::DRAMA,
15
- evr: GreekCities::Cities::EVROS,
16
- eyr: GreekCities::Cities::EYRYTANIA,
17
- eyv: GreekCities::Cities::EYVOIA,
18
- flo: GreekCities::Cities::FLORINA,
19
- fok: GreekCities::Cities::FOKIDA,
20
- fth: GreekCities::Cities::FTHIOTIDA,
21
- gre: GreekCities::Cities::GREVENA,
22
- hal: GreekCities::Cities::HALKIDIKI,
23
- han: GreekCities::Cities::HANIA,
24
- hio: GreekCities::Cities::HIOS,
25
- ili: GreekCities::Cities::ILIA,
26
- ima: GreekCities::Cities::IMATHIA,
27
- ioa: GreekCities::Cities::IOANNINA,
28
- ira: GreekCities::Cities::IRAKLEIO,
29
- kar: GreekCities::Cities::KARDITSA,
30
- kas: GreekCities::Cities::KASTORIA,
31
- kav: GreekCities::Cities::KAVALA,
32
- kef: GreekCities::Cities::KEFALLONIA,
33
- ker: GreekCities::Cities::KERKIRA,
34
- kik: GreekCities::Cities::KIKLADES,
35
- kil: GreekCities::Cities::KILKIS,
36
- kor: GreekCities::Cities::KORINTHOS,
37
- koz: GreekCities::Cities::KOZANI,
38
- lak: GreekCities::Cities::LAKONIA,
39
- lar: GreekCities::Cities::LARISA,
40
- las: GreekCities::Cities::LASITHI,
41
- lef: GreekCities::Cities::LEFKADA,
42
- les: GreekCities::Cities::LESVOS,
43
- mag: GreekCities::Cities::MAGNISIA,
44
- mes: GreekCities::Cities::MESSINIA,
45
- pel: GreekCities::Cities::PELLA,
46
- pie: GreekCities::Cities::PIERIA,
47
- pre: GreekCities::Cities::PREVEZA,
48
- ret: GreekCities::Cities::RETHYMNO,
49
- rod: GreekCities::Cities::RODOPI,
50
- sam: GreekCities::Cities::SAMOS,
51
- ser: GreekCities::Cities::SERRES,
52
- thesp: GreekCities::Cities::THESPROTIA,
53
- thess: GreekCities::Cities::THESSALONIKI,
54
- tri: GreekCities::Cities::TRIKALA,
55
- xan: GreekCities::Cities::XANTHI,
56
- zak: GreekCities::Cities::ZAKINTHOS
57
- }.freeze
58
-
59
- def self.get_cities(code)
60
- CITY_HASH[code.downcase.to_sym] || raise('city not found')
61
- end
62
- end
63
- end
@@ -1,51 +0,0 @@
1
- require 'greek-cities/cities/aitoloakarnania'
2
- require 'greek-cities/cities/argolida'
3
- require 'greek-cities/cities/ahaia'
4
- require 'greek-cities/cities/arkadia'
5
- require 'greek-cities/cities/arta'
6
- require 'greek-cities/cities/attiki'
7
- require 'greek-cities/cities/boiotia'
8
- require 'greek-cities/cities/dodekanisa'
9
- require 'greek-cities/cities/drama'
10
- require 'greek-cities/cities/evros'
11
- require 'greek-cities/cities/eyrytania'
12
- require 'greek-cities/cities/eyvoia'
13
- require 'greek-cities/cities/florina'
14
- require 'greek-cities/cities/fokida'
15
- require 'greek-cities/cities/fthiotida'
16
- require 'greek-cities/cities/grevena'
17
- require 'greek-cities/cities/halkidiki'
18
- require 'greek-cities/cities/hania'
19
- require 'greek-cities/cities/hios'
20
- require 'greek-cities/cities/ilia'
21
- require 'greek-cities/cities/imathia'
22
- require 'greek-cities/cities/ioannina'
23
- require 'greek-cities/cities/irakleio'
24
- require 'greek-cities/cities/karditsa'
25
- require 'greek-cities/cities/kastoria'
26
- require 'greek-cities/cities/kavala'
27
- require 'greek-cities/cities/kefallonia'
28
- require 'greek-cities/cities/kerkira'
29
- require 'greek-cities/cities/kiklades'
30
- require 'greek-cities/cities/kilkis'
31
- require 'greek-cities/cities/korinthos'
32
- require 'greek-cities/cities/kozani'
33
- require 'greek-cities/cities/lakonia'
34
- require 'greek-cities/cities/larisa'
35
- require 'greek-cities/cities/lasithi'
36
- require 'greek-cities/cities/lefkada'
37
- require 'greek-cities/cities/lesvos'
38
- require 'greek-cities/cities/magnisia'
39
- require 'greek-cities/cities/messinia'
40
- require 'greek-cities/cities/pella'
41
- require 'greek-cities/cities/pieria'
42
- require 'greek-cities/cities/preveza'
43
- require 'greek-cities/cities/rethymno'
44
- require 'greek-cities/cities/rodopi'
45
- require 'greek-cities/cities/samos'
46
- require 'greek-cities/cities/serres'
47
- require 'greek-cities/cities/thesprotia'
48
- require 'greek-cities/cities/thessaloniki'
49
- require 'greek-cities/cities/trikala'
50
- require 'greek-cities/cities/xanthi'
51
- require 'greek-cities/cities/zakinthos'
@@ -1,55 +0,0 @@
1
- module GreekCities
2
- STATES = [
3
- %w[Αιτωλοακαρνανίας ait],
4
- %w[Αργολίδας arg],
5
- %w[Αρκαδίας ark],
6
- %w[Άρτας art],
7
- %w[Αττικής att],
8
- %w[Αχαΐας aha],
9
- %w[Βοιωτίας boi],
10
- %w[Γρεβενών gre],
11
- %w[Δράμας dra],
12
- %w[Δωδεκανήσου dod],
13
- %w[Έβρου evr],
14
- %w[Ευβοίας eyv],
15
- %w[Ευρυτανίας eyr],
16
- %w[Ζακύνθου zak],
17
- %w[Ηλείας ili],
18
- %w[Ημαθίας ima],
19
- %w[Ηρακλείου ira],
20
- %w[Θεσπρωτίας thesp],
21
- %w[Θεσσαλονίκης thess],
22
- %w[Ιωαννίνων ioa],
23
- %w[Καβάλας kav],
24
- %w[Καρδίτσας kar],
25
- %w[Καστοριάς kas],
26
- %w[Κερκύρας ker],
27
- %w[Κεφαλληνίας kef],
28
- %w[Κιλκίς kil],
29
- %w[Κοζάνης koz],
30
- %w[Κορινθίας kor],
31
- %w[Κυκλάδων kik],
32
- %w[Λακωνίας lak],
33
- %w[Λάρισας lar],
34
- %w[Λασιθίου las],
35
- %w[Λέσβου les],
36
- %w[Λευκάδας lef],
37
- %w[Μαγνησίας mag],
38
- %w[Μεσσηνίας mes],
39
- %w[Ξάνθης xan],
40
- %w[Πέλλας pel],
41
- %w[Πιερίας pie],
42
- %w[Πρεβέζης pre],
43
- %w[Ρεθύμνης ret],
44
- %w[Ροδόπης rod],
45
- %w[Σάμου sam],
46
- %w[Σερρών ser],
47
- %w[Τρικάλων tri],
48
- %w[Φθιώτιδας fth],
49
- %w[Φλώρινας flo],
50
- %w[Φωκίδας fok],
51
- %w[Χαλκιδικής hal],
52
- %w[Χανίων han],
53
- %w[Χίου hio]
54
- ].freeze
55
- end
@@ -1,3 +0,0 @@
1
- module GreekCities
2
- VERSION = '1.1.2'.freeze
3
- end