From 66c4d246ae344e371344a2cc8eeca9f10d7dd68b Mon Sep 17 00:00:00 2001 From: Jason Garber Date: Sun, 12 May 2024 10:01:52 -0400 Subject: [PATCH] Add issues and source code metadata to gemspec The `gemspec` file supports a bunch of metadata [1]. Among that are a couple of `*_uri` methods that RubyGems.org will helpfully show in the sidebar of a page when viewing a gem (example [2]). This commit adds two of those pieces of metadata: - `bug_tracker_uri` pointing to the project's GitHub Issues page, and - `source_code_uri` which dynamically links to the published version's source tree on GitHub. The latter is most helpful when browsing versions of the gem on RubyGems.org. Having a direct link to that version's tag on GitHub is super handy. [1] https://guides.rubygems.org/specification-reference/#metadata [2] https://rubygems.org/gems/link-header-parser --- humanize.gemspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/humanize.gemspec b/humanize.gemspec index d2d97da..bee1db5 100644 --- a/humanize.gemspec +++ b/humanize.gemspec @@ -16,4 +16,6 @@ Gem::Specification.new do |s| s.add_development_dependency 'rspec' s.add_development_dependency 'rubocop' s.metadata['rubygems_mfa_required'] = 'true' + s.metadata['bug_tracker_uri'] = "#{s.homepage}/issues" + s.metadata['source_code_uri'] = "#{s.homepage}/tree/v#{s.version}" end