telephone_number 1.4.9 → 1.4.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +0 -1
  3. data/CHANGELOG.md +14 -0
  4. data/README.md +11 -5
  5. data/data/geocoding/de/49.dat +0 -0
  6. data/data/geocoding/de/49.txt +3 -3
  7. data/data/geocoding/en/1.dat +0 -0
  8. data/data/geocoding/en/1.txt +13 -1
  9. data/data/geocoding/en/212.dat +0 -0
  10. data/data/geocoding/en/212.txt +9 -1
  11. data/data/geocoding/en/225.dat +0 -0
  12. data/data/geocoding/en/225.txt +36 -22
  13. data/data/geocoding/en/267.dat +0 -0
  14. data/data/geocoding/en/267.txt +1 -0
  15. data/data/geocoding/en/44.dat +0 -0
  16. data/data/geocoding/en/44.txt +6 -1
  17. data/data/geocoding/en/49.dat +0 -0
  18. data/data/geocoding/en/49.txt +3 -3
  19. data/data/geocoding/en/504.dat +0 -0
  20. data/data/geocoding/en/504.txt +1 -0
  21. data/data/geocoding/en/52.dat +0 -0
  22. data/data/geocoding/en/52.txt +2 -0
  23. data/data/geocoding/en/55.dat +0 -0
  24. data/data/geocoding/en/55.txt +1 -1
  25. data/data/geocoding/en/57.dat +0 -0
  26. data/data/geocoding/en/57.txt +149 -0
  27. data/data/geocoding/en/598.dat +0 -0
  28. data/data/geocoding/en/598.txt +9 -1
  29. data/data/geocoding/en/61.dat +0 -0
  30. data/data/geocoding/en/61.txt +39 -9
  31. data/data/geocoding/en/678.dat +0 -0
  32. data/data/geocoding/en/678.txt +1 -1
  33. data/data/geocoding/en/81.dat +0 -0
  34. data/data/geocoding/en/81.txt +9 -1
  35. data/data/geocoding/en/880.dat +0 -0
  36. data/data/geocoding/en/880.txt +5 -1
  37. data/data/geocoding/en/961.dat +0 -0
  38. data/data/geocoding/en/961.txt +23 -0
  39. data/data/geocoding/en/994.dat +0 -0
  40. data/data/geocoding/en/994.txt +2 -2
  41. data/data/geocoding/es/52.dat +0 -0
  42. data/data/geocoding/es/52.txt +18 -16
  43. data/data/geocoding/es/57.dat +0 -0
  44. data/data/geocoding/es/57.txt +146 -0
  45. data/data/geocoding/fr/212.dat +0 -0
  46. data/data/geocoding/fr/212.txt +9 -1
  47. data/data/geocoding/fr/225.dat +0 -0
  48. data/data/geocoding/fr/225.txt +36 -22
  49. data/data/geocoding/ja/81.dat +0 -0
  50. data/data/geocoding/ja/81.txt +9 -1
  51. data/data/geocoding/pt/55.dat +0 -0
  52. data/data/geocoding/pt/55.txt +1 -1
  53. data/data/telephone_number_data_file.dat +0 -0
  54. data/data/telephone_number_data_file.xml +2162 -1297
  55. data/data/timezones/map_data.dat +0 -0
  56. data/data/timezones/map_data.txt +81 -177
  57. data/lib/telephone_number/country.rb +22 -9
  58. data/lib/telephone_number/version.rb +1 -1
  59. data/lib/telephone_number.rb +0 -1
  60. data/telephone_number.gemspec +1 -0
  61. metadata +6 -4
  62. data/lib/utilities/hash.rb +0 -47
@@ -1,47 +0,0 @@
1
- class Hash
2
- # Returns a new hash with +self+ and +other_hash+ merged recursively.
3
- #
4
- # h1 = { a: true, b: { c: [1, 2, 3] } }
5
- # h2 = { a: false, b: { x: [3, 4, 5] } }
6
- #
7
- # h1.deep_merge(h2) # => { a: false, b: { c: [1, 2, 3], x: [3, 4, 5] } }
8
- #
9
- # Like with Hash#merge in the standard library, a block can be provided
10
- # to merge values:
11
- #
12
- # h1 = { a: 100, b: 200, c: { c1: 100 } }
13
- # h2 = { b: 250, c: { c1: 200 } }
14
- # h1.deep_merge(h2) { |key, this_val, other_val| this_val + other_val }
15
- # # => { a: 100, b: 450, c: { c1: 300 } }
16
- def deep_deep_merge(other_hash, &block)
17
- dup.deep_deep_merge!(other_hash, &block)
18
- end
19
-
20
- # Same as +deep_merge+, but modifies +self+.
21
- def deep_deep_merge!(other_hash, &block)
22
- other_hash.each_pair do |current_key, other_value|
23
- this_value = self[current_key]
24
-
25
- self[current_key] = if this_value.is_a?(Hash) && other_value.is_a?(Hash)
26
- this_value.deep_deep_merge(other_value, &block)
27
- else
28
- if block_given? && key?(current_key)
29
- block.call(current_key, this_value, other_value)
30
- else
31
- other_value
32
- end
33
- end
34
- end
35
-
36
- self
37
- end
38
-
39
- def except(*keys)
40
- dup.except!(*keys)
41
- end
42
-
43
- def except!(*keys)
44
- keys.each { |key| delete(key) }
45
- self
46
- end
47
- end