Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for gemspec metadata #86

Closed
wants to merge 5 commits into from

Conversation

viraptor
Copy link

Add metadata to the produced gemspecs and convert existing urls into the
appropriate entries.
Also add the changelog entry for the hoe project.

Add metadata to the produced gemspecs and convert existing urls into the
appropriate entries.
Also add the changelog entry for the hoe project.
Copy link
Member

@zenspider zenspider left a comment

Choose a reason for hiding this comment

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

thanks for the PR. I have a couple questions and one suggestion.

lib/hoe.rb Outdated
@@ -631,6 +645,7 @@ def initialize name, version = nil # :nodoc:
self.extra_dev_deps = []
self.extra_rdoc_files = []
self.licenses = []
self.metadata = {}
Copy link
Member

Choose a reason for hiding this comment

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

Sorry. Catch me up. What purpose does this serve?

Copy link
Author

Choose a reason for hiding this comment

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

An accident from other approaches. Removed now.

lib/hoe.rb Outdated
@@ -536,6 +543,13 @@ def define_spec
s.require_paths = dirs unless dirs.empty?
s.rdoc_options = ["--main", readme_file]
s.post_install_message = post_install_message
s.metadata = {}.tap do |meta|
Copy link
Member

Choose a reason for hiding this comment

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

Can you point me at something to read up on this?

lib/hoe.rb Outdated
meta["changelog_uri"] = urls["clog"] if urls["clog"]
meta["documentation_uri"] = urls["doco"] if urls["doco"]
meta["homepage_uri"] = urls["home"] if urls["home"]
meta["source_code_uri"] = urls["code"] if urls["code"]
Copy link
Member

Choose a reason for hiding this comment

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

I think I'd rather see this as a 1 line loop around a mapping (eg from "bug_tracker_uri" to "bugs").

Copy link
Author

Choose a reason for hiding this comment

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

Done

@viraptor
Copy link
Author

Here's a good intro: https://olivierlacan.com/posts/changelogs-on-rubygems-org/

But in short - specific metadata entries can appear on rubygems as direct links. This makes manual and automatic navigation easier. For example if you're trying to process many changelogs when doing an update of dependencies, having a direct link to changelog/history file is really convenient.

@halostatue
Copy link

Rubygems supports more than the types provided in the translation map:

LINKS = {
    'home'      => 'homepage_uri',
     'changelog' => 'changelog_uri',
     'code'      => 'source_code_uri',
     'docs'      => 'documentation_uri',
     'wiki'      => 'wiki_uri',
     'mail'      => 'mailing_list_uri',
     'bugs'      => 'bug_tracker_uri',
     'download'  => 'download_uri'
}

Should we not have short forms for each of these, or at least some way of using the native names as well?

@viraptor
Copy link
Author

viraptor commented Aug 20, 2018

Happy to add them to the map - just let me know what you'd like to call them :) I see the current names are some private convention, so either happy to add just those or add the links map from above to it as well (so that both doco and docs map to documentation_uri).

@halostatue
Copy link

This is really up to @zenspider, but my gut feeling would be to look for either the current Hoe convention names or the full names (e.g., doco or documentation_uri) and mapping only those with preference for the current conventions. For those that don’t have current Hoe-conventional names, just look for the spec metadata name, at least with respect to the mapping of discovered URIs.

Being able to say, however, spec.metadata['wiki_uri'] = 'wiki://' explicitly in the Rakefile would also be useful, but I can see about providing that as a separate PR once the automatic versions are discovered.

@viraptor
Copy link
Author

viraptor commented Sep 3, 2018

@zenspider Is there a decision on what to do with the names mapping?

I agree that the other bits like updating metadata explicitly in a Rakefile seem like an extra feature/PR.

@halostatue
Copy link

Bump. This and/or explicit metadata updates, would be very nice to have as part of Hoe.

@zenspider
Copy link
Member

Done. Sorry for the delay!

@zenspider zenspider closed this Oct 20, 2019
@seattlerb seattlerb locked and limited conversation to collaborators Jan 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants