lib/hoe.rb in hoe-2.3.2 vs lib/hoe.rb in hoe-2.3.3
- old
+ new
@@ -57,11 +57,11 @@
# end
# end
class Hoe
# duh
- VERSION = '2.3.2'
+ VERSION = '2.3.3'
@@plugins = [:clean, :debug, :deps, :flay, :flog, :package, :publish,
:rcov, :signing, :test]
##
@@ -84,16 +84,18 @@
DEFAULT_CONFIG = {
"exclude" => /tmp$|CVS|\.svn|\.log$/,
}
##
- # True if you're a masochist developer. Used for building commands.
+ # True if you're a masochistic developer. Used for building commands.
WINDOZE = /mswin|mingw/ =~ RUBY_PLATFORM unless defined? WINDOZE
##
# *MANDATORY*: The author(s) of the package. (can be array)
+ #
+ # Use the #developer method to fill in both author and email cleanly.
attr_accessor :author
##
# Optional: A description of the release's latest changes. Auto-populates.
@@ -111,15 +113,19 @@
attr_accessor :description_sections
##
# *MANDATORY*: The author's email address(es). (can be array)
+ #
+ # Use the #developer method to fill in both author and email cleanly.
attr_accessor :email
##
# Optional: An array of rubygem dependencies.
+ #
+ # extra_deps << ['blah', '~> 1.0']
attr_accessor :extra_deps
##
# Optional: An array of rubygem developer dependencies.
@@ -138,10 +144,12 @@
attr_accessor :history_file
##
# *MANDATORY*: The name of the release.
+ #
+ # Set via Hoe.spec.
attr_accessor :name
##
# Optional: A post-install message to be displayed when gem is installed.
@@ -163,10 +171,14 @@
attr_accessor :spec # :nodoc:
##
# Optional: A hash of extra values to set in the gemspec. Value may be a proc.
+ #
+ # spec_extras[:required_rubygems_version] = '>= 1.3.2'
+ #
+ # (tho, see #pluggable! if that's all you want to do)
attr_accessor :spec_extras
##
# Optional: A short summary of the project. Auto-populates.
@@ -243,10 +255,11 @@
##
# Activate plugins.
def self.plugin *names
self.plugins.concat names
+ self.plugins.uniq!
end
##
# Return the list of activated plugins.
@@ -320,19 +333,21 @@
s.summary = summary
s.email = email
s.homepage = Array(url).first
s.rubyforge_project = rubyforge_name
s.description = description
- s.files = File.read_utf("Manifest.txt").split(/\r?\n\r?/)
+ s.files = files = File.read_utf("Manifest.txt").split(/\r?\n\r?/)
s.executables = s.files.grep(/^bin/) { |f| File.basename(f) }
s.bindir = "bin"
s.require_paths = dirs unless dirs.empty?
s.rdoc_options = ['--main', readme_file]
s.has_rdoc = true
s.post_install_message = post_install_message
s.test_files = Dir[*self.test_globs]
+ missing "Manifest.txt" if files.empty?
+
case author
when Array
s.authors = author
else
s.author = author
@@ -363,11 +378,13 @@
spec.version = self.version = version if version
unless self.version then
spec.version = self.version = "0.borked"
- warn "Add 'VERSION = \"x.y.z\"' to your code or fix your hoe spec"
+ warn "** Add 'VERSION = \"x.y.z\"' to your code,"
+ warn " add a version to your hoe spec,"
+ warn " or fix your Manifest.txt"
end
end
# Do any extra stuff the user wants
spec_extras.each do |msg, val|
@@ -493,10 +510,17 @@
##
# Normalize the dependencies.
def normalize_deps deps
- Array(deps).map { |o| String === o ? [o] : o }
+ Array(deps).map { |o|
+ if String === o then
+ warn "WAR\NING: HOE DEPRECATION: Add '>= 0' to the '#{o}' dependency."
+ [o, ">= 0"]
+ else
+ o
+ end
+ }
end
##
# Reads a file at +path+ and spits out an array of the +paragraphs+ specified.
#