countries 4.2.0 → 4.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -1
  3. data/LICENSE +3 -1
  4. data/README.markdown +15 -17
  5. data/Rakefile +2 -0
  6. data/countries.gemspec +5 -5
  7. data/lib/countries/cache/countries.json +1 -1
  8. data/lib/countries/cache/locales/oc.json +1 -1
  9. data/lib/countries/cache/locales/ti.json +1 -1
  10. data/lib/countries/cache/locales/zu.json +1 -1
  11. data/lib/countries/configuration.rb +13 -0
  12. data/lib/countries/country/currency_methods.rb +4 -1
  13. data/lib/countries/country/emoji.rb +3 -0
  14. data/lib/countries/country.rb +105 -5
  15. data/lib/countries/data/countries/AE.yaml +1 -1
  16. data/lib/countries/data/countries/IL.yaml +0 -2
  17. data/lib/countries/data/countries/KH.yaml +1 -1
  18. data/lib/countries/data/countries/TW.yaml +1 -1
  19. data/lib/countries/data/subdivisions/AD.yaml +21 -21
  20. data/lib/countries/data/subdivisions/AF.yaml +2 -2
  21. data/lib/countries/data/subdivisions/AG.yaml +1 -1
  22. data/lib/countries/data/subdivisions/AI.yaml +98 -98
  23. data/lib/countries/data/subdivisions/AL.yaml +82 -626
  24. data/lib/countries/data/subdivisions/AZ.yaml +5 -5
  25. data/lib/countries/data/subdivisions/BA.yaml +11 -11
  26. data/lib/countries/data/subdivisions/BD.yaml +8 -8
  27. data/lib/countries/data/subdivisions/BE.yaml +2 -2
  28. data/lib/countries/data/subdivisions/BF.yaml +13 -13
  29. data/lib/countries/data/subdivisions/BI.yaml +3 -3
  30. data/lib/countries/data/subdivisions/BM.yaml +77 -77
  31. data/lib/countries/data/subdivisions/BS.yaml +22 -22
  32. data/lib/countries/data/subdivisions/BW.yaml +7 -7
  33. data/lib/countries/data/subdivisions/BY.yaml +1 -1
  34. data/lib/countries/data/subdivisions/CD.yaml +19 -19
  35. data/lib/countries/data/subdivisions/CG.yaml +1 -1
  36. data/lib/countries/data/subdivisions/CI.yaml +14 -14
  37. data/lib/countries/data/subdivisions/CK.yaml +77 -77
  38. data/lib/countries/data/subdivisions/CN.yaml +0 -107
  39. data/lib/countries/data/subdivisions/CV.yaml +9 -9
  40. data/lib/countries/data/subdivisions/DK.yaml +1 -0
  41. data/lib/countries/data/subdivisions/DO.yaml +11 -11
  42. data/lib/countries/data/subdivisions/EE.yaml +78 -2
  43. data/lib/countries/data/subdivisions/EH.yaml +12 -12
  44. data/lib/countries/data/subdivisions/ES.yaml +17 -17
  45. data/lib/countries/data/subdivisions/FI.yaml +16 -16
  46. data/lib/countries/data/subdivisions/FJ.yaml +14 -14
  47. data/lib/countries/data/subdivisions/GB.yaml +21 -20
  48. data/lib/countries/data/subdivisions/GH.yaml +7 -7
  49. data/lib/countries/data/subdivisions/GL.yaml +6 -6
  50. data/lib/countries/data/subdivisions/GN.yaml +7 -7
  51. data/lib/countries/data/subdivisions/GQ.yaml +1 -0
  52. data/lib/countries/data/subdivisions/GR.yaml +1 -1
  53. data/lib/countries/data/subdivisions/GW.yaml +3 -3
  54. data/lib/countries/data/subdivisions/HT.yaml +1 -1
  55. data/lib/countries/data/subdivisions/ID.yaml +41 -41
  56. data/lib/countries/data/subdivisions/IE.yaml +1 -2
  57. data/lib/countries/data/subdivisions/IN.yaml +4 -3
  58. data/lib/countries/data/subdivisions/IQ.yaml +1 -1
  59. data/lib/countries/data/subdivisions/IR.yaml +2 -1
  60. data/lib/countries/data/subdivisions/IS.yaml +72 -0
  61. data/lib/countries/data/subdivisions/IT.yaml +7 -8
  62. data/lib/countries/data/subdivisions/KG.yaml +1 -1
  63. data/lib/countries/data/subdivisions/KH.yaml +1 -1
  64. data/lib/countries/data/subdivisions/KN.yaml +2 -2
  65. data/lib/countries/data/subdivisions/KP.yaml +12 -12
  66. data/lib/countries/data/subdivisions/KR.yaml +1 -1
  67. data/lib/countries/data/subdivisions/KZ.yaml +1 -1
  68. data/lib/countries/data/subdivisions/LA.yaml +1 -1
  69. data/lib/countries/data/subdivisions/LB.yaml +2 -2
  70. data/lib/countries/data/subdivisions/LC.yaml +10 -10
  71. data/lib/countries/data/subdivisions/LK.yaml +9 -9
  72. data/lib/countries/data/subdivisions/LR.yaml +2 -2
  73. data/lib/countries/data/subdivisions/LT.yaml +60 -60
  74. data/lib/countries/data/subdivisions/LU.yaml +1 -1
  75. data/lib/countries/data/subdivisions/LV.yaml +1 -1
  76. data/lib/countries/data/subdivisions/MA.yaml +35 -35
  77. data/lib/countries/data/subdivisions/MC.yaml +17 -17
  78. data/lib/countries/data/subdivisions/MD.yaml +740 -740
  79. data/lib/countries/data/subdivisions/ME.yaml +3 -3
  80. data/lib/countries/data/subdivisions/MH.yaml +2 -2
  81. data/lib/countries/data/subdivisions/ML.yaml +2 -2
  82. data/lib/countries/data/subdivisions/MM.yaml +1 -1
  83. data/lib/countries/data/subdivisions/MR.yaml +3 -3
  84. data/lib/countries/data/subdivisions/MV.yaml +8 -8
  85. data/lib/countries/data/subdivisions/MW.yaml +4 -4
  86. data/lib/countries/data/subdivisions/MX.yaml +1 -1
  87. data/lib/countries/data/subdivisions/NL.yaml +6 -6
  88. data/lib/countries/data/subdivisions/NO.yaml +1 -0
  89. data/lib/countries/data/subdivisions/NP.yaml +12 -12
  90. data/lib/countries/data/subdivisions/NZ.yaml +1 -1
  91. data/lib/countries/data/subdivisions/OM.yaml +6 -6
  92. data/lib/countries/data/subdivisions/PG.yaml +3 -3
  93. data/lib/countries/data/subdivisions/PH.yaml +16 -16
  94. data/lib/countries/data/subdivisions/PK.yaml +2 -2
  95. data/lib/countries/data/subdivisions/PS.yaml +16 -16
  96. data/lib/countries/data/subdivisions/QA.yaml +2 -2
  97. data/lib/countries/data/subdivisions/RS.yaml +2 -2
  98. data/lib/countries/data/subdivisions/SC.yaml +4 -2
  99. data/lib/countries/data/subdivisions/SH.yaml +1 -1
  100. data/lib/countries/data/subdivisions/SI.yaml +19 -19
  101. data/lib/countries/data/subdivisions/SJ.yaml +14 -14
  102. data/lib/countries/data/subdivisions/SL.yaml +1 -1
  103. data/lib/countries/data/subdivisions/SN.yaml +3 -3
  104. data/lib/countries/data/subdivisions/SS.yaml +10 -10
  105. data/lib/countries/data/subdivisions/ST.yaml +6 -0
  106. data/lib/countries/data/subdivisions/TD.yaml +6 -6
  107. data/lib/countries/data/subdivisions/TH.yaml +1 -1
  108. data/lib/countries/data/subdivisions/TJ.yaml +2 -2
  109. data/lib/countries/data/subdivisions/TK.yaml +21 -21
  110. data/lib/countries/data/subdivisions/TM.yaml +1 -1
  111. data/lib/countries/data/subdivisions/TT.yaml +2 -2
  112. data/lib/countries/data/subdivisions/TV.yaml +1 -1
  113. data/lib/countries/data/subdivisions/TW.yaml +3 -17
  114. data/lib/countries/data/subdivisions/TZ.yaml +5 -5
  115. data/lib/countries/data/subdivisions/UG.yaml +59 -52
  116. data/lib/countries/data/subdivisions/UM.yaml +0 -10
  117. data/lib/countries/data/subdivisions/WF.yaml +3 -13
  118. data/lib/countries/data/subdivisions/YE.yaml +3 -3
  119. data/lib/countries/data/subdivisions/ZA.yaml +2 -2
  120. data/lib/countries/data/subdivisions/ZM.yaml +1 -1
  121. data/lib/countries/data.rb +5 -1
  122. data/lib/countries/global.rb +12 -0
  123. data/lib/countries/mongoid.rb +3 -0
  124. data/lib/countries/sources/cldr/downloader.rb +3 -0
  125. data/lib/countries/sources/cldr/subdivision.rb +1 -0
  126. data/lib/countries/sources/cldr/subdivision_updater.rb +1 -0
  127. data/lib/countries/sources/local/cached_loader.rb +2 -0
  128. data/lib/countries/sources/local/subdivision.rb +1 -0
  129. data/lib/countries/timezones.rb +4 -2
  130. data/lib/countries/translations.rb +2 -3
  131. data/lib/countries/version.rb +1 -1
  132. metadata +6 -35
  133. data/lib/countries/data/subdivisions/AS.yaml +0 -85
  134. data/lib/countries/data/subdivisions/AW.yaml +0 -9
  135. data/lib/countries/data/subdivisions/AX.yaml +0 -51
  136. data/lib/countries/data/subdivisions/BL.yaml +0 -11
  137. data/lib/countries/data/subdivisions/CP.yaml +0 -4
  138. data/lib/countries/data/subdivisions/CW.yaml +0 -9
  139. data/lib/countries/data/subdivisions/GF.yaml +0 -11
  140. data/lib/countries/data/subdivisions/GG.yaml +0 -155
  141. data/lib/countries/data/subdivisions/GP.yaml +0 -11
  142. data/lib/countries/data/subdivisions/GU.yaml +0 -275
  143. data/lib/countries/data/subdivisions/HK.yaml +0 -267
  144. data/lib/countries/data/subdivisions/IC.yaml +0 -4
  145. data/lib/countries/data/subdivisions/IM.yaml +0 -337
  146. data/lib/countries/data/subdivisions/JE.yaml +0 -169
  147. data/lib/countries/data/subdivisions/MF.yaml +0 -9
  148. data/lib/countries/data/subdivisions/MO.yaml +0 -9
  149. data/lib/countries/data/subdivisions/MP.yaml +0 -71
  150. data/lib/countries/data/subdivisions/MQ.yaml +0 -11
  151. data/lib/countries/data/subdivisions/MS.yaml +0 -43
  152. data/lib/countries/data/subdivisions/NC.yaml +0 -57
  153. data/lib/countries/data/subdivisions/PF.yaml +0 -81
  154. data/lib/countries/data/subdivisions/PM.yaml +0 -39
  155. data/lib/countries/data/subdivisions/PR.yaml +0 -1107
  156. data/lib/countries/data/subdivisions/RE.yaml +0 -11
  157. data/lib/countries/data/subdivisions/SX.yaml +0 -9
  158. data/lib/countries/data/subdivisions/TA.yaml +0 -4
  159. data/lib/countries/data/subdivisions/TF.yaml +0 -67
  160. data/lib/countries/data/subdivisions/VI.yaml +0 -57
  161. data/lib/countries/data/subdivisions/YT.yaml +0 -247
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 887715ef29fbd425dc5ed15b431c742a4fc65122768658232604ad34fade76e9
4
- data.tar.gz: 21da6fd08a9ce1ff90cc3b3be66843811b1439c67d1bb4d17b39437b2e1c9ac8
3
+ metadata.gz: 4d9b0ecf844c063dc4ce2deeeb02a9fb2832a0640b8ed232b8d2c40ff7061692
4
+ data.tar.gz: 8969a80a3834eec68f5927dc14aa8470a62c438ec833c8c5a2183e632aabce59
5
5
  SHA512:
6
- metadata.gz: ee49e9f7940118d1bf3ce03d9784b7e7d89c3f0d2f5c08b89548855447ebdd02d7be05b2ec52c3e3d03d753de2f73aae9db666fb5c6c4b989b6800e4bcc0c857
7
- data.tar.gz: 3e0b5dcd574ce266e2d0243164d9370aad9aaf9a2c5a6572dae9b117e8c18a0b2e5e19b59382fac36516c744c5bf75fce4fbc08b9aa54c981360468ce8e18634
6
+ metadata.gz: f1a25098d98189de1f4b74374871559cc78ed42aba67166043d0f9892c8d91a2a8e27c6ab410f26e80a5a02e6bfe79194c4310b3b6e5f7ae0dec61869fdd2ca2
7
+ data.tar.gz: 3d51bbb186fdda7cc2172d5779d4b4be107ad1295a099894ab8d7f8c6a5b0601a38a03bc8494e017a2234ab081b5b234df913ee94512a6e59d281685c12a09d4
data/CHANGELOG.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Change Log
2
+
2
3
  All notable changes to this project will be documented in this file.
3
- This project adheres to [Semantic Versioning](http://semver.org/).
4
+ This project adheres to [Semantic Versioning](https://semver.org/).
4
5
 
5
6
  ## [Future 5.0 release]
6
7
 
@@ -8,6 +9,34 @@ This project adheres to [Semantic Versioning](http://semver.org/).
8
9
 
9
10
  - Drop support for Ruby 2.5 and 2.6 [\#708](https://github.com/countries/countries/pull/708) ([pmor](https://github.com/pmor))
10
11
 
12
+
13
+ ## [4.2.3](https://github.com/countries/countries/releases/tag/v4.2.2) (2022/03/24 11:00 +00:00)
14
+
15
+ **IMPORTANT NOTE: This will be be the last release of the 4.x series, and the last one to support Ruby 2.5 and 2.6**
16
+
17
+ * Use bundle add instead [\#743](https://github.com/countries/countries/pull/743) ([glaucocustodio](https://github.com/glaucocustodio))
18
+ * update i18n_data [\#742](https://github.com/countries/countries/pull/742) ([bonekost](https://github.com/bonekost))
19
+
20
+ ## [4.2.2](https://github.com/countries/countries/releases/tag/v4.2.2) (2022/02/17 13:52 +00:00)
21
+
22
+ **Merged pull requests:**
23
+
24
+ * http:// -> https:// [\#737](https://github.com/countries/countries/pull/737) ([biow0lf](https://github.com/biow0lf))
25
+ * Update AE start_of_week to monday. [\#739](https://github.com/countries/countries/pull/739) ([pmor](https://github.com/pmor))
26
+ * Fix Subdivision data by [\#740](https://github.com/countries/countries/pull/740) ([pmor](https://github.com/pmor))
27
+
28
+ **Closed issues:**
29
+
30
+ * Change on UAE Value.start_of_week [\#738](https://github.com/countries/countries/issues/738)
31
+
32
+
33
+ **Full Changelog**: https://github.com/countries/countries/compare/v4.2.1...v4.2.2
34
+
35
+ ## [4.2.1](https://github.com/countries/countries/releases/tag/v4.2.1) (2022/01/11 12:39 +00:00)
36
+
37
+ - Missing update to cache files on release 4.2.0
38
+ - Update postal code regexes from rake task [\#734](https://github.com/countries/countries/pull/734 ) ([cover](https://github.com/cover))
39
+
11
40
  ## [4.2.0](https://github.com/countries/countries/releases/tag/v4.2.0) (2022/01/11 11:04 +00:00)
12
41
 
13
42
  **Deprecations**
data/LICENSE CHANGED
@@ -1,4 +1,6 @@
1
- Copyright (c) 2012 hexorx
1
+ Copyright (c) 2012-2015 hexorx
2
+ Copyright (c) 2015-2021 hexorx, rposborne
3
+ Copyright (c) 2022 hexorx, rposborne, pmor
2
4
 
3
5
  MIT License
4
6
 
data/README.markdown CHANGED
@@ -7,19 +7,15 @@ Countries is a collection of all sorts of useful information for every country i
7
7
  ## Installation
8
8
 
9
9
  ```bash
10
- gem install countries
11
- ```
10
+ gem install countries
11
+ ```
12
12
 
13
- Or you can install via Bundler if you are using Rails. Add this line to your application's Gemfile:
13
+ Or you can install via Bundler if you are using Rails:
14
14
 
15
- ```ruby
16
- gem 'countries'
15
+ ```bash
16
+ bundle add countries
17
17
  ```
18
18
 
19
- And then execute:
20
-
21
- $ bundle
22
-
23
19
  ## Basic Usage
24
20
 
25
21
  Simply load a new country object using Country.new(*alpha2*) or the shortcut Country[*alpha2*]. An example works best.
@@ -60,12 +56,11 @@ The `#name` and `#names` attributes, and corresponding finder methods will be re
60
56
 
61
57
  For translated country names, we use data from [pkg-isocodes](https://salsa.debian.org/iso-codes-team/iso-codes), via the [i18n_data](https://github.com/grosser/i18n_data) gem, and these generally correspond to the expected "common names". These names and the corresponding methods have not been changed.
62
58
 
63
-
64
59
  ## Selective Loading of Locales
65
60
 
66
61
  As of 2.0 you can selectively load locales to reduce memory usage in production.
67
62
 
68
- By default we load I18n.available_locales if I18n is present, otherwise only [:en]. This means almost any rails environment will only bring in its supported translations.
63
+ By default we load `I18n.available_locales` if I18n is present, otherwise only `[:en]`. This means almost any Rails environment will only bring in its supported translations.
69
64
 
70
65
  You can add all the locales like this.
71
66
 
@@ -93,7 +88,7 @@ list = ISO3166::Country.find_all_countries_by_region('Americas')
93
88
  c = ISO3166::Country.find_country_by_alpha3('can')
94
89
  ```
95
90
 
96
- For a list of available attributes please see ISO3166::DEFAULT_COUNTRY_HASH.
91
+ For a list of available attributes please see `ISO3166::DEFAULT_COUNTRY_HASH`.
97
92
  Note: searches are *case insensitive and ignore accents*.
98
93
 
99
94
  _Please note that `find_by_name`, `find_by_names`, `find_*_by_name` and `find_*_by_names` methods are deprecated and will be removed in 5.0. See [Upgrading to 4.2 and 5.x](#upgrading-to-4-2-and-5-x) above_
@@ -154,7 +149,7 @@ c.region # => "Americas"
154
149
  c.subregion # => "Northern America"
155
150
  ```
156
151
 
157
- Please note that `latitude_dec` and `longitude_dec` will be deprecated on release 4.2 and deleted in 5.0. These attribues have been redundant for several years, since the `latitude` and `longitude` fields have been switched decimal coordinates.
152
+ Please note that `latitude_dec` and `longitude_dec` was be deprecated on release 4.2 and will be deleted in 5.0. These attributes have been redundant for several years, since the `latitude` and `longitude` fields have been switched decimal coordinates.
158
153
 
159
154
  ### Timezones **(optional)**
160
155
 
@@ -166,8 +161,8 @@ gem 'tzinfo', '~> 1.2', '>= 1.2.2'
166
161
 
167
162
  ```ruby
168
163
  c.timezones.zone_identifiers # => ["America/New_York", "America/Detroit", "America/Kentucky/Louisville", ...]
169
- c.timezones.zone_info # see [tzinfo docs]( http://www.rubydoc.info/gems/tzinfo/TZInfo/CountryInfo)
170
- c.timezones # see [tzinfo docs]( http://www.rubydoc.info/gems/tzinfo/TZInfo/Country)
164
+ c.timezones.zone_info # see [tzinfo docs](https://www.rubydoc.info/gems/tzinfo/TZInfo/CountryTimezone)
165
+ c.timezones # see [tzinfo docs](https://www.rubydoc.info/gems/tzinfo/TZInfo/Country)
171
166
  ```
172
167
 
173
168
  ### Telephone Routing (E164)
@@ -241,7 +236,7 @@ c.currency.symbol # => '$'
241
236
 
242
237
  ## Address Formatting
243
238
 
244
- A template for formatting addresses is available through the address_format method. These templates are compatible with the [Liquid](http://www.liquidmarkup.org/) template system.
239
+ A template for formatting addresses is available through the address_format method. These templates are compatible with the [Liquid](https://shopify.github.io/liquid/) template system.
245
240
 
246
241
  ```ruby
247
242
  c.address_format # => "{{recipient}}\n{{street}}\n{{city}} {{region}} {{postalcode}}\n{{country}}"
@@ -350,5 +345,8 @@ the next `rake update_cache`.
350
345
 
351
346
  ## Copyright
352
347
 
353
- Copyright (c) 2016 hexorx. See LICENSE for details.
348
+ Copyright (c) 2012-2015 hexorx
349
+ Copyright (c) 2015-2021 hexorx, rposborne
350
+ Copyright (c) 2022 hexorx, rposborne, pmor
354
351
 
352
+ See LICENSE for details.
data/Rakefile CHANGED
@@ -37,6 +37,8 @@ task :update_cache do
37
37
  corrections = YAML.load_file(File.join(File.dirname(__FILE__), 'lib', 'countries', 'data', 'translation_corrections.yaml')) || {}
38
38
 
39
39
  language_keys = I18nData.languages.keys + ['zh_CN', 'zh_TW', 'zh_HK','bn_IN','pt_BR']
40
+ # Ignore locales that have bad data in i18n_data 0.16.0
41
+ language_keys -= %w[AY AM BA]
40
42
  language_keys.each do |locale|
41
43
  locale = locale.downcase
42
44
  begin
data/countries.gemspec CHANGED
@@ -6,10 +6,10 @@ Gem::Specification.new do |gem|
6
6
  gem.email = ['hexorx@gmail.com', 'russell@burningpony.com', 'pedro@codecreations.tech']
7
7
  gem.description = 'All sorts of useful information about every country packaged as pretty little country objects. It includes data from ISO 3166'
8
8
  gem.summary = 'Gives you a country object full of all sorts of useful information.'
9
- gem.homepage = 'http://github.com/countries/countries'
10
- gem.metadata = { 'bug_tracker_uri' => 'http://github.com/countries/countries/issues',
11
- 'changelog_uri' => 'https://github.com/countries/countries/blob/master/CHANGELOG.md',
12
- 'source_code_uri' => 'https://github.com/countries/countries',
9
+ gem.homepage = 'https://github.com/countries/countries'
10
+ gem.metadata = { 'bug_tracker_uri' => 'https://github.com/countries/countries/issues',
11
+ 'changelog_uri' => 'https://github.com/countries/countries/blob/master/CHANGELOG.md',
12
+ 'source_code_uri' => 'https://github.com/countries/countries',
13
13
  'wiki_uri' => 'https://github.com/countries/countries/wiki'}
14
14
 
15
15
  gem.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
@@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
21
21
 
22
22
  gem.required_ruby_version = '>= 2.5'
23
23
 
24
- gem.add_dependency('i18n_data', '~> 0.15.0')
24
+ gem.add_dependency('i18n_data', '~> 0.16.0')
25
25
  gem.add_dependency('sixarm_ruby_unaccent', '~> 1.1')
26
26
  gem.add_development_dependency('rspec', '>= 3')
27
27
  gem.add_development_dependency('activesupport', '>= 3')