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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 505f8c91c3157729f788457a62fc02e5ff9a405d
4
- data.tar.gz: 9fcf07dfc388322d9d95a732e8c990edbe493412
3
+ metadata.gz: 59eeae18ac9959ba027208cc21eda3fedf2735fd
4
+ data.tar.gz: 9c2689071947c5f6f57b4040fe2c815121903e71
5
5
  SHA512:
6
- metadata.gz: dc36803f941c71f8ff4fc1663dfdcc1cdd4c44da8fc789d68441ebb9357653f996296c11a1e5446be6dffb76840067befc30b680605534dc4e297b0e35f3321c
7
- data.tar.gz: 6f66def691b3babda370be95013c7ee1a998e10d6c9cf078d02b4ccc43909842e9c2bbb4554b3ed6ca5577635d65f6963b00545054a792246d80a444c10cf8e4
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.exists?(path)
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.exists?(possible_path)
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.exists?(possible_path)
72
+ found_path = possible_path if File.exist?(possible_path)
73
73
  end
74
74
 
75
75
  return :not_found unless found_path
@@ -19,12 +19,13 @@ module DeepCover
19
19
  @base_node = base_node
20
20
  @parent = parent
21
21
  @index = index
22
- @children = begin
23
- augment_children(base_children)
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
- if self.class == Node
109
- exp = base_node.loc.expression
110
- warn ["Unknown node type encountered: #{base_node.type}",
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
- raise exception
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
@@ -9,7 +9,7 @@ module DeepCover
9
9
 
10
10
  def initialize(*)
11
11
  super
12
- self.validate_children_types(children) rescue binding.pry
12
+ self.validate_children_types(children)
13
13
  end
14
14
 
15
15
  def validate_children_types(nodes)
@@ -1,3 +1,3 @@
1
1
  module DeepCover
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deep-cover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-André Lafortune