phony 2.15.47 → 2.15.48

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
  SHA1:
3
- metadata.gz: 3e978c5a79c5540145b9bb9b8988924ff0be4d22
4
- data.tar.gz: 58f070c2f6fa6eb27396554f7221487c8475dc72
3
+ metadata.gz: f656832e7311c29b6d9cd2c4d38fdeba7701f4f7
4
+ data.tar.gz: 8abed66486b0361361d39cd6270f36c11340a0ce
5
5
  SHA512:
6
- metadata.gz: ed80ee547d6a0c3adc4552769346bf66b6b18af05898d10e682d05c8f909856dd0676e0426239e7367a2388dca961deb0ee2dc8148520fb7b27fa1f6fd79ce6d
7
- data.tar.gz: b1eb46a6f89898db4c82efae75eaa670bf4f0bb81eb5286fb5fd915a68995098cb725c43c5ac02f7ddcec5dafb9659b621bdaff8d6b65a354f3986e737afbe3b
6
+ metadata.gz: c44871ae99e9b3a31a20134c603f7520144bcfe65d534fedbae73d2311c808f18ce40e2318dec72ebd56de0d433001259196e77a77da12691627a8e5c5414827
7
+ data.tar.gz: 88847020258becb45f509a7c0de97bc8ec1c2c8df918d76ab4ac5df2a4ae7a43615075aa4c67d896429f112e7b76f4cd0ec3005b15327d9113a1ace0c4fa32ab
@@ -279,7 +279,10 @@ Phony.define do
279
279
  # Singapore (Republic of).
280
280
  #
281
281
  country '65',
282
- none >> split(4,4) # TODO Short Codes.
282
+ none >> matched_split(
283
+ /^(800)\d{7}$/ => [3,3,4], # International Toll Free Service (ITFS) and Home Country Direct Service (HCDS) Numbers
284
+ /^\d{8}$/ => [4,4] # TODO Short Codes
285
+ )
283
286
 
284
287
  # Thailand.
285
288
  #
@@ -77,7 +77,7 @@ module Phony
77
77
  country, cc, national_number = partial_split number
78
78
 
79
79
  # Split the national number into ndc and local part.
80
- trunk, ndc, *local = country.split national_number
80
+ _, ndc, *local = country.split national_number
81
81
 
82
82
  [cc, ndc, *local]
83
83
  end
@@ -268,6 +268,8 @@ describe 'plausibility' do
268
268
  ['+381 62 12 34567', '+381 62 12 3456'],
269
269
  ['+381 65 12 34567', '+381 65 12 3456']]
270
270
  it_is_correct_for 'Sierra Leone', :samples => '+232 42 393 972'
271
+ it_is_correct_for 'Singapore', :samples => ['+65 6123 1234',
272
+ '+65 800 852 1234']
271
273
  it_is_correct_for 'Solomon Islands', :samples => '+677 97851'
272
274
  it_is_correct_for 'Somali Democratic Republic', :samples => ['+252 1034 123 45',
273
275
  '+252 1313 123',
@@ -661,7 +661,8 @@ describe 'country descriptions' do
661
661
  end
662
662
 
663
663
  describe 'Singapore' do
664
- it_splits '6561231234', ['65', false, '6123', '1234'] # Fixed line
664
+ it_splits '6561231234', ['65', false, '6123', '1234'] # Fixed line
665
+ it_splits '658008521234', ['65', false, '800', '852', '1234'] # International Toll Free Service (ITFS) and Home Country Direct Service (HCDS) Numbers
665
666
  end
666
667
  describe 'Slovakia' do
667
668
  it_splits '421912123456', ['421', '912', '123456'] # Mobile
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.15.47
4
+ version: 2.15.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-16 00:00:00.000000000 Z
11
+ date: 2017-09-03 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
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  requirements: []
113
113
  rubyforge_project:
114
- rubygems_version: 2.6.7
114
+ rubygems_version: 2.4.5.1
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: Fast international phone number (E164 standard) normalizing, splitting and