bundler-stats 1.3.0 → 1.3.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/bundler/stats/cli.rb +19 -12
- data/lib/bundler/stats/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4a041422eb6d86e13e5b062fe2d7bd309b282523f2804a9470d21754279ca18f
|
|
4
|
+
data.tar.gz: 84f4a87d5d2a5ba647f59fa98cca6cd7d505bcdfc403efa4445d6cf70f2db6b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3bf9ea8589a762991695b6bae03d49f0af821fdc2a5db82fdcfdea17ef0cb8750458063cb3ccb5e3cff650ea5212ec194ff7280ddca0a2c29906983d0d3d7c58
|
|
7
|
+
data.tar.gz: 993b1a9bd53a7e6b34f460689f22717882ed764e11d4f73796fe0d883f2dbf46dc44b2d3f3062f292cba24701bd40e680d3de748e9c94c935dc5b206ce8d5a57
|
data/lib/bundler/stats/cli.rb
CHANGED
|
@@ -59,14 +59,18 @@ module Bundler
|
|
|
59
59
|
|
|
60
60
|
private
|
|
61
61
|
|
|
62
|
+
# TODO: just install table_print, 'eh?
|
|
62
63
|
def draw_stats(gem_stats, summary)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
say "
|
|
64
|
+
max_name_length = gem_stats.map { |gem| gem[:name].length }.max
|
|
65
|
+
|
|
66
|
+
say "+-#{"-" * max_name_length}-|-----------------|-----------------+"
|
|
67
|
+
say "| %-#{max_name_length}s | Total Deps | 1st Level Deps |" % ["Name"]
|
|
68
|
+
say "+-#{"-" * max_name_length}-|-----------------|-----------------+"
|
|
69
|
+
|
|
66
70
|
gem_stats.each do |stat_line|
|
|
67
|
-
say "|
|
|
71
|
+
say "| %-#{max_name_length}s | %-15s | %-15s |" % [stat_line[:name], stat_line[:total_dependencies], stat_line[:first_level_dependencies]]
|
|
68
72
|
end
|
|
69
|
-
say "
|
|
73
|
+
say "+-#{"-" * max_name_length}-|-----------------|-----------------+"
|
|
70
74
|
say ""
|
|
71
75
|
say "Declared Gems: #{summary[:declared]}"
|
|
72
76
|
say "Total Gems: #{summary[:total]}"
|
|
@@ -85,17 +89,20 @@ module Bundler
|
|
|
85
89
|
end
|
|
86
90
|
|
|
87
91
|
def draw_versions(stats, target)
|
|
92
|
+
dependers = stats[:top_level_dependencies] # they do the depending
|
|
88
93
|
say "bundle-stats for #{target}"
|
|
89
94
|
say ""
|
|
90
95
|
say "depended upon by (#{stats[:top_level_dependencies].count})\n"
|
|
91
|
-
if
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
say "
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
if dependers.count > 0
|
|
97
|
+
max_name_length = dependers.map { |gem| gem[:name].length }.max
|
|
98
|
+
|
|
99
|
+
say "+-#{"-" * max_name_length}-|-------------------+"
|
|
100
|
+
say "| %-#{max_name_length}s | Required Version |" % ["Name"]
|
|
101
|
+
say "+-#{"-" * max_name_length}-|-------------------+"
|
|
102
|
+
dependers.each do |stat_line|
|
|
103
|
+
say "| %-#{max_name_length}s | %-17s |" % [stat_line[:name], stat_line[:version]]
|
|
97
104
|
end
|
|
98
|
-
say "
|
|
105
|
+
say "+-#{"-" * max_name_length}-|-------------------+"
|
|
99
106
|
say ""
|
|
100
107
|
end
|
|
101
108
|
end
|