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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc7ee6a28acd10fed49e4f57e343ecc15f957f5e
4
- data.tar.gz: 1e2b3d39a186a8fc8905c6677585abdfe7ac0caa
3
+ metadata.gz: 11f5637427f1be3a320dba33a1bf4ef53c65a0bb
4
+ data.tar.gz: 7404e4d444ac139f5dc7512d48d15fe217422707
5
5
  SHA512:
6
- metadata.gz: 565e8713d76bf42c6f6d56f5b301764f8fb7863c9ca97393dc29cdf405275e6871427a610bc289bbf8820de04895182e504b6d2a27fc669e73328b3a21357fec
7
- data.tar.gz: dd1b5209227146dfd3b8982ef725fc5be89c41dd02eaee74439f4e108b57ec18641b0c1401637f63acdc8999820aabe74caaf435a5c0fc01ee289e6cdccc56d2
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, pry: false, **options)
25
+ def initialize(source, filename: '(source)', lineno: 1, debug: false, **options)
26
26
  @source = source
27
27
  @filename = filename
28
28
  @lineno = lineno
29
- @pry = pry
29
+ @debug = debug
30
30
  @options = options
31
31
  end
32
32
 
33
33
  def show
34
- show_line_coverage
35
- show_instrumented_code
36
- show_ast
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 @pry
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], pry: options[:debug], **options).show
71
+ Debugger.new(options[:expression], **options).show
72
72
  elsif (path = menu.arguments.first)
73
73
  InstrumentedCloneReporter.new(path, **options).run
74
74
  else
@@ -1,3 +1,3 @@
1
1
  module DeepCover
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-André Lafortune