Skip to content

Conversation

vinistock
Copy link
Collaborator

Add source_code, homepage and changelog uris to the gemspec metadata. These fields are used to populate links on rubygems.org. Also, dependabot uses changelog_uri on update PRs, which is a nice convenience.

s.homepage = "https://ruby.github.io/rdoc"
s.licenses = ["Ruby"]

s.metadata["homepage_uri"] = s.homepage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn’t rubygems.org fallback to #homepage?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think a lot of tools favour homepage over metadata, but I thought it wouldn't harm to add it. Do you prefer not adding homepage_uri?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just I was curious a little.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metadata.homepage_uri value is going to be copied from homepage when metadata.homepage_uri was not given. So, it'd be better to keep metadata.homepage_uri empty if there's no special reason to specify both. We don't need to repeat what RubyGems internally does.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amatsuda That method looks like just validating Specification#homepage, but nothing about metadata["homepage_uri"], no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed! My bad, please forget about my comment above...!

@vinistock vinistock requested a review from nobu June 15, 2023 14:37
@nobu nobu merged commit b93687f into ruby:master Jul 5, 2023
@vinistock vinistock deleted the vs/add_metadata_urls branch July 5, 2023 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants