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.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/CHANGELOG.md +14 -0
- data/README.md +11 -5
- data/data/geocoding/de/49.dat +0 -0
- data/data/geocoding/de/49.txt +3 -3
- data/data/geocoding/en/1.dat +0 -0
- data/data/geocoding/en/1.txt +13 -1
- data/data/geocoding/en/212.dat +0 -0
- data/data/geocoding/en/212.txt +9 -1
- data/data/geocoding/en/225.dat +0 -0
- data/data/geocoding/en/225.txt +36 -22
- data/data/geocoding/en/267.dat +0 -0
- data/data/geocoding/en/267.txt +1 -0
- data/data/geocoding/en/44.dat +0 -0
- data/data/geocoding/en/44.txt +6 -1
- data/data/geocoding/en/49.dat +0 -0
- data/data/geocoding/en/49.txt +3 -3
- data/data/geocoding/en/504.dat +0 -0
- data/data/geocoding/en/504.txt +1 -0
- data/data/geocoding/en/52.dat +0 -0
- data/data/geocoding/en/52.txt +2 -0
- data/data/geocoding/en/55.dat +0 -0
- data/data/geocoding/en/55.txt +1 -1
- data/data/geocoding/en/57.dat +0 -0
- data/data/geocoding/en/57.txt +149 -0
- data/data/geocoding/en/598.dat +0 -0
- data/data/geocoding/en/598.txt +9 -1
- data/data/geocoding/en/61.dat +0 -0
- data/data/geocoding/en/61.txt +39 -9
- data/data/geocoding/en/678.dat +0 -0
- data/data/geocoding/en/678.txt +1 -1
- data/data/geocoding/en/81.dat +0 -0
- data/data/geocoding/en/81.txt +9 -1
- data/data/geocoding/en/880.dat +0 -0
- data/data/geocoding/en/880.txt +5 -1
- data/data/geocoding/en/961.dat +0 -0
- data/data/geocoding/en/961.txt +23 -0
- data/data/geocoding/en/994.dat +0 -0
- data/data/geocoding/en/994.txt +2 -2
- data/data/geocoding/es/52.dat +0 -0
- data/data/geocoding/es/52.txt +18 -16
- data/data/geocoding/es/57.dat +0 -0
- data/data/geocoding/es/57.txt +146 -0
- data/data/geocoding/fr/212.dat +0 -0
- data/data/geocoding/fr/212.txt +9 -1
- data/data/geocoding/fr/225.dat +0 -0
- data/data/geocoding/fr/225.txt +36 -22
- data/data/geocoding/ja/81.dat +0 -0
- data/data/geocoding/ja/81.txt +9 -1
- data/data/geocoding/pt/55.dat +0 -0
- data/data/geocoding/pt/55.txt +1 -1
- data/data/telephone_number_data_file.dat +0 -0
- data/data/telephone_number_data_file.xml +2162 -1297
- data/data/timezones/map_data.dat +0 -0
- data/data/timezones/map_data.txt +81 -177
- data/lib/telephone_number/country.rb +22 -9
- data/lib/telephone_number/version.rb +1 -1
- data/lib/telephone_number.rb +0 -1
- data/telephone_number.gemspec +1 -0
- metadata +6 -4
- data/lib/utilities/hash.rb +0 -47
data/lib/utilities/hash.rb
DELETED
@@ -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
|