worldwide 0.4.1 → 0.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a9594ba5a0791de7841a1b420eb2035d7e426c407815a7b308cf19946a0c36e
4
- data.tar.gz: 4b91f4790718a7f1c5023c08d39fe6dbea86c4b00a4a6406fef6eb94327c10f4
3
+ metadata.gz: e6dab7ef2d9d926721d2ef41e8e81b947b7f0b4c053d7df98377f983797bc245
4
+ data.tar.gz: 9eaad39219ba9ddb74c963d97035b9222f5f82d604ca38fe7128a51ae53b9391
5
5
  SHA512:
6
- metadata.gz: a7df4373be3cf1f576c9ea97d2a1c6db1a9e0742d9e5c1ae955059efde1618f09566303e4e038c56ef653a308e67c38f3d3e94b7b60f46b5441f471f07fb59c5
7
- data.tar.gz: fc7f50b224674162e79e7178fd8f84e36dc99582ef0ebab5b9fc1c848d9b32f06ca20a1f12a7c9a909d6382cea3e970ab16227d3e34256944200d21498d9ff74
6
+ metadata.gz: ec3d8cbf74e6ec35195da2da959a5d104434f6f675bba2e8056a74338746dd01e82a3cd116a94f109be264e86b30a948631ef671967df94a07692e1e794588ce
7
+ data.tar.gz: '09f90b59ebdd15c7b7aa7b945defb11cfa544eec0cbcbdd5ba1faf7ae4b96ce16fc6a28ca830261bf834bca0bfc34b049fb511c1dc922beaf24df5ea7ce80619'
data/CHANGELOG.md CHANGED
@@ -27,11 +27,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
27
27
 
28
28
  ## [Unreleased]
29
29
 
30
- Nil.
30
+ - nil
31
31
 
32
32
  ---
33
33
 
