cover_rage 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cover_rage/record.rb +15 -11
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0d90184f8a2099a605e3a70ea825577f946312fa5116fdb7b178d3716f507686
|
|
4
|
+
data.tar.gz: e39a25676c9879a64aaecd45c31a2c21adf6cb0c99de5af81fed5468c3423941
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 541824efe9627329848384b72f63fcfde79290ae83d6f7f1367f0018334b8cad09a6169086d5292f35488598cfd0d55773efdc7d52b207847299781fa3e9dacb
|
|
7
|
+
data.tar.gz: 533b57415a77f94b77ad32c00fd220894ec77f4244fb31be3067e904fb4a79aff6ac7b2616842f120602587b89173777a8a8ec44db96782eb5099c527c91a3cb
|
data/lib/cover_rage/record.rb
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
module CoverRage
|
|
4
4
|
Record = Data.define(:path, :revision, :source, :execution_count, :last_executed_at) do
|
|
5
|
-
def self.merge(
|
|
5
|
+
def self.merge(existing_records, current_records)
|
|
6
6
|
records_to_save = []
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
current_records.each do |current_record|
|
|
8
|
+
existing_record = existing_records.find { _1.path == current_record.path }
|
|
9
9
|
records_to_save <<
|
|
10
|
-
if
|
|
11
|
-
|
|
10
|
+
if existing_record.nil? || current_record.revision != existing_record.revision
|
|
11
|
+
current_record
|
|
12
12
|
else
|
|
13
|
-
|
|
13
|
+
existing_record + current_record
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
records_to_save
|
|
@@ -19,13 +19,17 @@ module CoverRage
|
|
|
19
19
|
def +(other)
|
|
20
20
|
with(
|
|
21
21
|
execution_count: execution_count.map.with_index do |item, index|
|
|
22
|
-
|
|
22
|
+
other_item = other.execution_count[index]
|
|
23
|
+
if item.nil? && other_item.nil? then nil
|
|
24
|
+
elsif item.nil? || other_item.nil? then other_item
|
|
25
|
+
else item + other_item
|
|
26
|
+
end
|
|
23
27
|
end,
|
|
24
28
|
last_executed_at: last_executed_at.map.with_index do |item, index|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
elsif
|
|
28
|
-
else [item,
|
|
29
|
+
other_item = other.last_executed_at[index]
|
|
30
|
+
if item.nil? && other_item.nil? then nil
|
|
31
|
+
elsif item.nil? || other_item.nil? then other_item
|
|
32
|
+
else [item, other_item].max
|
|
29
33
|
end
|
|
30
34
|
end
|
|
31
35
|
)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cover_rage
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Weihang Jian
|
|
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
69
69
|
- !ruby/object:Gem::Version
|
|
70
70
|
version: '0'
|
|
71
71
|
requirements: []
|
|
72
|
-
rubygems_version: 4.0.
|
|
72
|
+
rubygems_version: 4.0.13
|
|
73
73
|
specification_version: 4
|
|
74
74
|
summary: cover_rage is a Ruby code coverage tool designed to be simple and easy to
|
|
75
75
|
use. It can be used not only for test coverage but also in production services to
|