worldwide 1.10.0 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/Gemfile.lock +1 -1
- data/db/data/regions/BE.yml +3 -0
- data/db/data/regions/BR.yml +2 -0
- data/db/data/regions/CL.yml +2 -0
- data/db/data/regions/DE.yml +3 -0
- data/db/data/regions/ES.yml +2 -0
- data/db/data/regions/IL.yml +3 -0
- data/db/data/regions/MX.yml +2 -0
- data/db/data/regions/NL.yml +2 -0
- data/lib/worldwide/deprecated_time_zone_mapper.rb +1 -0
- data/lib/worldwide/region.rb +5 -0
- data/lib/worldwide/regions_loader.rb +1 -0
- data/lib/worldwide/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 201314dc59d2e10fb46c16cd4cac2ddb6a345074226567b221340660f53d6936
|
4
|
+
data.tar.gz: 0acd813a2beea616bff276a474783d38f101dd6d875d24fbbc34862a7b3c1844
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8d0b34eccbde7cbf76254c9ca50e21d4a1bfd93f9b0ba7a75a12532d8152378572c184fccdb6749e3ee2efa7d62d9586a904333583d293acd3f6968c1da592d
|
7
|
+
data.tar.gz: cfbfeebf34e7b3c4b68d6c9c0e5da78fa1627b0fe7248a3cdc3ea74cde3292adbeab3be86c97391e56f32016de23fa357cc9c265e070fc90896f3c6782b7eb77
|
data/CHANGELOG.md
CHANGED
@@ -26,10 +26,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
26
26
|
- Security in case of vulnerabilities.
|
27
27
|
|
28
28
|
## [Unreleased]
|
29
|
-
- Nil.
|
30
29
|
|
31
30
|
---
|
32
31
|
|
32
|
+
## [1.11.0] - 2024-10-02
|
33
|
+
- Add address1_regex to regions [#281](https://github.com/Shopify/worldwide/pull/281)
|
34
|
+
- Add address1_regex for BE, CL, MX, ES, IL [#282](https://github.com/Shopify/worldwide/pull/282)
|
35
|
+
- Add address1_regex for DE [#286](https://github.com/Shopify/worldwide/pull/286)
|
36
|
+
- Update legacy timezone mappings for Europe/Kiev [#288](https://github.com/Shopify/worldwide/pull/288)
|
37
|
+
|
38
|
+
|
33
39
|
## [1.10.0] - 2024-09-16
|
34
40
|
- Add alternate Arabic names for UAE zones [#283](https://github.com/Shopify/worldwide/pull/283)
|
35
41
|
|
data/Gemfile.lock
CHANGED
data/db/data/regions/BE.yml
CHANGED
@@ -31,6 +31,9 @@ format:
|
|
31
31
|
show: "{firstName} {lastName}_{company}_{address1}_{address2}_{zip} {city}_{country}_{phone}"
|
32
32
|
format_extended:
|
33
33
|
edit: "{country}_{firstName}{lastName}_{company}_{streetName}{streetNumber}_{address2}_{zip}{city}_{phone}"
|
34
|
+
address1_regex:
|
35
|
+
- "^(?<streetName>[^\\d,]+),? (?<streetNumber>\\d+(?: ?[a-z])?)$"
|
36
|
+
- "^(?<streetNumber>\\d+(?: ?[a-z])?),? (?<streetName>[^\\d,]+)$"
|
34
37
|
additional_address_fields:
|
35
38
|
- name: streetName
|
36
39
|
required: true
|
data/db/data/regions/BR.yml
CHANGED
@@ -28,6 +28,8 @@ format:
|
|
28
28
|
show: "{firstName} {lastName}_{company}_{address1}_{address2}_{zip} {city} {province}_{country}_{phone}"
|
29
29
|
format_extended:
|
30
30
|
edit: "{country}_{firstName}{lastName}_{company}_{zip}_{streetName}{streetNumber}_{line2}{neighborhood}_{city}{province}_{phone}"
|
31
|
+
address1_regex:
|
32
|
+
- "^(?<streetName>(?!.*\\bnúmero\\b)[^\\d,]+(?<!\\s))(?:,? ?)(?<streetNumber>\\d+(?: ?[a-z])?)$"
|
31
33
|
additional_address_fields:
|
32
34
|
- name: streetName
|
33
35
|
required: true
|
data/db/data/regions/CL.yml
CHANGED
@@ -16,6 +16,8 @@ format:
|
|
16
16
|
show: "{firstName} {lastName}_{company}_{address1}_{address2}_{zip} {city}_{province}_{country}_{phone}"
|
17
17
|
format_extended:
|
18
18
|
edit: "{country}_{firstName}{lastName}_{company}_{streetName}{streetNumber}_{line2}{neighborhood}_{zip}{city}_{province}_{phone}"
|
19
|
+
address1_regex:
|
20
|
+
- "^(?<streetName>[^\\d,]+?),? (?<streetNumber>(?:n|n\\.|nº|número|no\\.|no|#)? ?\\d+(?: ?[a-z])?)$"
|
19
21
|
additional_address_fields:
|
20
22
|
- name: streetName
|
21
23
|
required: true
|
data/db/data/regions/DE.yml
CHANGED
@@ -29,6 +29,9 @@ format:
|
|
29
29
|
show: "{firstName} {lastName}_{company}_{address1}_{address2}_{zip} {city}_{country}_{phone}"
|
30
30
|
format_extended:
|
31
31
|
edit: "{country}_{firstName}{lastName}_{company}_{streetName}{streetNumber}_{address2}_{zip}{city}_{phone}"
|
32
|
+
address1_regex:
|
33
|
+
- "^(?<streetName>[^\\d,]+?\\.?)[, ]{1,2}(?<streetNumber>\\d+(?: ?[a-z])?)$"
|
34
|
+
- "^(?<streetName>[^\\d,]+\\.)(?<streetNumber>\\d+(?: ?[a-z])?)$"
|
32
35
|
additional_address_fields:
|
33
36
|
- name: streetName
|
34
37
|
required: true
|
data/db/data/regions/ES.yml
CHANGED
@@ -29,6 +29,8 @@ format:
|
|
29
29
|
show: "{firstName} {lastName}_{company}_{address1}_{address2}_{zip} {city}_{province}_{country}_{phone}"
|
30
30
|
format_extended:
|
31
31
|
edit: "{country}_{firstName}{lastName}_{company}_{streetName}{streetNumber}_{address2}_{zip}{city}{province}_{phone}"
|
32
|
+
address1_regex:
|
33
|
+
- "^(?<streetName>[^\\d,]+?),? (?<streetNumber>(?:n|n\\.|nº|número|no\\.|no|#)? ?\\d+(?: ?[a-z])?)$"
|
32
34
|
additional_address_fields:
|
33
35
|
- name: streetName
|
34
36
|
required: true
|
data/db/data/regions/IL.yml
CHANGED
@@ -18,6 +18,9 @@ format:
|
|
18
18
|
show: "{firstName} {lastName}_{company}_{address1}_{address2}_{zip} {city}_{country}_{phone}"
|
19
19
|
format_extended:
|
20
20
|
edit: "{country}_{firstName}{lastName}_{company}_{streetName}{streetNumber}_{address2}_{zip}{city}_{phone}"
|
21
|
+
address1_regex:
|
22
|
+
- "^(?<streetName>[^\\d,]+),? (?<streetNumber>\\d+(?:\/\\d+)?)$"
|
23
|
+
- "^(?<streetNumber>\\d+(?:\/\\d+)?),? (?<streetName>[^\\d,]+)$"
|
21
24
|
additional_address_fields:
|
22
25
|
- name: streetName
|
23
26
|
required: true
|
data/db/data/regions/MX.yml
CHANGED
@@ -17,6 +17,8 @@ format:
|
|
17
17
|
show: "{firstName} {lastName}_{company}_{address1}_{address2}_{zip} {city} {province}_{country}_{phone}"
|
18
18
|
format_extended:
|
19
19
|
edit: "{country}_{firstName}{lastName}_{company}_{streetName}{streetNumber}_{line2}{neighborhood}_{zip}{city}{province}_{phone}"
|
20
|
+
address1_regex:
|
21
|
+
- "^(?<streetName>[^\\d,]+?),? (?<streetNumber>(?:n|n\\.|nº|número|no\\.|no|#)? ?\\d+(?: ?[a-z])?)$"
|
20
22
|
additional_address_fields:
|
21
23
|
- name: streetName
|
22
24
|
required: true
|
data/db/data/regions/NL.yml
CHANGED
@@ -30,6 +30,8 @@ format:
|
|
30
30
|
show: "{firstName} {lastName}_{company}_{address1}_{address2}_{zip} {city}_{country}_{phone}"
|
31
31
|
format_extended:
|
32
32
|
edit: "{country}_{firstName}{lastName}_{company}_{streetName}{streetNumber}_{address2}_{zip}{city}_{phone}"
|
33
|
+
address1_regex:
|
34
|
+
- "^(?<streetName>[^\\d]+) (?<streetNumber>\\d+(?: ?[a-z])?)$"
|
33
35
|
additional_address_fields:
|
34
36
|
- name: streetName
|
35
37
|
required: true
|
data/lib/worldwide/region.rb
CHANGED
@@ -36,6 +36,7 @@ module Worldwide
|
|
36
36
|
:zip_requirement,
|
37
37
|
:additional_address_fields,
|
38
38
|
:combined_address_format,
|
39
|
+
:address1_regex,
|
39
40
|
]
|
40
41
|
|
41
42
|
# A region may have more than one parent.
|
@@ -208,6 +209,9 @@ module Worldwide
|
|
208
209
|
# A hash of the rules for concatening the additional address fields into the standard fields
|
209
210
|
attr_accessor :combined_address_format
|
210
211
|
|
212
|
+
# An array of regex patterns of the address1 field, capturing the supported additional address fields
|
213
|
+
attr_accessor :address1_regex
|
214
|
+
|
211
215
|
def initialize(
|
212
216
|
alpha_three: nil,
|
213
217
|
continent: false,
|
@@ -245,6 +249,7 @@ module Worldwide
|
|
245
249
|
|
246
250
|
@additional_address_fields = []
|
247
251
|
@combined_address_format = {}
|
252
|
+
@address1_regex = []
|
248
253
|
@building_number_required = false
|
249
254
|
@building_number_may_be_in_address2 = false
|
250
255
|
@currency = nil
|
@@ -97,6 +97,7 @@ module Worldwide
|
|
97
97
|
def apply_territory_attributes(region, spec)
|
98
98
|
region.additional_address_fields = spec["additional_address_fields"] || []
|
99
99
|
region.combined_address_format = spec["combined_address_format"] || {}
|
100
|
+
region.address1_regex = spec["address1_regex"] || []
|
100
101
|
region.building_number_required = spec["building_number_required"] || false
|
101
102
|
region.building_number_may_be_in_address2 = spec["building_number_may_be_in_address2"] || false
|
102
103
|
currency_code = spec["currency"]
|
data/lib/worldwide/version.rb
CHANGED
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: 1.
|
4
|
+
version: 1.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -8505,7 +8505,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
8505
8505
|
- !ruby/object:Gem::Version
|
8506
8506
|
version: '0'
|
8507
8507
|
requirements: []
|
8508
|
-
rubygems_version: 3.5.
|
8508
|
+
rubygems_version: 3.5.20
|
8509
8509
|
signing_key:
|
8510
8510
|
specification_version: 4
|
8511
8511
|
summary: Internationalization and localization APIs
|