deep-cover-core 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/deep_cover_core.gemspec +1 -1
- data/lib/deep_cover/analyser/stats.rb +1 -1
- data/lib/deep_cover/config.rb +1 -1
- data/lib/deep_cover/coverage/analysis.rb +1 -1
- data/lib/deep_cover/persistence.rb +7 -5
- data/lib/deep_cover/reporter/istanbul.rb +2 -2
- data/lib/deep_cover/tools/struct_with_options.rb +18 -0
- data/lib/deep_cover/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c49ed3d6ce339e7573d82e4f8a48963ced23fdbcd378a44e9d81660accc8455
|
4
|
+
data.tar.gz: a7e234a5b4bc9abafc51d59b1fea6dfb91549ab4a28d4ecc7c9b78f093542697
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e702d5ae1e9ce0e2044b9b53b7b842f0ccf4eda04d240afaf3d105db6b8a39bd464edfa9d4fc654159a757902335d9b6fba52ab872c429a2c940173fe01b665
|
7
|
+
data.tar.gz: 5f8b320bca0b9c78198f35cf5eba395d6fcbeb65719b797397aac92a9ba50929f946a07665c06dde57a69677a99a4aa003f8da38902c9b2f64caad23c9af5820
|
data/deep_cover_core.gemspec
CHANGED
@@ -45,7 +45,7 @@ Gem::Specification.new do |spec|
|
|
45
45
|
# About every single release breaks something
|
46
46
|
# Ruby 2.1 is no longer supported
|
47
47
|
if RUBY_VERSION >= '2.3.0'
|
48
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
48
|
+
spec.add_development_dependency 'rubocop', '~> 0.81.0'
|
49
49
|
spec.add_development_dependency 'rubocop-performance'
|
50
50
|
end
|
51
51
|
end
|
@@ -48,7 +48,7 @@ module DeepCover
|
|
48
48
|
memoize :percent
|
49
49
|
|
50
50
|
def percent
|
51
|
-
Analyser::StatsBase.new(to_h.transform_values { |v| (100 * v).fdiv(total).round(DECIMALS) })
|
51
|
+
Analyser::StatsBase.new(**to_h.transform_values { |v| (100 * v).fdiv(total).round(DECIMALS) })
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
data/lib/deep_cover/config.rb
CHANGED
@@ -51,7 +51,7 @@ module DeepCover
|
|
51
51
|
raise ArgumentError, 'No block is accepted' if block_given?
|
52
52
|
unless keywords.empty?
|
53
53
|
keywords = check_uncovered(keywords)
|
54
|
-
set(keywords.to_h { |kind| [FILTER_NAME[kind], false] })
|
54
|
+
set(**keywords.to_h { |kind| [FILTER_NAME[kind], false] })
|
55
55
|
end
|
56
56
|
OPTIONALLY_COVERED - Config.options_to_ignored(**@options)
|
57
57
|
end
|
@@ -31,10 +31,7 @@ module top_level_module::DeepCover # rubocop:disable Naming/ClassAndModuleCamelC
|
|
31
31
|
# returns a TrackerHitsPerPath
|
32
32
|
def load_trackers
|
33
33
|
tracker_hits_per_path_hashes = tracker_files.map do |full_path|
|
34
|
-
JSON.parse(full_path.binread).transform_keys(&:to_sym)
|
35
|
-
raise "dump version mismatch: #{version}, currently #{VERSION}" unless version == VERSION
|
36
|
-
tracker_hits_per_path
|
37
|
-
end
|
34
|
+
check_tracker_file(**JSON.parse(full_path.binread).transform_keys(&:to_sym))
|
38
35
|
end
|
39
36
|
|
40
37
|
self.class.merge_tracker_hits_per_paths(*tracker_hits_per_path_hashes)
|
@@ -56,7 +53,7 @@ module top_level_module::DeepCover # rubocop:disable Naming/ClassAndModuleCamelC
|
|
56
53
|
delete_trackers
|
57
54
|
begin
|
58
55
|
dir_path.rmdir
|
59
|
-
rescue SystemCallError # rubocop:disable Lint/
|
56
|
+
rescue SystemCallError # rubocop:disable Lint/SuppressedException
|
60
57
|
end
|
61
58
|
end
|
62
59
|
|
@@ -88,6 +85,11 @@ module top_level_module::DeepCover # rubocop:disable Naming/ClassAndModuleCamelC
|
|
88
85
|
|
89
86
|
private
|
90
87
|
|
88
|
+
def check_tracker_file(version:, tracker_hits_per_path:)
|
89
|
+
raise "dump version mismatch: #{version}, currently #{VERSION}" unless version == VERSION
|
90
|
+
tracker_hits_per_path
|
91
|
+
end
|
92
|
+
|
91
93
|
def create_directory_if_needed
|
92
94
|
dir_path.mkpath
|
93
95
|
end
|
@@ -68,7 +68,7 @@ module DeepCover
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
class CoveredCodeConverter <
|
71
|
+
class CoveredCodeConverter < StructWithOptions.new(:covered_code)
|
72
72
|
include Converters
|
73
73
|
|
74
74
|
def node_analyser
|
@@ -172,7 +172,7 @@ module DeepCover
|
|
172
172
|
|
173
173
|
class << self
|
174
174
|
def report(coverage, **options)
|
175
|
-
new(coverage, options).report
|
175
|
+
new(coverage, **options).report
|
176
176
|
end
|
177
177
|
|
178
178
|
def available?
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DeepCover
|
4
|
+
module StructWithOptions
|
5
|
+
module Initializer
|
6
|
+
def initialize(*args, **options)
|
7
|
+
super(*args, options)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.new(*args)
|
12
|
+
Struct.new(*args, :options).tap do |klass|
|
13
|
+
klass.include Initializer
|
14
|
+
klass.define_singleton_method(:new, Class.method(:new))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/deep_cover/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deep-cover-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
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: 2020-
|
12
|
+
date: 2020-05-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: parser
|
@@ -143,14 +143,14 @@ dependencies:
|
|
143
143
|
requirements:
|
144
144
|
- - "~>"
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version: 0.
|
146
|
+
version: 0.81.0
|
147
147
|
type: :development
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
151
|
- - "~>"
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version: 0.
|
153
|
+
version: 0.81.0
|
154
154
|
- !ruby/object:Gem::Dependency
|
155
155
|
name: rubocop-performance
|
156
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -303,6 +303,7 @@ files:
|
|
303
303
|
- lib/deep_cover/tools/silence_warnings.rb
|
304
304
|
- lib/deep_cover/tools/slice.rb
|
305
305
|
- lib/deep_cover/tools/strip_heredoc.rb
|
306
|
+
- lib/deep_cover/tools/struct_with_options.rb
|
306
307
|
- lib/deep_cover/tools/to_regexp.rb
|
307
308
|
- lib/deep_cover/tools/truncate_backtrace.rb
|
308
309
|
- lib/deep_cover/tools/with_unbundled_env.rb
|
@@ -326,7 +327,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
326
327
|
- !ruby/object:Gem::Version
|
327
328
|
version: '0'
|
328
329
|
requirements: []
|
329
|
-
rubygems_version: 3.0.
|
330
|
+
rubygems_version: 3.2.0.pre1
|
330
331
|
signing_key:
|
331
332
|
specification_version: 4
|
332
333
|
summary: In depth coverage of your Ruby code.
|