From f5a39a5a2b0fb611d8edb52f0a6a861a450d3c91 Mon Sep 17 00:00:00 2001 From: quinna-h Date: Wed, 29 Jan 2025 10:04:14 -0500 Subject: [PATCH] update columns --- .github/scripts/find_gem_version_bounds.rb | 32 +++++++++++++++------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/scripts/find_gem_version_bounds.rb b/.github/scripts/find_gem_version_bounds.rb index d8083cc2088..acfb0049fc3 100644 --- a/.github/scripts/find_gem_version_bounds.rb +++ b/.github/scripts/find_gem_version_bounds.rb @@ -106,10 +106,10 @@ def process_integrations def include_hardcoded_versions # `httpx` is maintained externally @integration_json_mapping['httpx'] = [ - '0.11', # Min version Ruby - 'infinity', # Max version Ruby - '0.11', # Min version JRuby - 'infinity' # Max version JRuby + '[3rd-party support](https://honeyryderchuck.gitlab.io/httpx/)', # Min version Ruby + '[3rd-party support](https://honeyryderchuck.gitlab.io/httpx/)', # Max version Ruby + '[3rd-party support](https://honeyryderchuck.gitlab.io/httpx/)', # Min version JRuby + '[3rd-party support](https://honeyryderchuck.gitlab.io/httpx/)', # Max version JRuby ] # `makara` is part of `activerecord` @@ -141,15 +141,27 @@ def write_markdown_output For a list of available integrations, and their supported version ranges, refer to the following: --> COMMENT - header = "| Integration | Ruby Min | Ruby Max | JRuby Min | JRuby Max |\n" - separator = "|--------------------------|----------|----------|-----------|-----------|\n" column_widths = { integration: 24, - ruby_min: 8, - ruby_max: 8, - jruby_min: 9, - jruby_max: 9 + ruby_min: 19, + ruby_max: 19, + jruby_min: 19, + jruby_max: 19 } + columns = { + integration: "Integration", + ruby_min: "Ruby Min", + ruby_max: "Ruby Max", + jruby_min: "JRuby Min", + jruby_max: "JRuby Max" + } + + adjusted_widths = columns.transform_values.with_index do |title, index| + [title.length, column_widths.values[index]].max + end + + header = "| " + columns.map { |key, title| title.ljust(adjusted_widths[key]) }.join(" | ") + " |" + separator = "|-" + adjusted_widths.map { |_, width| "-" * width }.join("-|-") + "-|" rows = @integration_json_mapping .sort_by { |name, _versions| name.downcase } .map do |name, versions|