summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRyan Davis <ryand@zenspider.com>2019-10-20 00:19:23 -0800
committerRyan Davis <ryand@zenspider.com>2019-10-20 00:19:23 -0800
commit842b1e5096824bbe6aa3851d73d54cf23bc6b43f (patch)
tree1c0268e8f71c6fa02bbc4b1e2b39f16a675a45f4 /lib
parentc5e9b061520426d954a9b60b544f2482083a2a2d (diff)
downloadhoe-842b1e5096824bbe6aa3851d73d54cf23bc6b43f.tar.gz
+ Added support for gemspec metadata. (viraptor)
[git-p4: depot-paths = "//src/hoe/dev/": change = 12348]
Diffstat (limited to 'lib')
-rw-r--r--lib/hoe.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/hoe.rb b/lib/hoe.rb
index f399e7c..853e7c3 100644
--- a/lib/hoe.rb
+++ b/lib/hoe.rb
@@ -112,6 +112,18 @@ class Hoe
RUBY_FLAGS = ENV["RUBY_FLAGS"] || default_ruby_flags
##
+ # Map from the commonly used url names to gemspec's metadata keys
+ # See https://guides.rubygems.org/specification-reference/#metadata
+
+ URLS_TO_META_MAP = {
+ "bugs" => "bug_tracker_uri",
+ "clog" => "changelog_uri",
+ "doco" => "documentation_uri",
+ "home" => "homepage_uri",
+ "code" => "source_code_uri",
+ }
+
+ ##
# Default configuration values for .hoerc. Plugins should populate
# this on load.
@@ -547,6 +559,9 @@ class Hoe
s.require_paths = dirs unless dirs.empty?
s.rdoc_options = ["--main", readme_file]
s.post_install_message = post_install_message
+ s.metadata = urls.select { |name, _| URLS_TO_META_MAP.key? name }.map { |name, link|
+ [URLS_TO_META_MAP[name], link]
+ }.to_h
missing "Manifest.txt" if s.files.empty?