lib/hoe.rb in hoe-3.23.1 vs lib/hoe.rb in hoe-3.24.0
- old
+ new
@@ -85,11 +85,11 @@
class Hoe
include Rake::DSL if defined?(Rake::DSL)
# duh
- VERSION = "3.23.1"
+ VERSION = "3.24.0"
@@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
:publish, :gemcutter, :signing, :test]
@bad_plugins = []
@@ -221,10 +221,22 @@
# Optional: The name of the group authoring the project. [default: name.downcase]
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:
##
@@ -523,21 +535,22 @@
s.name = name
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?
case author
when Array
@@ -808,11 +821,13 @@
##
# Finalize configuration
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
add_dependencies
end
@@ -892,9 +907,13 @@
def validate_fields
%w[email author].each do |field|
value = self.send(field)
abort "Hoe #{field} value not set. aborting" if value.nil? or value.empty?
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