fast_cov 0.4.0 → 0.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b276767c3b77601bb2cb06febd1476fcab8c5f94fc5b714842d0ddcce6a0fb9
4
- data.tar.gz: 44bd1a0b268802dc8c7b6e5687bf52fcb969849191fdb0d5471cab87350e43cc
3
+ metadata.gz: 1290bbc2d87f114fb2be87c35cbb658d3c9537a6ab6117f025ff2c134abd6c20
4
+ data.tar.gz: 6e9c2a5f8117a204d11d4dda86991044024c9fcd56a89138e6eea1a85e30852b
5
5
  SHA512:
6
- metadata.gz: 178d1061ae15c475719b2da16297df134be25798a6bc22ec81aece28a180d7db2e5914296fc54596d3ea858b57538be177dc96f203d2625004c2f369078b6d44
7
- data.tar.gz: abdf03b462db505b675d29b332ddc933a6af415cef35a474608d9d8330993b52f294b84923a00dd7c9371bcd7311b3e1518e1ab9772088fbb529740ff74fbfbc
6
+ metadata.gz: bb164c3ee12aebc5c9bfb456ce5e06ee55313d372027b94c323691ceafcf25608d6f70bc43822cfc186d6b046b5f5d8ab005ae702f0430c6b11acf11062cf0f0
7
+ data.tar.gz: 9f9c00cff32e5d0bcb47dd1fd3617b487dad49e7daa4f98e72d5bfbe028a944beb018865d1614d218027da984df1891ea4853246abb03e225e32fd0306310628
@@ -23,7 +23,7 @@ module FastCov
23
23
  processed = {}
24
24
 
25
25
  until queue.empty?
26
- to_process = queue.reject { |f| processed[f] }
26
+ to_process = queue.reject { |f| processed[f] || @graph.key?(relativize(f)) }
27
27
  break if to_process.empty?
28
28
 
29
29
  to_process.each { |f| processed[f] = true }
@@ -42,7 +42,7 @@ module FastCov
42
42
  @graph[relative_file] = deps.empty? ? EMPTY_ARRAY : deps.map { |d| relativize(d) }.freeze
43
43
 
44
44
  deps.each do |dep|
45
- queue << dep unless processed[dep]
45
+ queue << dep unless processed[dep] || @graph.key?(relativize(dep))
46
46
  end
47
47
  end
48
48
  end
@@ -53,8 +53,11 @@ module FastCov
53
53
  def dump(path)
54
54
  FileUtils.mkdir_p(File.dirname(path))
55
55
 
56
- lines = @mapping.map { |file, deps| "#{file}\t#{deps.to_a.join("\t")}\n" }
57
- Zlib::GzipWriter.open(path) { |gz| gz.write(lines.join) }
56
+ Zlib::GzipWriter.open(path) do |gz|
57
+ @mapping.each do |file, deps|
58
+ gz.write("#{file}\t#{deps.to_a.join("\t")}\n")
59
+ end
60
+ end
58
61
  end
59
62
 
60
63
  # Number of unique source files mapped.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FastCov
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_cov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ngan Pham