-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Conversation
Add metadata to the produced gemspecs and convert existing urls into the appropriate entries. Also add the changelog entry for the hoe project.
There was a problem hiding this 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 = {} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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| |
There was a problem hiding this comment.
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"] |
There was a problem hiding this comment.
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").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
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. |
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? |
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 |
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., Being able to say, however, |
@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. |
Bump. This and/or explicit metadata updates, would be very nice to have as part of Hoe. |
Done. Sorry for the delay! |
Add metadata to the produced gemspecs and convert existing urls into the
appropriate entries.
Also add the changelog entry for the hoe project.