mini_phone 0.1.7 → 1.0.0.beta.0

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
  SHA256:
3
- metadata.gz: d7bb347a05cfd2252b4d3da6bfb2918ab277ac8c0ade0d1ebfc1bd14d95a7acd
4
- data.tar.gz: d62bb44c21e637a343f039df50bd12f196ab27b763f426a635c080ac08e549a1
3
+ metadata.gz: 98edc8a1bf120a002c013d80d48ea0bd55c2f1d2bcb2912c02721ee58140a8f7
4
+ data.tar.gz: 52849767577cb45129bae6fb875f343316291da9600de16dbe406cc8c7705242
5
5
  SHA512:
6
- metadata.gz: 321ffa3218cb9d040b40d8ec8b03281ae1d92e910ab66275b21f258183f6e17fd14bfaa5a8629401cf3aae5b059727a6182ebff366d10badcbd8376eca908789
7
- data.tar.gz: 7916ba4ee31c8f9414481dbad9d4210d5fd16f4e77372588e1bf7154eb12f4d47d53dac1c413e905567abddd6e18284c386bda40bee0feb6ca5b617a2266f8ea
6
+ metadata.gz: a6ee4d57ff10389a45d0072b464098cee65fde3d7792127002e9a82879bd08077dec3182dcc243213510f4dd303c643202135f586c528463516f042dfae7c6cf
7
+ data.tar.gz: 564fb760f1a5cdcb9b81835511dc3a382632fa93b8235abb6384a3aa85ce727eaaa9cff031bf377669a102208776179e1b08000dc72a6cfe7d83caa75bde96a7
@@ -8,7 +8,7 @@ jobs:
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby: ["2.5", "2.6", "2.7"]
11
+ ruby: ["2.5", "2.6", "2.7", "3.0"]
12
12
  os: [ubuntu-latest, macos-latest]
13
13
  experimental: [false]
14
14
  # include:
@@ -30,7 +30,7 @@ static inline VALUE is_phone_number_valid(VALUE self, VALUE str, VALUE cc) {
30
30
  }
31
31
 
32
32
  extern "C" VALUE rb_is_phone_number_valid(VALUE self, VALUE str) {
33
- VALUE def_cc = rb_iv_get(rb_mMiniPhone, "@default_country_code");
33
+ VALUE def_cc = rb_iv_get(rb_mMiniPhone, "@default_country");
34
34
 
35
35
  return is_phone_number_valid(self, str, def_cc);
36
36
  }
@@ -51,7 +51,7 @@ extern "C" VALUE rb_is_phone_number_possible(VALUE self, VALUE str) {
51
51
  PhoneNumber parsed_number;
52
52
  PhoneNumberUtil *phone_util = PhoneNumberUtil::GetInstance();
53
53
 
54
- VALUE def_cc = rb_iv_get(rb_mMiniPhone, "@default_country_code");
54
+ VALUE def_cc = rb_iv_get(rb_mMiniPhone, "@default_country");
55
55
  std::string phone_number(RSTRING_PTR(str), RSTRING_LEN(str));
56
56
  std::string country_code(RSTRING_PTR(def_cc), RSTRING_LEN(def_cc));
57
57
 
@@ -68,11 +68,11 @@ extern "C" VALUE rb_is_phone_number_impossible(VALUE self, VALUE str) {
68
68
  return rb_is_phone_number_possible(self, str) == Qtrue ? Qfalse : Qtrue;
69
69
  }
70
70
 
71
- extern "C" VALUE rb_set_default_country_code(VALUE self, VALUE str_code) {
72
- return rb_iv_set(self, "@default_country_code", str_code);
71
+ extern "C" VALUE rb_set_default_country(VALUE self, VALUE str_code) {
72
+ return rb_iv_set(self, "@default_country", str_code);
73
73
  }
74
74
 
75
- extern "C" VALUE rb_get_default_country_code(VALUE self) { return rb_iv_get(self, "@default_country_code"); }
75
+ extern "C" VALUE rb_get_default_country(VALUE self) { return rb_iv_get(self, "@default_country"); }
76
76
 
77
77
  extern "C" void rb_phone_number_dealloc(PhoneNumberInfo *phone_number_info) { delete phone_number_info; }
78
78
 
@@ -108,7 +108,7 @@ extern "C" VALUE rb_phone_number_initialize(int argc, VALUE *argv, VALUE self) {
108
108
  rb_scan_args(argc, argv, "11", &str, &def_cc);
109
109
 
110
110
  if (NIL_P(def_cc)) {
111
- def_cc = rb_iv_get(rb_mMiniPhone, "@default_country_code");
111
+ def_cc = rb_iv_get(rb_mMiniPhone, "@default_country");
112
112
  }
113
113
 
114
114
  rb_iv_set(self, "@input", str);
@@ -339,7 +339,7 @@ extern "C" void Init_mini_phone(void) {
339
339
  rb_mMiniPhone = rb_define_module("MiniPhone");
340
340
 
341
341
  // Unknown
342
- rb_iv_set(rb_mMiniPhone, "@default_country_code", rb_str_new("ZZ", 2));
342
+ rb_iv_set(rb_mMiniPhone, "@default_country", rb_str_new("ZZ", 2));
343
343
 
344
344
  rb_define_module_function(rb_mMiniPhone, "valid?", reinterpret_cast<VALUE (*)(...)>(rb_is_phone_number_valid), 1);
345
345
  rb_define_module_function(rb_mMiniPhone, "valid_for_country?",
@@ -351,9 +351,9 @@ extern "C" void Init_mini_phone(void) {
351
351
  rb_define_module_function(rb_mMiniPhone, "impossible?", reinterpret_cast<VALUE (*)(...)>(rb_is_phone_number_invalid),
352
352
  1);
353
353
  rb_define_module_function(rb_mMiniPhone,
354
- "default_country_code=", reinterpret_cast<VALUE (*)(...)>(rb_set_default_country_code), 1);
355
- rb_define_module_function(rb_mMiniPhone, "default_country_code",
356
- reinterpret_cast<VALUE (*)(...)>(rb_get_default_country_code), 0);
354
+ "default_country=", reinterpret_cast<VALUE (*)(...)>(rb_set_default_country), 1);
355
+ rb_define_module_function(rb_mMiniPhone, "default_country",
356
+ reinterpret_cast<VALUE (*)(...)>(rb_get_default_country), 0);
357
357
  rb_define_module_function(rb_mMiniPhone, "parse", reinterpret_cast<VALUE (*)(...)>(rb_phone_number_parse), -1);
358
358
 
359
359
  rb_cPhoneNumber = rb_define_class_under(rb_mMiniPhone, "PhoneNumber", rb_cObject);
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MiniPhone
4
- VERSION = '0.1.7'
4
+ VERSION = '1.0.0.beta.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_phone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 1.0.0.beta.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ker-Seymer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-05 00:00:00.000000000 Z
11
+ date: 2021-01-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Plugs directly in the the Google's native C++ [libphonenumber](https://github.com/google/libphonenumber)
14
14
  for extemely _fast_ and _robust_ phone number parsing, validation, and formatting.
@@ -58,9 +58,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
58
58
  version: 2.5.0
59
59
  required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ">="
61
+ - - ">"
62
62
  - !ruby/object:Gem::Version
63
- version: '0'
63
+ version: 1.3.1
64
64
  requirements: []
65
65
  rubygems_version: 3.1.4
66
66
  signing_key: