csv_country_selector 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 74f70201250920891b6cab83e157659e4b487104
4
+ data.tar.gz: 0438c509265e775e9d7f6c3b096d6f40c61af12e
5
+ SHA512:
6
+ metadata.gz: 9321a989a5d9dc37ead34aaf9a1cdfc505ff83424a50a41c4e3ef2b649b469699038375fd8b2bffc17c1a4894a15350481f69c12b42790eb78fe506377aca6de
7
+ data.tar.gz: d41bd8a9bd24b38093dd4e4db080cf685298c5fb8ae13f384b0f76c0c320fff832153630746dbe960756836a89c33812028983efa986a381b5390ed7f6c85c5b
@@ -10,6 +10,10 @@ module CsvCountrySelector
10
10
  #Lnd;Kfz;Sprache;ISO-Code;Kurzbez;Bezeichnung;Nationalität;Bezeichnung lang
11
11
  @@codes = ::CSV.read("#{File.dirname(File.expand_path(__FILE__))}/csv_country_selector/countries.csv", :col_sep => ";").inject({}){|a,b| a.merge!({b[0].force_encoding('UTF-8') => b[5].force_encoding('UTF-8')})}
12
12
 
13
+ #CSV Tabelle der Europäischen Länder
14
+ #Lnd;Kfz;Sprache;ISO-Code;Kurzbez;Bezeichnung;Nationalität;Bezeichnung lang
15
+ @@eu_codes = ::CSV.read("#{File.dirname(File.expand_path(__FILE__))}/csv_country_selector/eu_countries.csv", :col_sep => ";").inject({}){|a,b| a.merge!({b[0].force_encoding('UTF-8') => b[5].force_encoding('UTF-8')})}
16
+
13
17
  def self.short_name_for(name)
14
18
  @@codes.select{|k,v| v.downcase == name.downcase}.try(:first).try(:first)
15
19
  end
@@ -31,5 +35,9 @@ module CsvCountrySelector
31
35
  @@codes
32
36
  end
33
37
 
38
+ def is_in_eu?(country_short_name)
39
+ @@eu_codes.values.include?(country_short_name)
40
+ end
41
+
34
42
  end
35
43
  end
@@ -0,0 +1,25 @@
1
+ AT;A;DE;AT;OESTER;Österreich;österreichisch;
2
+ BE;B;EN;BE;BELLUX;Belgien;belgisch;
3
+ BG;BG;;BG;;Bulgarien;bulgarisch;
4
+ CH;CH;DE;CH;SCHWZ;Schweiz;schweizerisch;
5
+ DE;D;DE;DE;;Deutschland;deutsch;
6
+ ES;E;ES;ES;SPAN;Spanien;spanisch;
7
+ FI;FIN;SV;FI;FINNL;Finnland;finnisch;
8
+ GD;;;GD;;Grenada;;
9
+ GE;;;GE;GEORG;Georgien;georgisch;Georgien
10
+ GI;GBZ;;GI;;Gibraltar;;
11
+ GR;GR;;GR;;Griechenland;griechisch;
12
+ HR;;;HR;;Kroatien;;
13
+ HU;H;RU;HU;UNGARN;Ungarn;ungarisch;
14
+ IE;IRL;EN;IE;;Irland;irisch;
15
+ IT;I;IT;IT;ITAL;Italien;italienisch;
16
+ LU;L;FR;LU;;Luxemburg;luxemburgisch;
17
+ MC;MC;FR;MC;;Monaco;monegassisch;
18
+ MD;;;MD;MOLDAU;Moldawien;;Moldawien
19
+ MT;M;;MT;;Malta;maltekisch;
20
+ NO;N;NO;NO;NORWEG;Norwegen;norwegisch;
21
+ PL;PL;;PL;;Polen;polnisch;
22
+ PT;P;PT;PT;;Portugal;portugiesisch;
23
+ RO;RO;;RO;;Rumänien;rumänisch;
24
+ SI;SLO;SL;SI;SLOWEN;Slowenien;SLOWENISCH;
25
+ TR;TR;;TR;;Türkei;türkisch;
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module CsvCountrySelector
4
- VERSION = "1.0.6"
4
+ VERSION = "1.0.7"
5
5
  end
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv_country_selector
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
5
- prerelease:
4
+ version: 1.0.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Marco Metz
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-11-25 00:00:00.000000000 Z
11
+ date: 2015-05-06 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.7'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '1.7'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
33
  version: '10.0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
40
  version: '10.0'
46
41
  description: Country list based on a csv file wit long an short names for Dropdowns
@@ -51,7 +46,7 @@ executables: []
51
46
  extensions: []
52
47
  extra_rdoc_files: []
53
48
  files:
54
- - .gitignore
49
+ - ".gitignore"
55
50
  - Gemfile
56
51
  - LICENSE.txt
57
52
  - README.md
@@ -59,30 +54,30 @@ files:
59
54
  - csv_country_selector.gemspec
60
55
  - lib/csv_country_selector.rb
61
56
  - lib/csv_country_selector/countries.csv
57
+ - lib/csv_country_selector/eu_countries.csv
62
58
  - lib/csv_country_selector/version.rb
63
59
  homepage: https://github.com/ikuseiGmbH/csv_country_selector
64
60
  licenses:
65
61
  - MIT
62
+ metadata: {}
66
63
  post_install_message:
67
64
  rdoc_options: []
68
65
  require_paths:
69
66
  - lib
70
67
  required_ruby_version: !ruby/object:Gem::Requirement
71
- none: false
72
68
  requirements:
73
- - - ! '>='
69
+ - - ">="
74
70
  - !ruby/object:Gem::Version
75
71
  version: '0'
76
72
  required_rubygems_version: !ruby/object:Gem::Requirement
77
- none: false
78
73
  requirements:
79
- - - ! '>='
74
+ - - ">="
80
75
  - !ruby/object:Gem::Version
81
76
  version: '0'
82
77
  requirements: []
83
78
  rubyforge_project:
84
- rubygems_version: 1.8.26
79
+ rubygems_version: 2.4.6
85
80
  signing_key:
86
- specification_version: 3
81
+ specification_version: 4
87
82
  summary: Country List with long and short names
88
83
  test_files: []