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 +4 -4
- data/README.md +5 -4
- data/data/extended_data.dat +0 -0
- data/data/phone_data.dat +0 -0
- data/lib/phonelib/phone.rb +5 -1
- data/lib/phonelib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 340a5c0487adffe92db6fbba129f1d79d669e3ca
|
4
|
+
data.tar.gz: 58b742b98ed74a4a8b47573f30b0eb4e4963e4ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
20
|
-
https://github.com/daddyz/phonelib/
|
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.
|
data/data/extended_data.dat
CHANGED
Binary file
|
data/data/phone_data.dat
CHANGED
Binary file
|
data/lib/phonelib/phone.rb
CHANGED
@@ -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 =
|
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
|
data/lib/phonelib/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2018-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|