mudguard 0.1.6 → 0.1.7
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/source.rb +18 -6
- data/lib/mudguard/version.rb +1 -1
- data/mudguard.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52da6086ca5ad7d9cc7882c0be051e35d1a1672930d616f3929d44909b23717f
|
4
|
+
data.tar.gz: 84ba1b85b2d6cdec19ccbd80ffe6f39745054f3e8617a250c7dc613cd40dc00e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d41681429a450ad75420b5cbe6bf78a261bc2d6d90be6547e080557d09b66c7a937c6798cd2f4603e20c7154d1540638f3861830ea4add5c5bce513d78a6dfbb
|
7
|
+
data.tar.gz: e4f6a3925f3a65496c646cf2c1d0f5143b7e9f0c103a327961479b3dd01e4307bc743934ef8152ac73d15661bd04a842906876d595414814efdc6be285ba5efb
|
data/Gemfile.lock
CHANGED
@@ -36,20 +36,27 @@ module Mudguard
|
|
36
36
|
def process(node, module_name = "")
|
37
37
|
case node
|
38
38
|
when type?(:module)
|
39
|
-
process_module(node.children)
|
39
|
+
process_module(node.children, module_name)
|
40
40
|
when type?(:class)
|
41
41
|
process_class(node.children, module_name)
|
42
42
|
when type?(:const)
|
43
|
-
|
43
|
+
create_dependency(module_name, node)
|
44
44
|
else
|
45
45
|
ignore_and_continue(node, module_name)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
49
|
def create_dependency(module_name, node)
|
50
|
-
|
50
|
+
const_name = find_const_name(node.children)
|
51
|
+
return [] unless const_name&.include?("::")
|
52
|
+
|
53
|
+
dependency = if module_name.empty?
|
54
|
+
const_name
|
55
|
+
else
|
56
|
+
"#{module_name}->#{const_name}"
|
57
|
+
end
|
51
58
|
location = "#{@location}:#{node.location.line}"
|
52
|
-
Dependency.new(location: location, dependency: dependency)
|
59
|
+
[Dependency.new(location: location, dependency: dependency)]
|
53
60
|
end
|
54
61
|
|
55
62
|
def ignore_and_continue(node, module_name)
|
@@ -61,8 +68,13 @@ module Mudguard
|
|
61
68
|
end
|
62
69
|
end
|
63
70
|
|
64
|
-
def process_module(children)
|
65
|
-
|
71
|
+
def process_module(children, module_name)
|
72
|
+
const_name = find_const_name(children[0].children)
|
73
|
+
module_name = if module_name.empty?
|
74
|
+
const_name
|
75
|
+
else
|
76
|
+
"#{module_name}::#{const_name}"
|
77
|
+
end
|
66
78
|
process(children[1], module_name)
|
67
79
|
end
|
68
80
|
|
data/lib/mudguard/version.rb
CHANGED
data/mudguard.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
|
13
13
|
spec.summary = "mudguard helps your ruby project not becoming a "\
|
14
14
|
"'Big ball of mud'"
|
15
|
-
spec.homepage = "https://
|
15
|
+
spec.homepage = "https://github.com/Enceradeira/mudguard"
|
16
16
|
spec.license = "MIT"
|
17
17
|
|
18
18
|
spec.metadata["homepage_uri"] = spec.homepage
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mudguard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jorg Jenni
|
@@ -186,12 +186,12 @@ files:
|
|
186
186
|
- lib/tasks/test.rake
|
187
187
|
- mudguard.gemspec
|
188
188
|
- pkg/mudguard-0.1.0.gem
|
189
|
-
homepage: https://
|
189
|
+
homepage: https://github.com/Enceradeira/mudguard
|
190
190
|
licenses:
|
191
191
|
- MIT
|
192
192
|
metadata:
|
193
|
-
homepage_uri: https://
|
194
|
-
source_code_uri: https://
|
193
|
+
homepage_uri: https://github.com/Enceradeira/mudguard
|
194
|
+
source_code_uri: https://github.com/Enceradeira/mudguard
|
195
195
|
post_install_message:
|
196
196
|
rdoc_options: []
|
197
197
|
require_paths:
|