diff options
author | Ryan Davis <ryand-ruby@zenspider.com> | 2022-05-17 15:00:16 -0800 |
---|---|---|
committer | Ryan Davis <ryand-ruby@zenspider.com> | 2022-05-17 15:00:16 -0800 |
commit | 95eb9a21fe572fe9e9dc622d7098548b88dcf041 (patch) | |
tree | 0d55802970ccb771b0071f4e244f7313a5865584 /lib | |
parent | 24c817b027e32e46844fe2daaeb4306979e3c3b7 (diff) | |
download | hoe-95eb9a21fe572fe9e9dc622d7098548b88dcf041.tar.gz |
+ Add bindir and homepage accessor methods. (dsisnero)
+ Use bindir to determine executables. (dsisnero)
+ Don't auto-intuit values if they're already set. (dsisnero)
[git-p4: depot-paths = "//src/hoe/dev/": change = 13384]
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hoe.rb | 29 |
1 files changed, 24 insertions, 5 deletions
@@ -223,6 +223,18 @@ class Hoe attr_accessor :group_name ## + # Optional: The name of the executables directory. [default: bin] + + attr_accessor :bindir + + ## + # Optional: The homepage of the project. Auto-populates to the home key + # of the urls read from the README.txt + # + + attr_accessor :homepage + + ## # The Gem::Specification. attr_accessor :spec # :nodoc: @@ -525,17 +537,18 @@ class Hoe s.version = version if version s.summary = summary s.email = email - s.homepage = urls["home"] || urls.values.first + s.homepage = homepage || urls["home"] || urls.values.first + s.description = description s.files = manifest - s.executables = s.files.grep(/^bin/) { |f| File.basename(f) } - s.bindir = "bin" + s.bindir = bindir || "bin" + s.executables = s.files.grep(/^#{s.bindir}/) { |f| File.basename(f) } s.require_paths = dirs unless dirs.empty? s.rdoc_options = ["--main", readme_file] s.post_install_message = post_install_message s.metadata = (urls.keys & URLS_TO_META_MAP.keys).map { |name| [URLS_TO_META_MAP[name], urls[name]] - }.to_h + }.to_h if urls missing "Manifest.txt" if s.files.empty? @@ -810,7 +823,9 @@ class Hoe def post_initialize activate_plugin_deps - intuit_values File.read_utf readme_file if readme_file + unless skip_intuit_values? + intuit_values File.read_utf readme_file if readme_file + end validate_fields define_spec load_plugin_tasks @@ -896,6 +911,10 @@ class Hoe end end + def skip_intuit_values? + %w[summary description homepage].all? { |field| send field } + end + ## # Loads ~/.hoerc, merges it with a .hoerc in the current pwd (if # any) and yields the configuration and its path |