bundler-stats 2.0.1 → 2.1.0

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: effbf5fc1dcb265737923b548467df2b831f444638f673e37622a2efd564cb54
4
- data.tar.gz: 23cae592f904d2cdaef97b5597f953b0a927f24368d5f6e1b8763224391d4884
3
+ metadata.gz: ce461ba8ff653585236394b5427033c2a5c8411d3a47d880a39f8d48925c0723
4
+ data.tar.gz: '058da5ce7a60f9ac7fc3e2f37fd56ac86466665bbea1cd95af61ce37db2ebd66'
5
5
  SHA512:
6
- metadata.gz: de70cf8fedea1260329b24fea38e1f564215ae7f6bf67d5d0d87d6aa1b639cad39ced3625069ea6ecb38e315a3fec7de561cde0a331e951d550234f90e6ed0c7
7
- data.tar.gz: 606dc092473b823593dc2baec837c91956a6554c31f66990afc1f89052dac95f9c0209324b7e643429e04fe922025bcb090264f9730a7b6d900706bf6138ccfd
6
+ metadata.gz: c44cc31e39f9be21950ef7a5c1146f30d22ba40314b267cc1621397c8259ea024cb96f9f79e139d7fbe4c9650e66d4b1b484e5e8d8e41092f9f4c286a0b13438
7
+ data.tar.gz: 44f2713ef76cab6726489481ba5322acee80feb571177608fa8267d920ce67992650da9ee2bcb2d32973ffdc70fa1851d009e347e526f0648bce93dcb1ed6f45
data/.travis.yml CHANGED
@@ -4,3 +4,6 @@ rvm:
4
4
  - 2.3
5
5
  - 2.4
6
6
  - 2.5
7
+ - 2.6
8
+ - 2.7
9
+ - 3.0
data/CHANGELOG.md CHANGED
@@ -1,19 +1,82 @@
1
1
  Changelog
2
2
  =============
3
3
 
4
- ## [1.1.0] - 2018-03-16
4
+ ## [2.1.0] - 2021-11-29
5
+
6
+ ### Changed
7
+ - Add Travis targets for more modern rubies, by @etagwerker.
8
+ - Make sorting predictable across platforms, by @etagwerker.
9
+
5
10
  ### Fixed
11
+ - Fix error in CI when `tput` isn't available, by @etagwerker.
6
12
 
7
- - Remove unintentional inclusion of pry outside of dev environment
13
+ ## [2.0.1] - 2018-05-04
14
+
15
+ ### Added
16
+ - Complete custom table printer for some nicer output.
17
+
18
+ ## [2.0.0] - 2018-05-04
19
+ Broken as hell.
20
+
21
+ ## [1.3.4] - 2019-04-18
22
+
23
+ ### Changed
24
+ - Allow use of either `bundle-stats` or `bundler-stats` since the gem name was
25
+ a confusing choice. Live and learn.
8
26
 
9
- ## [1.1.0] - 2018-03-15
10
27
  ### Added
28
+ - Display resolved version of a gem when using `bundler-stats show`.
29
+
30
+ ## [1.3.3] - 2019-04-18
31
+
32
+ ### Changed
33
+ - Only print missing system dependency warning once per target gem, rather than
34
+ blowing up the console when a complicated gem is affected.
35
+
36
+ ## [1.3.2] - 2019-04-17
37
+
38
+ ### Fixed
39
+ - Fix issue when testing removability and a system gem from another platform
40
+ is "required", thx @rwojnarowski.
41
+
42
+ ## [1.3.1] - 2019-04-05
43
+
44
+ ### Changed
45
+ - Nicer table printing, still committed to not adding a table printing gem.
46
+
47
+ ## [1.3.0] - 2019-04-05
11
48
 
