rubion 0.3.6 → 0.3.7

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: b0f29bc1b7cefe4b6e3373a74d9dddcaccf3f7ba0f2a49dc2562d18794bafc81
4
- data.tar.gz: 78d89a5554c4a0b46eb4cae2ea3d5a33427cfc207a9d86c7c9f95893acc9890b
3
+ metadata.gz: 8699b79a4501e6f466fc31e5ff30e26d04d516c39ddc26ebc7feca06c5f21dfb
4
+ data.tar.gz: b9dc8ea8e40ec891d99632b5a1e5b74518feace3eee80c5bc1b9aca0f8d7f4c8
5
5
  SHA512:
6
- metadata.gz: df1205450315340e9d7f9361576ebe12a609a0e73a554155dfbc142e786b5f4dbd194ef5beffc8ca97f0bf622460b99a9c0a1470010c54f0bf122ca4934e35be
7
- data.tar.gz: d860c50c98a819d75a54ae1a1d4bd8ed813bfa6968d900c90f915ae88321c7f4a09df7a5a0f937653193b6fdc20d2b7ba313d2c9669a591c5271cbeca6399e42
6
+ metadata.gz: 882f8c6228137d7e5814df1b7ee0ab199d2b69abaf828ef4e9676b4df747b2c916a74e25208c92f6b0e941beeb71bc6e2095faad8e3109e173d4f72172e48ccc
7
+ data.tar.gz: 5388ff2bef79e8b19f75e0ec051ba3a6891675c666fbf2f41564d4cb065521f4d6570f21e3d8ca91c4c95618ce18fd6c22c8074c177609839184044e51e2e575
@@ -88,7 +88,7 @@ module Rubion
88
88
  versions = sort_versions(versions, :gem) if @sort_by
89
89
 
90
90
  table = Terminal::Table.new do |t|
91
- t.headings = ['Name', 'Current', 'Date', 'Latest', 'Date', 'Behind By(Time)', 'Behind By(Versions)']
91
+ t.headings = format_version_headings
92
92
 
93
93
  versions.each do |gem|
94
94
  # Make direct dependencies bold
@@ -156,7 +156,7 @@ module Rubion
156
156
  versions = sort_versions(versions, :package) if @sort_by
157
157
 
158
158
  table = Terminal::Table.new do |t|
159
- t.headings = ['Name', 'Current', 'Date', 'Latest', 'Date', 'Behind By(Time)', 'Behind By(Versions)']
159
+ t.headings = format_version_headings
160
160
 
161
161
  versions.each do |pkg|
162
162
  # Make direct dependencies bold
@@ -234,6 +234,38 @@ module Rubion
234
234
  "\033[1m#{text}\033[0m"
235
235
  end
236
236
 
237
+ # Format version table headings with sorting indicator
238
+ def format_version_headings
239
+ base_headings = ['Name', 'Current', 'Date', 'Latest', 'Date', 'Behind By(Time)', 'Behind By(Versions)']
240
+
241
+ return base_headings unless @sort_by
242
+
243
+ # Map sort_by value to column index
244
+ column_map = {
245
+ 'name' => 0,
246
+ 'current' => 1,
247
+ 'date' => 2, # First Date column (current_date)
248
+ 'latest' => 4,
249
+ 'behind by(time)' => 5,
250
+ 'behind by time' => 5,
251
+ 'time' => 5,
252
+ 'behind by(versions)' => 6,
253
+ 'behind by versions' => 6,
254
+ 'versions' => 6
255
+ }
256
+
257
+ column_name = @sort_by.strip.downcase
258
+ column_index = column_map[column_name]
259
+
260
+ return base_headings unless column_index
261
+
262
+ # Add sorting indicator (↑ for ascending, ↓ for descending)
263
+ indicator = @sort_desc ? ' ↓' : ' ↑'
264
+ base_headings[column_index] = "#{base_headings[column_index]}#{indicator}"
265
+
266
+ base_headings
267
+ end
268
+
237
269
  def version_difference(current, latest)
238
270
  # Simple version difference calculation
239
271
  current_parts = current.split('.').map(&:to_i)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rubion
4
- VERSION = "0.3.6"
4
+ VERSION = "0.3.7"
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - bipashant