phony 2.18.0 → 2.18.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.textile +2 -2
  3. data/lib/phony.rb +2 -0
  4. data/lib/phony/config.rb +2 -0
  5. data/lib/phony/countries.rb +2 -0
  6. data/lib/phony/countries/austria.rb +2 -0
  7. data/lib/phony/countries/bangladesh.rb +2 -0
  8. data/lib/phony/countries/belarus.rb +2 -0
  9. data/lib/phony/countries/brazil.rb +2 -0
  10. data/lib/phony/countries/cambodia.rb +2 -0
  11. data/lib/phony/countries/china.rb +2 -0
  12. data/lib/phony/countries/croatia.rb +2 -0
  13. data/lib/phony/countries/georgia.rb +2 -0
  14. data/lib/phony/countries/germany.rb +2 -0
  15. data/lib/phony/countries/guinea.rb +8 -5
  16. data/lib/phony/countries/india.rb +2 -0
  17. data/lib/phony/countries/indonesia.rb +2 -0
  18. data/lib/phony/countries/ireland.rb +24 -22
  19. data/lib/phony/countries/italy.rb +6 -1
  20. data/lib/phony/countries/japan.rb +2 -0
  21. data/lib/phony/countries/kyrgyzstan.rb +2 -0
  22. data/lib/phony/countries/latvia.rb +2 -0
  23. data/lib/phony/countries/libya.rb +2 -0
  24. data/lib/phony/countries/malaysia.rb +2 -0
  25. data/lib/phony/countries/moldova.rb +2 -0
  26. data/lib/phony/countries/montenegro.rb +2 -0
  27. data/lib/phony/countries/myanmar.rb +2 -0
  28. data/lib/phony/countries/namibia.rb +2 -0
  29. data/lib/phony/countries/nepal.rb +2 -0
  30. data/lib/phony/countries/netherlands.rb +2 -0
  31. data/lib/phony/countries/pakistan.rb +2 -0
  32. data/lib/phony/countries/paraguay.rb +2 -0
  33. data/lib/phony/countries/russia_kazakhstan_abkhasia_south_ossetia.rb +2 -0
  34. data/lib/phony/countries/saudi_arabia.rb +2 -0
  35. data/lib/phony/countries/serbia.rb +2 -0
  36. data/lib/phony/countries/somalia.rb +2 -0
  37. data/lib/phony/countries/south_korea.rb +7 -2
  38. data/lib/phony/countries/sweden.rb +2 -0
  39. data/lib/phony/countries/taiwan.rb +2 -0
  40. data/lib/phony/countries/tajikistan.rb +2 -0
  41. data/lib/phony/countries/turkmenistan.rb +2 -0
  42. data/lib/phony/countries/ukraine.rb +2 -0
  43. data/lib/phony/countries/united_kingdom.rb +5 -2
  44. data/lib/phony/countries/uruguay.rb +2 -0
  45. data/lib/phony/countries/vietnam.rb +3 -1
  46. data/lib/phony/countries/zimbabwe.rb +2 -0
  47. data/lib/phony/country.rb +2 -0
  48. data/lib/phony/dsl.rb +1 -1
  49. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7060b3843f748b526a0242338501d1aabd32e12302a3c995b8dcfe7d7e51083b
4
- data.tar.gz: d688a27ee525838a92a6d257809f32bc65129bac8d69624ac637e6e3a8e6042a
3
+ metadata.gz: 7ea8c6332f0da9d7ba47dbd4874768b5abd2bead07dcee7ccca38a0dbea2f741
4
+ data.tar.gz: 48659b180852ae68bb6ae9a3277ce7403dadb3d16ac31614b73822a14b3985b9
5
5
  SHA512:
6
- metadata.gz: e2b6963e048c2de9a2d30f9b5a5df655149058345a22d13ec354e2737f4d23b8009f48afcdaf92f4062183dabce3013d82c37a9c1122c52e6c7f40622e70a7f0
7
- data.tar.gz: '094d6b09c3aa9b7db89d3eddfc27e5019c6a624df85bf9264eb8dc8aad1a7a99742302743c4c3dfbe49d5898f2157874d9615dfbbfc39d3b6e1917137e7de2bb'
6
+ metadata.gz: 29cc75cd083d90e44c3c5b98c1dad659be8160eb4859fa65b8115cbd993fe151022d18e0ac48260945b49af1d9f8fd438b065ed12221b7a9ae287a9cfd737cad
7
+ data.tar.gz: b9a1676ae81bf52d122f86cc9f0e5b9333c8668c56322973d80c14d8e56785586ca81eba8daa099122d2664d4ba9adfc7d66143c9bddc33f149b47583b6f4026
data/README.textile CHANGED
@@ -13,7 +13,7 @@ Used in: "airbnb.com":http://airbnb.com, "socialcam.com":http://socialcam.com, "
13
13
 
