bundler-stats 1.3.0 → 1.3.1

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: d5fde729d9b355f9814f07eff533cfcb50fda60c86a95dc708b84bd942582a99
4
- data.tar.gz: dc5d80390c3bfcf5e4f730014f58c372f1da0b9fbca6154b3a1b158c2c0341ff
3
+ metadata.gz: 4a041422eb6d86e13e5b062fe2d7bd309b282523f2804a9470d21754279ca18f
4
+ data.tar.gz: 84f4a87d5d2a5ba647f59fa98cca6cd7d505bcdfc403efa4445d6cf70f2db6b7
5
5
  SHA512:
6
- metadata.gz: 9097c6c60071db66d17f1eb74dc4091a9a075d596b8a0d7afa8f614dda523635369dba0825ca243bd5349055e7ff62ac416de303927c5b7c797e46e2aeb2f624
7
- data.tar.gz: 971a910df4e01d1cc8055852591c2f57422385a472795b2773a864312b4fbdc4c10e22c76f0134474a134f9c619bd3e6e9ffdb4d340885a6eb35c98273803ce2
6
+ metadata.gz: 3bf9ea8589a762991695b6bae03d49f0af821fdc2a5db82fdcfdea17ef0cb8750458063cb3ccb5e3cff650ea5212ec194ff7280ddca0a2c29906983d0d3d7c58
7
+ data.tar.gz: 993b1a9bd53a7e6b34f460689f22717882ed764e11d4f73796fe0d883f2dbf46dc44b2d3f3062f292cba24701bd40e680d3de748e9c94c935dc5b206ce8d5a57
@@ -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
- say "+------------------------------|-----------------|-----------------+"
64
- say "| Name | Total Deps | 1st Level Deps |"
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 "| %-28s | %-15s | %-15s |" % [stat_line[:name], stat_line[:total_dependencies], stat_line[:first_level_dependencies]]
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 stats[:top_level_dependencies].count > 0
92
- say "+------------------------------|-------------------+"
93
- say "| Name | Required Version |"
94
- say "+------------------------------|-------------------+"
95
- stats[:top_level_dependencies].each do |stat_line|
96
- say "| %-28s | %-17s |" % [stat_line[:name], stat_line[:version]]
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
@@ -1,6 +1,6 @@
1
1
  module Bundler
2
2
  module Stats
3
3
  # bundler-stats version
4
- VERSION = '1.3.0'
4
+ VERSION = '1.3.1'
5
5
  end
6
6
  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.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Mastey