phony 3.0.5 → 3.0.7

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: 4f37288b8ea31fdca99cce51f1fef36d82e52af7098fda16d874b3d935363a36
4
- data.tar.gz: 9e61873f0cc56aa2f654e36caeac1ee93d2c9093c025108db0b3ab95c83f1b2c
3
+ metadata.gz: 441d0dbf7565477e2cfacbcaee8eabd753d913ae8b63d4ba69c74a23f7f433e1
4
+ data.tar.gz: d3bfdb4e3a747e03dc322c6e58fc15f8be60ed029250e64c951ce7e11a489b22
5
5
  SHA512:
6
- metadata.gz: a1acc8bf572986ef164afee309810729954efbcc37780810126cb16b89874b5f7ca9190a6ced46f752043c7bd1bd78a925a90a2daca2ff8766474444bac65c8f
7
- data.tar.gz: 89c7a7c6b6a2f98f28f553d873dde061c906c6dd4c53a91bfb00d74d3bb489a7de518c5c3be60d13a2232d2c0c3bf69fbfed0ffc912e32ce823bb3ef46cd0b73
6
+ metadata.gz: 5a10c26c9b54329432f2fdd6c7262c2424d95c60d190a87983972f3f6dbc530168eb63065bd94423bc52ec6107484ce3e9106ef51df3f09169377e6fa215064a
7
+ data.tar.gz: e852a59e36e98c18f2cfeae12623662902a97057b7242606f8b7335d7e22078b3c8f0b59a1bfe1f4bd2ed600d4520ee244497a12a254ee7469067de3e5e0738e
@@ -69,7 +69,10 @@ ndcs_with_3_subscriber_digits = %w[331700]
69
69
 
70
70
  Phony.define do
71
71
  country '992',
72
- trunk('8') |
72
+ # The trunk code '8' is also the leading digit of the MegaFon mobile
73
+ # NDCs (88x), so the scheme is ambiguous. Do not strip it on normalize
74
+ # (same as Russia and Latvia, which share this '8' ambiguity).
75
+ trunk('8', normalize: false) |
73
76
  one_of(ndcs_with_3_subscriber_digits) >> split(3) |
74
77
  one_of(ndcs_with_5_subscriber_digits) >> split(3, 2) |
75
78
  one_of(ndcs_with_6_subscriber_digits) >> split(3, 3) |
@@ -432,6 +432,7 @@ Phony.define do
432
432
  match(/^([7-9]0\d)\d+$/) >> split(3, 4) | # Mobile
433
433
  match(/^(81\d)\d+$/) >> split(3, 4) | # Mobile
434
434
  match(/^(91\d)\d+$/) >> split(3, 4) | # Mobile
435
+ one_of('20') >> split(3, 3..5) | # 2-digit NDC (area code 20) - must come before 1-digit '2'
435
436
  one_of('1', '2') >> split(3, 3..4) | # Lagos, Ibadan
436
437
  one_of('9') >> split(3, 4) | # Abuja
437
438
  one_of((30..79).map(&:to_s)) >> split(3, 2..3) | # 2-digit NDC
@@ -535,6 +536,7 @@ Phony.define do
535
536
  match(/\A(32)\d+\z/) >> split(2, 3, 2) | # mobile Orange Madagascar
536
537
  match(/\A(33)\d+\z/) >> split(2, 3, 2) | # mobile Airtel Madagascar
537
538
  match(/\A(34)\d+\z/) >> split(2, 3, 2) | # mobile Telecom Malagasy (Telma)
539
+ match(/\A(35)\d+\z/) >> split(2, 3, 2) | # mobile Airtel Madagascar
538
540
  match(/\A(37)\d+\z/) >> split(2, 3, 2) | # mobile Orange Madagascar
539
541
  match(/\A(38)\d+\z/) >> split(2, 3, 2) | # mobile Telecom Malagasy (Telma)
540
542
  match(/\A(39)\d+\z/) >> split(2, 3, 2) # mobile Blueline Madagascar
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phony
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5
4
+ version: 3.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-26 00:00:00.000000000 Z
11
+ date: 2026-08-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Fast international phone number (E164 standard) normalizing, splitting
14
14
  and formatting. Lots of formatting options: International (+.., 00..), national