bundler-stats 1.3.2 → 1.3.3

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
  SHA256:
3
- metadata.gz: 66d53289a79dd7b950987a512f6876f60f415862ab169c2b3fe935a4199b25c3
4
- data.tar.gz: 130b1e1a7d84163bea7fa95802639e1078bb53c1176f1d7482c0168ff752e37e
3
+ metadata.gz: 00521574e50038905fce9c0f58c700220922c38ff91ce987448e2372121333ff
4
+ data.tar.gz: 76632e66f4e00c8cc0a00e4ae755fddbd29361526067140c3610b5023042008d
5
5
  SHA512:
6
- metadata.gz: 882690eb56bbbd2bd001703277cd499ddd2e13ce3376470ae5ff1f657a23425a86112acd6bb2d3fa54e9ad92d1c6ccb1adfcca1742ec0a7b821b519cf77c305f
7
- data.tar.gz: 7f3dcd1216f8747c1f36bc4627017eebf94f7eb1f668eb8e923e56ed3975958861bf48ceb605004e7f368216de638e2a2065f100c8a52c422417ac6ef0c68063
6
+ metadata.gz: 88b9b171219491c7590c41758137200a2c07e85456f4d21aaa00ea786b8c6574622ca872e133cf39bfc05603cb2372bd9a6dda67841b114f0c080abb4b471898
7
+ data.tar.gz: 8fb71219134a7722f93811d61d29aef329a39cfd67a9d52a5a282de1dc708a3eada49321347e087fa8b4df73db16a2396cdf15acc9b34511ad69dde966a2b0f6
@@ -1,11 +1,12 @@
1
1
  class Bundler::Stats::Remover
2
- ERR_MESSAGE = "Trying to check whether `%s` can be removed, but was unable " \
2
+ ERR_MESSAGE = "Trying to check whether dep can be removed, but was unable " \
3
3
  "to resolve whether it is used by `%s`. It may not be in your Gemfile.lock. " \
4
4
  "This often happens when a dependency isn't installed on your platform."
5
5
 
6
6
  def initialize(tree, top_level)
7
- @tree = tree
8
- @top_level = top_level
7
+ @tree = tree
8
+ @top_level = top_level
9
+ @trace_warnings = []
9
10
  end
10
11
 
11
12
  def potential_removals(target)
@@ -33,7 +34,7 @@ class Bundler::Stats::Remover
33
34
  return true if candidate == target
34
35
 
35
36
  if modified_tree[candidate].nil?
36
- warn(ERR_MESSAGE % [target, candidate])
37
+ warn_of_bad_tracing(candidate)
37
38
  else
38
39
  deps_to_check += modified_tree[candidate].dependencies
39
40
  end
@@ -44,7 +45,10 @@ class Bundler::Stats::Remover
44
45
 
45
46
  private
46
47
 
47
- def warn(str)
48
- STDERR.puts(str)
48
+ def warn_of_bad_tracing(candidate)
49
+ return if @trace_warnings.include? candidate
50
+
51
+ STDERR.puts(ERR_MESSAGE % [candidate])
52
+ @trace_warnings << candidate
49
53
  end
50
54
  end
@@ -1,5 +1,5 @@
1
1
  module Bundler
2
2
  module Stats
3
- VERSION = '1.3.2'
3
+ VERSION = '1.3.3'
4
4
  end
5
5
  end
@@ -106,11 +106,11 @@ describe Bundler::Stats::Remover do
106
106
  it "raises an error if the top level dependency isn't in the lockfile" do
107
107
  top_level << dep("tzinfo")
108
108
  remover = subject.new(tree, top_level)
109
- allow(remover).to receive(:warn)
109
+ allow(remover).to receive(:warn_of_bad_tracing)
110
110
 
111
111
  remover.still_used?("actionview", deleted: "rails")
112
112
 
113
- expect(remover).to have_received(:warn)
113
+ expect(remover).to have_received(:warn_of_bad_tracing)
114
114
  end
115
115
  end
116
116
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler-stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Mastey