phonelib 0.6.20 → 0.6.21

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: e5f646f52d422a81f3c5661833bc8fbcd16d58d0
4
- data.tar.gz: c95290c503448d13bcbc8155441cd3eaf79db473
3
+ metadata.gz: 340a5c0487adffe92db6fbba129f1d79d669e3ca
4
+ data.tar.gz: 58b742b98ed74a4a8b47573f30b0eb4e4963e4ab
5
5
  SHA512:
6
- metadata.gz: 2081bdbc6d307b6443809a38f3a2bf5e928c7049095a113fe53583d9677f52c38a9b18d8df8b2818dec095abf84dc9d942fb433dd8c68457c745586a3dd304c7
7
- data.tar.gz: 22d1502ae3859b9ac61a95c5477c65423454dd312cb2bf0bc92270ea67769ca32bd8d64645ced86b9115e2ca1f9cc02de0b997b7c9d044d806f598fabfbd7f2e
6
+ metadata.gz: 935c0feb67ce471cba7f9e2c4046deba98ea3800e5bbd864ef227ec5503a4fd1b8317d8a00cac190e02c8f161c9c72191f44b4c79129f1436ee2d4d7a7136cf7
7
+ data.tar.gz: 5377cf7fa504d3538163f7eac8142e8729620c0f558a48f3488e93a4a5ddd786061e2366028b21d525f16d68145b3c295be1dc8a243e11b068c1c3b5555a71f9
data/README.md CHANGED
@@ -16,8 +16,8 @@ But it still doesn't include all Google's library functionality.
16
16
 
17
17
  ### Change Log
18
18
 
19
- Change log can be found in repo's wiki
20
- https://github.com/daddyz/phonelib/wiki/Change-Log
19
+ Change log can be found in repo's releases page
20
+ https://github.com/daddyz/phonelib/releases
21
21
 
22
22
  ### Bug reports
23
23
 
@@ -68,10 +68,11 @@ To set different extension separator on formatting, this setting doesn't affect
68
68
  Phonelib.extension_separator = ';'
69
69
  ```
70
70
 
71
- To set symbols that are used for separating extension from phone number for parsing use ```Phonelib.extension_separate_symbols``` method. Default value is '#;'.
71
+ To set symbols that are used for separating extension from phone number for parsing use ```Phonelib.extension_separate_symbols``` method. Default value is '#;'. In case string is passed each one of the symbols in the string will be treated as possible separator, in case array was passed each string in array will be treated as possible separator.
72
72
 
73
73
  ``` ruby
74
- Phonelib.extension_separate_symbols = '#;'
74
+ Phonelib.extension_separate_symbols = '#;' # for single symbol separator
75
+ Phonelib.extension_separator = %w(ext # ; extension) # each string will be treated as separator
75
76
  ```
76
77
 
77
78
  In case you need to overwrite some Google's libphonenumber library data, you need to assign file path to this setter. File should be Marshal.dump'ed with existing structure like in ```Phonelib.phone_data```. Gem is simply doing ```merge``` between hashes.
Binary file
Binary file
@@ -166,7 +166,11 @@ module Phonelib
166
166
 
167
167
  # @private extracts extension from passed phone number if provided
168
168
  def separate_extension(original)
169
- regex = cr("[#{Phonelib.extension_separate_symbols}]")
169
+ regex = if Phonelib.extension_separate_symbols.is_a?(Array)
170
+ cr("#{Phonelib.extension_separate_symbols.join('|')}")
171
+ else
172
+ cr("[#{Phonelib.extension_separate_symbols}]")
173
+ end
170
174
  split = (original || '').split regex
171
175
  [split.first || '', split[1..-1] && split[1..-1].join || '']
172
176
  end
@@ -1,4 +1,4 @@
1
1
  module Phonelib
2
2
  # @private
3
- VERSION = '0.6.20'
3
+ VERSION = '0.6.21'
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.20
4
+ version: 0.6.21
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-04-03 00:00:00.000000000 Z
11
+ date: 2018-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake