deep-cover 0.1.3 → 0.1.4
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/cli/debugger.rb +18 -13
- data/lib/deep_cover/cli/deep_cover.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: 11f5637427f1be3a320dba33a1bf4ef53c65a0bb
|
4
|
+
data.tar.gz: 7404e4d444ac139f5dc7512d48d15fe217422707
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cbe0ca664f11052565e4a63f441db2ce0de7e62d8f5132a8d0001da87f83f21f06c8fbdc821165111c81fbdf716a9e22fb43576b36d5b17736d639d3893092d
|
7
|
+
data.tar.gz: 9ce2bb23b00309099555558d19dc42962b903d3f3aea5e8d591c883ba203f498d013ce48de3b0f61474d379a25dad51fb6504dcaf3c21e78ef6364b4bd909f39
|
@@ -22,20 +22,23 @@ module DeepCover
|
|
22
22
|
end
|
23
23
|
|
24
24
|
attr_reader :options
|
25
|
-
def initialize(source, filename: '(source)', lineno: 1,
|
25
|
+
def initialize(source, filename: '(source)', lineno: 1, debug: false, **options)
|
26
26
|
@source = source
|
27
27
|
@filename = filename
|
28
28
|
@lineno = lineno
|
29
|
-
@
|
29
|
+
@debug = debug
|
30
30
|
@options = options
|
31
31
|
end
|
32
32
|
|
33
33
|
def show
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
execute
|
35
|
+
if @debug
|
36
|
+
show_line_coverage
|
37
|
+
show_instrumented_code
|
38
|
+
show_ast
|
39
|
+
end
|
37
40
|
show_char_coverage
|
38
|
-
pry if @
|
41
|
+
pry if @debug
|
39
42
|
finish
|
40
43
|
end
|
41
44
|
|
@@ -60,13 +63,6 @@ module DeepCover
|
|
60
63
|
|
61
64
|
def show_ast
|
62
65
|
puts "\nParsed code:\n"
|
63
|
-
begin
|
64
|
-
execute_sample(covered_code)
|
65
|
-
rescue Exception => e
|
66
|
-
puts "Can't `execute_sample`:#{e.class.name}: #{e}\n#{e.backtrace.join("\n")}"
|
67
|
-
@failed = true
|
68
|
-
end
|
69
|
-
|
70
66
|
Node.prepend ColorAST
|
71
67
|
puts covered_code.covered_ast
|
72
68
|
end
|
@@ -90,6 +86,15 @@ module DeepCover
|
|
90
86
|
def covered_code
|
91
87
|
@covered_code ||= CoveredCode.new(source: @source, path: @filename, lineno: @lineno)
|
92
88
|
end
|
89
|
+
|
90
|
+
def execute
|
91
|
+
begin
|
92
|
+
execute_sample(covered_code)
|
93
|
+
rescue Exception => e
|
94
|
+
puts "Can't `execute_sample`:#{e.class.name}: #{e}\n#{e.backtrace.join("\n")}"
|
95
|
+
@failed = true
|
96
|
+
end
|
97
|
+
end
|
93
98
|
end
|
94
99
|
end
|
95
100
|
end
|
@@ -68,7 +68,7 @@ module DeepCover
|
|
68
68
|
def go
|
69
69
|
options = convert_options(menu.to_h)
|
70
70
|
if options[:expression]
|
71
|
-
Debugger.new(options[:expression],
|
71
|
+
Debugger.new(options[:expression], **options).show
|
72
72
|
elsif (path = menu.arguments.first)
|
73
73
|
InstrumentedCloneReporter.new(path, **options).run
|
74
74
|
else
|
data/lib/deep_cover/version.rb
CHANGED