mini_phone 1.1.8 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.md +14 -0
- data/Rakefile +6 -2
- data/certs/ianks.pem +8 -8
- data/ext/mini_phone/extconf.rb +3 -3
- data/ext/mini_phone/mini_phone.cc +3 -1
- data/lib/mini_phone/version.rb +1 -1
- data/mini_phone.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +12 -12
- metadata.gz.sig +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c398c60b592f86860c4e077e2c645d6a581dbac7819f1ddfa2a15af5bcf5d6bf
|
4
|
+
data.tar.gz: 2332e7b03cf3a703d98a3bca80a5eeadfbcb285136a1c1402240c10e2d189021
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4004538e8696f32e6ca6947c6ee66ff18ccd2383c53ee5097c9597d2614f6107273e6beaee7a959a365f8063dde1543be013d803b9e2afff44bceb29b8fdb1b6
|
7
|
+
data.tar.gz: f9c11923842410cfbb77e78289d7c2f181d1f8cca95902b2b7d506f6a00c4435fbe82fc3b9aac0bb6c1aeed78f1b1562e98b56668ea9247ea60d952879c9d0f8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -121,6 +121,20 @@ TelephoneNumber: e164: 228.8 i/s - 179.99x (± 0.00) slower
|
|
121
121
|
gem install mini_phone
|
122
122
|
```
|
123
123
|
|
124
|
+
### Installation on Heroku
|
125
|
+
|
126
|
+
1. In addition to the steps above add the [apt buildpack](https://github.com/heroku/heroku-buildpack-apt) to your Heroku app:
|
127
|
+
|
128
|
+
```sh
|
129
|
+
heroku buildpacks:add --index 1 heroku-community/apt
|
130
|
+
```
|
131
|
+
|
132
|
+
2. Create Aptfile in your repo with the following content:
|
133
|
+
|
134
|
+
```
|
135
|
+
libphonenumber-dev
|
136
|
+
```
|
137
|
+
|
124
138
|
## Development
|
125
139
|
|
126
140
|
After checking out the repo, run `bin/setup` to install dependencies. Then,
|
data/Rakefile
CHANGED
@@ -5,6 +5,8 @@ require 'rspec/core/rake_task'
|
|
5
5
|
require 'rubygems/package_task'
|
6
6
|
require 'rake/extensiontask'
|
7
7
|
|
8
|
+
CXX_FILES = FileList['ext/**/*.{c,cc,cpp,cxx,h}']
|
9
|
+
|
8
10
|
RSpec::Core::RakeTask.new(:spec)
|
9
11
|
|
10
12
|
task default: %i[clobber compile spec lint]
|
@@ -21,18 +23,20 @@ Rake::ExtensionTask.new('mini_phone', spec) do |ext|
|
|
21
23
|
end
|
22
24
|
|
23
25
|
task bench: %i[clobber compile] do
|
24
|
-
Dir['bench/**/*'].
|
26
|
+
Dir['bench/**/*'].each do |f|
|
25
27
|
require_relative f
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
29
31
|
task :lint do
|
32
|
+
require 'mkmf'
|
30
33
|
sh 'bundle exec rubocop'
|
34
|
+
sh 'clang-format', '--dry-run', '-i', *CXX_FILES if find_executable('clang-format')
|
31
35
|
end
|
32
36
|
|
33
37
|
task :format do
|
34
38
|
sh 'bundle exec rubocop -A'
|
35
|
-
sh 'clang-format -i
|
39
|
+
sh 'clang-format', '--dry-run', '-i', *CXX_FILES
|
36
40
|
end
|
37
41
|
|
38
42
|
task deploy: :default do
|
data/certs/ianks.pem
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
2
|
+
MIIDfDCCAmSgAwIBAgIBATANBgkqhkiG9w0BAQsFADBCMRQwEgYDVQQDDAtpLmtl
|
3
3
|
cnNleW1lcjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYD
|
4
|
-
|
4
|
+
Y29tMB4XDTIzMDQxNDEzMzYxNVoXDTI0MDQxMzEz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HANGED
@@ -12,7 +12,7 @@ if conf['target_cpu'] == 'arm64' && conf['target_os'].start_with?('darwin')
|
|
12
12
|
$CXXFLAGS << ' -I/opt/homebrew/include '
|
13
13
|
end
|
14
14
|
|
15
|
-
unless have_library('phonenumber')
|
15
|
+
unless have_library('phonenumber') && have_library('protobuf')
|
16
16
|
abort <<~MSG
|
17
17
|
|
18
18
|
,----------------------------------------------------------------------,
|
@@ -38,8 +38,8 @@ unless have_library('phonenumber')
|
|
38
38
|
end
|
39
39
|
|
40
40
|
dir_config('mini_phone')
|
41
|
-
|
42
|
-
$CXXFLAGS
|
41
|
+
append_cppflags('-O3')
|
42
|
+
$CXXFLAGS << ' -std=c++17 ' unless $CXXFLAGS.include?('-std=c++')
|
43
43
|
|
44
44
|
create_makefile('mini_phone/mini_phone')
|
45
45
|
|
@@ -14,7 +14,9 @@ static VALUE rb_cPhoneNumber;
|
|
14
14
|
static RepeatedPtrField<NumberFormat> raw_national_format;
|
15
15
|
static RepeatedPtrField<NumberFormat> dasherized_national_format;
|
16
16
|
|
17
|
-
extern "C" struct PhoneNumberInfo {
|
17
|
+
extern "C" struct PhoneNumberInfo {
|
18
|
+
PhoneNumber *phone_number;
|
19
|
+
};
|
18
20
|
|
19
21
|
extern "C" size_t phone_number_info_size(const void *data) { return sizeof(PhoneNumberInfo); }
|
20
22
|
|
data/lib/mini_phone/version.rb
CHANGED
data/mini_phone.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
MSG
|
15
15
|
spec.homepage = 'https://github.com/ianks/mini_phone'
|
16
16
|
spec.license = 'MIT'
|
17
|
-
spec.required_ruby_version = Gem::Requirement.new('>=
|
17
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 3.0.0')
|
18
18
|
|
19
19
|
spec.platform = Gem::Platform::RUBY
|
20
20
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_phone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Ker-Seymer
|
@@ -10,9 +10,9 @@ bindir: exe
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIDfDCCAmSgAwIBAgIBATANBgkqhkiG9w0BAQsFADBCMRQwEgYDVQQDDAtpLmtl
|
14
14
|
cnNleW1lcjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYD
|
15
|
-
|
15
|
+
Y29tMB4XDTIzMDQxNDEzMzYxNVoXDTI0MDQxMzEzMzYxNVowQjEUMBIGA1UEAwwL
|
16
16
|
aS5rZXJzZXltZXIxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixk
|
17
17
|
ARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMJ2pG+er4cP
|
18
18
|
PasxsMIKL9/tmLL4gh80EMuF3SCS0qZoh+Oo8dkvRYxW8NXdwEIcp3cCNgE+5G+J
|
@@ -23,14 +23,14 @@ cert_chain:
|
|
23
23
|
eWGea+yCZkECAwEAAaN9MHswCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
|
24
24
|
BBYEFOkrF6hsocaIMOjR/K3JBzyXCLJPMCAGA1UdEQQZMBeBFWkua2Vyc2V5bWVy
|
25
25
|
QGdtYWlsLmNvbTAgBgNVHRIEGTAXgRVpLmtlcnNleW1lckBnbWFpbC5jb20wDQYJ
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
KoZIhvcNAQELBQADggEBAMAohCl0cdVlYrJl9viGtzbEyLV/Krn0ZD/LM9d2cIRj
|
27
|
+
WBu7HRkP6AfYVzhZwdgUgDYw67d715kOMpLNGeWQw3QGEHFqbVzRML64jL8IxuTz
|
28
|
+
J8ttZVqM8f4GrHyISJnL92u6iP4WzdbVqx89EFjrrHd14OJXK+ZpdRh0YvnN/vMJ
|
29
|
+
t2EcDweRHkN/MEdrwbH+PbYjELnKcTIEZqcCWTk8pgssGrNyjkMhxGSsSUo9qTz0
|
30
|
+
DIZ6NVmpBvohJVCCCDxQQxFKLXZp1ivoxjN+m7eJSW7yzIz062pH4u8pPNQsiVSb
|
31
|
+
I5rgRPbDr2rAFGXKoQ0+u6CLkRxqrVsITl/OPfZhBQI=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
33
|
+
date: 2023-05-24 00:00:00.000000000 Z
|
34
34
|
dependencies: []
|
35
35
|
description: Plugs directly in the the Google's native C++ [libphonenumber](https://github.com/google/libphonenumber)
|
36
36
|
for extemely _fast_ and _robust_ phone number parsing, validation, and formatting.
|
@@ -75,14 +75,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
75
75
|
requirements:
|
76
76
|
- - ">="
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
version:
|
78
|
+
version: 3.0.0
|
79
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|
85
|
-
rubygems_version: 3.
|
85
|
+
rubygems_version: 3.4.6
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Uses the Google libphonenumber C lib to parse, validate, and format phone
|
metadata.gz.sig
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
5�6h��
|
2
|
+
� S�l/���lW|�*��{`>�q
|
3
|
+
�\�avi�U|��t6^�!��=n7�5��X��G�QD�u���{�.����b�1�u�����
|