diff --git a/app/helpers/rubygems_helper.rb b/app/helpers/rubygems_helper.rb index 7898a9e9475..e5562fc43ad 100644 --- a/app/helpers/rubygems_helper.rb +++ b/app/helpers/rubygems_helper.rb @@ -161,6 +161,12 @@ def show_all_versions_link?(rubygem) rubygem.versions_count > 5 || rubygem.yanked_versions? end + def latest_release_date(rubygem) + return version_date_tag(rubygem.latest_version) if rubygem.latest_version.present? + + tag.small("- #{nice_date_for(rubygem.updated)}", class: "gem__version__date") if rubygem.respond_to?(:updated) && rubygem.updated.present? + end + def latest_version_number(rubygem) return rubygem.version if rubygem.respond_to?(:version) (rubygem.latest_version || rubygem.versions.last)&.number diff --git a/app/views/rubygems/_rubygem.html.erb b/app/views/rubygems/_rubygem.html.erb index c3a4f8f714e..a309ad70a02 100644 --- a/app/views/rubygems/_rubygem.html.erb +++ b/app/views/rubygems/_rubygem.html.erb @@ -3,6 +3,7 @@

<%= rubygem.name %> <%= latest_version_number(rubygem) %> + <%= latest_release_date(rubygem) %>

<%= short_info(rubygem) %>

diff --git a/lib/elastic_searcher.rb b/lib/elastic_searcher.rb index 8436e740ccb..3f6ba9ce668 100644 --- a/lib/elastic_searcher.rb +++ b/lib/elastic_searcher.rb @@ -152,6 +152,7 @@ def ui_source summary description downloads + updated version] end end