49
+ ### Changed
50
+ - Reversed the order in which gems are printed to worst-offenders-first.
51
+
52
+ ## [1.2.1] - 2019-04-05
53
+
54
+ ### Fixed
55
+ - When a system gem is missing from the lockfile (but is depended upon), warn
56
+ the user rather than exploding.
57
+
58
+ ## [1.2.0] - 2019-04-05
59
+
60
+ ### Fixed
61
+ - Loosen dependency on thor gem, by localhostdotdev.
62
+
63
+ ## [1.1.2] - 2018-03-16
64
+ Wonkiness w/ versioning. Apparently I was bad at this.
65
+
66
+ ## [1.1.0] - 2018-03-16
67
+ Eventually superseded by 1.1.2 for reasons.
68
+
69
+ ### Fixed
70
+ - Remove unintentional inclusion of pry outside of dev environment, per @Tuxified
71
+
72
+ ## [1.1.0] - 2018-03-15
73
+
74
+ ### Added
12
75
  - Adds a way to view dependency version restrictions for a given gem, by @olivierlacan
13
76
 
14
77
  ## [1.0.0] - 2016-04-13
15
- ### Added
16
78
 
79
+ ### Added
17
80
  - Base library, woo!
18
81
  - List all transitive dependencies and how many other deps rely on them
19
82
  - View list of Github-specified dependencies
@@ -64,7 +64,7 @@ module Bundler
64
64
  stats = @gemfile.map do |gem|
65
65
  @tree.summarize(gem.name)
66
66
  end
67
- stats.sort_by { |row| row[:total_dependencies] }.reverse
67
+ stats.sort_by { |row| [row[:total_dependencies] * -1, row[:name]] }
68
68
  end
69
69
  end
70
70
  end
@@ -38,7 +38,7 @@ class Bundler::Stats::Printer
38
38
 
39
39
  def terminal_width
40
40
  Integer(Kernel.send(:"`", "tput cols"))
41
- rescue Errno::ENOENT, TypeError, Errno::ENOENT
41
+ rescue StandardError
42
42
  80
43
43
  end
44
44
 
@@ -1,5 +1,5 @@
1
1
  module Bundler
2
2
  module Stats
3
- VERSION = '2.0.1'
3
+ VERSION = '2.1.0'
4
4
  end
5
5
  end
@@ -77,6 +77,16 @@ describe Bundler::Stats::Calculator do
77
77
  end
78
78
 
79
79
  context "#gem_stats" do
80
+ let(:partial_sorted_result) do
81
+ [
82
+ ["will_paginate", 0],
83
+ ["rolify", 0],
84
+ ["rubocop-rspec", 0],
85
+ ["spring", 0],
86
+ ["state_machine", 0],
87
+ ]
88
+ end
89
+
80
90
  it "includes entries for each gem" do
81
91
  calculator = subject.new(gemfile_path, lockfile_path)
82
92
 
@@ -85,6 +95,14 @@ describe Bundler::Stats::Calculator do
85
95
  expect(target).to be_a(Array)
86
96
  expect(target.length).to eq(calculator.gemfile.length)
87
97
  end
98
+
99
+ it "sorts entries by total dependencies descending and name ascending" do
100
+ calculator = subject.new(gemfile_path, lockfile_path)
101
+
102
+ target = calculator.gem_stats
103
+ tuple = target.map {|x| [x[:name], x[:total_dependencies]] }
104
+ expect(tuple).to end_with(*partial_sorted_result)
105
+ end
88
106
  end
89
107
 
90
108
  context "#summary" do
@@ -30,6 +30,17 @@ describe Bundler::Stats::Printer do
30
30
  expect(response).to eq(80)
31
31
  end
32
32
  end
33
+
34
+ context "tput returns an error" do
35
+ it "returns the default value" do
36
+ allow(Kernel).to receive(:send).and_return("tput: No value for $TERM and no -T specified")
37
+
38
+ printer = subject.new
39
+ response = printer.terminal_width
40
+
41
+ expect(response).to eq(80)
42
+ end
43
+ end
33
44
  end
34
45
 
35
46
  describe "#column_widths" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler-stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Mastey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-05 00:00:00.000000000 Z
11
+ date: 2021-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -167,8 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  requirements: []
170
- rubyforge_project:
171
- rubygems_version: 2.7.3
170
+ rubygems_version: 3.0.3
172
171
  signing_key:
173
172
  specification_version: 4
174
173
  summary: Dependency investigation for Bundler