deep-cover 0.5.4 → 0.5.5

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: 0bba970164c728e793e997703cbd54329ebf2cbe
4
- data.tar.gz: 6b0f4d81fec095c929499c23376f6c4126492b05
3
+ metadata.gz: b5f726d4e86e7bdf1a301c27d84dc8e7c0ffc783
4
+ data.tar.gz: 8af350ceda402ac91ee6f2d94c17307098a56583
5
5
  SHA512:
6
- metadata.gz: 0bf7681b2d1b3f6ab26322d40d5b2a8ccf9017d5ee6de335c083997c9f520077ef6bfadf67e28c724c781af856444cc98d320bba81757bc61d80eab5fe6fdcaf
7
- data.tar.gz: ddff0db12f706e8d30e6d5c7cfd226043befd7310476986943fdcfcd8e954d1dd55d02160291baa6c322cf8bfcf6f30a96548d17ff40bbdfa03df9518dc5cb18
6
+ metadata.gz: dc37d5e63f7a6d9c2bc9327e45cdb692f5ddcf7312241432e4e2907e54a964b3a75c93d713bcaa55d9be6e785e07a1d2cf015b15f0c59e949149461429f8bd55
7
+ data.tar.gz: b0c2e47f27f3240f3bb5787130ab0851953b9e29d3ead7070cb2e16c42bbc3aa08dd313e9d9ce259eb56e03fed3367aefae366489643f353397e34d67e9ea246
data/README.md CHANGED
@@ -82,7 +82,7 @@ First we present the official way. There are also quick and dirty ways to try `d
82
82
 
83
83
  For a standalone project (Rails app), add `deep-cover` to your Gemfile:
84
84
 
85
- gem 'deep-cover', '~> 0.4', group: :test
85
+ gem 'deep-cover', '~> 0.4', group: :test, require: false
86
86
 
87
87
  Then run `bundle`
88
88
 
@@ -142,7 +142,7 @@ It also uses our builtin HTML reporter. Check the produced `coverage/index.html`
142
142
 
143
143
  To make it easier to transition for projects already using the builtin `Coverage` library (or indirectly those using `SimpleCov`), there is a way to overwrite the `Coverage` library using `deep-cover`'s extended coverage.
144
144
 
145
- Add to your Gemfile `gem 'deep-cover'`, then run `bundle`.
145
+ Add to your Gemfile `gem 'deep-cover', require: false`, then run `bundle`.
146
146
 
147
147
  Before you require `coverage` or `simplecov`, do a `require 'deep_cover/builtin_takeover'`.
148
148
 
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'rspec/core/rake_task'
5
5
  require 'rubocop/rake_task'
6
6
 
7
7
  RuboCop::RakeTask.new(:rubocop) do |t|
8
- t.options = ['-a']
8
+ t.options = ['-a'] unless ENV['TRAVIS']
9
9
  end
10
10
 
11
11
  RSpec::Core::RakeTask.new(:spec).tap { |task| task.pattern = 'spec/*_spec.rb, spec/*/*_spec.rb' }
@@ -17,7 +17,8 @@ module DeepCover
17
17
  require 'yaml'
18
18
  require_relative '../backports'
19
19
  env_var = {'DEEP_COVER' => 't',
20
- 'DEEP_COVER_OPTIONS' => YAML.dump(@options.slice(*DEFAULTS.keys))}
20
+ 'DEEP_COVER_OPTIONS' => YAML.dump(@options.slice(*DEFAULTS.keys)),
21
+ }
21
22
 
22
23
  system(env_var, *@argv)
23
24
  end
@@ -21,6 +21,10 @@ module DeepCover
21
21
  end
22
22
  end
23
23
 
24
+ def child_index_to_name(index)
25
+ self.class.child_index_to_name(index, children.size)
26
+ end
27
+
24
28
  module ClassMethods
25
29
  def has_child(rest_: false, refine_: false, **args)
26
30
  raise "Needs exactly one custom named argument, got #{args.size}" if args.size != 1
@@ -8,7 +8,7 @@ module DeepCover
8
8
  end
9
9
 
10
10
  def call_child_handler(template, child, child_name = nil)
11
- child_name ||= self.class.child_index_to_name(child.index, children.size)
11
+ child_name ||= self.child_index_to_name(child.index)
12
12
  method_name = format(template, name: child_name)
13
13
  if respond_to?(method_name)
14
14
  args = [child, child_name]
@@ -72,7 +72,7 @@ module DeepCover
72
72
  include ExecutedAfterChildren
73
73
 
74
74
  def has_block?
75
- parent.parent.is_a?(Block)
75
+ parent.has_block?
76
76
  end
77
77
 
78
78
  def rewrite
@@ -123,7 +123,7 @@ module DeepCover
123
123
  executed_loc_keys :dot
124
124
 
125
125
  def has_block?
126
- parent.is_a?(Block)
126
+ parent.is_a?(Block) && parent.child_index_to_name(index) == :call
127
127
  end
128
128
 
129
129
  def rewrite
@@ -30,6 +30,7 @@ module DeepCover
30
30
 
31
31
  def columns
32
32
  _covered_code, analyser_map = analysis.analyser_map.first
33
+ analyser_map ||= []
33
34
  columns = analyser_map.flat_map do |type, analyser|
34
35
  [{
35
36
  value: type,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeepCover
4
- VERSION = '0.5.4'
4
+ VERSION = '0.5.5'
5
5
  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.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-André Lafortune
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-05-31 00:00:00.000000000 Z
12
+ date: 2018-06-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parser