phonelib 0.6.23 → 0.6.24

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: 573b358ca48ca35ddc9bf18c7db307ae0ecb3ace
4
- data.tar.gz: 004b1c1a8ac9d076f6168ef60688b1c7acde4313
3
+ metadata.gz: 25c5a05a6aa505d6044b2f151d441d6b52454e41
4
+ data.tar.gz: '02680848c2687bff0986facb3ac0118cc388eb7e'
5
5
  SHA512:
6
- metadata.gz: e50830e94086b7a8fc0c4d0f534ff5248fb6a778dd483e1fab1506ddf0565b2e48bb2ac6509c97599f59ab2c13a2108560ab35b56a4fb7cf8c94e443d6d73459
7
- data.tar.gz: 4f39bd625f9a5a69fc86cd189e9611f783187ab441693d8067af11867031a824661c7291264d0d9a06fcfed44087e144b32d0f0e075b305240098f1be6a07ec0
6
+ metadata.gz: 738b1089bf73b682a66fb1cfb6f4c857a0029f0a1f0a0f9990309f6e56a56186bfbc6ec66015e2bd613a1b8c4dd7a13c86b4b2796425af077ef236d27eab4e75
7
+ data.tar.gz: 610fa8a2d87c6751cf2aeda26d823f33bee1ff925880b402cc6817565b83b587ad0e7570a6a15e428fb91e75d3229c593af944a26171ac60d195dbd295d85e18
Binary file
Binary file
@@ -102,6 +102,7 @@ module Phonelib
102
102
  # * +country_optional+ - whether to put country code as optional group
103
103
  def full_regex_for_data(data, type, country_optional = true)
104
104
  regex = []
105
+ regex << '0{2}?'
105
106
  regex << "(#{data[Core::INTERNATIONAL_PREFIX]})?"
106
107
  regex << "(#{data[Core::COUNTRY_CODE]})#{country_optional ? '?' : ''}"
107
108
  regex << "(#{data[Core::NATIONAL_PREFIX_FOR_PARSING] || data[Core::NATIONAL_PREFIX]})?"
@@ -133,7 +134,7 @@ module Phonelib
133
134
  def phone_match_data?(phone, data, possible = false)
134
135
  country_code = "#{data[Core::COUNTRY_CODE]}"
135
136
  inter_prefix = "(#{data[Core::INTERNATIONAL_PREFIX]})?"
136
- return unless phone.match cr("^#{inter_prefix}#{country_code}")
137
+ return unless phone.match cr("^0{2}?#{inter_prefix}#{country_code}")
137
138
 
138
139
  type = possible ? Core::POSSIBLE_PATTERN : Core::VALID_PATTERN
139
140
  phone.match full_regex_for_data(data, type, false)
@@ -1,4 +1,4 @@
1
1
  module Phonelib
2
2
  # @private
3
- VERSION = '0.6.23'
3
+ VERSION = '0.6.24'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phonelib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.23
4
+ version: 0.6.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vadim Senderovich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-10 00:00:00.000000000 Z
11
+ date: 2018-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake