deep-cover 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/deep_cover/custom_requirer.rb +3 -3
- data/lib/deep_cover/node/base.rb +16 -14
- data/lib/deep_cover/node/mixin/has_child.rb +1 -1
- data/lib/deep_cover/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59eeae18ac9959ba027208cc21eda3fedf2735fd
|
4
|
+
data.tar.gz: 9c2689071947c5f6f57b4040fe2c815121903e71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbf53d5a5b2b7722ec0b04a7541fb16474be2954a704622b15e656bfcc5a686b5b911aa86d6511bfd4080c2f09cdea623cb8d34e7d3cf9d898e1b44cd2d75a0b
|
7
|
+
data.tar.gz: fd6e2a09772a24f3f79f3c9046c00d643d3b1d694518fd6e8af778e054e452e83c20c1247eefb3ac5e4eb0f56549df02d93fc915ee9f2b71dcfee526387c084e
|
@@ -17,13 +17,13 @@ module DeepCover
|
|
17
17
|
path = File.absolute_path(path) if path.start_with?('./') || path.start_with?('../')
|
18
18
|
|
19
19
|
if Pathname.new(path).absolute?
|
20
|
-
return path if File.
|
20
|
+
return path if File.exist?(path)
|
21
21
|
return nil
|
22
22
|
end
|
23
23
|
|
24
24
|
@load_path.each do |load_path|
|
25
25
|
possible_path = File.absolute_path(path, load_path)
|
26
|
-
return possible_path if File.
|
26
|
+
return possible_path if File.exist?(possible_path)
|
27
27
|
end
|
28
28
|
|
29
29
|
nil
|
@@ -69,7 +69,7 @@ module DeepCover
|
|
69
69
|
if found_path.nil?
|
70
70
|
# #load has a final fallback of always trying relative to current work directory of process
|
71
71
|
possible_path = File.absolute_path(path)
|
72
|
-
found_path = possible_path if File.
|
72
|
+
found_path = possible_path if File.exist?(possible_path)
|
73
73
|
end
|
74
74
|
|
75
75
|
return :not_found unless found_path
|
data/lib/deep_cover/node/base.rb
CHANGED
@@ -19,12 +19,13 @@ module DeepCover
|
|
19
19
|
@base_node = base_node
|
20
20
|
@parent = parent
|
21
21
|
@index = index
|
22
|
-
@children =
|
23
|
-
|
22
|
+
@children = []
|
23
|
+
begin
|
24
|
+
@children = augment_children(base_children)
|
25
|
+
super()
|
24
26
|
rescue StandardError => e
|
25
27
|
diagnose(e)
|
26
28
|
end
|
27
|
-
super()
|
28
29
|
end
|
29
30
|
|
30
31
|
### Public API
|
@@ -105,19 +106,20 @@ module DeepCover
|
|
105
106
|
|
106
107
|
private
|
107
108
|
def diagnose(exception)
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
'This node will not be handled properly; its subnodes will be ignored',
|
112
|
-
'Source:',
|
113
|
-
exp && exp.source,
|
114
|
-
"Original exception:",
|
115
|
-
exception.inspect,
|
116
|
-
].join("\n")
|
117
|
-
[]
|
109
|
+
exp = base_node.loc.expression
|
110
|
+
msg = if self.class == Node
|
111
|
+
"Unknown node type encountered: #{base_node.type}"
|
118
112
|
else
|
119
|
-
|
113
|
+
"Node class #{self.class} incorrectly defined"
|
120
114
|
end
|
115
|
+
warn [msg,
|
116
|
+
'Attempting to continue, but this node will not be handled properly',
|
117
|
+
('Its subnodes will be ignored' if children.empty?),
|
118
|
+
'Source:',
|
119
|
+
exp && exp.source,
|
120
|
+
"Original exception:",
|
121
|
+
exception.inspect,
|
122
|
+
].join("\n")
|
121
123
|
end
|
122
124
|
end
|
123
125
|
end
|
data/lib/deep_cover/version.rb
CHANGED