phony 2.19.2 → 2.19.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a25ea5ae1863104772974d3d8a632ef53bd45563a583d4598850c0488d319613
4
- data.tar.gz: eaf8164939b8f6b86f0923f808d939f357bff541d4edbdea8471524c3c7d1e00
3
+ metadata.gz: 54c6578da7427af232e98c6a999e1f53a3bf0098da9a3902d191db28c4d534d7
4
+ data.tar.gz: 9dac986205602a15d9ccd6ba189dd7fe233664cbbfdc5b7f2cc6c6465648af5b
5
5
  SHA512:
6
- metadata.gz: 7f0a932b5089196f06e373fb83cb1586304ce6ac8a1764d8b6b6be97a7a8c3edec1b1017ce0dbaaa5a26a46ab42ae250a3716c7207c669fa2a520a1180ab3f22
7
- data.tar.gz: 0f58eaca4e4b4981e6ebe92ad309f51d3607567976dd106881ad453adeca1d63756df3ed2f4693f14a79f135db00ac3ec6c4b5efff1fe8818bad291a6c6db5b1
6
+ metadata.gz: 0d2f07e5acbe13ad9b8f5c1a034e9c18e73e0915415617a143afc9555b14071084a323016d4866064862cc78fda2b8cb914b5a80762543b15dfaa986e1cbdc23
7
+ data.tar.gz: bc1397a96d18962582bc2a67628d622503cd972712cd27623ed5b93ec1f4157d7fbf8539dadd6bdeb92dd9d423f5c7a709dca051b4e8e49458f14e418ac452c8
data/lib/phony/country.rb CHANGED
@@ -97,6 +97,9 @@ module Phony
97
97
  end
98
98
  end
99
99
  def format_cc_ndc trunk, ndc, local, type, space, parentheses, use_trunk
100
+ # Note: We mark NDCs that are of type "none" with false (nil trips plausible?). This would result in false being printed.
101
+ # Therefore we set NDC to nil when formatting.
102
+ ndc = nil if ndc == false
100
103
  case type
101
104
  when String
102
105
  trunk &&= trunk.format(space, use_trunk)
@@ -125,6 +128,7 @@ module Phony
125
128
  end
126
129
  end
127
130
  def format_ndc ndc, parentheses
131
+ ndc = nil if ndc == false # TODO
128
132
  parentheses ? "(#{ndc})" : ndc
129
133
  end
130
134
  def format_with_ndc format, cc, ndc, local, space
@@ -31,9 +31,7 @@ module Phony
31
31
  # since using nil is dangerous and breaks
32
32
  # abstraction)
33
33
  #
34
- # Note: Actually, it might stay in.
35
- #
36
- # TODO Flip nil/false?
34
+ # Note: Decided it stays in. When formatting, it's turned into nil.
37
35
  #
38
36
  def split national_number
39
37
  [nil, false, national_number]
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: 2.19.2
4
+ version: 2.19.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-05 00:00:00.000000000 Z
11
+ date: 2021-07-08 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