phonelib 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +3 -2
  3. data/data/extended_data.dat +0 -0
  4. data/data/libphonenumber/README.md +2 -2
  5. data/data/libphonenumber/cpp/src/phonenumbers/lite_metadata.cc +9378 -9374
  6. data/data/libphonenumber/cpp/src/phonenumbers/metadata.cc +10179 -10175
  7. data/data/libphonenumber/cpp/src/phonenumbers/short_metadata.cc +2322 -2321
  8. data/data/libphonenumber/cpp/test/phonenumbers/shortnumberinfo_test.cc +4 -2
  9. data/data/libphonenumber/java/carrier/pom.xml +4 -4
  10. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/232_en +0 -0
  11. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/65_en +0 -0
  12. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/972_en +0 -0
  13. data/data/libphonenumber/java/demo/pom.xml +5 -5
  14. data/data/libphonenumber/java/geocoder/pom.xml +4 -4
  15. data/data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1220_en +0 -0
  16. data/data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1628_en +0 -0
  17. data/data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1629_en +0 -0
  18. data/data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/config +0 -0
  19. data/data/libphonenumber/java/internal/prefixmapper/pom.xml +3 -3
  20. data/data/libphonenumber/java/libphonenumber/pom.xml +2 -2
  21. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CA +0 -0
  22. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HU +0 -0
  23. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IL +0 -0
  24. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JO +0 -0
  25. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LU +0 -0
  26. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SG +0 -0
  27. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SL +0 -0
  28. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_US +0 -0
  29. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/ShortNumberMetadataProto_BI +0 -0
  30. data/data/libphonenumber/java/pom.xml +1 -1
  31. data/data/libphonenumber/java/release_notes.txt +9 -0
  32. data/data/libphonenumber/javascript/i18n/phonenumbers/asyoutypeformatter_test.js +6 -4
  33. data/data/libphonenumber/javascript/i18n/phonenumbers/demo-compiled.js +82 -82
  34. data/data/libphonenumber/javascript/i18n/phonenumbers/metadata.js +14 -14
  35. data/data/libphonenumber/javascript/i18n/phonenumbers/metadatalite.js +14 -14
  36. data/data/libphonenumber/resources/PhoneNumberMetadata.xml +34 -20
  37. data/data/libphonenumber/resources/ShortNumberMetadata.xml +17 -7
  38. data/data/libphonenumber/resources/carrier/en/232.txt +8 -0
  39. data/data/libphonenumber/resources/carrier/en/65.txt +188 -0
  40. data/data/libphonenumber/resources/carrier/en/972.txt +2 -0
  41. data/data/libphonenumber/resources/geocoding/en/1.txt +3 -0
  42. data/data/libphonenumber/resources/geocoding/en/86.txt +8219 -1528
  43. data/data/libphonenumber/resources/geocoding/zh/86.txt +7262 -569
  44. data/data/phone_data.dat +0 -0
  45. data/lib/phonelib/phone.rb +4 -1
  46. data/lib/phonelib/version.rb +1 -1
  47. metadata +5 -2
data/data/phone_data.dat CHANGED
Binary file
@@ -124,6 +124,8 @@ module Phonelib
124
124
 
125
125
  # Returns e164 formatted phone number
126
126
  def international
127
+ sanitized = self.sanitized
128
+ return nil if sanitized.nil? || sanitized.empty?
127
129
  return "+#{sanitized}" unless valid?
128
130
 
129
131
  format = @data[country][:format]
@@ -139,7 +141,8 @@ module Phonelib
139
141
 
140
142
  # Returns e164 unformatted phone number
141
143
  def e164
142
- international.gsub /[^+0-9]/, ''
144
+ international = self.international
145
+ international and international.gsub /[^+0-9]/, ''
143
146
  end
144
147
 
145
148
  # Returns whether a current parsed phone number is valid for specified
@@ -1,5 +1,5 @@
1
1
  # :nodoc:
2
2
  module Phonelib
3
3
  # :nodoc:
4
- VERSION = '0.4.3'
4
+ VERSION = '0.4.4'
5
5
  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.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vadim Senderovich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-12 00:00:00.000000000 Z
11
+ date: 2015-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -422,6 +422,7 @@ files:
422
422
  - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1217_en
423
423
  - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1218_en
424
424
  - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1219_en
425
+ - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1220_en
425
426
  - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1224_en
426
427
  - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1225_en
427
428
  - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1226_en
@@ -583,6 +584,8 @@ files:
583
584
  - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1620_en
584
585
  - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1623_en
585
586
  - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1626_en
587
+ - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1628_en
588
+ - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1629_en
586
589
  - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1630_en
587
590
  - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1631_en
588
591
  - data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1636_en