countries 2.0.6 β 2.1.1
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 +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +49 -3
- data/README.markdown +90 -93
- data/countries.gemspec +3 -3
- data/lib/countries/cache/countries.json +1 -1
- data/lib/countries/cache/locales/ar.json +1 -1
- data/lib/countries/cache/locales/fa.json +1 -1
- data/lib/countries/cache/locales/he.json +1 -1
- data/lib/countries/country/class_methods.rb +4 -1
- data/lib/countries/country/emoji.rb +3 -0
- data/lib/countries/country.rb +6 -2
- data/lib/countries/data/countries/AD.yaml +1 -0
- data/lib/countries/data/countries/AE.yaml +1 -0
- data/lib/countries/data/countries/AF.yaml +1 -0
- data/lib/countries/data/countries/AG.yaml +1 -0
- data/lib/countries/data/countries/AI.yaml +1 -0
- data/lib/countries/data/countries/AL.yaml +1 -0
- data/lib/countries/data/countries/AM.yaml +1 -0
- data/lib/countries/data/countries/AO.yaml +1 -0
- data/lib/countries/data/countries/AQ.yaml +1 -0
- data/lib/countries/data/countries/AR.yaml +1 -0
- data/lib/countries/data/countries/AS.yaml +1 -0
- data/lib/countries/data/countries/AT.yaml +1 -0
- data/lib/countries/data/countries/AU.yaml +1 -0
- data/lib/countries/data/countries/AW.yaml +1 -0
- data/lib/countries/data/countries/AX.yaml +1 -0
- data/lib/countries/data/countries/AZ.yaml +1 -0
- data/lib/countries/data/countries/BA.yaml +1 -0
- data/lib/countries/data/countries/BB.yaml +1 -0
- data/lib/countries/data/countries/BD.yaml +1 -0
- data/lib/countries/data/countries/BE.yaml +1 -0
- data/lib/countries/data/countries/BF.yaml +1 -0
- data/lib/countries/data/countries/BG.yaml +1 -0
- data/lib/countries/data/countries/BH.yaml +1 -0
- data/lib/countries/data/countries/BI.yaml +1 -0
- data/lib/countries/data/countries/BJ.yaml +1 -0
- data/lib/countries/data/countries/BL.yaml +1 -0
- data/lib/countries/data/countries/BM.yaml +1 -0
- data/lib/countries/data/countries/BN.yaml +1 -0
- data/lib/countries/data/countries/BO.yaml +1 -0
- data/lib/countries/data/countries/BQ.yaml +1 -0
- data/lib/countries/data/countries/BR.yaml +3 -2
- data/lib/countries/data/countries/BS.yaml +1 -0
- data/lib/countries/data/countries/BT.yaml +1 -0
- data/lib/countries/data/countries/BV.yaml +1 -0
- data/lib/countries/data/countries/BW.yaml +1 -0
- data/lib/countries/data/countries/BY.yaml +1 -0
- data/lib/countries/data/countries/BZ.yaml +1 -0
- data/lib/countries/data/countries/CA.yaml +1 -0
- data/lib/countries/data/countries/CC.yaml +1 -0
- data/lib/countries/data/countries/CD.yaml +1 -0
- data/lib/countries/data/countries/CF.yaml +1 -0
- data/lib/countries/data/countries/CG.yaml +1 -0
- data/lib/countries/data/countries/CH.yaml +1 -0
- data/lib/countries/data/countries/CI.yaml +1 -0
- data/lib/countries/data/countries/CK.yaml +1 -0
- data/lib/countries/data/countries/CL.yaml +1 -0
- data/lib/countries/data/countries/CM.yaml +1 -0
- data/lib/countries/data/countries/CN.yaml +1 -0
- data/lib/countries/data/countries/CO.yaml +1 -0
- data/lib/countries/data/countries/CR.yaml +1 -0
- data/lib/countries/data/countries/CU.yaml +1 -0
- data/lib/countries/data/countries/CV.yaml +1 -0
- data/lib/countries/data/countries/CW.yaml +1 -0
- data/lib/countries/data/countries/CX.yaml +1 -0
- data/lib/countries/data/countries/CY.yaml +1 -0
- data/lib/countries/data/countries/CZ.yaml +1 -0
- data/lib/countries/data/countries/DE.yaml +1 -0
- data/lib/countries/data/countries/DJ.yaml +1 -0
- data/lib/countries/data/countries/DK.yaml +1 -0
- data/lib/countries/data/countries/DM.yaml +1 -0
- data/lib/countries/data/countries/DO.yaml +1 -0
- data/lib/countries/data/countries/DZ.yaml +1 -0
- data/lib/countries/data/countries/EC.yaml +1 -0
- data/lib/countries/data/countries/EE.yaml +1 -0
- data/lib/countries/data/countries/EG.yaml +1 -0
- data/lib/countries/data/countries/EH.yaml +1 -0
- data/lib/countries/data/countries/ER.yaml +1 -0
- data/lib/countries/data/countries/ES.yaml +1 -0
- data/lib/countries/data/countries/ET.yaml +1 -0
- data/lib/countries/data/countries/FI.yaml +1 -0
- data/lib/countries/data/countries/FJ.yaml +2 -1
- data/lib/countries/data/countries/FK.yaml +1 -0
- data/lib/countries/data/countries/FM.yaml +1 -0
- data/lib/countries/data/countries/FO.yaml +1 -0
- data/lib/countries/data/countries/FR.yaml +1 -0
- data/lib/countries/data/countries/GA.yaml +1 -0
- data/lib/countries/data/countries/GB.yaml +2 -0
- data/lib/countries/data/countries/GD.yaml +1 -0
- data/lib/countries/data/countries/GE.yaml +1 -0
- data/lib/countries/data/countries/GF.yaml +1 -0
- data/lib/countries/data/countries/GG.yaml +1 -0
- data/lib/countries/data/countries/GH.yaml +1 -0
- data/lib/countries/data/countries/GI.yaml +1 -0
- data/lib/countries/data/countries/GL.yaml +1 -0
- data/lib/countries/data/countries/GM.yaml +1 -0
- data/lib/countries/data/countries/GN.yaml +1 -0
- data/lib/countries/data/countries/GP.yaml +1 -0
- data/lib/countries/data/countries/GQ.yaml +1 -0
- data/lib/countries/data/countries/GR.yaml +1 -0
- data/lib/countries/data/countries/GS.yaml +1 -0
- data/lib/countries/data/countries/GT.yaml +1 -0
- data/lib/countries/data/countries/GU.yaml +1 -0
- data/lib/countries/data/countries/GW.yaml +1 -0
- data/lib/countries/data/countries/GY.yaml +1 -0
- data/lib/countries/data/countries/HK.yaml +2 -1
- data/lib/countries/data/countries/HM.yaml +1 -0
- data/lib/countries/data/countries/HN.yaml +1 -0
- data/lib/countries/data/countries/HR.yaml +1 -0
- data/lib/countries/data/countries/HT.yaml +1 -0
- data/lib/countries/data/countries/HU.yaml +1 -0
- data/lib/countries/data/countries/ID.yaml +1 -0
- data/lib/countries/data/countries/IE.yaml +1 -0
- data/lib/countries/data/countries/IL.yaml +1 -0
- data/lib/countries/data/countries/IM.yaml +1 -0
- data/lib/countries/data/countries/IN.yaml +1 -0
- data/lib/countries/data/countries/IO.yaml +1 -0
- data/lib/countries/data/countries/IQ.yaml +1 -0
- data/lib/countries/data/countries/IR.yaml +1 -0
- data/lib/countries/data/countries/IS.yaml +1 -0
- data/lib/countries/data/countries/IT.yaml +1 -0
- data/lib/countries/data/countries/JE.yaml +1 -0
- data/lib/countries/data/countries/JM.yaml +1 -0
- data/lib/countries/data/countries/JO.yaml +1 -0
- data/lib/countries/data/countries/JP.yaml +1 -0
- data/lib/countries/data/countries/KE.yaml +1 -0
- data/lib/countries/data/countries/KG.yaml +1 -0
- data/lib/countries/data/countries/KH.yaml +1 -0
- data/lib/countries/data/countries/KI.yaml +1 -0
- data/lib/countries/data/countries/KM.yaml +1 -0
- data/lib/countries/data/countries/KN.yaml +1 -0
- data/lib/countries/data/countries/KP.yaml +1 -0
- data/lib/countries/data/countries/KR.yaml +1 -0
- data/lib/countries/data/countries/KW.yaml +1 -0
- data/lib/countries/data/countries/KY.yaml +1 -0
- data/lib/countries/data/countries/KZ.yaml +1 -0
- data/lib/countries/data/countries/LA.yaml +1 -0
- data/lib/countries/data/countries/LB.yaml +1 -0
- data/lib/countries/data/countries/LC.yaml +1 -0
- data/lib/countries/data/countries/LI.yaml +1 -0
- data/lib/countries/data/countries/LK.yaml +1 -0
- data/lib/countries/data/countries/LR.yaml +1 -0
- data/lib/countries/data/countries/LS.yaml +1 -0
- data/lib/countries/data/countries/LT.yaml +1 -0
- data/lib/countries/data/countries/LU.yaml +1 -0
- data/lib/countries/data/countries/LV.yaml +1 -0
- data/lib/countries/data/countries/LY.yaml +1 -0
- data/lib/countries/data/countries/MA.yaml +1 -0
- data/lib/countries/data/countries/MC.yaml +1 -0
- data/lib/countries/data/countries/MD.yaml +1 -0
- data/lib/countries/data/countries/ME.yaml +1 -0
- data/lib/countries/data/countries/MF.yaml +1 -0
- data/lib/countries/data/countries/MG.yaml +1 -0
- data/lib/countries/data/countries/MH.yaml +1 -0
- data/lib/countries/data/countries/MK.yaml +1 -0
- data/lib/countries/data/countries/ML.yaml +1 -0
- data/lib/countries/data/countries/MM.yaml +1 -0
- data/lib/countries/data/countries/MN.yaml +1 -0
- data/lib/countries/data/countries/MO.yaml +1 -0
- data/lib/countries/data/countries/MP.yaml +1 -0
- data/lib/countries/data/countries/MQ.yaml +1 -0
- data/lib/countries/data/countries/MR.yaml +1 -0
- data/lib/countries/data/countries/MS.yaml +1 -0
- data/lib/countries/data/countries/MT.yaml +1 -0
- data/lib/countries/data/countries/MU.yaml +1 -0
- data/lib/countries/data/countries/MV.yaml +1 -0
- data/lib/countries/data/countries/MW.yaml +1 -0
- data/lib/countries/data/countries/MX.yaml +1 -0
- data/lib/countries/data/countries/MY.yaml +1 -0
- data/lib/countries/data/countries/MZ.yaml +1 -0
- data/lib/countries/data/countries/NA.yaml +1 -0
- data/lib/countries/data/countries/NC.yaml +1 -0
- data/lib/countries/data/countries/NE.yaml +1 -0
- data/lib/countries/data/countries/NF.yaml +1 -0
- data/lib/countries/data/countries/NG.yaml +1 -0
- data/lib/countries/data/countries/NI.yaml +1 -0
- data/lib/countries/data/countries/NL.yaml +1 -0
- data/lib/countries/data/countries/NO.yaml +1 -0
- data/lib/countries/data/countries/NP.yaml +11 -0
- data/lib/countries/data/countries/NR.yaml +1 -0
- data/lib/countries/data/countries/NU.yaml +1 -0
- data/lib/countries/data/countries/NZ.yaml +1 -0
- data/lib/countries/data/countries/OM.yaml +1 -0
- data/lib/countries/data/countries/PA.yaml +1 -0
- data/lib/countries/data/countries/PE.yaml +1 -0
- data/lib/countries/data/countries/PF.yaml +1 -0
- data/lib/countries/data/countries/PG.yaml +1 -0
- data/lib/countries/data/countries/PH.yaml +1 -0
- data/lib/countries/data/countries/PK.yaml +1 -0
- data/lib/countries/data/countries/PL.yaml +1 -0
- data/lib/countries/data/countries/PM.yaml +1 -0
- data/lib/countries/data/countries/PN.yaml +1 -0
- data/lib/countries/data/countries/PR.yaml +1 -0
- data/lib/countries/data/countries/PS.yaml +1 -0
- data/lib/countries/data/countries/PT.yaml +1 -0
- data/lib/countries/data/countries/PW.yaml +1 -0
- data/lib/countries/data/countries/PY.yaml +1 -0
- data/lib/countries/data/countries/QA.yaml +1 -0
- data/lib/countries/data/countries/RE.yaml +1 -0
- data/lib/countries/data/countries/RO.yaml +2 -1
- data/lib/countries/data/countries/RS.yaml +1 -0
- data/lib/countries/data/countries/RU.yaml +1 -0
- data/lib/countries/data/countries/RW.yaml +1 -0
- data/lib/countries/data/countries/SA.yaml +2 -0
- data/lib/countries/data/countries/SB.yaml +1 -0
- data/lib/countries/data/countries/SC.yaml +1 -0
- data/lib/countries/data/countries/SD.yaml +1 -0
- data/lib/countries/data/countries/SE.yaml +1 -0
- data/lib/countries/data/countries/SG.yaml +1 -0
- data/lib/countries/data/countries/SH.yaml +1 -0
- data/lib/countries/data/countries/SI.yaml +1 -0
- data/lib/countries/data/countries/SJ.yaml +1 -0
- data/lib/countries/data/countries/SK.yaml +1 -0
- data/lib/countries/data/countries/SL.yaml +1 -0
- data/lib/countries/data/countries/SM.yaml +1 -0
- data/lib/countries/data/countries/SN.yaml +1 -0
- data/lib/countries/data/countries/SO.yaml +1 -0
- data/lib/countries/data/countries/SR.yaml +1 -0
- data/lib/countries/data/countries/SS.yaml +2 -1
- data/lib/countries/data/countries/ST.yaml +1 -0
- data/lib/countries/data/countries/SV.yaml +1 -0
- data/lib/countries/data/countries/SX.yaml +1 -0
- data/lib/countries/data/countries/SY.yaml +1 -0
- data/lib/countries/data/countries/SZ.yaml +1 -0
- data/lib/countries/data/countries/TC.yaml +1 -0
- data/lib/countries/data/countries/TD.yaml +1 -0
- data/lib/countries/data/countries/TF.yaml +1 -0
- data/lib/countries/data/countries/TG.yaml +1 -0
- data/lib/countries/data/countries/TH.yaml +1 -0
- data/lib/countries/data/countries/TJ.yaml +1 -0
- data/lib/countries/data/countries/TK.yaml +1 -0
- data/lib/countries/data/countries/TL.yaml +1 -0
- data/lib/countries/data/countries/TM.yaml +1 -0
- data/lib/countries/data/countries/TN.yaml +1 -0
- data/lib/countries/data/countries/TO.yaml +1 -0
- data/lib/countries/data/countries/TR.yaml +1 -0
- data/lib/countries/data/countries/TT.yaml +1 -0
- data/lib/countries/data/countries/TV.yaml +1 -0
- data/lib/countries/data/countries/TW.yaml +1 -0
- data/lib/countries/data/countries/TZ.yaml +1 -0
- data/lib/countries/data/countries/UA.yaml +1 -0
- data/lib/countries/data/countries/UG.yaml +1 -0
- data/lib/countries/data/countries/UM.yaml +1 -0
- data/lib/countries/data/countries/US.yaml +1 -0
- data/lib/countries/data/countries/UY.yaml +1 -0
- data/lib/countries/data/countries/UZ.yaml +1 -0
- data/lib/countries/data/countries/VA.yaml +1 -0
- data/lib/countries/data/countries/VC.yaml +1 -0
- data/lib/countries/data/countries/VE.yaml +1 -0
- data/lib/countries/data/countries/VG.yaml +1 -0
- data/lib/countries/data/countries/VI.yaml +1 -0
- data/lib/countries/data/countries/VN.yaml +1 -0
- data/lib/countries/data/countries/VU.yaml +1 -0
- data/lib/countries/data/countries/WF.yaml +1 -0
- data/lib/countries/data/countries/WS.yaml +1 -0
- data/lib/countries/data/countries/YE.yaml +1 -0
- data/lib/countries/data/countries/YT.yaml +1 -0
- data/lib/countries/data/countries/ZA.yaml +1 -0
- data/lib/countries/data/countries/ZM.yaml +1 -0
- data/lib/countries/data/countries/ZW.yaml +1 -0
- data/lib/countries/data/subdivisions/FR.yaml +182 -0
- data/lib/countries/data/subdivisions/PH.yaml +0 -12
- data/lib/countries/data/subdivisions/TM.yaml +0 -14
- data/lib/countries/data/subdivisions/TR.yaml +78 -79
- data/lib/countries/data/translation_corrections.yaml +9 -5
- data/lib/countries/data.rb +12 -3
- data/lib/countries/structure.rb +1 -0
- data/lib/countries/subdivision.rb +1 -0
- data/lib/countries/version.rb +1 -1
- data/spec/country_spec.rb +21 -0
- data/spec/data_spec.rb +14 -2
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 735b197a9e7e8fda800a39ab7e2558da8ee59b80
|
|
4
|
+
data.tar.gz: 7af8cbb88f8301bf72f8831fffffa2d556f38a81
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5d3b4230c7a1500f5eab70351d027b1ede91811817cac14e8e602a222d7fdc68b61bb8af5ef5b8150e5ae888e9e9ce01cc003dd85e6b27c33c8e822e9ddcf127
|
|
7
|
+
data.tar.gz: 8e9d46e88acad56b12dbead0157f0895a4c80b10bc850e3bf26fe15a10a950241d5ee54763719d39cf332a236eb16e62c99d5488bfad7a6e891997bad2af19b3
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -2,26 +2,52 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
## 2.0.8
|
|
7
|
+
- Add language data to Nepal @gkunwar
|
|
8
|
+
- Add start of week day @Vsanchezr
|
|
9
|
+
- Normalized Turkey's Subdivisions @emir
|
|
10
|
+
|
|
11
|
+
## 2.0.7
|
|
12
|
+
- Content Fixes
|
|
13
|
+
|
|
14
|
+
## 2.0.6
|
|
15
|
+
- Adds French Guiana nationality
|
|
16
|
+
- Add missing un_locode for south sudan
|
|
17
|
+
- Fix Norwegian country code (false -> NO)
|
|
18
|
+
- Add missing un location codes
|
|
19
|
+
- Further reduce calls to .keys to provide additional speedup and performance bump
|
|
20
|
+
- Add sixarm_ruby_unaccent to gemspec dependencies
|
|
21
|
+
- Update all official country names to the ISO 3166 standard
|
|
22
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v2.0.5...v2.0.6)
|
|
23
|
+
|
|
5
24
|
## 2.0.5
|
|
6
25
|
- Fixes #408 Correct Subdivision files for AD, AE, AF, AG, and AL
|
|
26
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v2.0.4...v2.0.5)
|
|
7
27
|
|
|
8
28
|
## 2.0.4
|
|
9
29
|
- Update cache.
|
|
30
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v2.0.3...v2.0.4)
|
|
10
31
|
|
|
11
32
|
## 2.0.3
|
|
12
33
|
- Fix comparison with country to nil
|
|
13
34
|
- Add NANP_prefix as separate field
|
|
35
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v2.0.2...v2.0.3)
|
|
14
36
|
|
|
15
37
|
## 2.0.2
|
|
16
38
|
- Add nanp_prefix data.
|
|
39
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v2.0.1...v2.0.2)
|
|
17
40
|
|
|
18
41
|
## 2.0.1
|
|
19
|
-
- Content updates
|
|
20
|
-
|
|
21
|
-
- Update bounding box update task to prevent any lookup from return anything other than a country.
|
|
42
|
+
- Content updates
|
|
43
|
+
- Fix bounding boxes that were mismatched.
|
|
44
|
+
- Update bounding box update task to prevent any lookup from return anything other than a country.
|
|
45
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v2.0.0...v2.0.1)
|
|
22
46
|
|
|
23
47
|
## 2.0.0
|
|
24
48
|
- Remove find_country_by_translations
|
|
49
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v1.2.5...v2.0.0)
|
|
50
|
+
- [Changelog from RC](https://github.com/hexorx/countries/compare/v2.0.0.rc3...v2.0.0)
|
|
25
51
|
|
|
26
52
|
## 2.0.0.rc3
|
|
27
53
|
- Content updates
|
|
@@ -29,22 +55,28 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
29
55
|
- All bounding boxes updated
|
|
30
56
|
- United States is now United States of America
|
|
31
57
|
- Refactor of Rake tasks
|
|
58
|
+
- [Changelog from RC](https://github.com/hexorx/countries/compare/v2.0.0.rc2...v2.0.0.rc3)
|
|
32
59
|
|
|
33
60
|
## 2.0.0.rc2
|
|
34
61
|
- Add fallback when looking up locales for pt-BR style languages
|
|
35
62
|
- Implement project style guide
|
|
63
|
+
- [Changelog from RC](https://github.com/hexorx/countries/compare/v2.0.0.rc...v2.0.0.rc2)
|
|
36
64
|
|
|
37
65
|
## 2.0.0.rc
|
|
38
66
|
- Fixed a regression that would purge the countries memory cache when adding a custom country #353
|
|
39
67
|
- Various Content Updates
|
|
68
|
+
- [Changelog from RC](https://github.com/hexorx/countries/compare/v2.0.0.pre.4...v2.0.0.rc)
|
|
40
69
|
|
|
41
70
|
## 2.0.0.pre.4
|
|
71
|
+
- [Changelog from RC](https://github.com/hexorx/countries/compare/v2.0.0.pre.2...v2.0.0.pre.4)
|
|
42
72
|
- Fix crash when app introduces an unexpected locale. Much thanks to @jstenhouse
|
|
43
73
|
|
|
44
74
|
## 2.0.0.pre.2
|
|
75
|
+
- [Changelog from RC](https://github.com/hexorx/countries/compare/v2.0.0.pre...v2.0.0.pre.2)
|
|
45
76
|
- Bringing in content from 1.x branch
|
|
46
77
|
|
|
47
78
|
## 2.0.0.pre
|
|
79
|
+
- [Changelog from RC](https://github.com/hexorx/countries/compare/v1.2.5...v2.0.0.pre)
|
|
48
80
|
- Selective loading translations of countries
|
|
49
81
|
- Auto detect I18n locales to load
|
|
50
82
|
- Add Configuration methods to force locales to load
|
|
@@ -62,6 +94,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
62
94
|
|
|
63
95
|
## 1.2.5 @ 2016-01-22
|
|
64
96
|
- Rebuilding cache
|
|
97
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v1.2.4...v1.2.5)
|
|
65
98
|
|
|
66
99
|
## 1.2.4 @ 2016-01-21
|
|
67
100
|
- Romanian Standard VAT rate is 20% as of 2016-01-01 #325 @dougal
|
|
@@ -69,19 +102,24 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
69
102
|
- Added 47 as calling code for Bouvet Island, Norwegian territory #323
|
|
70
103
|
- Added XAF as currency code for Congo @espen
|
|
71
104
|
- Force converting passed locale to string @borodiychuk
|
|
105
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v1.2.3...v1.2.4)
|
|
72
106
|
|
|
73
107
|
## 1.2.3
|
|
74
108
|
- Content Updates
|
|
109
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v1.2.2...v1.2.3)
|
|
75
110
|
|
|
76
111
|
## 1.2.2
|
|
77
112
|
- Content Updates
|
|
113
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v1.2.1...v1.2.2)
|
|
78
114
|
|
|
79
115
|
## 1.2.1
|
|
80
116
|
- Fixed issue in loading @rposborne
|
|
117
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v1.2.0...v1.2.1)
|
|
81
118
|
|
|
82
119
|
## 1.2.0 (yanked)
|
|
83
120
|
- Cleaning up Global Load Path @rposborne
|
|
84
121
|
- Add MOP as the currency for Macao @kriskhaira
|
|
122
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v1.1.0...v1.2.0)
|
|
85
123
|
|
|
86
124
|
## 1.1.0
|
|
87
125
|
- Adding compare operation to country @guilleart
|
|
@@ -89,6 +127,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
89
127
|
- Correct NL to NO for un_locode @ohenrik
|
|
90
128
|
- Fix spelling of Sjælland @boatrite
|
|
91
129
|
- Add alternate spelling of Macao/Macau @nityaoberoi
|
|
130
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v1.0.0...v1.1.0)
|
|
92
131
|
|
|
93
132
|
## 1.0.0
|
|
94
133
|
- Switch to Marshalling for cache storage @rposborne
|
|
@@ -96,6 +135,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
96
135
|
- Removed Rails 2.0 FormHelper COUNTRIES @rposborne
|
|
97
136
|
- Add class codes method to get list of all alpha2 codes @rposborne
|
|
98
137
|
- Change default behavior of all method to return a list of country objects vs a tuple of alpha code + name
|
|
138
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v0.11.5...v1.0.0)
|
|
99
139
|
|
|
100
140
|
## 0.11.5
|
|
101
141
|
- Refactored data loading into it's own class
|
|
@@ -105,22 +145,27 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
105
145
|
- Fix New York, Washington, Oklahoma state's latitude/longitude information @GUI
|
|
106
146
|
- Bad state data present in Uruguay has been removed @saisha92
|
|
107
147
|
- Various Other Content Updates by @danshultz @embs @sykaeh, @tg0
|
|
148
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v0.11.4...v0.11.5)
|
|
108
149
|
|
|
109
150
|
## 0.11.4
|
|
110
151
|
- Added coordinates for subdivisions @fabn
|
|
111
152
|
- Various Other Content Updates by @fabn, @snowblink
|
|
153
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v0.11.3...v0.11.4)
|
|
112
154
|
|
|
113
155
|
## 0.11.3
|
|
114
156
|
- Translations update from i18n-data
|
|
157
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v0.11.2...v0.11.3)
|
|
115
158
|
|
|
116
159
|
## 0.11.2
|
|
117
160
|
- silence ruby warnings @franckverrot
|
|
118
161
|
- add find_country_by_translated_name @rposborne NOTE: this is garbage for the
|
|
119
162
|
time being, some translations have duplicates in them and causes false results
|
|
163
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v0.11.1...v0.11.2)
|
|
120
164
|
|
|
121
165
|
## 0.11.1
|
|
122
166
|
- added bounding box coordinates for VI, CW, PR, AS, and GU : @marinom
|
|
123
167
|
- revert Lookup country by translated name via find_by_name @rposborne
|
|
168
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v0.11.0...v0.11.1)
|
|
124
169
|
|
|
125
170
|
## [0.11.0] - 2015-03-03
|
|
126
171
|
### Changed
|
|
@@ -130,3 +175,4 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
130
175
|
- Content Updates @masolino, @rosetree, @stayhero, @skarlcf, @cllns, @speric, @rposborne
|
|
131
176
|
- Adding Lat/Lng to countries @jabawack81
|
|
132
177
|
- Readme Updates @cllns
|
|
178
|
+
- [Full Changelog](https://github.com/hexorx/countries/compare/v0.10.0...v0.11.0)
|
data/README.markdown
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
Countries
|
|
2
|
-
=========
|
|
1
|
+
# Countries
|
|
3
2
|
|
|
4
|
-
Countries is a collection of all sorts of useful information for every country in the ISO 3166 standard. It contains info for the following standards ISO3166-1(countries), ISO3166-2(states/subdivisions), ISO4217(currency) and E.164(phone numbers). I will add any country based data I can get access to. I hope this to be a repository for all country based information.
|
|
3
|
+
Countries is a collection of all sorts of useful information for every country in the ISO 3166 standard. It contains info for the following standards ISO3166-1 (countries), ISO3166-2 (states/subdivisions), ISO4217 (currency) and E.164 (phone numbers). I will add any country based data I can get access to. I hope this to be a repository for all country based information.
|
|
5
4
|
|
|
6
5
|
[](https://www.codewake.com/p/countries) [](https://badge.fury.io/rb/countries) [](https://travis-ci.org/hexorx/countries) [](https://gemnasium.com/hexorx/countries) [](https://codeclimate.com/github/hexorx/countries)
|
|
7
6
|
|
|
8
|
-
Installation
|
|
9
|
-
------------
|
|
7
|
+
## Installation
|
|
10
8
|
|
|
11
9
|
``` bash
|
|
12
|
-
|
|
10
|
+
gem install countries
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
Or you can install via Bundler if you are using Rails. Add this line to your application's Gemfile:
|
|
16
14
|
|
|
17
|
-
```
|
|
18
|
-
|
|
15
|
+
```ruby
|
|
16
|
+
gem 'countries'
|
|
19
17
|
```
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
And then execute:
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
$ bundle
|
|
24
22
|
|
|
25
|
-
Basic Usage
|
|
26
|
-
-----------
|
|
23
|
+
## Basic Usage
|
|
27
24
|
|
|
28
25
|
Simply load a new country object using Country.new(*alpha2*) or the shortcut Country[*alpha2*]. An example works best.
|
|
29
26
|
|
|
@@ -31,15 +28,14 @@ Simply load a new country object using Country.new(*alpha2*) or the shortcut Cou
|
|
|
31
28
|
c = ISO3166::Country.new('US')
|
|
32
29
|
```
|
|
33
30
|
|
|
34
|
-
Configuration
|
|
35
|
-
-----------
|
|
31
|
+
## Configuration
|
|
36
32
|
|
|
37
33
|
#### Country Helper
|
|
38
34
|
Some apps might not want to constantly call `ISO3166::Country` this gem has a
|
|
39
35
|
helper that can provide a `Country` class
|
|
40
36
|
|
|
41
37
|
``` ruby
|
|
42
|
-
#
|
|
38
|
+
# With global Country Helper
|
|
43
39
|
c = Country['US']
|
|
44
40
|
```
|
|
45
41
|
|
|
@@ -61,8 +57,7 @@ has become
|
|
|
61
57
|
gem 'countries', :require => 'countries/global'
|
|
62
58
|
```
|
|
63
59
|
|
|
64
|
-
Selective Loading of Locales
|
|
65
|
-
------------
|
|
60
|
+
## Selective Loading of Locales
|
|
66
61
|
|
|
67
62
|
As of 2.0 you can selectively load locales to reduce memory usage in production.
|
|
68
63
|
|
|
@@ -83,8 +78,7 @@ ISO3166.configure do |config|
|
|
|
83
78
|
end
|
|
84
79
|
```
|
|
85
80
|
|
|
86
|
-
Attribute-Based Finder Methods
|
|
87
|
-
------------
|
|
81
|
+
## Attribute-Based Finder Methods
|
|
88
82
|
|
|
89
83
|
You can lookup a country or an array of countries using any of the data attributes via the find\_country\_by_*attribute* dynamic methods:
|
|
90
84
|
|
|
@@ -97,114 +91,118 @@ c = ISO3166::Country.find_country_by_alpha3('can')
|
|
|
97
91
|
For a list of available attributes please see ISO3166::DEFAULT_COUNTRY_HASH.
|
|
98
92
|
Note: searches are *case insensitive and ignore accents*.
|
|
99
93
|
|
|
100
|
-
Country Info
|
|
101
|
-
------------
|
|
102
|
-
|
|
103
|
-
Identification Codes
|
|
104
|
-
|
|
105
|
-
c.number #=> "840"
|
|
106
|
-
c.alpha2 #=> "US"
|
|
107
|
-
c.alpha3 #=> "USA"
|
|
108
|
-
c.gec #=> "US"
|
|
109
|
-
|
|
110
|
-
Names & Translations
|
|
94
|
+
## Country Info
|
|
111
95
|
|
|
112
|
-
|
|
113
|
-
c.unofficial_names #=> ["United States of America", "Vereinigte Staaten von Amerika", "Γtats-Unis", "Estados Unidos"]
|
|
96
|
+
### Identification Codes
|
|
114
97
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
98
|
+
```ruby
|
|
99
|
+
c.number # => "840"
|
|
100
|
+
c.alpha2 # => "US"
|
|
101
|
+
c.alpha3 # => "USA"
|
|
102
|
+
c.gec # => "US"
|
|
103
|
+
```
|
|
119
104
|
|
|
120
|
-
|
|
121
|
-
c.translation('de') #=> 'Vereinigte Staaten von Amerika'
|
|
122
|
-
c.translations['fr'] #=> "Γtats-Unis"
|
|
105
|
+
### Names & Translations
|
|
123
106
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
107
|
+
```ruby
|
|
108
|
+
c.name # => "United States"
|
|
109
|
+
c.unofficial_names # => ["United States of America", "Vereinigte Staaten von Amerika", "Γtats-Unis", "Estados Unidos"]
|
|
110
|
+
|
|
111
|
+
# Get the names for a country translated to its local languages
|
|
112
|
+
c = Country[:BE]
|
|
113
|
+
c.local_names # => ["BelgiΓ«", "Belgique", "Belgien"]
|
|
114
|
+
c.local_name # => "BelgiΓ«"
|
|
115
|
+
|
|
116
|
+
# Get a specific translation
|
|
117
|
+
c.translation('de') # => 'Vereinigte Staaten von Amerika'
|
|
118
|
+
c.translations['fr'] # => "Γtats-Unis"
|
|
119
|
+
|
|
120
|
+
ISO3166::Country.translations # {"DE"=>"Germany",...}
|
|
121
|
+
ISO3166::Country.translations('DE') # {"DE"=>"Deutschland",...}
|
|
122
|
+
ISO3166::Country.all_translated # ['Germany', ...]
|
|
123
|
+
ISO3166::Country.all_translated('DE') # ['Deutschland', ...]
|
|
124
|
+
```
|
|
128
125
|
|
|
129
|
-
|
|
126
|
+
### Subdivisions & States
|
|
130
127
|
|
|
131
128
|
``` ruby
|
|
132
|
-
c.subdivisions
|
|
133
|
-
c.states
|
|
129
|
+
c.subdivisions # => {"CO" => {"name" => "Colorado", "names" => "Colorado"}, ... }
|
|
130
|
+
c.states # => {"CO" => {"name" => "Colorado", "names" => "Colorado"}, ... }
|
|
134
131
|
```
|
|
135
|
-
|
|
132
|
+
|
|
133
|
+
### Location
|
|
136
134
|
|
|
137
135
|
``` ruby
|
|
138
|
-
c.latitude
|
|
139
|
-
c.longitude
|
|
140
|
-
c.latitude_dec
|
|
141
|
-
c.longitude_dec
|
|
136
|
+
c.latitude # => "38 00 N"
|
|
137
|
+
c.longitude # => "97 00 W"
|
|
138
|
+
c.latitude_dec # => 39.44325637817383
|
|
139
|
+
c.longitude_dec # => -98.95733642578125
|
|
142
140
|
|
|
143
|
-
c.region
|
|
144
|
-
c.subregion
|
|
141
|
+
c.region # => "Americas"
|
|
142
|
+
c.subregion # => "Northern America"
|
|
145
143
|
```
|
|
146
144
|
|
|
147
|
-
Timezones **(optional)**
|
|
145
|
+
### Timezones **(optional)**
|
|
148
146
|
|
|
149
|
-
Add tzinfo to your
|
|
147
|
+
Add `tzinfo` to your Gemfile and ensure it's required, Countries will not do this for you.
|
|
150
148
|
|
|
151
|
-
|
|
149
|
+
```ruby
|
|
150
|
+
gem 'tzinfo', '~> 1.2', '>= 1.2.2'
|
|
151
|
+
```
|
|
152
152
|
|
|
153
153
|
``` ruby
|
|
154
|
-
c.timezones.zone_identifiers
|
|
154
|
+
c.timezones.zone_identifiers # => ["America/New_York", "America/Detroit", "America/Kentucky/Louisville", ...]
|
|
155
155
|
c.timezones.zone_info # see [tzinfo docs]( http://www.rubydoc.info/gems/tzinfo/TZInfo/CountryInfo)
|
|
156
156
|
c.timezones # see [tzinfo docs]( http://www.rubydoc.info/gems/tzinfo/TZInfo/Country)
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
-
Telephone Routing (E164)
|
|
159
|
+
### Telephone Routing (E164)
|
|
160
160
|
|
|
161
161
|
``` ruby
|
|
162
|
-
c.country_code
|
|
163
|
-
c.national_destination_code_lengths
|
|
164
|
-
c.national_number_lengths
|
|
165
|
-
c.international_prefix
|
|
166
|
-
c.national_prefix
|
|
162
|
+
c.country_code # => "1"
|
|
163
|
+
c.national_destination_code_lengths # => 3
|
|
164
|
+
c.national_number_lengths # => 10
|
|
165
|
+
c.international_prefix # => "011"
|
|
166
|
+
c.national_prefix # => "1"
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
-
Boundary Boxes
|
|
169
|
+
### Boundary Boxes
|
|
170
170
|
|
|
171
171
|
``` ruby
|
|
172
|
-
c.min_longitude
|
|
173
|
-
c.min_latitude
|
|
174
|
-
c.max_longitude
|
|
175
|
-
c.max_latitude
|
|
172
|
+
c.min_longitude # => '45'
|
|
173
|
+
c.min_latitude # => '22.166667'
|
|
174
|
+
c.max_longitude # => '58'
|
|
175
|
+
c.max_latitude # => '26.133333'
|
|
176
176
|
```
|
|
177
177
|
|
|
178
|
-
European Union Membership
|
|
178
|
+
### European Union Membership
|
|
179
179
|
|
|
180
180
|
``` ruby
|
|
181
|
-
c.in_eu?
|
|
181
|
+
c.in_eu? # => false
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
-
Currencies
|
|
185
|
-
----------
|
|
184
|
+
## Currencies
|
|
186
185
|
|
|
187
186
|
**WARNING** if you have a top level class named `Money` you will conflict with this gem. If this is a large issue we will add a feature to turn currency features off.
|
|
188
187
|
|
|
189
188
|
Countries now uses the [Money](https://github.com/RubyMoney/money) gem. What this means is you now get back a Money::Currency object that gives you access to all the currency information.
|
|
190
189
|
|
|
191
190
|
``` ruby
|
|
192
|
-
c.currency.code
|
|
193
|
-
c.currency.name
|
|
194
|
-
c.currency.symbol
|
|
191
|
+
c.currency.code # => 'USD'
|
|
192
|
+
c.currency.name # => 'Dollars'
|
|
193
|
+
c.currency.symbol # => '$'
|
|
195
194
|
```
|
|
196
195
|
|
|
197
|
-
Address Formatting
|
|
198
|
-
------------------
|
|
196
|
+
## Address Formatting
|
|
199
197
|
|
|
200
198
|
A template for formatting addresses is available through the address_format method. These templates are compatible with the [Liquid][] template system.
|
|
201
199
|
|
|
202
200
|
``` ruby
|
|
203
|
-
c.address_format
|
|
201
|
+
c.address_format # => "{{recipient}}\n{{street}}\n{{city}} {{region}} {{postalcode}}\n{{country}}"
|
|
204
202
|
```
|
|
205
203
|
|
|
206
|
-
Loading Custom Data
|
|
207
|
-
|
|
204
|
+
## Loading Custom Data
|
|
205
|
+
|
|
208
206
|
As of 2.0 countries supports loading custom countries / overriding data in it's data set, though if you choose to do this please contribute back to the upstream repo!
|
|
209
207
|
|
|
210
208
|
Any country registered this way will have it's data available for searching etc... If you are overriding an existing country, for cultural reasons, our code uses a simple merge, not a deep merge so you will need to __bring in all data you wish to be available__. Bringing in an existing country will also remove it from the internal management of translations, __all registered countries will remain in memory__.
|
|
@@ -222,14 +220,15 @@ ISO3166::Data.register(
|
|
|
222
220
|
ISO3166::Country.new('LOL').name == 'Happy Country'
|
|
223
221
|
```
|
|
224
222
|
|
|
225
|
-
Mongoid
|
|
226
|
-
-------
|
|
223
|
+
## Mongoid
|
|
227
224
|
|
|
228
225
|
Mongoid support has been added. It is required automatically if Mongoid is defined in your project.
|
|
229
226
|
|
|
230
227
|
Use native country fields in your model:
|
|
231
228
|
|
|
232
|
-
|
|
229
|
+
```ruby
|
|
230
|
+
field :country, type: Country
|
|
231
|
+
```
|
|
233
232
|
|
|
234
233
|
Adds native support for searching/saving by a country object or alpha2 code.
|
|
235
234
|
|
|
@@ -262,21 +261,21 @@ Note that the database stores only the alpha2 code and rebuilds the object when
|
|
|
262
261
|
|
|
263
262
|
``` ruby
|
|
264
263
|
def country
|
|
265
|
-
|
|
264
|
+
super.name
|
|
266
265
|
end
|
|
267
266
|
```
|
|
268
267
|
|
|
269
|
-
Country Code in Emoji
|
|
270
|
-
|
|
268
|
+
## Country Code in Emoji
|
|
269
|
+
|
|
271
270
|
``` ruby
|
|
272
271
|
c = Country['MY']
|
|
273
272
|
c.emoji_flag # => "πΊπΈ"
|
|
274
273
|
```
|
|
275
274
|
|
|
276
|
-
Note on Patches/Pull Requests
|
|
277
|
-
|
|
275
|
+
## Note on Patches/Pull Requests
|
|
276
|
+
|
|
277
|
+
### Please do not submit pull requests on `cache/**/*`
|
|
278
278
|
|
|
279
|
-
## Please do not submit pull requests on cache/**/*
|
|
280
279
|
Any additions should be directed upstream to [pkg-isocodes](http://anonscm.debian.org/cgit/pkg-isocodes/iso-codes.git/)
|
|
281
280
|
|
|
282
281
|
New Bugs can be filed upstream here https://alioth.debian.org/projects/pkg-iso-codes/
|
|
@@ -302,12 +301,10 @@ the next ```rake update_cache```
|
|
|
302
301
|
bump version in a commit by itself I can ignore when I pull)
|
|
303
302
|
* Send me a pull request. Bonus points for topic branches.
|
|
304
303
|
|
|
305
|
-
Copyright
|
|
306
|
-
---------
|
|
304
|
+
## Copyright
|
|
307
305
|
|
|
308
306
|
Copyright (c) 2016 hexorx. See LICENSE for details.
|
|
309
307
|
|
|
310
|
-
|
|
311
308
|
[Teliax]: http://teliax.com
|
|
312
309
|
[Centrex]: http://en.wikipedia.org/wiki/Centrex
|
|
313
310
|
[CommonDataHub]: http://commondatahub.com
|
data/countries.gemspec
CHANGED
|
@@ -13,11 +13,11 @@ Gem::Specification.new do |gem|
|
|
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
14
14
|
gem.name = 'countries'
|
|
15
15
|
gem.require_paths = ['lib']
|
|
16
|
-
gem.version = Countries::VERSION
|
|
16
|
+
gem.version = Countries::VERSION.dup
|
|
17
17
|
gem.license = 'MIT'
|
|
18
18
|
|
|
19
|
-
gem.add_dependency('i18n_data', '~> 0.
|
|
20
|
-
gem.add_dependency('money', '~> 6.
|
|
19
|
+
gem.add_dependency('i18n_data', '~> 0.8.0')
|
|
20
|
+
gem.add_dependency('money', '~> 6.9')
|
|
21
21
|
gem.add_dependency('unicode_utils', '~> 1.4')
|
|
22
22
|
gem.add_dependency('sixarm_ruby_unaccent', '~> 1.1')
|
|
23
23
|
gem.add_development_dependency('rspec', '>= 3')
|