34
+ [0.5.0] - 2023-11-20
35
+
36
+ - Add support for `Region#associated_continent` to return the containing continent of the region [#43](https://github.com/Shopify/worldwide/pull/43)
37
+ - Add more postal code prefixes for KR [#44](https://github.com/Shopify/worldwide/pull/44)
38
+ - Add name alternates for the zones of South Korea [#45](https://github.com/Shopify/worldwide/pull/45)
39
+ - Add support for Hangul and Arabic script detection, update Latn regexp [#46](https://github.com/Shopify/worldwide/pull/46)
40
+
34
41
  [0.4.1] - 2023-11-10
42
+
35
43
  - Add support for deprecated timezone Australia/Canberra [#35](https://github.com/Shopify/worldwide/pull/35)
36
44
  - Add alternate codes for territories [#39](https://github.com/Shopify/worldwide/pull/39)
37
45
  - Allow building numbers on address2 field for Austrian addresses [#40](https://github.com/Shopify/worldwide/pull/40)
data/Gemfile.lock CHANGED
@@ -13,7 +13,7 @@ GIT
13
13
  PATH
14
14
  remote: .
15
15
  specs:
16
- worldwide (0.4.1)
16
+ worldwide (0.5.0)
17
17
  activesupport (~> 7.0)
18
18
  i18n (~> 1.12.0)
19
19
  phonelib (~> 0.8)
@@ -26,6 +26,8 @@ languages:
26
26
  - ko
27
27
  zones:
28
28
  - name: Busan
29
+ name_alternates:
30
+ - 부산광역시
29
31
  code: KR-26
30
32
  iso_code: KR-26
31
33
  tax: 0.0
@@ -36,6 +38,8 @@ zones:
36
38
  - '48'
37
39
  - '49'
38
40
  - name: Chungbuk
41
+ name_alternates:
42
+ - 충청북도
39
43
  code: KR-43
40
44
  iso_code: KR-43
41
45
  tax: 0.0
@@ -45,6 +49,8 @@ zones:
45
49
  - '28'
46
50
  - '29'
47
51
  - name: Chungnam
52
+ name_alternates:
53
+ - 충청남도
48
54
  code: KR-44
49
55
  iso_code: KR-44
50
56
  tax: 0.0
@@ -54,6 +60,8 @@ zones:
54
60
  - '32'
55
61
  - '33'
56
62
  - name: Daegu
63
+ name_alternates:
64
+ - 대구광역시
57
65
  code: KR-27
58
66
  iso_code: KR-27
59
67
  tax: 0.0
@@ -63,6 +71,8 @@ zones:
63
71
  - '42'
64
72
  - '43'
65
73
  - name: Daejeon
74
+ name_alternates:
75
+ - 대전광역시
66
76
  code: KR-30
67
77
  iso_code: KR-30
68
78
  tax: 0.0
@@ -71,6 +81,8 @@ zones:
71
81
  - '34'
72
82
  - '35'
73
83
  - name: Gangwon
84
+ name_alternates:
85
+ - 강원도
74
86
  code: KR-42
75
87
  iso_code: KR-42
76
88
  tax: 0.0
@@ -80,6 +92,8 @@ zones:
80
92
  - '25'
81
93
  - '26'
82
94
  - name: Gwangju
95
+ name_alternates:
96
+ - 광주광역시
83
97
  code: KR-29
84
98
  iso_code: KR-29
85
99
  tax: 0.0
@@ -88,6 +102,8 @@ zones:
88
102
  - '61'
89
103
  - '62'
90
104
  - name: Gyeongbuk
105
+ name_alternates:
106
+ - 경상북도
91
107
  code: KR-47
92
108
  iso_code: KR-47
93
109
  tax: 0.0
@@ -99,13 +115,25 @@ zones:
99
115
  - '39'
100
116
  - '40'
101
117
  - name: Gyeonggi
118
+ name_alternates:
119
+ - 경기도
102
120
  code: KR-41
103
121
  iso_code: KR-41
104
122
  tax: 0.0
105
123
  tax_name: VAT
106
124
  zip_prefixes:
107
- - '1'
125
+ - '10'
126
+ - '11'
127
+ - '12'
128
+ - '13'
129
+ - '14'
130
+ - '15'
131
+ - '16'
132
+ - '17'
133
+ - '18'
108
134
  - name: Gyeongnam
135
+ name_alternates:
136
+ - 경상남도
109
137
  code: KR-48
110
138
  iso_code: KR-48
111
139
  tax: 0.0
@@ -116,6 +144,8 @@ zones:
116
144
  - '52'
117
145
  - '53'
118
146
  - name: Incheon
147
+ name_alternates:
148
+ - 인천광역시
119
149
  code: KR-28
120
150
  iso_code: KR-28
121
151
  tax: 0.0
@@ -125,6 +155,8 @@ zones:
125
155
  - '22'
126
156
  - '23'
127
157
  - name: Jeju
158
+ name_alternates:
159
+ - 제주특별자치도
128
160
  code: KR-49
129
161
  iso_code: KR-49
130
162
  tax: 0.0
@@ -132,6 +164,8 @@ zones:
132
164
  zip_prefixes:
133
165
  - '63'
134
166
  - name: Jeonbuk
167
+ name_alternates:
168
+ - 전라북도
135
169
  code: KR-45
136
170
  iso_code: KR-45
137
171
  tax: 0.0
@@ -141,6 +175,8 @@ zones:
141
175
  - '55'
142
176
  - '56'
143
177
  - name: Jeonnam
178
+ name_alternates:
179
+ - 전라남도
144
180
  code: KR-46
145
181
  iso_code: KR-46
146
182
  tax: 0.0
@@ -150,6 +186,8 @@ zones:
150
186
  - '58'
151
187
  - '59'
152
188
  - name: Sejong
189
+ name_alternates:
190
+ - 세종특별자치시
153
191
  code: KR-50
154
192
  iso_code: KR-50
155
193
  tax: 0.0
@@ -157,13 +195,25 @@ zones:
157
195
  zip_prefixes:
158
196
  - '30'
159
197
  - name: Seoul
198
+ name_alternates:
199
+ - 서울특별시
200
+ - 서울
160
201
  code: KR-11
161
202
  iso_code: KR-11
162
203
  tax: 0.0
163
204
  tax_name: VAT
164
205
  zip_prefixes:
165
- - '0'
206
+ - '01'
207
+ - '02'
208
+ - '03'
209
+ - '04'
210
+ - '05'
211
+ - '06'
212
+ - '07'
213
+ - '08'
166
214
  - name: Ulsan
215
+ name_alternates:
216
+ - 울산광역시
167
217
  code: KR-31
168
218
  iso_code: KR-31
169
219
  tax: 0.0
@@ -272,6 +272,17 @@ module Worldwide
272
272
  parent_country
273
273
  end
274
274
 
275
+ def associated_continent
276
+ return self if continent?
277
+
278
+ parents.each do |parent|
279
+ candidate = parent.associated_continent
280
+ return candidate unless candidate.nil?
281
+ end
282
+
283
+ nil
284
+ end
285
+
275
286
  # The value with which to autofill the zip, if this region has zip autofill active;
276
287
  # otherwise, nil.
277
288
  def autofill_zip
@@ -10,10 +10,12 @@ module Worldwide
10
10
  discovered_scripts = []
11
11
 
12
12
  script_regexes = {
13
- "Latn": "[A-Za-z\uFF21-\uFF3A\uFF41-\uFF5A]",
13
+ "Arabic": "\\p{Arabic}",
14
+ "Latn": "\\p{Latin}",
14
15
  "Han": "\\p{Han}",
15
- "Katakana": "\\p{Katakana}",
16
+ "Hangul": "\\p{Hangul}",
16
17
  "Hiragana": "\\p{Hiragana}",
18
+ "Katakana": "\\p{Katakana}",
17
19
  }
18
20
 
19
21
  script_regexes.each do |script, regex|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Worldwide
4
- VERSION = "0.4.1"
4
+ VERSION = "0.5.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: worldwide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-10 00:00:00.000000000 Z
11
+ date: 2023-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport