mudguard 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/mudguard/domain/consts.rb +3 -7
- data/lib/mudguard/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 456ae028fad5fdfd5e2e96158d53956c7a709823d2477c351050fb220e8ab1ec
|
4
|
+
data.tar.gz: 0c9375de37dd75a71f89203c2248aad4cf4b555ef5f63d8ecb4442d63fe1a56f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15a30108d5b47a12905075ed35c62ace335fd4b9303b4da46301af6db2f6b5d509d4cba95e245a4144368accf710f85e4be334c9d09a50840bad4600962078d3
|
7
|
+
data.tar.gz: 6102ca6a925655ccae7d345ed4522ac8cf546f3d3fd212bedd519c1a69be3321c80a09e46b8aa1893ff67f62d9ce9703672d255dfc5ff0a22c14278dd4b7853d
|
data/Gemfile.lock
CHANGED
@@ -8,11 +8,11 @@ module Mudguard
|
|
8
8
|
class Consts
|
9
9
|
def initialize(sources:)
|
10
10
|
@consts = sources.flat_map(&:find_consts)
|
11
|
-
.each_with_object(
|
11
|
+
.each_with_object({}) do |c, a|
|
12
12
|
path = split_hierarchy(c)
|
13
13
|
const_name = path.last
|
14
14
|
module_names = path.take(path.count - 1)
|
15
|
-
sub_module = module_names.reduce(a) { |h, m| h[m] }
|
15
|
+
sub_module = module_names.reduce(a) { |h, m| h.key?(m) ? h[m] : h[m] = {} }
|
16
16
|
sub_module[const_name] = {} unless sub_module.key?(const_name)
|
17
17
|
end
|
18
18
|
end
|
@@ -36,12 +36,8 @@ module Mudguard
|
|
36
36
|
|
37
37
|
SEPARATOR = "::"
|
38
38
|
|
39
|
-
def create_hash_of_hash
|
40
|
-
Hash.new { |h, k| h[k] = create_hash_of_hash }
|
41
|
-
end
|
42
|
-
|
43
39
|
def find_const_deeper(current_module, remaining_modules, consts, const_path)
|
44
|
-
return if consts.nil?
|
40
|
+
return if consts.nil?
|
45
41
|
|
46
42
|
if remaining_modules.any?
|
47
43
|
# Move deeper toward target module
|
data/lib/mudguard/version.rb
CHANGED