worldwide 1.14.4 → 1.15.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/data/regions/IE.yml +0 -1
- data/lib/worldwide/region.rb +17 -3
- data/lib/worldwide/regions_loader.rb +1 -0
- data/lib/worldwide/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d10d81c9b857f86106cd5bd152abbe999ca045435d904a932eb8f3df69a52293
|
4
|
+
data.tar.gz: 7a2fa0a560b361db7ab472c6cc5676c9dd68518dc6fe49fe3b1c98f3dea1b98f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e672163556eacb4fcdbbdef8859242fdd26f8575ed6c4d9c0c24fe16938b06d6c8e125fb2c8876f36829efe08ec3f09bbe78e8a3aab0d3ea763708f26c3422e7
|
7
|
+
data.tar.gz: 7dda9172548c84533eb716b1c84fb26bf6383d5b31afc69da71efe7128b34a7ac72cfbc2b9231e9ebc415e57e91bf975067f28ae2a48d5186ffd883c8f29c4ad
|
data/CHANGELOG.md
CHANGED
@@ -28,8 +28,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
28
28
|
## [Unreleased]
|
29
29
|
|
30
30
|
Nil.
|
31
|
+
|
31
32
|
---
|
32
33
|
|
34
|
+
## [1.15.0] - 2024-12-16
|
35
|
+
- Add zip requirement and tax inclusive methods to country regions [#320](https://github.com/Shopify/worldwide/pull/320)
|
36
|
+
- Set Ireland (IE) zip as a required address field [#321](https://github.com/Shopify/worldwide/pull/321)
|
37
|
+
|
33
38
|
## [1.14.4] - 2024-12-12
|
34
39
|
- Speed up configure_i18n by precomputing paths and indexing descendants [#316](https://github.com/Shopify/worldwide/pull/316)
|
35
40
|
- Update BV phone number prefix to 47 (Norway) [#318](https://github.com/Shopify/worldwide/pull/318)
|
data/Gemfile.lock
CHANGED
data/data/regions/IE.yml
CHANGED
data/lib/worldwide/region.rb
CHANGED
@@ -163,6 +163,9 @@ module Worldwide
|
|
163
163
|
# Note that this should really be translated; showing this untranslated name to users is a bad idea.
|
164
164
|
attr_reader :tax_name
|
165
165
|
|
166
|
+
# Whether the region uses tax-inclusive pricing.
|
167
|
+
attr_accessor :tax_inclusive
|
168
|
+
|
166
169
|
# "generic" VAT tax rate on "most" goods
|
167
170
|
attr_reader :tax_rate
|
168
171
|
|
@@ -198,7 +201,7 @@ module Worldwide
|
|
198
201
|
attr_accessor :zip_example
|
199
202
|
|
200
203
|
# Is a zip value required in this region? (Possible values: "optional", "recommended", "required")
|
201
|
-
|
204
|
+
attr_writer :zip_requirement
|
202
205
|
|
203
206
|
# A list of character sequences with which a postal code in this region may start.
|
204
207
|
attr_accessor :zip_prefixes
|
@@ -276,6 +279,7 @@ module Worldwide
|
|
276
279
|
@partial_zip_regex = nil
|
277
280
|
@phone_number_prefix = nil
|
278
281
|
@tags = []
|
282
|
+
@tax_inclusive = false
|
279
283
|
@timezone = nil
|
280
284
|
@timezones = {}
|
281
285
|
@unit_system = nil
|
@@ -435,13 +439,23 @@ module Worldwide
|
|
435
439
|
|
436
440
|
# is a postal code required for this region?
|
437
441
|
def zip_required?
|
438
|
-
if zip_requirement.nil?
|
442
|
+
if @zip_requirement.nil?
|
439
443
|
!zip_regex.nil?
|
440
444
|
else
|
441
|
-
REQUIRED == zip_requirement
|
445
|
+
REQUIRED == @zip_requirement
|
442
446
|
end
|
443
447
|
end
|
444
448
|
|
449
|
+
# Returns whether (and how firmly) we require a value in the zip field
|
450
|
+
# Possible returns:
|
451
|
+
# - "required" means a value must be supplied
|
452
|
+
# - "recommended" means a value is optional, but we recommend providing one
|
453
|
+
# - "optional" means a value is optional, and we say it is optional
|
454
|
+
# @return [String]
|
455
|
+
def zip_requirement
|
456
|
+
@zip_requirement || (zip_required? ? REQUIRED : OPTIONAL)
|
457
|
+
end
|
458
|
+
|
445
459
|
# is a neighborhood required for this region?
|
446
460
|
def neighborhood_required?
|
447
461
|
additional_field_required?("neighborhood")
|
@@ -114,6 +114,7 @@ module Worldwide
|
|
114
114
|
region.partial_zip_regex = spec["partial_zip_regex"]
|
115
115
|
region.phone_number_prefix = spec["phone_number_prefix"]
|
116
116
|
region.tags = spec["tags"] || []
|
117
|
+
region.tax_inclusive = spec["tax_inclusive"] || false
|
117
118
|
region.timezone = spec["timezone"]
|
118
119
|
region.timezones = spec["timezones"] || {}
|
119
120
|
region.week_start_day = spec["week_start_day"] || "sunday"
|
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.15.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-12-
|
11
|
+
date: 2024-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|