14
14
  h2(#memory). Runtime Memory Usage
15
15
 
16
- According to "memory_profiler":https://github.com/SamSaffron/memory_profiler, the Phony gem uses roughly 1.2 MBs of memory per Ruby process.
16
+ According to "memory_profiler":https://github.com/SamSaffron/memory_profiler, the Phony gem uses roughly 1MB of memory per Ruby process.
17
17
  Usage was generated using (look for @Total retained@): @ruby -e 'require "memory_profiler"; MemoryProfiler.report(allow_files: "phony"){ require "phony" }.pretty_print'@
18
18
 
19
19
  h2. Description
@@ -27,7 +27,7 @@ E164 numbers are international numbers with a country dial prefix, usually an ar
27
27
 
28
28
  It currently handles the countries listed at the end of this README.
29
29
 
30
- It is covered by roughly 2,000 tests (January 2016).
30
+ It is covered by roughly 2,250 tests that run in 2 seconds (April 2019).
31
31
  If it doesn't work, please "enter an issue":http://github.com/floere/phony/issues or better, fork and "send a pull request":http://github.com/floere/phony/pulls.
32
32
 
33
33
  h2. Installation
data/lib/phony.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # NOTE We use Kernel.load here, as it's possible to redefine Phony via Phony::Config.
2
4
 
3
5
  # Framework.
data/lib/phony/config.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Phony
2
4
 
3
5
  # Add config.
@@ -1,4 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
+ # frozen_string_literal: true
3
+
2
4
  # All countries, ordered by country code.
3
5
  #
4
6
  # Definitions are in the format:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Austria uses a variable-length ndc code, thus we use a separate file to not let all_other.rb explode.
2
4
  #
3
5
  ndcs = [
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Bangladesh (People's Republic of)
2
4
  # https://www.numberingplans.com
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Belarus
2
4
  # http://www.eng.beltelecom.by/en/subscribers/phone-codes
3
5
  # https://www.numberingplans.com
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Brazilian phone numbers.
2
4
  #
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Cambodia (Kingdom of)
2
4
  # http://en.wikipedia.org/wiki/Telecommunications_in_Cambodia#Mobile_networks
3
5
  # http://en.wikipedia.org/wiki/Telephone_numbers_in_Cambodia
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Chinese phone numbers.
2
4
  #
3
5
  # http://en.wikipedia.org/wiki/Telephone_numbers_in_China
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Croatia
2
4
  #
3
5
  # http://en.wikipedia.org/wiki/Telephone_numbers_in_Croatia
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Georgia
2
4
  # https://www.numberingplans.com/?page=dialling&sub=areacodes
3
5
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=GE
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Germany uses a variable-length ndc code, thus we use a separate file to not let countries.rb explode.
2
4
  #
3
5
  # Note: Germany uses a variable ndc format from length 2 to 5.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Guinea (sometimes Guinea-Conakry; officially Republic of Guinea)
2
4
  # http://www.itu.int/oth/T020200005B/en
3
5
 
@@ -25,12 +27,13 @@ land_ndcs_with_5_digits = [
25
27
  '30613' # Télimélé
26
28
  ]
27
29
 
30
+ # NOTE We're not using *('660'..'669') since it does not freeze easily.
28
31
  mobile_ndcs_with_3_digits = [
29
- *('660'..'669'), # Areeba
30
- *('620'..'629'), # Orange
31
- *('650'..'659'), # Cellcom
32
- *('630'..'639'), # Intercel
33
- *('600'..'609') # Sotelgui
32
+ '600', '601', '602', '603', '604', '605', '606', '607', '608', '609', # Sotelgui
33
+ '620', '621', '622', '623', '624', '625', '626', '627', '628', '629', # Orange
34
+ '650', '651', '652', '653', '654', '655', '656', '657', '658', '659', # Cellcom
35
+ '630', '631', '632', '633', '634', '635', '636', '637', '638', '639', # Intercel
36
+ '660', '661', '662', '663', '664', '665', '666', '667', '668', '669', # Areeba
34
37
  ]
35
38
 
36
39
  Phony.define do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Indian phone numbers.
2
4
  #
3
5
  # http://en.wikipedia.org/wiki/Telephone_numbers_in_India
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Indonesia (Republic of)
2
4
  # http://www.numberingplans.com/?page=dialling&sub=areacodes
3
5
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=ID
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # The Republic of Ireland has variable-length NDCs from 2-3 digits in length. Depending on the NDC, the length of the subscriber number varies from 5-7 characters in length. There does not appear to be any pattern that relates NDCs to subscriber number length.
2
4
  #
3
5
  # 7 digit subscriber numbers follow a 3-4 split pattern.
@@ -11,28 +13,28 @@
11
13
  # http://en.wikipedia.org/wiki/Telephone_numbers_in_the_Republic_of_Ireland
12
14
  #
13
15
  ndcs_with_5_subscriber_digits = [
14
- ('22'..'29').to_a, # Mallow, Bandon, Youghal, Fermoy, Macroom, Bantry, Skibbereen, Kanturk
15
- '402', # Arklow
16
- '404', # Wicklow
17
- '43', # Longford, Granard
18
- '47', # Monaghan, Clones
19
- '48', # Northern Ireland
20
- '502', # Portlaoise, Abbeyleix
21
- '504', # Thurles
22
- '505', # Roscrea
23
- '506', # Tullamore
24
- '509', # Bin-
25
- '52', # Killenaule
26
- '54', # Legacy Ferns, Enniscorthy
27
- '55', # Legacy Gorey
28
- '62', # Tipperary, Cashel
29
- '63', # Charleville
30
- '64', # Killarney, Rathmore
31
- '67', # Nenagh
32
- '68', # Listowel
33
- '69', # Newcastle West
34
- '93', # Tuam
35
- ('94'..'99').to_a # Castlebar, Castlerea, Claremorris, Clifden, Ballina, Belmullet, Westport, Kilronan
16
+ '22', '23', '24', '25', '26', '27', '28', '29', # Mallow, Bandon, Youghal, Fermoy, Macroom, Bantry, Skibbereen, Kanturk
17
+ '402', # Arklow
18
+ '404', # Wicklow
19
+ '43', # Longford, Granard
20
+ '47', # Monaghan, Clones
21
+ '48', # Northern Ireland
22
+ '502', # Portlaoise, Abbeyleix
23
+ '504', # Thurles
24
+ '505', # Roscrea
25
+ '506', # Tullamore
26
+ '509', # Bin-
27
+ '52', # Killenaule
28
+ '54', # Legacy Ferns, Enniscorthy
29
+ '55', # Legacy Gorey
30
+ '62', # Tipperary, Cashel
31
+ '63', # Charleville
32
+ '64', # Killarney, Rathmore
33
+ '67', # Nenagh
34
+ '68', # Listowel
35
+ '69', # Newcastle West
36
+ '93', # Tuam
37
+ '94', '95', '96', '97', '98', '99' # Castlebar, Castlerea, Claremorris, Clifden, Ballina, Belmullet, Westport, Kilronan
36
38
  ].flatten
37
39
 
38
40
  ndcs_with_6_subscriber_digits = [
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Italian phone numbers.
2
4
  #
3
5
  # http://en.wikipedia.org/wiki/Telephone_numbers_in_Italy
@@ -249,7 +251,10 @@ ndcs_4digit = [
249
251
 
250
252
  # All 3-- numbers are reserved for mobile phones according to
251
253
  # http://en.wikipedia.org/wiki/Telephone_numbers_in_Italy#Mobile_telephones
252
- mobile = (300..399).collect(&:to_s).to_a
254
+ # NOTE was:
255
+ # mobile = ('300'..'399').to_a
256
+ # but this was not frozen so easily.
257
+ mobile = %w(300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399)
253
258
 
254
259
  service = [ # Not exhaustive.
255
260
  '112',
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Japan
2
4
  # http://www.itu.int/oth/T020200006D/en
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Kyrgyz Republic
2
4
  # https://www.numberingplans.com/?page=dialling&sub=areacodes
3
5
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=KG
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Latvia
2
4
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=LV
3
5
  # https://www.numberingplans.com/?page=dialling&sub=areacodes
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Lybia, https://www.numberingplans.com/?page=dialling&sub=areacodes
2
4
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=LY
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Malaysian phone numbers.
2
4
  #
3
5
  # http://en.wikipedia.org/wiki/Telephone_numbers_in_Malaysia
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Moldova
2
4
  # https://www.numberingplans.com/?page=dialling&sub=areacodes
3
5
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=MD
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Montenegro
2
4
  # https://www.numberingplans.com/?page=dialling&sub=areacodes
3
5
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=ME
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Myanmar: http://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000920003PDFE.pdf
2
4
  #
3
5
  # formatting according to Google's libphonenumber library. (r680 7/30/2014)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Namibia
2
4
  # https://www.numberingplans.com/?page=dialling&sub=areacodes
3
5
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=NA
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Nepal
2
4
  # https://www.numberingplans.com/?page=dialling&sub=areacodes
3
5
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=NP
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # The Netherlands use a variable-length ndc code, thus we use a separate file to not let all_other.rb explode. The
2
4
  # latest version of the numbering plan is available at http://wetten.overheid.nl/BWBR0010198/
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Pakistan (Islamic Republic of)
2
4
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=PK
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Paraguay (Republic of)
2
4
  # https://www.numberingplans.com/?page=dialling&sub=areacodes
3
5
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=PY
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  ndcs_with_5_subscriber_digits = %w(30130 30131 30132 30133 30134 30135 30136 30137 30138 30140 30141 30142 30143 30144
2
4
  30145 30146 30147 30148 30149 30150 30153 30230 30231 30232 30233 30234 30235 30236 30237 30238 30239 30240 30241
3
5
  30242 30243 30244 30245 30246 30247 30248 30249 30251 30252 30253 30255 30256 30257 30261 30262 30264 30265 30266
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # References:
2
4
  # http://www.itu.int/oth/T02020000B7/en
3
5
  # https://en.wikipedia.org/wiki/Telephone_numbers_in_Saudi_Arabia
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Serbia
2
4
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=RS
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Phony.define do
2
4
  # Somali Democratic Republic http://www.wtng.info/wtng-252-so.html
3
5
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=SO
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # South Korean (Republic of Korea) phone numbers.
2
4
  #
3
5
  # http://en.wikipedia.org/wiki/Telephone_numbers_in_South_Korea
@@ -7,8 +9,11 @@
7
9
  # TODO 4-digit services, like "unreasonable infringement of livelihood report" number :)
8
10
  #
9
11
 
10
- special = %w{ 100 101 105 106 107 108 109 111 112 113 114 115 116 117 118 119 120 121 122 123 125 127 128 129 131 132 134 141 182 188 }
11
- mobile = ('10'..'19').to_a
12
+ special = %w(100 101 105 106 107 108 109 111 112 113 114 115 116 117 118 119 120 121 122 123 125 127 128 129 131 132 134 141 182 188)
13
+ # NOTE was:
14
+ # mobile = ('10'..'19').to_a
15
+ # but this was not frozen so easily.
16
+ mobile = %w(10 11 12 13 14 15 16 17 18 19)
12
17
 
13
18
  Phony.define do
14
19
  country '82',
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Sweden uses a variable-length ndc code, thus we use a separate file to not let all_other.rb explode.
2
4
  #
3
5
  # Note: Sweden use a variable ndc format from length 2 to 3.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Taiwan
2
4
  # https://zh.wikipedia.org/wiki/%E4%B8%AD%E8%8F%AF%E6%B0%91%E5%9C%8B%E9%95%B7%E9%80%94%E9%9B%BB%E8%A9%B1%E5%8D%80%E8%99%9F%E8%A1%A8
3
5
  # https://en.wikipedia.org/wiki/Telephone_numbers_in_Taiwan
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Tajikistan (Republic of)
2
4
 
3
5
  ndcs_with_6_subscriber_digits = %w(372)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Turkmenistan
2
4
  # https://www.numberingplans.com/?page=dialling&sub=areacodes
3
5
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=TM
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Ukraine
2
4
  # https://www.numberingplans.com/?page=dialling&sub=areacodes
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # The United Kingdom uses a variable-length NDC code,
2
4
  # thus we use a separate file to not let countries.rb explode.
3
5
  #
@@ -16,9 +18,10 @@
16
18
  mobile_ndc = [
17
19
  # Mobile [4+6].
18
20
  #
19
- *('7100'..'7599'),
21
+ # NOTE We're explicitly denoting this as dynamic strings cannot be frozen.
22
+ *%w(7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599),
20
23
  '7624', # Isle of Man
21
- *('7700'..'7999')
24
+ *%w(7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999)
22
25
  ]
23
26
 
24
27
  two_digit_ndc = [
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Uruguay (Eastern Republic of)
2
4
  # https://www.numberingplans.com/?page=dialling&sub=areacodes
3
5
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=UY
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Vietnamese phone numbers.
2
4
  #
3
5
  # http://en.wikipedia.org/wiki/Telephone_numbers_in_Vietnam
@@ -115,7 +117,7 @@ mobile = [
115
117
  '99', # Gmobile (traded as Beeline)
116
118
  ]
117
119
 
118
- mobile_with_trunk = (mobile).map{|num| "0#{num}" }
120
+ mobile_with_trunk = (mobile).map{ |num| "0#{num}" }
119
121
 
120
122
  Phony.define do
121
123
  country '84',
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Zimbabwe, https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=ZW
2
4
  # http://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000E90002PDFE.pdf
3
5
 
data/lib/phony/country.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Phony
2
4
 
3
5
  #
data/lib/phony/dsl.rb CHANGED
@@ -141,7 +141,7 @@ module Phony
141
141
  #
142
142
  ndcs = ndcs.first if Array === ndcs.first
143
143
 
144
- NationalSplitters::Variable.new options[:max_length], ndcs
144
+ NationalSplitters::Variable.new options[:max_length], ndcs.map(&:freeze)
145
145
  end
146
146
 
147
147
  # If you have a number of (possibly) variable length NDCs
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phony
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.18.0
4
+ version: 2.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke