mudguard 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/mudguard/domain/consts.rb +7 -4
- 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: 44d7f2ff1e9b179d3d64e1263ab13cb217497fce8dd174f5b0ee5ef4cdf1c67f
|
4
|
+
data.tar.gz: 6597fed3f89fa210951650bec390b8c6a5196db0806b3e5b2daaba9406693d21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0eecb391426607e7650a7da55c2f470acf06b44da2327c7853c1215dc2a46fcdb592cedf3a7f383d57772b16017eb5f2b0c9edb0b87c4dc1d9d3821749a7a1a1
|
7
|
+
data.tar.gz: d69e2ec7b320c04a6e01475f7973992204f08653d84316865f903363b72e51928c15f98601c1b0e2a9009f712612556e0fc33811bf271c707d6cbcc92def2eba
|
data/Gemfile.lock
CHANGED
@@ -7,9 +7,8 @@ module Mudguard
|
|
7
7
|
# Knows all constants of the project
|
8
8
|
class Consts
|
9
9
|
def initialize(sources:)
|
10
|
-
@consts = sources
|
11
|
-
|
12
|
-
.each_with_object(Hash.new { |h, k| h[k] = {} }) do |c, a|
|
10
|
+
@consts = sources.flat_map(&:find_consts)
|
11
|
+
.each_with_object(create_hash_of_hash) do |c, a|
|
13
12
|
path = split_hierarchy(c)
|
14
13
|
const_name = path.last
|
15
14
|
module_names = path.take(path.count - 1)
|
@@ -37,8 +36,12 @@ module Mudguard
|
|
37
36
|
|
38
37
|
SEPARATOR = "::"
|
39
38
|
|
39
|
+
def create_hash_of_hash
|
40
|
+
Hash.new { |h, k| h[k] = create_hash_of_hash }
|
41
|
+
end
|
42
|
+
|
40
43
|
def find_const_deeper(current_module, remaining_modules, consts, const_path)
|
41
|
-
return if consts.nil?
|
44
|
+
return if consts.nil? || consts.empty?
|
42
45
|
|
43
46
|
if remaining_modules.any?
|
44
47
|
# Move deeper toward target module
|
data/lib/mudguard/version.rb
CHANGED