phony 2.14.15 → 2.15.0

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
  SHA1:
3
- metadata.gz: f7db3aeb99e0674a7c0de8b180676e1f10bad279
4
- data.tar.gz: 0c59b56cf1d684fb1a5dc25ac177937ca88bef29
3
+ metadata.gz: 5773702ad69699c8cefd3a0001d444b341f44582
4
+ data.tar.gz: e9550ac45100b93cb5ea04e328f0e7d1b6b45916
5
5
  SHA512:
6
- metadata.gz: aa44c9f91eaa2ed5dcb7112cfedeade05a59f997b9a5b33a6dc4caa2d34b55fb9e8d54714bd9535855f5eb3d84340049f917f72de57f94a15def800938690c1f
7
- data.tar.gz: 7e4585f2586db0f919418708410230cd9ebfa1bc6868a490cd6ef7e215a4023e04f9ce70c9773e78b23671a40a41c7ccc85ab1d5b834f2511d5f1083aa8a387b
6
+ metadata.gz: 809eec8aa6c21b477bca405d453303fd3ddb5b32960253c092d0fa107a47ad742b9326a518dab360a04aa50afb1b12c6cd95a7c26f3d2d6acdc4d9f36f4bdf9b
7
+ data.tar.gz: 55ba7177b59174f902c988ceccd54db3df53c840a325ea6ed0e25dee9464e366ac62adfa7b3d01b35f4c02cdd1daab54ff4502408d5cf757cd2e9c1fea1e3533
@@ -114,7 +114,7 @@ ndcs_with_7_subscriber_digits = %w(17 25 29 33 44)
114
114
 
115
115
  Phony.define do
116
116
  country '375',
117
- trunk('8') |
117
+ trunk('80?') |
118
118
  one_of(ndcs_with_5_subscriber_digits) >> split(5) |
119
119
  one_of(ndcs_with_6_subscriber_digits) >> split(6) |
120
120
  one_of(ndcs_with_7_subscriber_digits) >> split(7) |
@@ -42,7 +42,13 @@ module Phony
42
42
  # Format the trunk code using the spaces given.
43
43
  #
44
44
  def format space, force = nil
45
- @code.size > 1 ? @code % space : @code if force || @format
45
+ if force || @format
46
+ if @code.size > 1
47
+ (@code % space).gsub(/\D/, ' ')
48
+ else
49
+ @code
50
+ end
51
+ end
46
52
  end
47
53
 
48
54
  end
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.14.15
4
+ version: 2.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-04 00:00:00.000000000 Z
11
+ date: 2015-09-05 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